Skip to content

Commit

Permalink
For #1638, #307, add comments in RTMP/RTP message for RTC.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Mar 16, 2020
1 parent 9e856c8 commit e905fce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion trunk/src/app/srs_app_rtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ srs_error_t SrsRtpMuxer::frame_to_packet(SrsSharedPtrMessage* shared_frame, SrsF
uint8_t header = sample.bytes[0];
uint8_t nal_type = header & kNalTypeMask;

// TODO: FIXME: Magic number? Doc?

This comment has been minimized.

Copy link
@xiaozhihong

xiaozhihong Mar 16, 2020

Collaborator

Already fix, next commit

// ignore SEI nal
if (nal_type == 0x06 || nal_type == 0x09) {
continue;
Expand Down Expand Up @@ -253,6 +254,7 @@ void SrsRtp::dispose()
}
}

// TODO: FIXME: Dead code?
srs_error_t SrsRtp::cycle()
{
srs_error_t err = srs_success;
Expand Down Expand Up @@ -338,7 +340,8 @@ srs_error_t SrsRtp::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
srs_error_t SrsRtp::on_video(SrsSharedPtrMessage* shared_video, SrsFormat* format)
{
srs_error_t err = srs_success;


// TODO: FIXME: Maybe it should config on vhost level.
if (!enabled) {
return err;
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/src/app/srs_app_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,15 +1122,20 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se
return err;
}

// Parse RTMP message to RTP packets, in FU-A if too large.

This comment has been minimized.

Copy link
@xiaozhihong

xiaozhihong Mar 16, 2020

Collaborator

RTP打包模式有好几种, WebRTC兼容的最好的, 就是我这种打包方式, FU-A + STAP-A, 而且sps/pps一定要跟随I帧一起下发, 不然会有播放不了的问题

if ((err = rtp->on_video(msg, format)) != srs_success) {
// TODO: We should support more strategies.
srs_warn("rtp: ignore video error %s", srs_error_desc(err).c_str());
srs_error_reset(err);
rtp->on_unpublish();
}

// TODO: FIXME: Refactor to move to rtp?
// Save the RTP packets for find_rtp_packet() to rtx or restore it.
source->rtp_queue->push(msg->rtp_packets);

if ((err = hls->on_video(msg, format)) != srs_success) {
// TODO: We should support more strategies.
// apply the error strategy for hls.
// @see https://github.com/ossrs/srs/issues/264
std::string hls_error_strategy = _srs_config->get_hls_on_error(req->vhost);
Expand Down

0 comments on commit e905fce

Please sign in to comment.