[email protected] | f2b9cf3 | 2012-04-27 00:13:43 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | e976a171 | 2010-10-18 20:09:50 | [diff] [blame] | 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 | |
| 7 | syntax = "proto2"; |
| 8 | |
[email protected] | 93115b5 | 2012-11-12 21:36:20 | [diff] [blame] | 9 | option optimize_for = LITE_RUNTIME; |
| 10 | |
[email protected] | 5e24067 | 2010-11-02 21:42:25 | [diff] [blame] | 11 | package remoting.protocol; |
[email protected] | e976a171 | 2010-10-18 20:09:50 | [diff] [blame] | 12 | |
Erik Jensen | e343331 | 2019-11-09 00:31:16 | [diff] [blame] | 13 | import "layout_key_function.proto"; |
| 14 | |
Jamie Walch | 56f354dd | 2018-05-22 21:59:57 | [diff] [blame] | 15 | // Set the host resolution to match the client. If none of the fields are |
| 16 | // present, restore the host resolution instead. |
[email protected] | 48a8ca3 | 2013-02-13 04:31:01 | [diff] [blame] | 17 | message ClientResolution { |
Jamie Walch | 56f354dd | 2018-05-22 21:59:57 | [diff] [blame] | 18 | // Width and height of the client in Density-Independent Pixels. |
[email protected] | 48a8ca3 | 2013-02-13 04:31:01 | [diff] [blame] | 19 | optional int32 dips_width = 1; |
| 20 | optional int32 dips_height = 2; |
| 21 | |
sergeyu | 54624e1 | 2016-06-01 10:54:31 | [diff] [blame] | 22 | // Deprecated width and height of the client in device pixels. |
| 23 | optional int32 width_deprecated = 3; |
| 24 | optional int32 height_deprecated = 4; |
[email protected] | 48a8ca3 | 2013-02-13 04:31:01 | [diff] [blame] | 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; |
[email protected] | f2b9cf3 | 2012-04-27 00:13:43 | [diff] [blame] | 30 | } |
[email protected] | 50d71c7 | 2012-05-03 01:28:55 | [diff] [blame] | 31 | |
| 32 | message VideoControl { |
| 33 | // Enables the video channel if true, pauses if false. |
| 34 | optional bool enable = 1; |
[email protected] | a516f1e | 2014-05-30 07:21:20 | [diff] [blame] | 35 | |
| 36 | // Controls whether lossless encode and color translation are requested. |
| 37 | optional bool lossless_encode = 2; |
| 38 | optional bool lossless_color = 3; |
[email protected] | 50d71c7 | 2012-05-03 01:28:55 | [diff] [blame] | 39 | } |
[email protected] | d65e15bd | 2012-06-02 22:16:41 | [diff] [blame] | 40 | |
[email protected] | f458bed | 2012-10-18 03:27:59 | [diff] [blame] | 41 | message AudioControl { |
| 42 | // Enables the audio channel if true, pauses if false. |
| 43 | optional bool enable = 1; |
| 44 | } |
| 45 | |
[email protected] | d65e15bd | 2012-06-02 22:16:41 | [diff] [blame] | 46 | message 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 | } |
[email protected] | a5d181f | 2013-04-19 14:55:37 | [diff] [blame] | 58 | |
| 59 | message Capabilities { |
| 60 | // List of capabilities supported by the sender (case sensitive, capabilities |
| 61 | // are separated by spaces). |
| 62 | optional string capabilities = 1; |
| 63 | } |
[email protected] | 9ffa78a2 | 2013-05-10 04:35:10 | [diff] [blame] | 64 | |
| 65 | message PairingRequest { |
| 66 | // Human-readable name of the client. |
| 67 | optional string client_name = 1; |
| 68 | } |
| 69 | |
| 70 | message 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 | } |
[email protected] | 09eabd65c | 2013-08-13 00:13:48 | [diff] [blame] | 77 | |
| 78 | message 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; |
sergeyu | 00a67b1 | 2016-04-01 00:07:00 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | message VideoTrackLayout { |
Gary Kacmarcik | a7e33e4 | 2019-02-22 19:23:28 | [diff] [blame] | 90 | // Unique display identifier. |
| 91 | optional int32 id = 8; |
| 92 | |
sergeyu | 00a67b1 | 2016-04-01 00:07:00 | [diff] [blame] | 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 | |
| 110 | message VideoLayout { |
| 111 | // Layout for each video track. |
| 112 | repeated VideoTrackLayout video_track = 1; |
Gary Kacmarcik | 5dac99c | 2020-03-05 22:55:40 | [diff] [blame] | 113 | |
| 114 | // True if this display configuration supports capturing the entire desktop. |
| 115 | optional bool supports_full_desktop_capture = 2; |
sergeyu | 00a67b1 | 2016-04-01 00:07:00 | [diff] [blame] | 116 | } |
Gary Kacmarcik | 0c56fda | 2019-01-17 03:10:12 | [diff] [blame] | 117 | |
| 118 | message 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 | } |
Gary Kacmarcik | ebe85a81 | 2019-01-23 20:11:54 | [diff] [blame] | 123 | |
| 124 | message 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 | } |
Erik Jensen | e343331 | 2019-11-09 00:31:16 | [diff] [blame] | 145 | |
| 146 | // Next ID: 2 |
| 147 | message 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 { |
Erik Jensen | b887667 | 2019-12-03 04:30:05 | [diff] [blame] | 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; |
Erik Jensen | e343331 | 2019-11-09 00:31:16 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | // Map USB code to key behavior. |
| 164 | map<uint32, KeyBehavior> keys = 1; |
| 165 | } |
Yuwei Huang | cf7fdff | 2020-05-04 19:46:43 | [diff] [blame] | 166 | |
| 167 | // Next ID: 2 |
| 168 | message 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 | } |
Yuwei Huang | ef53007 | 2020-06-19 02:33:44 | [diff] [blame] | 177 | |
Lambros Lambrou | f845208 | 2020-08-05 18:18:16 | [diff] [blame] | 178 | // Next ID: 5 |
Yuwei Huang | ef53007 | 2020-06-19 02:33:44 | [diff] [blame] | 179 | message 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; |
Lambros Lambrou | 4c46dcb0 | 2020-07-22 18:14:54 | [diff] [blame] | 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. |
Lambros Lambrou | f845208 | 2020-08-05 18:18:16 | [diff] [blame] | 188 | // This can be used to re-establish a connection, without needing to |
| 189 | // re-authenticate the user. |
Lambros Lambrou | 4c46dcb0 | 2020-07-22 18:14:54 | [diff] [blame] | 190 | optional bool request_ice_restart = 3; |
Lambros Lambrou | f845208 | 2020-08-05 18:18:16 | [diff] [blame] | 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; |
Yuwei Huang | ef53007 | 2020-06-19 02:33:44 | [diff] [blame] | 196 | } |