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 video messages. | 5 // Protocol for video messages. |
6 | 6 |
7 syntax = "proto2"; | 7 syntax = "proto2"; |
8 | 8 |
9 option optimize_for = LITE_RUNTIME; | 9 option optimize_for = LITE_RUNTIME; |
10 | 10 |
11 package remoting; | 11 package remoting; |
12 | 12 |
13 // A message that gets sent to the client after the client is connected to the | 13 // A message that gets sent to the client after the client is connected to the |
14 // host. It contains information that the client needs to know about the host. | 14 // host. It contains information that the client needs to know about the host. |
15 // NEXT ID: 3 | 15 // NEXT ID: 3 |
16 // TODO(sergeyu): Move to the control channel. | 16 // TODO(sergeyu): Move to the control channel. |
17 message InitClientMessage { | 17 message InitClientMessage { |
18 required int32 width = 1; | 18 required int32 width = 1; |
19 required int32 height = 2; | 19 required int32 height = 2; |
20 } | 20 } |
21 | 21 |
22 // Identifies the pixel format. | |
23 // Note that this list should match exactly the same as | |
24 // media::VideoFrame::Format in media/base/video_frame.h. | |
25 enum PixelFormat { | |
26 PIXEL_FORMAT_INVALID = 0; | |
27 PIXEL_FORMAT_RGB555 = 1; | |
28 PIXEL_FORMAT_RGB565 = 2; | |
29 PIXEL_FORMAT_RGB24 = 3; | |
30 PIXEL_FORMAT_RGB32 = 4; | |
31 PIXEL_FORMAT_RGBA = 5; | |
32 PIXEL_FORMAT_YV12 = 6; | |
33 PIXEL_FORMAT_YV16 = 7; | |
34 PIXEL_FORMAT_NV12 = 8; | |
35 PIXEL_FORMAT_EMPTY = 9; | |
36 PIXEL_FORMAT_ASCII = 10; | |
37 } | |
38 | |
39 // TODO(ajwong): Determine if these fields should be optional or required. | 22 // TODO(ajwong): Determine if these fields should be optional or required. |
40 message VideoPacketFormat { | 23 message VideoPacketFormat { |
41 // Identifies how the image was encoded. | 24 // Identifies how the image was encoded. |
42 enum Encoding { | 25 enum Encoding { |
43 ENCODING_INVALID = -1; | 26 ENCODING_INVALID = -1; |
44 ENCODING_VERBATIM = 0; | 27 ENCODING_VERBATIM = 0; |
45 ENCODING_ZLIB = 1; | 28 ENCODING_ZLIB = 1; |
46 ENCODING_VP8 = 2; | 29 ENCODING_VP8 = 2; |
47 }; | 30 }; |
48 | 31 |
49 // X,Y coordinates (in screen pixels) for origin of this update. | 32 // X,Y coordinates (in screen pixels) for origin of this update. |
50 optional int32 x = 1; | 33 optional int32 x = 1; |
51 optional int32 y = 2; | 34 optional int32 y = 2; |
52 | 35 |
53 // Width, height (in screen pixels) for this update. | 36 // Width, height (in screen pixels) for this update. |
54 optional int32 width = 3; | 37 optional int32 width = 3; |
55 optional int32 height = 4; | 38 optional int32 height = 4; |
56 | 39 |
57 // The encoding used for this image update. | 40 // The encoding used for this image update. |
58 optional Encoding encoding = 5 [default = ENCODING_INVALID]; | 41 optional Encoding encoding = 5 [default = ENCODING_INVALID]; |
59 | |
60 // The pixel format of this image. | |
61 optional PixelFormat pixel_format = 6 [default = PIXEL_FORMAT_RGB24]; | |
62 } | 42 } |
63 | 43 |
64 message VideoPacket { | 44 message VideoPacket { |
65 // Bitmasks for use in the flags field below. | 45 // Bitmasks for use in the flags field below. |
66 // | 46 // |
67 // The encoder may fragment one update into multiple packets depending on | 47 // The encoder may fragment one update into multiple packets depending on |
68 // how the encoder outputs data. Thus, one update can logically consist of | 48 // how the encoder outputs data. Thus, one update can logically consist of |
69 // multiple packets. The FIRST_PACKET and LAST_PACKET flags are used to | 49 // multiple packets. The FIRST_PACKET and LAST_PACKET flags are used to |
70 // indicate the start and end of a logical update. Here are notable | 50 // indicate the start and end of a logical update. Here are notable |
71 // consequences: | 51 // consequences: |
(...skipping 14 matching lines...) Expand all Loading... |
86 optional int32 sequence_number = 2 [default = 0]; | 66 optional int32 sequence_number = 2 [default = 0]; |
87 | 67 |
88 optional int32 timestamp = 3 [default = 0]; | 68 optional int32 timestamp = 3 [default = 0]; |
89 | 69 |
90 // This is provided on the first packet of the rectangle data, when | 70 // This is provided on the first packet of the rectangle data, when |
91 // the flags has FIRST_PACKET set. | 71 // the flags has FIRST_PACKET set. |
92 optional VideoPacketFormat format = 4; | 72 optional VideoPacketFormat format = 4; |
93 | 73 |
94 optional bytes data = 5; | 74 optional bytes data = 5; |
95 } | 75 } |
OLD | NEW |