chromium/remoting/proto/video.proto

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Protocol for video messages.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package remoting;

message VideoPacketFormat {
  // Reserved fields IDs used for removed fields: 1 to 4.

  // Identifies how the image was encoded.
  enum Encoding {
    ENCODING_INVALID = -1;
    ENCODING_VERBATIM = 0;
    ENCODING_ZLIB = 1;
    ENCODING_VP8 = 2;
    ENCODING_VP9 = 3;
  };

  // The encoding used for this image update.
  optional Encoding encoding = 5 [default = ENCODING_INVALID];

  // Width and height of the whole screen.
  optional int32 screen_width = 6;
  optional int32 screen_height = 7;

  // Horizontal and vertical DPI of the screen. If either of these is zero or
  // unset, the corresponding DPI should be assumed to be 96 (Windows' default)
  optional int32 x_dpi = 8;
  optional int32 y_dpi = 9;
}

message Rect {
  optional int32 x = 1;
  optional int32 y = 2;
  optional int32 width = 3;
  optional int32 height = 4;
}

message VideoPacket {
  // Reserved fields IDs used for removed fields: 1 to 3, 10, 11, 12.

  optional VideoPacketFormat format = 4;

  optional bytes data = 5;

  // List of rectangles updated by this frame.
  repeated Rect dirty_rects = 6;

  // Time in milliseconds spent in capturing this video frame.
  optional int64 capture_time_ms = 7;

  // Time in milliseconds spent in encoding this video frame.
  optional int64 encode_time_ms = 8;

  // The client's timestamp of the latest event received by the host before
  // starting to capture this video frame.
  optional int64 latest_event_timestamp = 9;

  // Frame identifier used to match VideoFrame and VideoAck.
  optional int32 frame_id = 13;

  // Time from when the last event was received until capturing has started.
  optional int64 capture_pending_time_ms = 14;

  // Total overhead time for IPC and threading when capturing frames.
  optional int64 capture_overhead_time_ms = 15;

  // Time between when the frame was captured and when encoder started encoding
  // it.
  optional int64 encode_pending_time_ms = 16;

  // Time for which the frame is blocked until it's sent to the client.
  optional int64 send_pending_time_ms = 17;
}

// VideoAck acknowledges that the frame in the VideoPacket with the same
// frame_id has been rendered. VideoAck messages must be sent only for frames
// that have frame_id field set. They must be sent the same order in which
// the corresponding VideoPackets were received.
message VideoAck {
  // Frame ID.
  optional int32 frame_id = 1;
}