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

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

Issue 2874933004: Request keyframe if the first received frame is not a keyframe. (Closed)
Patch Set: Created 3 years, 7 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 | « webrtc/video/rtp_stream_receiver.h ('k') | webrtc/video/rtp_stream_receiver_unittest.cc » ('j') | 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 receiving_(false), 104 receiving_(false),
105 restored_packet_in_use_(false), 105 restored_packet_in_use_(false),
106 last_packet_log_ms_(-1), 106 last_packet_log_ms_(-1),
107 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(), 107 rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(),
108 transport, 108 transport,
109 rtt_stats, 109 rtt_stats,
110 receive_stats_proxy, 110 receive_stats_proxy,
111 packet_router)), 111 packet_router)),
112 complete_frame_callback_(complete_frame_callback), 112 complete_frame_callback_(complete_frame_callback),
113 keyframe_request_sender_(keyframe_request_sender), 113 keyframe_request_sender_(keyframe_request_sender),
114 timing_(timing) { 114 timing_(timing),
115 has_received_frame_(false) {
115 packet_router_->AddReceiveRtpModule(rtp_rtcp_.get()); 116 packet_router_->AddReceiveRtpModule(rtp_rtcp_.get());
116 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy); 117 rtp_receive_statistics_->RegisterRtpStatisticsCallback(receive_stats_proxy);
117 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy); 118 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(receive_stats_proxy);
118 119
119 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) 120 RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff)
120 << "A stream should not be configured with RTCP disabled. This value is " 121 << "A stream should not be configured with RTCP disabled. This value is "
121 "reserved for internal usage."; 122 "reserved for internal usage.";
122 RTC_DCHECK(config_.rtp.remote_ssrc != 0); 123 RTC_DCHECK(config_.rtp.remote_ssrc != 0);
123 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams? 124 // TODO(pbos): What's an appropriate local_ssrc for receive-only streams?
124 RTC_DCHECK(config_.rtp.local_ssrc != 0); 125 RTC_DCHECK(config_.rtp.local_ssrc != 0);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 rtp_rtcp_->SendNack(sequence_numbers); 374 rtp_rtcp_->SendNack(sequence_numbers);
374 } 375 }
375 376
376 int32_t RtpStreamReceiver::ResendPackets(const uint16_t* sequence_numbers, 377 int32_t RtpStreamReceiver::ResendPackets(const uint16_t* sequence_numbers,
377 uint16_t length) { 378 uint16_t length) {
378 return rtp_rtcp_->SendNACK(sequence_numbers, length); 379 return rtp_rtcp_->SendNACK(sequence_numbers, length);
379 } 380 }
380 381
381 void RtpStreamReceiver::OnReceivedFrame( 382 void RtpStreamReceiver::OnReceivedFrame(
382 std::unique_ptr<video_coding::RtpFrameObject> frame) { 383 std::unique_ptr<video_coding::RtpFrameObject> frame) {
384
385 if (!has_received_frame_) {
386 has_received_frame_ = true;
mflodman 2017/05/11 13:11:36 What happens if: 1. The frame buffer is reset late
philipel 2017/05/11 13:38:58 If things are working as they should (the incoming
mflodman 2017/05/15 08:46:29 I was thinking about a jitter buffer flush, or the
stefan-webrtc 2017/05/15 11:01:27 Philip, I think the question is if the PacketBuffe
philipel 2017/05/15 11:43:22 This function is called when the packet buffer fin
stefan-webrtc 2017/05/15 14:43:38 Ah, I see.
philipel 2017/05/16 11:26:23 We might want to tweak how keyframe requests are s
387 if (frame->FrameType() != kVideoFrameKey)
388 keyframe_request_sender_->RequestKeyFrame();
brandtr 2017/05/11 12:37:39 Except for it being a heuristic, are there any dra
philipel 2017/05/11 13:38:58 The worst drawback I can think of is on really bad
stefan-webrtc 2017/05/15 11:01:27 Are these key frame requests throttled somewhere,
philipel 2017/05/15 11:43:22 Quickly looking through the code I can't find any
389 }
390
383 if (!frame->delayed_by_retransmission()) 391 if (!frame->delayed_by_retransmission())
384 timing_->IncomingTimestamp(frame->timestamp, clock_->TimeInMilliseconds()); 392 timing_->IncomingTimestamp(frame->timestamp, clock_->TimeInMilliseconds());
385 reference_finder_->ManageFrame(std::move(frame)); 393 reference_finder_->ManageFrame(std::move(frame));
386 } 394 }
387 395
388 void RtpStreamReceiver::OnCompleteFrame( 396 void RtpStreamReceiver::OnCompleteFrame(
389 std::unique_ptr<video_coding::FrameObject> frame) { 397 std::unique_ptr<video_coding::FrameObject> frame) {
390 { 398 {
391 rtc::CritScope lock(&last_seq_num_cs_); 399 rtc::CritScope lock(&last_seq_num_cs_);
392 video_coding::RtpFrameObject* rtp_frame = 400 video_coding::RtpFrameObject* rtp_frame =
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 return; 657 return;
650 658
651 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str())) 659 if (!sprop_decoder.DecodeSprop(sprop_base64_it->second.c_str()))
652 return; 660 return;
653 661
654 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(), 662 tracker_.InsertSpsPpsNalus(sprop_decoder.sps_nalu(),
655 sprop_decoder.pps_nalu()); 663 sprop_decoder.pps_nalu());
656 } 664 }
657 665
658 } // namespace webrtc 666 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/rtp_stream_receiver.h ('k') | webrtc/video/rtp_stream_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698