Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: remoting/protocol/webrtc_video_renderer_adapter.cc

Issue 2021773002: Use only DIPs size in ClientResolution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/host_control_dispatcher.cc ('k') | remoting/test/app_remoting_connection_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_video_renderer_adapter.cc
diff --git a/remoting/protocol/webrtc_video_renderer_adapter.cc b/remoting/protocol/webrtc_video_renderer_adapter.cc
index ff98b5bf45a78a9545b3bc11a0bf1b02d80a3757..a1a892e8583589d00bd7191c4c0dbb17b13f9235 100644
--- a/remoting/protocol/webrtc_video_renderer_adapter.cc
+++ b/remoting/protocol/webrtc_video_renderer_adapter.cc
@@ -61,16 +61,21 @@ void WebrtcVideoRendererAdapter::OnFrame(const cricket::VideoFrame& frame) {
std::unique_ptr<webrtc::DesktopFrame> rgb_frame(new webrtc::BasicDesktopFrame(
webrtc::DesktopSize(frame.width(), frame.height())));
+ base::TimeDelta render_delay = std::max(
+ base::TimeDelta(), base::TimeDelta::FromMicroseconds(static_cast<float>(
+ frame.timestamp_us() - rtc::TimeMicros())));
+
frame.ConvertToRgbBuffer(
output_format_fourcc_, rgb_frame->data(),
std::abs(rgb_frame->stride()) * rgb_frame->size().height(),
rgb_frame->stride());
rgb_frame->mutable_updated_region()->AddRect(
webrtc::DesktopRect::MakeSize(rgb_frame->size()));
- task_runner_->PostTask(
+ task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&WebrtcVideoRendererAdapter::DrawFrame,
- weak_factory_.GetWeakPtr(), base::Passed(&rgb_frame)));
+ weak_factory_.GetWeakPtr(), base::Passed(&rgb_frame)),
+ render_delay);
}
void WebrtcVideoRendererAdapter::DrawFrame(
« no previous file with comments | « remoting/protocol/host_control_dispatcher.cc ('k') | remoting/test/app_remoting_connection_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698