Skip to content

Commit

Permalink
SRT: Refine hevc demux interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
chundonglinlin committed Jan 12, 2023
1 parent 8059ded commit b69ad38
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 325 deletions.
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_srt_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ srs_error_t SrsRtmpFromSrtBridge::on_ts_hevc(SrsTsMessage *msg, SrsBuffer *avs)
// for vps
if (hevc->is_vps(frame, frame_size)) {
std::string vps;
if ((err = hevc->sps_demux(frame, frame_size, vps)) != srs_success) {
if ((err = hevc->vps_demux(frame, frame_size, vps)) != srs_success) {
return srs_error_wrap(err, "demux vps");
}

Expand Down
4 changes: 4 additions & 0 deletions trunk/src/kernel/srs_kernel_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ SrsFormat::~SrsFormat()

srs_error_t SrsFormat::initialize()
{
if (!vcodec) {
vcodec = new SrsVideoCodecConfig();
}

return srs_success;
}

Expand Down
11 changes: 5 additions & 6 deletions trunk/src/kernel/srs_kernel_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@
XX(ERROR_HTTP_WITH_BODY , 3097, "HttpWithBody", "Failed for HTTP body") \
XX(ERROR_HEVC_DISABLED , 3098, "HevcDisabled", "HEVC is disabled") \
XX(ERROR_HEVC_DECODE_ERROR , 3099, "HevcDecode", "HEVC decode av stream failed") \
XX(ERROR_MP4_HVCC_CHANGE , 3100, "Mp4HvcCChange", "MP4 does not support video HvcC change")
XX(ERROR_HEVC_DROP_BEFORE_SPS_PPS , 4050, "HevcDropBeforeSequence", "HEVC Drop frames before get sps and pps") \
XX(ERROR_HEVC_API_NO_PREFIXED , 4051, "HevcAnnexbPrefix", "No annexb prefix for HEVC decoder")
XX(ERROR_MP4_HVCC_CHANGE , 3100, "Mp4HvcCChange", "MP4 does not support video HvcC change") \
XX(ERROR_HEVC_API_NO_PREFIXED , 3101, "HevcAnnexbPrefix", "No annexb prefix for HEVC decoder")

/**************************************************/
/* HTTP/StreamConverter protocol error. */
Expand Down Expand Up @@ -327,9 +326,9 @@
XX(ERROR_GB_SSRC_GENERATE , 4051, "GbSsrcGenerate", "Failed to generate SSRC for GB28181") \
XX(ERROR_GB_CONFIG , 4052, "GbConfig", "Invalid configuration for GB28181") \
XX(ERROR_GB_TIMEOUT , 4053, "GbTimeout", "SIP or media connection timeout for GB28181") \
XX(ERROR_STREAM_CASTER_HEVC_VPS , 4060, "CasterTsHevcVps", "Invalid ts HEVC VPS for stream caster") \
XX(ERROR_STREAM_CASTER_HEVC_SPS , 4061, "CasterTsHevcSps", "Invalid ts HEVC SPS for stream caster") \
XX(ERROR_STREAM_CASTER_HEVC_PPS , 4062, "CasterTsHevcPps", "Invalid ts HEVC PPS for stream caster")
XX(ERROR_STREAM_CASTER_HEVC_VPS , 4054, "CasterTsHevcVps", "Invalid ts HEVC VPS for stream caster") \
XX(ERROR_STREAM_CASTER_HEVC_SPS , 4055, "CasterTsHevcSps", "Invalid ts HEVC SPS for stream caster") \
XX(ERROR_STREAM_CASTER_HEVC_PPS , 4056, "CasterTsHevcPps", "Invalid ts HEVC PPS for stream caster")

/**************************************************/
/* RTC protocol error. */
Expand Down
Loading

0 comments on commit b69ad38

Please sign in to comment.