1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4// 5// Protocol for control messages. 6 7syntax = "proto2"; 8 9option optimize_for = LITE_RUNTIME; 10 11package remoting.protocol; 12 13import "layout_key_function.proto"; 14 15// Set the host resolution to match the client. If none of the fields are 16// present, restore the host resolution instead. 17message ClientResolution { 18 // Width and height of the client in Density-Independent Pixels. 19 optional int32 dips_width = 1; 20 optional int32 dips_height = 2; 21 22 // Deprecated width and height of the client in device pixels. 23 optional int32 width_deprecated = 3; 24 optional int32 height_deprecated = 4; 25 26 // Horizontal and vertical DPI of the screen. If either of these is zero or 27 // unset, the corresponding DPI should be assumed to be 96 (Windows' default) 28 optional int32 x_dpi = 5; 29 optional int32 y_dpi = 6; 30} 31 32message VideoControl { 33 // Enables the video channel if true, pauses if false. 34 optional bool enable = 1; 35 36 // Controls whether lossless encode and color translation are requested. 37 optional bool lossless_encode = 2; 38 optional bool lossless_color = 3; 39} 40 41message AudioControl { 42 // Enables the audio channel if true, pauses if false. 43 optional bool enable = 1; 44} 45 46message CursorShapeInfo { 47 // Width, height (in screen pixels) of the cursor. 48 optional int32 width = 1; 49 optional int32 height = 2; 50 51 // X,Y coordinates (relative to upper-left corner) of the cursor hotspot. 52 optional int32 hotspot_x = 3; 53 optional int32 hotspot_y = 4; 54 55 // Cursor pixmap data in 32-bit BGRA format. 56 optional bytes data = 5; 57} 58 59message Capabilities { 60 // List of capabilities supported by the sender (case sensitive, capabilities 61 // are separated by spaces). 62 optional string capabilities = 1; 63} 64 65message PairingRequest { 66 // Human-readable name of the client. 67 optional string client_name = 1; 68} 69 70message PairingResponse { 71 // Unique identifier for this client. 72 optional string client_id = 1; 73 74 // Shared secret for this client. 75 optional string shared_secret = 2; 76} 77 78message ExtensionMessage { 79 // The message type. This is used to dispatch the message to the correct 80 // recipient. 81 optional string type = 1; 82 83 // String-encoded message data. The client and host must agree on the encoding 84 // for each message type; different message types need not shared the same 85 // encoding. 86 optional string data = 2; 87} 88 89message VideoTrackLayout { 90 // Unique display identifier. 91 optional int32 id = 8; 92 93 // Name of the video track. 94 optional string track_name = 1; 95 96 // Position of the top left corner of the rectangle covered by the video 97 // track in DIPs (device independent pixels). 98 optional int32 position_x = 2; 99 optional int32 position_y = 3; 100 101 // Size of the area covered by the video track in DIPs. 102 optional int32 width = 4; 103 optional int32 height = 5; 104 105 // DPI of the screen. 106 optional int32 x_dpi = 6; 107 optional int32 y_dpi = 7; 108} 109 110message VideoLayout { 111 // Layout for each video track. 112 repeated VideoTrackLayout video_track = 1; 113 114 // True if this display configuration supports capturing the entire desktop. 115 optional bool supports_full_desktop_capture = 2; 116} 117 118message SelectDesktopDisplayRequest { 119 // Identifier for display to select. Valid strings are "0", "1", ... 120 // The "all" string is used to select the entire desktop. 121 optional string id = 1; 122} 123 124message DesktopDisplayInfo { 125 // Unique display identifier. 126 optional int32 id = 1; 127 128 // Position of the top left corner of this display (in pixels). 129 optional int32 x = 2; 130 optional int32 y = 3; 131 132 // Size of the display (in pixels). 133 optional int32 width = 4; 134 optional int32 height = 5; 135 136 // DPI of the screen. 137 optional int32 dpi = 6; 138 139 // Bits per pixel. 140 optional int32 bpp = 7; 141 142 // True if this is the default display. 143 optional bool is_default = 8; 144} 145 146// Next ID: 2 147message KeyboardLayout { 148 // Next ID: 3 149 message KeyAction { 150 oneof action { 151 LayoutKeyFunction function = 1; 152 string character = 2; 153 } 154 } 155 156 // Next ID: 2 157 message KeyBehavior { 158 // Maps 0-based shift level to key action. (Note: because this is zero- 159 // based, it will be one less than the corresponding ISO shift level.) 160 map<uint32, KeyAction> actions = 1; 161 } 162 163 // Map USB code to key behavior. 164 map<uint32, KeyBehavior> keys = 1; 165} 166 167// Next ID: 2 168message TransportInfo { 169 // Transport layer protocol the message sender uses to connect to the relay 170 // server or the peer (if connection not relayed). 171 // Possible values are those defined in the protocol and relayProtocol fields 172 // in the RTCIceCandidateStats dictionary. 173 // If the host failed to get protocol using WebRTC API, this field will be set 174 // to "api-error". 175 optional string protocol = 1; 176} 177 178// Next ID: 5 179message PeerConnectionParameters { 180 // Sets preferred minimum and maximum bitrates. Unset fields means no 181 // preference on the bitrate. Clients might need to keep track of existing 182 // parameters if they need to do incremental changes. 183 optional int32 preferred_min_bitrate_bps = 1; 184 optional int32 preferred_max_bitrate_bps = 2; 185 186 // Requests an ICE restart. This causes the host to initiate a new SDP 187 // offer/answer exchange, and restarts the ICE gathering/connection sequence. 188 // This can be used to re-establish a connection, without needing to 189 // re-authenticate the user. 190 optional bool request_ice_restart = 3; 191 192 // Requests the host to initiate a new SDP offer/answer exchange, without 193 // restarting ICE. This can be used to change SDP configuration (for example, 194 // switching to a different codec), without needing a full reconnection. 195 optional bool request_sdp_restart = 4; 196} 197