Chromium Code Reviews| Index: remoting/client/chromoting_client.cc |
| diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc |
| index bed7215f84175b13e91b106ede5ae0265d6af8cd..d20c7e9646e0f2ac69834496537d0daf7f9e4809 100644 |
| --- a/remoting/client/chromoting_client.cc |
| +++ b/remoting/client/chromoting_client.cc |
| @@ -7,6 +7,7 @@ |
| #include <utility> |
| #include "remoting/base/capabilities.h" |
| +#include "remoting/base/constants.h" |
| #include "remoting/client/audio_decode_scheduler.h" |
| #include "remoting/client/audio_player.h" |
| #include "remoting/client/client_context.h" |
| @@ -22,6 +23,7 @@ |
| #include "remoting/protocol/video_renderer.h" |
| #include "remoting/protocol/webrtc_connection_to_host.h" |
| #include "remoting/signaling/jid_util.h" |
| +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| namespace remoting { |
| @@ -147,6 +149,27 @@ void ChromotingClient::DeliverHostMessage( |
| user_interface_->DeliverHostMessage(message); |
| } |
| +void ChromotingClient::SetVideoLayout(const protocol::VideoLayout& layout) { |
| + if (layout.video_track_size() < 1) { |
|
Jamie
2016/03/31 00:35:53
I assume that the name video_track_size is auto-ge
Sergey Ulanov
2016/03/31 06:25:14
Done.
|
| + LOG(ERROR) << "Received VideoLayout message with 0 tracks."; |
| + return; |
| + } |
| + |
| + if (layout.video_track_size() > 2) { |
| + LOG(WARNING) << "Received VideoLayout message with " |
| + << layout.video_track_size() |
| + << " tracks. Only one track is supported."; |
| + } |
| + |
| + const protocol::VideoTrackLayout& track_layout = layout.video_track(0); |
| + int x_dpi = track_layout.has_x_dpi() ? track_layout.x_dpi() : kDefaultDpi; |
| + int y_dpi = track_layout.has_y_dpi() ? track_layout.y_dpi() : kDefaultDpi; |
| + user_interface_->SetDesktopSize( |
| + webrtc::DesktopSize(track_layout.width() * x_dpi / kDefaultDpi, |
| + track_layout.height() * y_dpi / kDefaultDpi), |
|
Jamie
2016/03/31 00:35:53
Why divide by kDefaultDpi? If it's to convert to D
Sergey Ulanov
2016/03/31 06:25:14
It's to convert to physical pixels. Added a commen
|
| + webrtc::DesktopVector(x_dpi, y_dpi)); |
| +} |
| + |
| void ChromotingClient::InjectClipboardEvent( |
| const protocol::ClipboardEvent& event) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |