OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Protocol for communication between chromoting client and host. | 5 // Protocol for communication between chromoting client and host. |
6 | 6 |
7 syntax = "proto2"; | 7 syntax = "proto2"; |
8 | 8 |
9 option optimize_for = LITE_RUNTIME; | 9 option optimize_for = LITE_RUNTIME; |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 // A message to denote a partial update stream. | 91 // A message to denote a partial update stream. |
92 // NEXT ID: 4 | 92 // NEXT ID: 4 |
93 message UpdateStreamPacketMessage { | 93 message UpdateStreamPacketMessage { |
94 optional UpdateStreamBeginRect begin_rect = 1; | 94 optional UpdateStreamBeginRect begin_rect = 1; |
95 optional UpdateStreamRectData rect_data = 2; | 95 optional UpdateStreamRectData rect_data = 2; |
96 optional UpdateStreamEndRect end_rect = 3; | 96 optional UpdateStreamEndRect end_rect = 3; |
97 } | 97 } |
98 | 98 |
| 99 // TODO(ajwong): Determine if these fields should be optional or required. |
| 100 message RectangleFormat { |
| 101 // X,Y coordinates (in screen pixels) for origin of this update. |
| 102 required int32 x = 1; |
| 103 required int32 y = 2; |
| 104 |
| 105 // Width, height (in screen pixels) for this update. |
| 106 required int32 width = 3; |
| 107 required int32 height = 4; |
| 108 |
| 109 // The encoding used for this image update. |
| 110 optional UpdateStreamEncoding encoding = 5 [default = EncodingInvalid]; |
| 111 |
| 112 // The pixel format of this image. |
| 113 optional PixelFormat pixel_format = 6 [default = PixelFormatRgb24]; |
| 114 } |
| 115 |
| 116 message RectangleUpdatePacket { |
| 117 // Bitmasks for use in the flags field below. |
| 118 // |
| 119 // The encoder may fragment one update into multiple packets depending on |
| 120 // how the encoder outputs data. Thus, one update can logically consist of |
| 121 // multiple packets. The FIRST_PACKET and LAST_PACKET flags are used to |
| 122 // indicate the start and end of a logical update. Here are notable |
| 123 // consequences: |
| 124 // * Both FIRST_PACKET and LAST_PACKET may be set if an update is only |
| 125 // one packet long. |
| 126 // * The RectangleFormat is only supplied in a FIRST_PACKET. |
| 127 // * An local update cannot change format between a FIRST_PACKET and |
| 128 // a LAST_PACKET. |
| 129 // * All packets in one logical update must be processed in order, and |
| 130 // packets may not be skipped. |
| 131 enum Flags { |
| 132 FIRST_PACKET = 1; |
| 133 LAST_PACKET = 2; |
| 134 } |
| 135 optional int32 flags = 1 [default = 0]; |
| 136 |
| 137 // The sequence number of the partial data for updating a rectangle. |
| 138 optional int32 sequence_number = 2 [default = 0]; |
| 139 |
| 140 // This is provided on the first packet of the rectangle data, when |
| 141 // the sequence_number is 0. |
| 142 optional RectangleFormat format = 3; |
| 143 |
| 144 optional bytes encoded_rect = 4; |
| 145 } |
| 146 |
99 // Defines the message that is sent from the host to the client. | 147 // Defines the message that is sent from the host to the client. |
100 // Only one of these messages should be present. | 148 // Only one of these messages should be present. |
101 // NEXT ID: 5 | 149 // NEXT ID: 5 |
102 message ChromotingHostMessage { | 150 message ChromotingHostMessage { |
103 optional InitClientMessage init_client= 1; | 151 optional InitClientMessage init_client= 1; |
104 optional BeginUpdateStreamMessage begin_update_stream = 2; | 152 optional BeginUpdateStreamMessage begin_update_stream = 2; |
105 optional EndUpdateStreamMessage end_update_stream = 3; | 153 optional EndUpdateStreamMessage end_update_stream = 3; |
106 optional UpdateStreamPacketMessage update_stream_packet = 4; | 154 optional UpdateStreamPacketMessage update_stream_packet = 4; |
| 155 |
| 156 optional RectangleUpdatePacket rectangle_update = 5; |
107 } | 157 } |
108 | 158 |
109 // Defines a keyboard event. | 159 // Defines a keyboard event. |
110 // NEXT ID: 3 | 160 // NEXT ID: 3 |
111 message KeyEvent { | 161 message KeyEvent { |
112 // The POSIX key code. | 162 // The POSIX key code. |
113 required int32 key = 1; | 163 required int32 key = 1; |
114 required bool pressed = 2; | 164 required bool pressed = 2; |
115 } | 165 } |
116 | 166 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Only one of the optional messages should be present. | 216 // Only one of the optional messages should be present. |
167 // NEXT ID: 7 | 217 // NEXT ID: 7 |
168 message ChromotingClientMessage { | 218 message ChromotingClientMessage { |
169 optional KeyEvent key_event = 1; | 219 optional KeyEvent key_event = 1; |
170 optional MouseSetPositionEvent mouse_set_position_event = 2; | 220 optional MouseSetPositionEvent mouse_set_position_event = 2; |
171 optional MouseMoveEvent mouse_move_event = 3; | 221 optional MouseMoveEvent mouse_move_event = 3; |
172 optional MouseWheelEvent mouse_wheel_event = 4; | 222 optional MouseWheelEvent mouse_wheel_event = 4; |
173 optional MouseDownEvent mouse_down_event = 5; | 223 optional MouseDownEvent mouse_down_event = 5; |
174 optional MouseUpEvent mouse_up_event = 6; | 224 optional MouseUpEvent mouse_up_event = 6; |
175 } | 225 } |
OLD | NEW |