OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 // if (render_buffers_.AddFrame(std::move(frame)) == 1) | 30 // if (render_buffers_.AddFrame(std::move(frame)) == 1) |
31 // Dequeue(); | 31 // Dequeue(); |
32 // }); | 32 // }); |
33 class IncomingVideoStream::NewFrameTask : public rtc::QueuedTask { | 33 class IncomingVideoStream::NewFrameTask : public rtc::QueuedTask { |
34 public: | 34 public: |
35 NewFrameTask(IncomingVideoStream* stream, VideoFrame frame) | 35 NewFrameTask(IncomingVideoStream* stream, VideoFrame frame) |
36 : stream_(stream), frame_(std::move(frame)) {} | 36 : stream_(stream), frame_(std::move(frame)) {} |
37 | 37 |
38 private: | 38 private: |
39 bool Run() override { | 39 bool Run() override { |
40 RTC_DCHECK(rtc::TaskQueue::IsCurrent(kIncomingQueueName)); | 40 RTC_DCHECK(stream_->incoming_render_queue_.IsCurrent()); |
41 if (stream_->render_buffers_.AddFrame(std::move(frame_)) == 1) | 41 if (stream_->render_buffers_.AddFrame(std::move(frame_)) == 1) |
42 stream_->Dequeue(); | 42 stream_->Dequeue(); |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
46 IncomingVideoStream* stream_; | 46 IncomingVideoStream* stream_; |
47 VideoFrame frame_; | 47 VideoFrame frame_; |
48 }; | 48 }; |
49 | 49 |
50 IncomingVideoStream::IncomingVideoStream( | 50 IncomingVideoStream::IncomingVideoStream( |
(...skipping 23 matching lines...) Expand all Loading... |
74 if (frame_to_render) | 74 if (frame_to_render) |
75 callback_->OnFrame(*frame_to_render); | 75 callback_->OnFrame(*frame_to_render); |
76 | 76 |
77 if (render_buffers_.HasPendingFrames()) { | 77 if (render_buffers_.HasPendingFrames()) { |
78 uint32_t wait_time = render_buffers_.TimeToNextFrameRelease(); | 78 uint32_t wait_time = render_buffers_.TimeToNextFrameRelease(); |
79 incoming_render_queue_.PostDelayedTask([this]() { Dequeue(); }, wait_time); | 79 incoming_render_queue_.PostDelayedTask([this]() { Dequeue(); }, wait_time); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 } // namespace webrtc | 83 } // namespace webrtc |
OLD | NEW |