control.proto 6.0 KB

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