OLD | NEW |
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 Loading... |
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 |
OLD | NEW |