OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Protocol for video messages. |
| 6 |
| 7 syntax = "proto2"; |
| 8 |
| 9 option optimize_for = LITE_RUNTIME; |
| 10 |
| 11 package remoting; |
| 12 |
| 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. |
| 15 // NEXT ID: 3 |
| 16 // TODO(sergeyu): Move to the control channel. |
| 17 message InitClientMessage { |
| 18 required int32 width = 1; |
| 19 required int32 height = 2; |
| 20 } |
| 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. |
| 40 message VideoPacketFormat { |
| 41 // Identifies how the image was encoded. |
| 42 enum Encoding { |
| 43 ENCODING_INVALID = -1; |
| 44 ENCODING_VERBATIM = 0; |
| 45 ENCODING_ZLIB = 1; |
| 46 ENCODING_VP8 = 2; |
| 47 }; |
| 48 |
| 49 // X,Y coordinates (in screen pixels) for origin of this update. |
| 50 optional int32 x = 1; |
| 51 optional int32 y = 2; |
| 52 |
| 53 // Width, height (in screen pixels) for this update. |
| 54 optional int32 width = 3; |
| 55 optional int32 height = 4; |
| 56 |
| 57 // The encoding used for this image update. |
| 58 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 } |
| 63 |
| 64 message VideoPacket { |
| 65 // Bitmasks for use in the flags field below. |
| 66 // |
| 67 // The encoder may fragment one update into multiple packets depending on |
| 68 // 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 |
| 70 // indicate the start and end of a logical update. Here are notable |
| 71 // consequences: |
| 72 // * Both FIRST_PACKET and LAST_PACKET may be set if an update is only |
| 73 // one packet long. |
| 74 // * The VideoPacketFormat is only supplied in a FIRST_PACKET. |
| 75 // * An local update cannot change format between a FIRST_PACKET and |
| 76 // a LAST_PACKET. |
| 77 // * All packets in one logical update must be processed in order, and |
| 78 // packets may not be skipped. |
| 79 enum Flags { |
| 80 FIRST_PACKET = 1; |
| 81 LAST_PACKET = 2; |
| 82 } |
| 83 optional int32 flags = 1 [default = 0]; |
| 84 |
| 85 // The sequence number of the partial data for updating a rectangle. |
| 86 optional int32 sequence_number = 2 [default = 0]; |
| 87 |
| 88 // This is provided on the first packet of the rectangle data, when |
| 89 // the flags has FIRST_PACKET set. |
| 90 optional VideoPacketFormat format = 3; |
| 91 |
| 92 optional bytes data = 4; |
| 93 } |
OLD | NEW |