blob: 8611721aac375b2ffab53e204a26e63f14874b72 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
leozwang@webrtc.org39e96592012-03-01 18:22:48 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "video/rtp_video_stream_receiver.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000012
eladalonc0d481a2017-08-02 07:39:07 -070013#include <algorithm>
philipelfd5a20f2016-11-15 00:57:57 -080014#include <utility>
ilnik04f4d122017-06-19 07:18:55 -070015#include <vector>
mflodman@webrtc.org4fd55272013-02-06 17:46:39 +000016
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "call/video_config.h"
Mirko Bonadei71207422017-09-15 13:58:09 +020018#include "common_types.h" // NOLINT(build/include)
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "media/base/mediaconstants.h"
20#include "modules/pacing/packet_router.h"
21#include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
22#include "modules/rtp_rtcp/include/receive_statistics.h"
23#include "modules/rtp_rtcp/include/rtp_cvo.h"
24#include "modules/rtp_rtcp/include/rtp_header_parser.h"
25#include "modules/rtp_rtcp/include/rtp_receiver.h"
26#include "modules/rtp_rtcp/include/rtp_rtcp.h"
27#include "modules/rtp_rtcp/include/ulpfec_receiver.h"
28#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
29#include "modules/rtp_rtcp/source/rtp_packet_received.h"
30#include "modules/video_coding/frame_object.h"
31#include "modules/video_coding/h264_sprop_parameter_sets.h"
32#include "modules/video_coding/h264_sps_pps_tracker.h"
33#include "modules/video_coding/packet_buffer.h"
34#include "modules/video_coding/video_coding_impl.h"
35#include "rtc_base/checks.h"
36#include "rtc_base/location.h"
37#include "rtc_base/logging.h"
38#include "system_wrappers/include/field_trial.h"
39#include "system_wrappers/include/metrics.h"
40#include "system_wrappers/include/timestamp_extrapolator.h"
41#include "video/receive_statistics_proxy.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000042
43namespace webrtc {
44
philipelfd5a20f2016-11-15 00:57:57 -080045namespace {
philipel3bf97cf2017-08-10 18:10:59 +020046// TODO(philipel): Change kPacketBufferStartSize back to 32 in M63 see:
47// crbug.com/752886
48constexpr int kPacketBufferStartSize = 512;
philipelfd5a20f2016-11-15 00:57:57 -080049constexpr int kPacketBufferMaxSixe = 2048;
50}
51
mflodmanc0e58a32016-04-25 01:26:26 -070052std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
53 ReceiveStatistics* receive_statistics,
54 Transport* outgoing_transport,
55 RtcpRttStats* rtt_stats,
56 RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer,
nisse15389c02017-01-24 02:36:58 -080057 TransportSequenceNumberAllocator* transport_sequence_number_allocator) {
mflodmanc0e58a32016-04-25 01:26:26 -070058 RtpRtcp::Configuration configuration;
59 configuration.audio = false;
60 configuration.receiver_only = true;
61 configuration.receive_statistics = receive_statistics;
62 configuration.outgoing_transport = outgoing_transport;
63 configuration.intra_frame_callback = nullptr;
64 configuration.rtt_stats = rtt_stats;
65 configuration.rtcp_packet_type_counter_observer =
66 rtcp_packet_type_counter_observer;
mflodmanc0e58a32016-04-25 01:26:26 -070067 configuration.transport_sequence_number_allocator =
68 transport_sequence_number_allocator;
69 configuration.send_bitrate_observer = nullptr;
70 configuration.send_frame_count_observer = nullptr;
71 configuration.send_side_delay_observer = nullptr;
asapersson35151f32016-05-02 23:44:01 -070072 configuration.send_packet_observer = nullptr;
mflodmanc0e58a32016-04-25 01:26:26 -070073 configuration.bandwidth_callback = nullptr;
74 configuration.transport_feedback_callback = nullptr;
75
76 std::unique_ptr<RtpRtcp> rtp_rtcp(RtpRtcp::CreateRtpRtcp(configuration));
mflodmanc0e58a32016-04-25 01:26:26 -070077 rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
78
79 return rtp_rtcp;
80}
81
stefan@webrtc.orgeb24b042014-10-14 11:40:13 +000082static const int kPacketLogIntervalMs = 10000;
83
nisseb1f2ff92017-06-09 04:01:55 -070084RtpVideoStreamReceiver::RtpVideoStreamReceiver(
mflodmanfa666592016-04-28 23:15:33 -070085 Transport* transport,
86 RtcpRttStats* rtt_stats,
mflodmancfc8e3b2016-05-03 21:22:04 -070087 PacketRouter* packet_router,
Tommi733b5472016-06-10 17:58:01 +020088 const VideoReceiveStream::Config* config,
nisseca5706d2017-09-11 02:32:16 -070089 ReceiveStatistics* rtp_receive_statistics,
mflodmandc7d0d22016-05-06 05:32:22 -070090 ReceiveStatisticsProxy* receive_stats_proxy,
Erik Språng737336d2016-07-29 12:59:36 +020091 ProcessThread* process_thread,
philipelfd5a20f2016-11-15 00:57:57 -080092 NackSender* nack_sender,
93 KeyFrameRequestSender* keyframe_request_sender,
94 video_coding::OnCompleteFrameCallback* complete_frame_callback,
95 VCMTiming* timing)
Tommi97888bd2016-01-21 23:24:59 +010096 : clock_(Clock::GetRealTimeClock()),
Tommi733b5472016-06-10 17:58:01 +020097 config_(*config),
mflodmanc0e58a32016-04-25 01:26:26 -070098 packet_router_(packet_router),
mflodmandc7d0d22016-05-06 05:32:22 -070099 process_thread_(process_thread),
Peter Boström4fa7eca2016-03-02 15:05:53 +0100100 ntp_estimator_(clock_),
Peter Boström4fa7eca2016-03-02 15:05:53 +0100101 rtp_header_parser_(RtpHeaderParser::Create()),
102 rtp_receiver_(RtpReceiver::CreateVideoReceiver(clock_,
103 this,
mflodmanfa666592016-04-28 23:15:33 -0700104 this,
Peter Boström4fa7eca2016-03-02 15:05:53 +0100105 &rtp_payload_registry_)),
nisseca5706d2017-09-11 02:32:16 -0700106 rtp_receive_statistics_(rtp_receive_statistics),
brandtrd726a3f2017-06-29 02:45:35 -0700107 ulpfec_receiver_(UlpfecReceiver::Create(config->rtp.remote_ssrc, this)),
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000108 receiving_(false),
mflodmanc0e58a32016-04-25 01:26:26 -0700109 last_packet_log_ms_(-1),
nisseca5706d2017-09-11 02:32:16 -0700110 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_,
mflodmanc0e58a32016-04-25 01:26:26 -0700111 transport,
112 rtt_stats,
mflodmancfc8e3b2016-05-03 21:22:04 -0700113 receive_stats_proxy,
nisse15389c02017-01-24 02:36:58 -0800114 packet_router)),
philipelfd5a20f2016-11-15 00:57:57 -0800115 complete_frame_callback_(complete_frame_callback),
116 keyframe_request_sender_(keyframe_request_sender),
philipel2c53b132017-05-16 08:06:30 -0700117 timing_(timing),
118 has_received_frame_(false) {
eladalon822ff2b2017-08-01 06:30:28 -0700119 constexpr bool remb_candidate = true;
120 packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), remb_candidate);
mflodmancfc8e3b2016-05-03 21:22:04 -0700121 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy);
122 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy);
123
Tommi733b5472016-06-10 17:58:01 +0200124 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff)
mflodmancfc8e3b2016-05-03 21:22:04 -0700125 << "A stream should not be configured with RTCP disabled. This value is "
126 "reserved for internal usage.";
mflodmandc7d0d22016-05-06 05:32:22 -0700127 RTC_DCHECK(config_.rtp.remote_ssrc != 0);
128 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams?
129 RTC_DCHECK(config_.rtp.local_ssrc != 0);
130 RTC_DCHECK(config_.rtp.remote_ssrc != config_.rtp.local_ssrc);
131
Tommi733b5472016-06-10 17:58:01 +0200132 rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode);
133 rtp_rtcp_->SetSSRC(config_.rtp.local_ssrc);
stefanb4ab3812017-06-09 06:12:11 -0700134 rtp_rtcp_->SetRemoteSSRC(config_.rtp.remote_ssrc);
mflodmanc0e58a32016-04-25 01:26:26 -0700135 rtp_rtcp_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp);
mflodmandc7d0d22016-05-06 05:32:22 -0700136
Tommi733b5472016-06-10 17:58:01 +0200137 for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) {
138 EnableReceiveRtpHeaderExtension(config_.rtp.extensions[i].uri,
139 config_.rtp.extensions[i].id);
mflodmandc7d0d22016-05-06 05:32:22 -0700140 }
mflodmancfc8e3b2016-05-03 21:22:04 -0700141
142 static const int kMaxPacketAgeToNack = 450;
Tommi733b5472016-06-10 17:58:01 +0200143 const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0)
144 ? kMaxPacketAgeToNack
145 : kDefaultMaxReorderingThreshold;
mflodmancfc8e3b2016-05-03 21:22:04 -0700146 rtp_receive_statistics_->SetMaxReorderingThreshold(max_reordering_threshold);
mflodmandc7d0d22016-05-06 05:32:22 -0700147
brandtr14742122017-01-27 04:53:07 -0800148 if (config_.rtp.rtx_ssrc) {
nisseca5706d2017-09-11 02:32:16 -0700149 // Needed for rtp_payload_registry_.RtxEnabled().
brandtr14742122017-01-27 04:53:07 -0800150 rtp_payload_registry_.SetRtxSsrc(config_.rtp.rtx_ssrc);
mflodmandc7d0d22016-05-06 05:32:22 -0700151 }
152
brandtrf7c6d722016-12-08 08:25:47 -0800153 if (IsUlpfecEnabled()) {
mflodmandc7d0d22016-05-06 05:32:22 -0700154 VideoCodec ulpfec_codec = {};
155 ulpfec_codec.codecType = kVideoCodecULPFEC;
156 strncpy(ulpfec_codec.plName, "ulpfec", sizeof(ulpfec_codec.plName));
brandtrb5f2c3f2016-10-04 23:28:39 -0700157 ulpfec_codec.plType = config_.rtp.ulpfec.ulpfec_payload_type;
johan07e276c2016-12-13 02:23:03 -0800158 RTC_CHECK(AddReceiveCodec(ulpfec_codec));
brandtre6f98c72016-11-11 03:28:30 -0800159 }
mflodmandc7d0d22016-05-06 05:32:22 -0700160
brandtre6f98c72016-11-11 03:28:30 -0800161 if (IsRedEnabled()) {
mflodmandc7d0d22016-05-06 05:32:22 -0700162 VideoCodec red_codec = {};
163 red_codec.codecType = kVideoCodecRED;
164 strncpy(red_codec.plName, "red", sizeof(red_codec.plName));
brandtrb5f2c3f2016-10-04 23:28:39 -0700165 red_codec.plType = config_.rtp.ulpfec.red_payload_type;
johan07e276c2016-12-13 02:23:03 -0800166 RTC_CHECK(AddReceiveCodec(red_codec));
mflodmandc7d0d22016-05-06 05:32:22 -0700167 }
168
Tommi733b5472016-06-10 17:58:01 +0200169 if (config_.rtp.rtcp_xr.receiver_reference_time_report)
mflodmandc7d0d22016-05-06 05:32:22 -0700170 rtp_rtcp_->SetRtcpXrRrtrStatus(true);
171
172 // Stats callback for CNAME changes.
173 rtp_rtcp_->RegisterRtcpStatisticsCallback(receive_stats_proxy);
174
tommidea489f2017-03-03 03:20:24 -0800175 process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
philipelfd5a20f2016-11-15 00:57:57 -0800176
tommif284b7f2017-02-27 01:59:36 -0800177 if (config_.rtp.nack.rtp_history_ms != 0) {
178 nack_module_.reset(
179 new NackModule(clock_, nack_sender, keyframe_request_sender));
tommidea489f2017-03-03 03:20:24 -0800180 process_thread_->RegisterModule(nack_module_.get(), RTC_FROM_HERE);
tommif284b7f2017-02-27 01:59:36 -0800181 }
philipelfd5a20f2016-11-15 00:57:57 -0800182
philipela45102f2017-02-22 05:30:39 -0800183 packet_buffer_ = video_coding::PacketBuffer::Create(
184 clock_, kPacketBufferStartSize, kPacketBufferMaxSixe, this);
185 reference_finder_.reset(new video_coding::RtpFrameReferenceFinder(this));
mflodmanc0e58a32016-04-25 01:26:26 -0700186}
niklase@google.com470e71d2011-07-07 08:21:25 +0000187
nisseb1f2ff92017-06-09 04:01:55 -0700188RtpVideoStreamReceiver::~RtpVideoStreamReceiver() {
eladalonc0d481a2017-08-02 07:39:07 -0700189 RTC_DCHECK(secondary_sinks_.empty());
190
tommif284b7f2017-02-27 01:59:36 -0800191 if (nack_module_) {
192 process_thread_->DeRegisterModule(nack_module_.get());
193 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000194
tommif284b7f2017-02-27 01:59:36 -0800195 process_thread_->DeRegisterModule(rtp_rtcp_.get());
philipelfd5a20f2016-11-15 00:57:57 -0800196
nissefdbfdc92017-03-31 05:44:52 -0700197 packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get());
mflodmandc7d0d22016-05-06 05:32:22 -0700198 UpdateHistograms();
asapersson@webrtc.org0800db72015-01-15 07:40:20 +0000199}
200
nisseb1f2ff92017-06-09 04:01:55 -0700201bool RtpVideoStreamReceiver::AddReceiveCodec(
philipel022b54e2016-12-20 04:15:59 -0800202 const VideoCodec& video_codec,
203 const std::map<std::string, std::string>& codec_params) {
204 pt_codec_params_.insert(make_pair(video_codec.plType, codec_params));
205 return AddReceiveCodec(video_codec);
206}
207
nisseb1f2ff92017-06-09 04:01:55 -0700208bool RtpVideoStreamReceiver::AddReceiveCodec(const VideoCodec& video_codec) {
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000209 int8_t old_pltype = -1;
magjed56124bd2016-11-24 09:34:46 -0800210 if (rtp_payload_registry_.ReceivePayloadType(video_codec, &old_pltype) !=
211 -1) {
Peter Boström4fa7eca2016-03-02 15:05:53 +0100212 rtp_payload_registry_.DeRegisterReceivePayload(old_pltype);
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000213 }
magjed56124bd2016-11-24 09:34:46 -0800214 return rtp_payload_registry_.RegisterReceivePayload(video_codec) == 0;
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000215}
216
nisseb1f2ff92017-06-09 04:01:55 -0700217uint32_t RtpVideoStreamReceiver::GetRemoteSsrc() const {
stefanb4ab3812017-06-09 06:12:11 -0700218 return config_.rtp.remote_ssrc;
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000219}
220
nisseb1f2ff92017-06-09 04:01:55 -0700221int RtpVideoStreamReceiver::GetCsrcs(uint32_t* csrcs) const {
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000222 return rtp_receiver_->CSRCs(csrcs);
223}
224
nisseb1f2ff92017-06-09 04:01:55 -0700225RtpReceiver* RtpVideoStreamReceiver::GetRtpReceiver() const {
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000226 return rtp_receiver_.get();
227}
228
nisseb1f2ff92017-06-09 04:01:55 -0700229int32_t RtpVideoStreamReceiver::OnReceivedPayloadData(
mflodmanfa666592016-04-28 23:15:33 -0700230 const uint8_t* payload_data,
Peter Boström02083222016-06-14 12:52:54 +0200231 size_t payload_size,
mflodmanfa666592016-04-28 23:15:33 -0700232 const WebRtcRTPHeader* rtp_header) {
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000233 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header;
wu@webrtc.org88abf112014-05-14 16:53:51 +0000234 rtp_header_with_ntp.ntp_time_ms =
Peter Boström4fa7eca2016-03-02 15:05:53 +0100235 ntp_estimator_.Estimate(rtp_header->header.timestamp);
philipela45102f2017-02-22 05:30:39 -0800236 VCMPacket packet(payload_data, payload_size, rtp_header_with_ntp);
tommif284b7f2017-02-27 01:59:36 -0800237 packet.timesNacked =
238 nack_module_ ? nack_module_->OnReceivedPacket(packet) : -1;
ilnik04f4d122017-06-19 07:18:55 -0700239 packet.receive_time_ms = clock_->TimeInMilliseconds();
philipelfd5a20f2016-11-15 00:57:57 -0800240
philipel54ca9192017-03-21 05:45:18 -0700241 // In the case of a video stream without picture ids and no rtx the
242 // RtpFrameReferenceFinder will need to know about padding to
243 // correctly calculate frame references.
244 if (packet.sizeBytes == 0) {
245 reference_finder_->PaddingReceived(packet.seqNum);
philipel2c9f9f22017-06-13 02:47:28 -0700246 packet_buffer_->PaddingReceived(packet.seqNum);
philipel54ca9192017-03-21 05:45:18 -0700247 return 0;
248 }
249
philipela45102f2017-02-22 05:30:39 -0800250 if (packet.codec == kVideoCodecH264) {
251 // Only when we start to receive packets will we know what payload type
252 // that will be used. When we know the payload type insert the correct
253 // sps/pps into the tracker.
254 if (packet.payloadType != last_payload_type_) {
255 last_payload_type_ = packet.payloadType;
256 InsertSpsPpsIntoTracker(packet.payloadType);
philipelfd5a20f2016-11-15 00:57:57 -0800257 }
258
philipela45102f2017-02-22 05:30:39 -0800259 switch (tracker_.CopyAndFixBitstream(&packet)) {
260 case video_coding::H264SpsPpsTracker::kRequestKeyframe:
261 keyframe_request_sender_->RequestKeyFrame();
kjellanderbdf30722017-09-08 11:00:21 -0700262 FALLTHROUGH();
philipela45102f2017-02-22 05:30:39 -0800263 case video_coding::H264SpsPpsTracker::kDrop:
264 return 0;
265 case video_coding::H264SpsPpsTracker::kInsert:
266 break;
267 }
268
philipelfd5a20f2016-11-15 00:57:57 -0800269 } else {
philipela45102f2017-02-22 05:30:39 -0800270 uint8_t* data = new uint8_t[packet.sizeBytes];
271 memcpy(data, packet.dataPtr, packet.sizeBytes);
272 packet.dataPtr = data;
mflodman@webrtc.orgad4ee362011-11-28 22:39:24 +0000273 }
philipela45102f2017-02-22 05:30:39 -0800274
275 packet_buffer_->InsertPacket(&packet);
mflodman@webrtc.orgad4ee362011-11-28 22:39:24 +0000276 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000277}
278
nissed2ef3142017-05-11 08:00:58 -0700279// TODO(nisse): Try to delete this method. Obstacles: It is used by
nisse30e89312017-05-29 08:16:37 -0700280// ParseAndHandleEncapsulatingHeader, for handling Rtx packets, and
281// for callbacks from |ulpfec_receiver_|.
nisseb1f2ff92017-06-09 04:01:55 -0700282void RtpVideoStreamReceiver::OnRecoveredPacket(const uint8_t* rtp_packet,
283 size_t rtp_packet_length) {
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000284 RTPHeader header;
285 if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length, &header)) {
nisse30e89312017-05-29 08:16:37 -0700286 return;
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000287 }
288 header.payload_type_frequency = kVideoPayloadTypeFrequency;
stefan@webrtc.org01581da2014-09-04 06:48:14 +0000289 bool in_order = IsPacketInOrder(header);
nisse30e89312017-05-29 08:16:37 -0700290 ReceivePacket(rtp_packet, rtp_packet_length, header, in_order);
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000291}
292
mflodmanfa666592016-04-28 23:15:33 -0700293// TODO(pbos): Remove as soon as audio can handle a changing payload type
294// without this callback.
nisseb1f2ff92017-06-09 04:01:55 -0700295int32_t RtpVideoStreamReceiver::OnInitializeDecoder(
mflodmanfa666592016-04-28 23:15:33 -0700296 const int8_t payload_type,
297 const char payload_name[RTP_PAYLOAD_NAME_SIZE],
298 const int frequency,
299 const size_t channels,
300 const uint32_t rate) {
301 RTC_NOTREACHED();
302 return 0;
303}
304
nissed2ef3142017-05-11 08:00:58 -0700305// This method handles both regular RTP packets and packets recovered
306// via FlexFEC.
nisseb1f2ff92017-06-09 04:01:55 -0700307void RtpVideoStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
eladalon8b073052017-08-25 00:49:08 -0700308 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
eladalonc0d481a2017-08-02 07:39:07 -0700309
eladalon8b073052017-08-25 00:49:08 -0700310 if (!receiving_) {
311 return;
312 }
solenberg@webrtc.orgfc320462014-02-11 15:27:49 +0000313
eladalon8b073052017-08-25 00:49:08 -0700314 if (!packet.recovered()) {
315 int64_t now_ms = clock_->TimeInMilliseconds();
stefan@webrtc.orgeb24b042014-10-14 11:40:13 +0000316
eladalon8b073052017-08-25 00:49:08 -0700317 // Periodically log the RTP header of incoming packets.
318 if (now_ms - last_packet_log_ms_ > kPacketLogIntervalMs) {
319 std::stringstream ss;
320 ss << "Packet received on SSRC: " << packet.Ssrc()
321 << " with payload type: " << static_cast<int>(packet.PayloadType())
322 << ", timestamp: " << packet.Timestamp()
323 << ", sequence number: " << packet.SequenceNumber()
324 << ", arrival time: " << packet.arrival_time_ms();
325 int32_t time_offset;
326 if (packet.GetExtension<TransmissionOffset>(&time_offset)) {
327 ss << ", toffset: " << time_offset;
nisse38cc1d62017-02-13 05:59:46 -0800328 }
eladalon8b073052017-08-25 00:49:08 -0700329 uint32_t send_time;
330 if (packet.GetExtension<AbsoluteSendTime>(&send_time)) {
331 ss << ", abs send time: " << send_time;
332 }
333 LOG(LS_INFO) << ss.str();
334 last_packet_log_ms_ = now_ms;
stefan@webrtc.orgeb24b042014-10-14 11:40:13 +0000335 }
336 }
wu@webrtc.orga9890802013-12-13 00:21:03 +0000337
nisse38cc1d62017-02-13 05:59:46 -0800338 // TODO(nisse): Delete use of GetHeader, but needs refactoring of
339 // ReceivePacket and IncomingPacket methods below.
340 RTPHeader header;
341 packet.GetHeader(&header);
342
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000343 header.payload_type_frequency = kVideoPayloadTypeFrequency;
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000344
stefan@webrtc.org48df3812013-11-08 15:18:52 +0000345 bool in_order = IsPacketInOrder(header);
nissed2ef3142017-05-11 08:00:58 -0700346 if (!packet.recovered()) {
347 // TODO(nisse): Why isn't this done for recovered packets?
348 rtp_payload_registry_.SetIncomingPayloadType(header);
349 }
nisse38cc1d62017-02-13 05:59:46 -0800350 ReceivePacket(packet.data(), packet.size(), header, in_order);
asapersson@webrtc.org1457b472014-05-26 13:06:04 +0000351 // Update receive statistics after ReceivePacket.
352 // Receive statistics will be reset if the payload type changes (make sure
353 // that the first packet is included in the stats).
nissed2ef3142017-05-11 08:00:58 -0700354 if (!packet.recovered()) {
355 // TODO(nisse): We should pass a recovered flag to stats, to aid
356 // fixing bug bugs.webrtc.org/6339.
357 rtp_receive_statistics_->IncomingPacket(
358 header, packet.size(), IsPacketRetransmitted(header, in_order));
359 }
eladalonc0d481a2017-08-02 07:39:07 -0700360
361 for (RtpPacketSinkInterface* secondary_sink : secondary_sinks_) {
362 secondary_sink->OnRtpPacket(packet);
363 }
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000364}
365
nisseb1f2ff92017-06-09 04:01:55 -0700366int32_t RtpVideoStreamReceiver::RequestKeyFrame() {
mflodmancfc8e3b2016-05-03 21:22:04 -0700367 return rtp_rtcp_->RequestKeyFrame();
368}
369
nisseb1f2ff92017-06-09 04:01:55 -0700370bool RtpVideoStreamReceiver::IsUlpfecEnabled() const {
brandtre6f98c72016-11-11 03:28:30 -0800371 return config_.rtp.ulpfec.ulpfec_payload_type != -1;
372}
373
nisseb1f2ff92017-06-09 04:01:55 -0700374bool RtpVideoStreamReceiver::IsRedEnabled() const {
brandtre6f98c72016-11-11 03:28:30 -0800375 return config_.rtp.ulpfec.red_payload_type != -1;
mflodmandc7d0d22016-05-06 05:32:22 -0700376}
377
nisseb1f2ff92017-06-09 04:01:55 -0700378bool RtpVideoStreamReceiver::IsRetransmissionsEnabled() const {
mflodmandc7d0d22016-05-06 05:32:22 -0700379 return config_.rtp.nack.rtp_history_ms > 0;
380}
381
nisseb1f2ff92017-06-09 04:01:55 -0700382void RtpVideoStreamReceiver::RequestPacketRetransmit(
mflodmandc7d0d22016-05-06 05:32:22 -0700383 const std::vector<uint16_t>& sequence_numbers) {
384 rtp_rtcp_->SendNack(sequence_numbers);
385}
386
nisseb1f2ff92017-06-09 04:01:55 -0700387int32_t RtpVideoStreamReceiver::ResendPackets(const uint16_t* sequence_numbers,
388 uint16_t length) {
mflodmancfc8e3b2016-05-03 21:22:04 -0700389 return rtp_rtcp_->SendNACK(sequence_numbers, length);
390}
391
nisseb1f2ff92017-06-09 04:01:55 -0700392void RtpVideoStreamReceiver::OnReceivedFrame(
philipelfd5a20f2016-11-15 00:57:57 -0800393 std::unique_ptr<video_coding::RtpFrameObject> frame) {
philipel2c53b132017-05-16 08:06:30 -0700394 if (!has_received_frame_) {
395 has_received_frame_ = true;
396 if (frame->FrameType() != kVideoFrameKey)
397 keyframe_request_sender_->RequestKeyFrame();
398 }
399
philipelbd26ba72017-01-29 04:04:47 -0800400 if (!frame->delayed_by_retransmission())
401 timing_->IncomingTimestamp(frame->timestamp, clock_->TimeInMilliseconds());
philipelfd5a20f2016-11-15 00:57:57 -0800402 reference_finder_->ManageFrame(std::move(frame));
403}
404
nisseb1f2ff92017-06-09 04:01:55 -0700405void RtpVideoStreamReceiver::OnCompleteFrame(
philipelfd5a20f2016-11-15 00:57:57 -0800406 std::unique_ptr<video_coding::FrameObject> frame) {
407 {
408 rtc::CritScope lock(&last_seq_num_cs_);
409 video_coding::RtpFrameObject* rtp_frame =
410 static_cast<video_coding::RtpFrameObject*>(frame.get());
411 last_seq_num_for_pic_id_[rtp_frame->picture_id] = rtp_frame->last_seq_num();
412 }
413 complete_frame_callback_->OnCompleteFrame(std::move(frame));
414}
415
nisseb1f2ff92017-06-09 04:01:55 -0700416void RtpVideoStreamReceiver::OnRttUpdate(int64_t avg_rtt_ms,
417 int64_t max_rtt_ms) {
tommif284b7f2017-02-27 01:59:36 -0800418 if (nack_module_)
419 nack_module_->UpdateRtt(max_rtt_ms);
philipelfd5a20f2016-11-15 00:57:57 -0800420}
421
nisseb1f2ff92017-06-09 04:01:55 -0700422rtc::Optional<int64_t> RtpVideoStreamReceiver::LastReceivedPacketMs() const {
philipel3184f8e2017-05-18 08:08:53 -0700423 return packet_buffer_->LastReceivedPacketMs();
424}
425
nisseb1f2ff92017-06-09 04:01:55 -0700426rtc::Optional<int64_t> RtpVideoStreamReceiver::LastReceivedKeyframePacketMs()
427 const {
philipel3184f8e2017-05-18 08:08:53 -0700428 return packet_buffer_->LastReceivedKeyframePacketMs();
429}
430
eladalonc0d481a2017-08-02 07:39:07 -0700431void RtpVideoStreamReceiver::AddSecondarySink(RtpPacketSinkInterface* sink) {
eladalon8b073052017-08-25 00:49:08 -0700432 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
eladalonc0d481a2017-08-02 07:39:07 -0700433 RTC_DCHECK(std::find(secondary_sinks_.cbegin(), secondary_sinks_.cend(),
434 sink) == secondary_sinks_.cend());
435 secondary_sinks_.push_back(sink);
436}
437
438void RtpVideoStreamReceiver::RemoveSecondarySink(
439 const RtpPacketSinkInterface* sink) {
eladalon8b073052017-08-25 00:49:08 -0700440 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
eladalonc0d481a2017-08-02 07:39:07 -0700441 auto it = std::find(secondary_sinks_.begin(), secondary_sinks_.end(), sink);
442 if (it == secondary_sinks_.end()) {
443 // We might be rolling-back a call whose setup failed mid-way. In such a
444 // case, it's simpler to remove "everything" rather than remember what
445 // has already been added.
446 LOG(LS_WARNING) << "Removal of unknown sink.";
447 return;
448 }
449 secondary_sinks_.erase(it);
450}
451
nisseb1f2ff92017-06-09 04:01:55 -0700452void RtpVideoStreamReceiver::ReceivePacket(const uint8_t* packet,
453 size_t packet_length,
454 const RTPHeader& header,
455 bool in_order) {
nissef54573b2017-09-13 07:13:57 -0700456 if (rtp_payload_registry_.IsRed(header)) {
nisse30e89312017-05-29 08:16:37 -0700457 ParseAndHandleEncapsulatingHeader(packet, packet_length, header);
458 return;
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000459 }
460 const uint8_t* payload = packet + header.headerLength;
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000461 assert(packet_length >= header.headerLength);
462 size_t payload_length = packet_length - header.headerLength;
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000463 PayloadUnion payload_specific;
Peter Boström4fa7eca2016-03-02 15:05:53 +0100464 if (!rtp_payload_registry_.GetPayloadSpecifics(header.payloadType,
465 &payload_specific)) {
nisse30e89312017-05-29 08:16:37 -0700466 return;
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000467 }
nisse30e89312017-05-29 08:16:37 -0700468 rtp_receiver_->IncomingRtpPacket(header, payload, payload_length,
469 payload_specific, in_order);
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000470}
471
nisseb1f2ff92017-06-09 04:01:55 -0700472void RtpVideoStreamReceiver::ParseAndHandleEncapsulatingHeader(
mflodmanfa666592016-04-28 23:15:33 -0700473 const uint8_t* packet, size_t packet_length, const RTPHeader& header) {
eladalon8b073052017-08-25 00:49:08 -0700474 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
Peter Boström4fa7eca2016-03-02 15:05:53 +0100475 if (rtp_payload_registry_.IsRed(header)) {
476 int8_t ulpfec_pt = rtp_payload_registry_.ulpfec_payload_type();
asapersson@webrtc.org37c05592015-01-28 13:58:27 +0000477 if (packet[header.headerLength] == ulpfec_pt) {
asapersson@webrtc.org273fbbb2015-01-27 12:17:29 +0000478 rtp_receive_statistics_->FecPacketReceived(header, packet_length);
Peter Boström0b250722016-04-22 18:23:15 +0200479 // Notify video_receiver about received FEC packets to avoid NACKing these
480 // packets.
asapersson@webrtc.org37c05592015-01-28 13:58:27 +0000481 NotifyReceiverOfFecPacket(header);
482 }
brandtrd55c3f62016-10-31 04:51:33 -0700483 if (ulpfec_receiver_->AddReceivedRedPacket(header, packet, packet_length,
484 ulpfec_pt) != 0) {
nisse30e89312017-05-29 08:16:37 -0700485 return;
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000486 }
nisse30e89312017-05-29 08:16:37 -0700487 ulpfec_receiver_->ProcessReceivedFec();
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000488 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000489}
490
nisseb1f2ff92017-06-09 04:01:55 -0700491void RtpVideoStreamReceiver::NotifyReceiverOfFecPacket(
492 const RTPHeader& header) {
asapersson@webrtc.org37c05592015-01-28 13:58:27 +0000493 int8_t last_media_payload_type =
Peter Boström4fa7eca2016-03-02 15:05:53 +0100494 rtp_payload_registry_.last_received_media_payload_type();
asapersson@webrtc.org37c05592015-01-28 13:58:27 +0000495 if (last_media_payload_type < 0) {
496 LOG(LS_WARNING) << "Failed to get last media payload type.";
497 return;
498 }
499 // Fake an empty media packet.
500 WebRtcRTPHeader rtp_header = {};
501 rtp_header.header = header;
502 rtp_header.header.payloadType = last_media_payload_type;
503 rtp_header.header.paddingLength = 0;
504 PayloadUnion payload_specific;
Peter Boström4fa7eca2016-03-02 15:05:53 +0100505 if (!rtp_payload_registry_.GetPayloadSpecifics(last_media_payload_type,
506 &payload_specific)) {
asapersson@webrtc.org37c05592015-01-28 13:58:27 +0000507 LOG(LS_WARNING) << "Failed to get payload specifics.";
508 return;
509 }
510 rtp_header.type.Video.codec = payload_specific.Video.videoCodecType;
guoweis@webrtc.orgfdd10572015-03-12 20:50:57 +0000511 rtp_header.type.Video.rotation = kVideoRotation_0;
512 if (header.extension.hasVideoRotation) {
magjed71eb61c2016-09-08 03:24:58 -0700513 rtp_header.type.Video.rotation = header.extension.videoRotation;
guoweis@webrtc.orgfdd10572015-03-12 20:50:57 +0000514 }
ilnik00d802b2017-04-11 10:34:31 -0700515 rtp_header.type.Video.content_type = VideoContentType::UNSPECIFIED;
516 if (header.extension.hasVideoContentType) {
517 rtp_header.type.Video.content_type = header.extension.videoContentType;
518 }
ilnik04f4d122017-06-19 07:18:55 -0700519 rtp_header.type.Video.video_timing = {0u, 0u, 0u, 0u, 0u, 0u, false};
520 if (header.extension.has_video_timing) {
521 rtp_header.type.Video.video_timing = header.extension.video_timing;
ilnik04f4d122017-06-19 07:18:55 -0700522 }
isheriff6b4b5f32016-06-08 00:24:21 -0700523 rtp_header.type.Video.playout_delay = header.extension.playout_delay;
524
Peter Boström74f6e9e2016-04-04 17:56:10 +0200525 OnReceivedPayloadData(nullptr, 0, &rtp_header);
asapersson@webrtc.org37c05592015-01-28 13:58:27 +0000526}
527
nisseb1f2ff92017-06-09 04:01:55 -0700528bool RtpVideoStreamReceiver::DeliverRtcp(const uint8_t* rtcp_packet,
529 size_t rtcp_packet_length) {
eladalon8b073052017-08-25 00:49:08 -0700530 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
531
532 if (!receiving_) {
533 return false;
Peter Boström4fa7eca2016-03-02 15:05:53 +0100534 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000535
Per83d09102016-04-15 14:59:13 +0200536 rtp_rtcp_->IncomingRtcpPacket(rtcp_packet, rtcp_packet_length);
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000537
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000538 int64_t rtt = 0;
Per83d09102016-04-15 14:59:13 +0200539 rtp_rtcp_->RTT(rtp_receiver_->SSRC(), &rtt, nullptr, nullptr, nullptr);
minyue@webrtc.org2c0cdbc2014-10-09 10:52:43 +0000540 if (rtt == 0) {
541 // Waiting for valid rtt.
Peter Boströmd1d66ba2016-02-08 14:07:14 +0100542 return true;
minyue@webrtc.org2c0cdbc2014-10-09 10:52:43 +0000543 }
544 uint32_t ntp_secs = 0;
545 uint32_t ntp_frac = 0;
546 uint32_t rtp_timestamp = 0;
Per83d09102016-04-15 14:59:13 +0200547 if (rtp_rtcp_->RemoteNTP(&ntp_secs, &ntp_frac, nullptr, nullptr,
548 &rtp_timestamp) != 0) {
minyue@webrtc.org2c0cdbc2014-10-09 10:52:43 +0000549 // Waiting for RTCP.
Peter Boströmd1d66ba2016-02-08 14:07:14 +0100550 return true;
minyue@webrtc.org2c0cdbc2014-10-09 10:52:43 +0000551 }
Peter Boström4fa7eca2016-03-02 15:05:53 +0100552 ntp_estimator_.UpdateRtcpTimestamp(rtt, ntp_secs, ntp_frac, rtp_timestamp);
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000553
Peter Boströmd1d66ba2016-02-08 14:07:14 +0100554 return true;
wu@webrtc.orgcd701192014-04-24 22:10:24 +0000555}
556
philipeld4fac692017-09-04 07:03:46 -0700557void RtpVideoStreamReceiver::FrameContinuous(int64_t picture_id) {
tommif284b7f2017-02-27 01:59:36 -0800558 if (!nack_module_)
559 return;
560
philipela45102f2017-02-22 05:30:39 -0800561 int seq_num = -1;
562 {
563 rtc::CritScope lock(&last_seq_num_cs_);
564 auto seq_num_it = last_seq_num_for_pic_id_.find(picture_id);
565 if (seq_num_it != last_seq_num_for_pic_id_.end())
566 seq_num = seq_num_it->second;
philipelfd5a20f2016-11-15 00:57:57 -0800567 }
philipela45102f2017-02-22 05:30:39 -0800568 if (seq_num != -1)
569 nack_module_->ClearUpTo(seq_num);
philipelfd5a20f2016-11-15 00:57:57 -0800570}
571
philipeld4fac692017-09-04 07:03:46 -0700572void RtpVideoStreamReceiver::FrameDecoded(int64_t picture_id) {
philipela45102f2017-02-22 05:30:39 -0800573 int seq_num = -1;
574 {
575 rtc::CritScope lock(&last_seq_num_cs_);
576 auto seq_num_it = last_seq_num_for_pic_id_.find(picture_id);
577 if (seq_num_it != last_seq_num_for_pic_id_.end()) {
578 seq_num = seq_num_it->second;
579 last_seq_num_for_pic_id_.erase(last_seq_num_for_pic_id_.begin(),
580 ++seq_num_it);
philipelfd5a20f2016-11-15 00:57:57 -0800581 }
philipela45102f2017-02-22 05:30:39 -0800582 }
583 if (seq_num != -1) {
584 packet_buffer_->ClearTo(seq_num);
585 reference_finder_->ClearTo(seq_num);
philipelfd5a20f2016-11-15 00:57:57 -0800586 }
587}
588
nisseb1f2ff92017-06-09 04:01:55 -0700589void RtpVideoStreamReceiver::SignalNetworkState(NetworkState state) {
mflodmandc7d0d22016-05-06 05:32:22 -0700590 rtp_rtcp_->SetRTCPStatus(state == kNetworkUp ? config_.rtp.rtcp_mode
591 : RtcpMode::kOff);
592}
593
nisseb1f2ff92017-06-09 04:01:55 -0700594void RtpVideoStreamReceiver::StartReceive() {
eladalon8b073052017-08-25 00:49:08 -0700595 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
mflodman@webrtc.orgad4ee362011-11-28 22:39:24 +0000596 receiving_ = true;
597}
598
nisseb1f2ff92017-06-09 04:01:55 -0700599void RtpVideoStreamReceiver::StopReceive() {
eladalon8b073052017-08-25 00:49:08 -0700600 RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_task_checker_);
mflodman@webrtc.orgad4ee362011-11-28 22:39:24 +0000601 receiving_ = false;
602}
603
nisseb1f2ff92017-06-09 04:01:55 -0700604bool RtpVideoStreamReceiver::IsPacketInOrder(const RTPHeader& header) const {
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000605 StreamStatistician* statistician =
606 rtp_receive_statistics_->GetStatistician(header.ssrc);
607 if (!statistician)
608 return false;
609 return statistician->IsPacketInOrder(header.sequenceNumber);
610}
611
nisseb1f2ff92017-06-09 04:01:55 -0700612bool RtpVideoStreamReceiver::IsPacketRetransmitted(const RTPHeader& header,
613 bool in_order) const {
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000614 // Retransmissions are handled separately if RTX is enabled.
Peter Boström4fa7eca2016-03-02 15:05:53 +0100615 if (rtp_payload_registry_.RtxEnabled())
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000616 return false;
617 StreamStatistician* statistician =
618 rtp_receive_statistics_->GetStatistician(header.ssrc);
619 if (!statistician)
620 return false;
621 // Check if this is a retransmission.
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000622 int64_t min_rtt = 0;
stefanb4ab3812017-06-09 06:12:11 -0700623 rtp_rtcp_->RTT(config_.rtp.remote_ssrc, nullptr, nullptr, &min_rtt, nullptr);
stefan@webrtc.org48df3812013-11-08 15:18:52 +0000624 return !in_order &&
stefan@webrtc.org7bb8f022013-09-06 13:40:11 +0000625 statistician->IsRetransmitOfOldPacket(header, min_rtt);
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000626}
mflodmandc7d0d22016-05-06 05:32:22 -0700627
nisseb1f2ff92017-06-09 04:01:55 -0700628void RtpVideoStreamReceiver::UpdateHistograms() {
brandtrd55c3f62016-10-31 04:51:33 -0700629 FecPacketCounter counter = ulpfec_receiver_->GetPacketCounter();
asapersson0c43f772016-11-30 01:42:26 -0800630 if (counter.first_packet_time_ms == -1)
631 return;
632
633 int64_t elapsed_sec =
634 (clock_->TimeInMilliseconds() - counter.first_packet_time_ms) / 1000;
635 if (elapsed_sec < metrics::kMinRunTimeInSeconds)
636 return;
637
mflodmandc7d0d22016-05-06 05:32:22 -0700638 if (counter.num_packets > 0) {
asapersson1d02d3e2016-09-09 22:40:25 -0700639 RTC_HISTOGRAM_PERCENTAGE(
mflodmandc7d0d22016-05-06 05:32:22 -0700640 "WebRTC.Video.ReceivedFecPacketsInPercent",
641 static_cast<int>(counter.num_fec_packets * 100 / counter.num_packets));
642 }
643 if (counter.num_fec_packets > 0) {
asapersson1d02d3e2016-09-09 22:40:25 -0700644 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.RecoveredMediaPacketsInPercentOfFec",
645 static_cast<int>(counter.num_recovered_packets *
646 100 / counter.num_fec_packets));
mflodmandc7d0d22016-05-06 05:32:22 -0700647 }
648}
649
nisseb1f2ff92017-06-09 04:01:55 -0700650void RtpVideoStreamReceiver::EnableReceiveRtpHeaderExtension(
mflodmandc7d0d22016-05-06 05:32:22 -0700651 const std::string& extension, int id) {
652 // One-byte-extension local identifiers are in the range 1-14 inclusive.
653 RTC_DCHECK_GE(id, 1);
654 RTC_DCHECK_LE(id, 14);
655 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension));
656 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension(
657 StringToRtpExtensionType(extension), id));
658}
659
nisseb1f2ff92017-06-09 04:01:55 -0700660void RtpVideoStreamReceiver::InsertSpsPpsIntoTracker(uint8_t payload_type) {
philipel022b54e2016-12-20 04:15:59 -0800661 auto codec_params_it = pt_codec_params_.find(payload_type);
662 if (codec_params_it == pt_codec_params_.end())
663 return;
664
665 LOG(LS_INFO) << "Found out of band supplied codec parameters for"
johan62d02c32017-01-24 04:38:27 -0800666 << " payload type: " << static_cast<int>(payload_type);
philipel022b54e2016-12-20 04:15:59 -0800667
668 H264SpropParameterSets sprop_decoder;
669 auto sprop_base64_it =
670 codec_params_it->second.find(cricket::kH264FmtpSpropParameterSets);
671
672 if (sprop_base64_it == codec_params_it->second.end())
673 return;
674
johan62d02c32017-01-24 04:38:27 -0800675 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str()))
philipel022b54e2016-12-20 04:15:59 -0800676 return;
677
johand2b092f2017-01-24 02:38:17 -0800678 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(),
679 sprop_decoder.pps_nalu());
philipel022b54e2016-12-20 04:15:59 -0800680}
681
mflodman@webrtc.orgad4ee362011-11-28 22:39:24 +0000682} // namespace webrtc