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

Unified Diff: remoting/client/chromoting_client.cc

Issue 1844143002: Add VideoLayout message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/client/chromoting_client.h ('k') | remoting/client/client_user_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/chromoting_client.cc
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index bed7215f84175b13e91b106ede5ae0265d6af8cd..e51bc7b8046e550e7494cad51ec371b14850a0ea 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) {
+ int num_video_tracks = layout.video_track_size();
+ if (num_video_tracks < 1) {
+ LOG(ERROR) << "Received VideoLayout message with 0 tracks.";
+ return;
+ }
+
+ if (num_video_tracks > 2) {
+ LOG(WARNING) << "Received VideoLayout message with " << num_video_tracks
+ << " 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),
+ webrtc::DesktopVector(x_dpi, y_dpi));
+}
+
void ChromotingClient::InjectClipboardEvent(
const protocol::ClipboardEvent& event) {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « remoting/client/chromoting_client.h ('k') | remoting/client/client_user_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698