| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 std::unique_ptr<ClientFrameStats> stats(new ClientFrameStats()); | 168 std::unique_ptr<ClientFrameStats> stats(new ClientFrameStats()); |
| 169 // TODO(sergeyu): |time_received| is not reported correctly here because the | 169 // TODO(sergeyu): |time_received| is not reported correctly here because the |
| 170 // frame is already decoded at this point. | 170 // frame is already decoded at this point. |
| 171 stats->time_received = time_received; | 171 stats->time_received = time_received; |
| 172 | 172 |
| 173 std::unique_ptr<webrtc::DesktopFrame> rgb_frame = | 173 std::unique_ptr<webrtc::DesktopFrame> rgb_frame = |
| 174 video_renderer_->GetFrameConsumer()->AllocateFrame( | 174 video_renderer_->GetFrameConsumer()->AllocateFrame( |
| 175 webrtc::DesktopSize(frame->width(), frame->height())); | 175 webrtc::DesktopSize(frame->width(), frame->height())); |
| 176 | 176 |
| 177 base::PostTaskWithTraitsAndReplyWithResult( | 177 base::PostTaskWithTraitsAndReplyWithResult( |
| 178 FROM_HERE, base::TaskTraits().WithShutdownBehavior( | 178 FROM_HERE, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 179 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | |
| 180 base::Bind(&ConvertYuvToRgb, base::Passed(&frame), | 179 base::Bind(&ConvertYuvToRgb, base::Passed(&frame), |
| 181 base::Passed(&rgb_frame), | 180 base::Passed(&rgb_frame), |
| 182 video_renderer_->GetFrameConsumer()->GetPixelFormat()), | 181 video_renderer_->GetFrameConsumer()->GetPixelFormat()), |
| 183 base::Bind(&WebrtcVideoRendererAdapter::DrawFrame, | 182 base::Bind(&WebrtcVideoRendererAdapter::DrawFrame, |
| 184 weak_factory_.GetWeakPtr(), frame_id, base::Passed(&stats))); | 183 weak_factory_.GetWeakPtr(), frame_id, base::Passed(&stats))); |
| 185 } | 184 } |
| 186 | 185 |
| 187 void WebrtcVideoRendererAdapter::DrawFrame( | 186 void WebrtcVideoRendererAdapter::DrawFrame( |
| 188 uint32_t frame_id, | 187 uint32_t frame_id, |
| 189 std::unique_ptr<ClientFrameStats> stats, | 188 std::unique_ptr<ClientFrameStats> stats, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 frame_stats.client_stats = *client_stats; | 238 frame_stats.client_stats = *client_stats; |
| 240 host_stats_queue_.pop_front(); | 239 host_stats_queue_.pop_front(); |
| 241 FrameStatsConsumer* frame_stats_consumer = | 240 FrameStatsConsumer* frame_stats_consumer = |
| 242 video_renderer_->GetFrameStatsConsumer(); | 241 video_renderer_->GetFrameStatsConsumer(); |
| 243 if (frame_stats_consumer) | 242 if (frame_stats_consumer) |
| 244 frame_stats_consumer->OnVideoFrameStats(frame_stats); | 243 frame_stats_consumer->OnVideoFrameStats(frame_stats); |
| 245 } | 244 } |
| 246 | 245 |
| 247 } // namespace protocol | 246 } // namespace protocol |
| 248 } // namespace remoting | 247 } // namespace remoting |
| OLD | NEW |