| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 void WebrtcVideoRendererAdapter::SetVideoStatsChannel( | 91 void WebrtcVideoRendererAdapter::SetVideoStatsChannel( |
| 92 std::unique_ptr<MessagePipe> message_pipe) { | 92 std::unique_ptr<MessagePipe> message_pipe) { |
| 93 // Expect that the host also creates video_stats data channel. | 93 // Expect that the host also creates video_stats data channel. |
| 94 video_stats_dispatcher_.reset(new ClientVideoStatsDispatcher(label_, this)); | 94 video_stats_dispatcher_.reset(new ClientVideoStatsDispatcher(label_, this)); |
| 95 video_stats_dispatcher_->Init(std::move(message_pipe), this); | 95 video_stats_dispatcher_->Init(std::move(message_pipe), this); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void WebrtcVideoRendererAdapter::OnFrame(const webrtc::VideoFrame& frame) { | 98 void WebrtcVideoRendererAdapter::OnFrame(const webrtc::VideoFrame& frame) { |
| 99 if (static_cast<uint64_t>(frame.timestamp_us()) >= rtc::TimeMicros()) { | 99 if (frame.timestamp_us() >= rtc::TimeMicros()) { |
| 100 // The host sets playout delay to 0, so all incoming frames are expected to | 100 // The host sets playout delay to 0, so all incoming frames are expected to |
| 101 // be rendered as so as they are received. | 101 // be rendered as so as they are received. |
| 102 LOG(WARNING) << "Received frame with playout delay greater than 0."; | 102 LOG(WARNING) << "Received frame with playout delay greater than 0."; |
| 103 } | 103 } |
| 104 | 104 |
| 105 task_runner_->PostTask( | 105 task_runner_->PostTask( |
| 106 FROM_HERE, | 106 FROM_HERE, |
| 107 base::Bind(&WebrtcVideoRendererAdapter::HandleFrameOnMainThread, | 107 base::Bind(&WebrtcVideoRendererAdapter::HandleFrameOnMainThread, |
| 108 weak_factory_.GetWeakPtr(), frame.transport_frame_id(), | 108 weak_factory_.GetWeakPtr(), frame.transport_frame_id(), |
| 109 base::TimeTicks::Now(), | 109 base::TimeTicks::Now(), |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 frame_stats.client_stats = *client_stats; | 239 frame_stats.client_stats = *client_stats; |
| 240 host_stats_queue_.pop_front(); | 240 host_stats_queue_.pop_front(); |
| 241 FrameStatsConsumer* frame_stats_consumer = | 241 FrameStatsConsumer* frame_stats_consumer = |
| 242 video_renderer_->GetFrameStatsConsumer(); | 242 video_renderer_->GetFrameStatsConsumer(); |
| 243 if (frame_stats_consumer) | 243 if (frame_stats_consumer) |
| 244 frame_stats_consumer->OnVideoFrameStats(frame_stats); | 244 frame_stats_consumer->OnVideoFrameStats(frame_stats); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace protocol | 247 } // namespace protocol |
| 248 } // namespace remoting | 248 } // namespace remoting |
| OLD | NEW |