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.
5 // Protocol for video messages.
9 option optimize_for = LITE_RUNTIME;
13 message VideoPacketFormat {
14 // Identifies how the image was encoded.
16 ENCODING_INVALID = -1;
17 ENCODING_VERBATIM = 0;
22 // X,Y coordinates (in screen pixels) for origin of this update.
26 // Width, height (in screen pixels) for this update.
27 optional int32 width = 3;
28 optional int32 height = 4;
30 // The encoding used for this image update.
31 optional Encoding encoding = 5 [default = ENCODING_INVALID];
33 // Width and height of the whole screen.
34 optional int32 screen_width = 6;
35 optional int32 screen_height = 7;
37 // Horizontal and vertical DPI of the screen. If either of these is zero or
38 // unset, the corresponding DPI should be assumed to be 96 (Windows' default)
39 optional int32 x_dpi = 8;
40 optional int32 y_dpi = 9;
43 // TODO(hclam): Remove this message once we can obtain dirty rects from libvpx.
47 optional int32 width = 3;
48 optional int32 height = 4;
52 // Bitmasks for use in the flags field below.
54 // The encoder may fragment one update into multiple partitions.
55 // Each partition may be divided into multiple packets depending on
56 // how the encoder outputs data. Thus, one update can logically
57 // consist of multiple packets. The FIRST_PACKET and LAST_PACKET
58 // flags are used to indicate the start and end of a partition. The
59 // LAST_PARTITION flag is set for the last packet in the last
60 // partition. Here are notable consequences:
61 // * Both FIRST_PACKET and LAST_PACKET may be set if an update is only
63 // * The VideoPacketFormat is only supplied in a FIRST_PACKET.
64 // * LAST_PARTITION can be set only in packet that has LAST_PACKET set.
65 // * An local update cannot change format between a FIRST_PACKET and
67 // * All packets in one logical update must be processed in order, and
68 // packets may not be skipped.
74 optional int32 flags = 1 [default = 0];
76 // The sequence number of the partial data for updating a rectangle.
77 optional int32 sequence_number = 2 [default = 0];
79 optional int32 timestamp = 3 [default = 0];
81 // This is provided on the first packet of the rectangle data, when
82 // the flags has FIRST_PACKET set.
83 optional VideoPacketFormat format = 4;
85 optional bytes data = 5;
87 // This field is only for VP8 to provide out-of-band information of dirty
89 // TODO(hclam): Remove this field when we can obtain this information from
91 repeated Rect dirty_rects = 6;
93 // Time in milliseconds spent in capturing this video frame.
94 optional int32 capture_time_ms = 7;
96 // Time in milliseconds spent in encoding this video frame.
97 optional int32 encode_time_ms = 8;
99 // The most recent sequence number received from the client on the event
101 optional int64 client_sequence_number = 9;