| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 return static_cast<VideoReceiveStream*>(ptr)->Decode(); | 481 return static_cast<VideoReceiveStream*>(ptr)->Decode(); |
| 482 } | 482 } |
| 483 | 483 |
| 484 bool VideoReceiveStream::Decode() { | 484 bool VideoReceiveStream::Decode() { |
| 485 TRACE_EVENT0("webrtc", "VideoReceiveStream::Decode"); | 485 TRACE_EVENT0("webrtc", "VideoReceiveStream::Decode"); |
| 486 static const int kMaxWaitForFrameMs = 3000; | 486 static const int kMaxWaitForFrameMs = 3000; |
| 487 std::unique_ptr<video_coding::FrameObject> frame; | 487 std::unique_ptr<video_coding::FrameObject> frame; |
| 488 video_coding::FrameBuffer::ReturnReason res = | 488 video_coding::FrameBuffer::ReturnReason res = |
| 489 frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame); | 489 frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame); |
| 490 | 490 |
| 491 if (res == video_coding::FrameBuffer::ReturnReason::kStopped) | 491 if (res == video_coding::FrameBuffer::ReturnReason::kStopped) { |
| 492 video_receiver_.DecodingStopped(); |
| 492 return false; | 493 return false; |
| 494 } |
| 493 | 495 |
| 494 if (frame) { | 496 if (frame) { |
| 495 if (video_receiver_.Decode(frame.get()) == VCM_OK) | 497 if (video_receiver_.Decode(frame.get()) == VCM_OK) |
| 496 rtp_stream_receiver_.FrameDecoded(frame->picture_id); | 498 rtp_stream_receiver_.FrameDecoded(frame->picture_id); |
| 497 } else { | 499 } else { |
| 498 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 500 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
| 499 << " ms, requesting keyframe."; | 501 << " ms, requesting keyframe."; |
| 500 RequestKeyFrame(); | 502 RequestKeyFrame(); |
| 501 } | 503 } |
| 502 return true; | 504 return true; |
| 503 } | 505 } |
| 504 } // namespace internal | 506 } // namespace internal |
| 505 } // namespace webrtc | 507 } // namespace webrtc |
| OLD | NEW |