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 video messages. 6 7syntax = "proto2"; 8 9option optimize_for = LITE_RUNTIME; 10 11package remoting; 12 13message VideoPacketFormat { 14 // Reserved fields IDs used for removed fields: 1 to 4. 15 16 // Identifies how the image was encoded. 17 enum Encoding { 18 ENCODING_INVALID = -1; 19 ENCODING_VERBATIM = 0; 20 ENCODING_ZLIB = 1; 21 ENCODING_VP8 = 2; 22 ENCODING_VP9 = 3; 23 }; 24 25 // The encoding used for this image update. 26 optional Encoding encoding = 5 [default = ENCODING_INVALID]; 27 28 // Width and height of the whole screen. 29 optional int32 screen_width = 6; 30 optional int32 screen_height = 7; 31 32 // Horizontal and vertical DPI of the screen. If either of these is zero or 33 // unset, the corresponding DPI should be assumed to be 96 (Windows' default) 34 optional int32 x_dpi = 8; 35 optional int32 y_dpi = 9; 36} 37 38message Rect { 39 optional int32 x = 1; 40 optional int32 y = 2; 41 optional int32 width = 3; 42 optional int32 height = 4; 43} 44 45message VideoPacket { 46 // Reserved fields IDs used for removed fields: 1 to 3, 10, 11, 12. 47 48 optional VideoPacketFormat format = 4; 49 50 optional bytes data = 5; 51 52 // List of rectangles updated by this frame. 53 repeated Rect dirty_rects = 6; 54 55 // Time in milliseconds spent in capturing this video frame. 56 optional int64 capture_time_ms = 7; 57 58 // Time in milliseconds spent in encoding this video frame. 59 optional int64 encode_time_ms = 8; 60 61 // The client's timestamp of the latest event received by the host before 62 // starting to capture this video frame. 63 optional int64 latest_event_timestamp = 9; 64 65 // Frame identifier used to match VideoFrame and VideoAck. 66 optional int32 frame_id = 13; 67 68 // Time from when the last event was received until capturing has started. 69 optional int64 capture_pending_time_ms = 14; 70 71 // Total overhead time for IPC and threading when capturing frames. 72 optional int64 capture_overhead_time_ms = 15; 73 74 // Time between when the frame was captured and when encoder started encoding 75 // it. 76 optional int64 encode_pending_time_ms = 16; 77 78 // Time for which the frame is blocked until it's sent to the client. 79 optional int64 send_pending_time_ms = 17; 80} 81 82// VideoAck acknowledges that the frame in the VideoPacket with the same 83// frame_id has been rendered. VideoAck messages must be sent only for frames 84// that have frame_id field set. They must be sent the same order in which 85// the corresponding VideoPackets were received. 86message VideoAck { 87 // Frame ID. 88 optional int32 frame_id = 1; 89} 90