OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/webrtc_video_renderer_adapter.h" | 5 #include "remoting/protocol/webrtc_video_renderer_adapter.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 void WebrtcVideoRendererAdapter::SetVideoStatsChannel( | 90 void WebrtcVideoRendererAdapter::SetVideoStatsChannel( |
91 std::unique_ptr<MessagePipe> message_pipe) { | 91 std::unique_ptr<MessagePipe> message_pipe) { |
92 // Expect that the host also creates video_stats data channel. | 92 // Expect that the host also creates video_stats data channel. |
93 video_stats_dispatcher_.reset(new ClientVideoStatsDispatcher(label_, this)); | 93 video_stats_dispatcher_.reset(new ClientVideoStatsDispatcher(label_, this)); |
94 video_stats_dispatcher_->Init(std::move(message_pipe), this); | 94 video_stats_dispatcher_->Init(std::move(message_pipe), this); |
95 } | 95 } |
96 | 96 |
97 void WebrtcVideoRendererAdapter::OnFrame(const webrtc::VideoFrame& frame) { | 97 void WebrtcVideoRendererAdapter::OnFrame(const webrtc::VideoFrame& frame) { |
98 if (frame.timestamp_us() >= rtc::TimeMicros()) { | 98 if (frame.timestamp_us() > rtc::TimeMicros()) { |
99 // The host sets playout delay to 0, so all incoming frames are expected to | 99 // The host sets playout delay to 0, so all incoming frames are expected to |
100 // be rendered as so as they are received. | 100 // be rendered as so as they are received. |
101 LOG(WARNING) << "Received frame with playout delay greater than 0."; | 101 NOTREACHED() << "Received frame with playout delay greater than 0."; |
102 } | 102 } |
103 | 103 |
104 task_runner_->PostTask( | 104 task_runner_->PostTask( |
105 FROM_HERE, | 105 FROM_HERE, |
106 base::Bind(&WebrtcVideoRendererAdapter::HandleFrameOnMainThread, | 106 base::Bind(&WebrtcVideoRendererAdapter::HandleFrameOnMainThread, |
107 weak_factory_.GetWeakPtr(), frame.transport_frame_id(), | 107 weak_factory_.GetWeakPtr(), frame.transport_frame_id(), |
108 base::TimeTicks::Now(), | 108 base::TimeTicks::Now(), |
109 scoped_refptr<webrtc::VideoFrameBuffer>( | 109 scoped_refptr<webrtc::VideoFrameBuffer>( |
110 frame.video_frame_buffer().get()))); | 110 frame.video_frame_buffer().get()))); |
111 } | 111 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 frame_stats.client_stats = *client_stats; | 238 frame_stats.client_stats = *client_stats; |
239 host_stats_queue_.pop_front(); | 239 host_stats_queue_.pop_front(); |
240 FrameStatsConsumer* frame_stats_consumer = | 240 FrameStatsConsumer* frame_stats_consumer = |
241 video_renderer_->GetFrameStatsConsumer(); | 241 video_renderer_->GetFrameStatsConsumer(); |
242 if (frame_stats_consumer) | 242 if (frame_stats_consumer) |
243 frame_stats_consumer->OnVideoFrameStats(frame_stats); | 243 frame_stats_consumer->OnVideoFrameStats(frame_stats); |
244 } | 244 } |
245 | 245 |
246 } // namespace protocol | 246 } // namespace protocol |
247 } // namespace remoting | 247 } // namespace remoting |
OLD | NEW |