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

Side by Side Diff: webrtc/modules/video_coding/video_receiver.cc

Issue 2995153002: Revert of quest keyframes more frequently on stream start/decoding error. (Closed)
Patch Set: Created 3 years, 4 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/modules/video_coding/frame_object.h ('k') | webrtc/video/video_receive_stream.h » ('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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 313
314 // Must be called from inside the receive side critical section. 314 // Must be called from inside the receive side critical section.
315 int32_t VideoReceiver::Decode(const VCMEncodedFrame& frame) { 315 int32_t VideoReceiver::Decode(const VCMEncodedFrame& frame) {
316 TRACE_EVENT0("webrtc", "VideoReceiver::Decode"); 316 TRACE_EVENT0("webrtc", "VideoReceiver::Decode");
317 // Change decoder if payload type has changed 317 // Change decoder if payload type has changed
318 VCMGenericDecoder* decoder = 318 VCMGenericDecoder* decoder =
319 _codecDataBase.GetDecoder(frame, &_decodedFrameCallback); 319 _codecDataBase.GetDecoder(frame, &_decodedFrameCallback);
320 if (decoder == nullptr) { 320 if (decoder == nullptr) {
321 return VCM_NO_CODEC_REGISTERED; 321 return VCM_NO_CODEC_REGISTERED;
322 } 322 }
323 return decoder->Decode(frame, clock_->TimeInMilliseconds()); 323 // Decode a frame
324 int32_t ret = decoder->Decode(frame, clock_->TimeInMilliseconds());
325
326 // Check for failed decoding, run frame type request callback if needed.
327 bool request_key_frame = false;
328 if (ret < 0) {
329 request_key_frame = true;
330 }
331
332 if (!frame.Complete() || frame.MissingFrame()) {
333 request_key_frame = true;
334 ret = VCM_OK;
335 }
336 if (request_key_frame) {
337 rtc::CritScope cs(&process_crit_);
338 _scheduleKeyRequest = true;
339 }
340 return ret;
324 } 341 }
325 342
326 // Register possible receive codecs, can be called multiple times 343 // Register possible receive codecs, can be called multiple times
327 int32_t VideoReceiver::RegisterReceiveCodec(const VideoCodec* receiveCodec, 344 int32_t VideoReceiver::RegisterReceiveCodec(const VideoCodec* receiveCodec,
328 int32_t numberOfCores, 345 int32_t numberOfCores,
329 bool requireKeyFrame) { 346 bool requireKeyFrame) {
330 RTC_DCHECK(construction_thread_.CalledOnValidThread()); 347 RTC_DCHECK(construction_thread_.CalledOnValidThread());
331 // TODO(tommi): This method must only be called when the decoder thread 348 // TODO(tommi): This method must only be called when the decoder thread
332 // is not running. Do we need a lock? If not, it looks like we might not need 349 // is not running. Do we need a lock? If not, it looks like we might not need
333 // a lock at all for |_codecDataBase|. 350 // a lock at all for |_codecDataBase|.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack, 448 _receiver.SetNackSettings(max_nack_list_size, max_packet_age_to_nack,
432 max_incomplete_time_ms); 449 max_incomplete_time_ms);
433 } 450 }
434 451
435 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) { 452 int VideoReceiver::SetMinReceiverDelay(int desired_delay_ms) {
436 return _receiver.SetMinReceiverDelay(desired_delay_ms); 453 return _receiver.SetMinReceiverDelay(desired_delay_ms);
437 } 454 }
438 455
439 } // namespace vcm 456 } // namespace vcm
440 } // namespace webrtc 457 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_object.h ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698