1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

For #1638, #307, add comments in RTMP/RTP message for RTC.

This commit is contained in:
winlin 2020-03-16 17:39:06 +08:00
parent 9e856c84e7
commit e905fce847
2 changed files with 9 additions and 1 deletions

View file

@ -77,6 +77,7 @@ srs_error_t SrsRtpMuxer::frame_to_packet(SrsSharedPtrMessage* shared_frame, SrsF
uint8_t header = sample.bytes[0]; uint8_t header = sample.bytes[0];
uint8_t nal_type = header & kNalTypeMask; uint8_t nal_type = header & kNalTypeMask;
// TODO: FIXME: Magic number? Doc?
// ignore SEI nal // ignore SEI nal
if (nal_type == 0x06 || nal_type == 0x09) { if (nal_type == 0x06 || nal_type == 0x09) {
continue; continue;
@ -253,6 +254,7 @@ void SrsRtp::dispose()
} }
} }
// TODO: FIXME: Dead code?
srs_error_t SrsRtp::cycle() srs_error_t SrsRtp::cycle()
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
@ -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 SrsRtp::on_video(SrsSharedPtrMessage* shared_video, SrsFormat* format)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
// TODO: FIXME: Maybe it should config on vhost level.
if (!enabled) { if (!enabled) {
return err; return err;
} }

View file

@ -1122,15 +1122,20 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se
return err; return err;
} }
// Parse RTMP message to RTP packets, in FU-A if too large.
if ((err = rtp->on_video(msg, format)) != srs_success) { 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_warn("rtp: ignore video error %s", srs_error_desc(err).c_str());
srs_error_reset(err); srs_error_reset(err);
rtp->on_unpublish(); 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); source->rtp_queue->push(msg->rtp_packets);
if ((err = hls->on_video(msg, format)) != srs_success) { if ((err = hls->on_video(msg, format)) != srs_success) {
// TODO: We should support more strategies.
// apply the error strategy for hls. // apply the error strategy for hls.
// @see https://github.com/ossrs/srs/issues/264 // @see https://github.com/ossrs/srs/issues/264
std::string hls_error_strategy = _srs_config->get_hls_on_error(req->vhost); std::string hls_error_strategy = _srs_config->get_hls_on_error(req->vhost);