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

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

Issue 2744013002: Updates to VCMDecodedFrameCallback, VideoReceiver and a few related classes/tests. (Closed)
Patch Set: Format + assert->DCHECK and require callback in decode Created 3 years, 9 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
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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 return static_cast<VideoReceiveStream*>(ptr)->Decode(); 474 return static_cast<VideoReceiveStream*>(ptr)->Decode();
475 } 475 }
476 476
477 bool VideoReceiveStream::Decode() { 477 bool VideoReceiveStream::Decode() {
478 TRACE_EVENT0("webrtc", "VideoReceiveStream::Decode"); 478 TRACE_EVENT0("webrtc", "VideoReceiveStream::Decode");
479 static const int kMaxWaitForFrameMs = 3000; 479 static const int kMaxWaitForFrameMs = 3000;
480 std::unique_ptr<video_coding::FrameObject> frame; 480 std::unique_ptr<video_coding::FrameObject> frame;
481 video_coding::FrameBuffer::ReturnReason res = 481 video_coding::FrameBuffer::ReturnReason res =
482 frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame); 482 frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame);
483 483
484 if (res == video_coding::FrameBuffer::ReturnReason::kStopped) 484 if (res == video_coding::FrameBuffer::ReturnReason::kStopped) {
485 video_receiver_.DecodingStopped();
485 return false; 486 return false;
487 }
486 488
487 if (frame) { 489 if (frame) {
488 if (video_receiver_.Decode(frame.get()) == VCM_OK) 490 if (video_receiver_.Decode(frame.get()) == VCM_OK)
489 rtp_stream_receiver_.FrameDecoded(frame->picture_id); 491 rtp_stream_receiver_.FrameDecoded(frame->picture_id);
490 } else { 492 } else {
491 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs 493 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs
492 << " ms, requesting keyframe."; 494 << " ms, requesting keyframe.";
493 RequestKeyFrame(); 495 RequestKeyFrame();
494 } 496 }
495 return true; 497 return true;
496 } 498 }
497 } // namespace internal 499 } // namespace internal
498 } // namespace webrtc 500 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698