Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: webrtc/video/rtp_stream_receiver.cc

Issue 2663513003: Only update VCMTiming on every received frame instead of every received packet. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 int32_t RtpStreamReceiver::OnReceivedPayloadData( 250 int32_t RtpStreamReceiver::OnReceivedPayloadData(
251 const uint8_t* payload_data, 251 const uint8_t* payload_data,
252 size_t payload_size, 252 size_t payload_size,
253 const WebRtcRTPHeader* rtp_header) { 253 const WebRtcRTPHeader* rtp_header) {
254 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header; 254 WebRtcRTPHeader rtp_header_with_ntp = *rtp_header;
255 rtp_header_with_ntp.ntp_time_ms = 255 rtp_header_with_ntp.ntp_time_ms =
256 ntp_estimator_.Estimate(rtp_header->header.timestamp); 256 ntp_estimator_.Estimate(rtp_header->header.timestamp);
257 if (jitter_buffer_experiment_) { 257 if (jitter_buffer_experiment_) {
258 VCMPacket packet(payload_data, payload_size, rtp_header_with_ntp); 258 VCMPacket packet(payload_data, payload_size, rtp_header_with_ntp);
259 timing_->IncomingTimestamp(packet.timestamp, clock_->TimeInMilliseconds());
260 packet.timesNacked = nack_module_->OnReceivedPacket(packet); 259 packet.timesNacked = nack_module_->OnReceivedPacket(packet);
261 260
262 if (packet.codec == kVideoCodecH264) { 261 if (packet.codec == kVideoCodecH264) {
263 // Only when we start to receive packets will we know what payload type 262 // Only when we start to receive packets will we know what payload type
264 // that will be used. When we know the payload type insert the correct 263 // that will be used. When we know the payload type insert the correct
265 // sps/pps into the tracker. 264 // sps/pps into the tracker.
266 if (packet.payloadType != last_payload_type_) { 265 if (packet.payloadType != last_payload_type_) {
267 last_payload_type_ = packet.payloadType; 266 last_payload_type_ = packet.payloadType;
268 InsertSpsPpsIntoTracker(packet.payloadType); 267 InsertSpsPpsIntoTracker(packet.payloadType);
269 } 268 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 rtp_rtcp_->SendNack(sequence_numbers); 405 rtp_rtcp_->SendNack(sequence_numbers);
407 } 406 }
408 407
409 int32_t RtpStreamReceiver::ResendPackets(const uint16_t* sequence_numbers, 408 int32_t RtpStreamReceiver::ResendPackets(const uint16_t* sequence_numbers,
410 uint16_t length) { 409 uint16_t length) {
411 return rtp_rtcp_->SendNACK(sequence_numbers, length); 410 return rtp_rtcp_->SendNACK(sequence_numbers, length);
412 } 411 }
413 412
414 void RtpStreamReceiver::OnReceivedFrame( 413 void RtpStreamReceiver::OnReceivedFrame(
415 std::unique_ptr<video_coding::RtpFrameObject> frame) { 414 std::unique_ptr<video_coding::RtpFrameObject> frame) {
415 if (!frame->delayed_by_retransmission())
416 timing_->IncomingTimestamp(frame->timestamp, clock_->TimeInMilliseconds());
416 reference_finder_->ManageFrame(std::move(frame)); 417 reference_finder_->ManageFrame(std::move(frame));
417 } 418 }
418 419
419 void RtpStreamReceiver::OnCompleteFrame( 420 void RtpStreamReceiver::OnCompleteFrame(
420 std::unique_ptr<video_coding::FrameObject> frame) { 421 std::unique_ptr<video_coding::FrameObject> frame) {
421 { 422 {
422 rtc::CritScope lock(&last_seq_num_cs_); 423 rtc::CritScope lock(&last_seq_num_cs_);
423 video_coding::RtpFrameObject* rtp_frame = 424 video_coding::RtpFrameObject* rtp_frame =
424 static_cast<video_coding::RtpFrameObject*>(frame.get()); 425 static_cast<video_coding::RtpFrameObject*>(frame.get());
425 last_seq_num_for_pic_id_[rtp_frame->picture_id] = rtp_frame->last_seq_num(); 426 last_seq_num_for_pic_id_[rtp_frame->picture_id] = rtp_frame->last_seq_num();
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 return; 677 return;
677 678
678 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) 679 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str()))
679 return; 680 return;
680 681
681 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), 682 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(),
682 sprop_decoder.pps_nalu()); 683 sprop_decoder.pps_nalu());
683 } 684 }
684 685
685 } // namespace webrtc 686 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698