diff options
author | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 19:58:23 +0000 |
---|---|---|
committer | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 19:58:23 +0000 |
commit | cb3b1f93130040a150e7fcc57cd4d5a75569685a (patch) | |
tree | ff93665e3c1478c61663d1107cd42dc25b31448d /remoting/base/protocol/chromotocol.proto | |
parent | b0110e822ac2b2db56d1b1542aad06da573cd544 (diff) | |
download | chromium_src-cb3b1f93130040a150e7fcc57cd4d5a75569685a.zip chromium_src-cb3b1f93130040a150e7fcc57cd4d5a75569685a.tar.gz chromium_src-cb3b1f93130040a150e7fcc57cd4d5a75569685a.tar.bz2 |
Copy the (early prototype of) remoting in Chrome into the public tree.
At the moment, this is a semi-functional demo.
BUG=none
TEST=build/run all unittests on linux
Review URL: http://codereview.chromium.org/2690003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base/protocol/chromotocol.proto')
-rw-r--r-- | remoting/base/protocol/chromotocol.proto | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/remoting/base/protocol/chromotocol.proto b/remoting/base/protocol/chromotocol.proto new file mode 100644 index 0000000..a7907f9 --- /dev/null +++ b/remoting/base/protocol/chromotocol.proto @@ -0,0 +1,153 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// Protocol for communication between chromoting client and host. + +syntax = "proto2"; + +option optimize_for = LITE_RUNTIME; + +package chromotocol_pb; + +// A message that gets sent to the client after the client is connected to the +// host. It contains information that the client needs to know about the host. +// NEXT ID: 3 +message InitClientMessage { + required int32 width = 1; + required int32 height = 2; +} + +// A message to denote the beginning of an update stream. It will be followed +// by 0 or more PartialUpdateStream messages and then a EndUpdateStream message. +// NEXT ID: 1 +message BeginUpdateStreamMessage { +} + +// A message to denote the end of an update stream. +// NEXT ID: 1 +message EndUpdateStreamMessage { +} + +// Identifies how the image was encoded. +enum UpdateStreamEncoding { + EncodingNone = 0; + EncodingZlib = 1; +} + +// Identifies the pixel format. +// Note that this list should match exactly the same as +// media::VideoFrame::Format in media/base/video_frame.h. +enum PixelFormat { + PixelFormatInvalid = 0; + PixelFormatRgb555 = 1; + PixelFormatRgb565 = 2; + PixelFormatRgb24 = 3; + PixelFormatRgb32 = 4; + PixelFormatRgba = 5; + PixelFormatYv12 = 6; + PixelFormatYv16 = 7; + PixelFormatEmpty = 8; + PixelFormatAscii = 9; +} + +// A message with info about the update stream. +// NEXT ID: 6 +message UpdateStreamPacketHeader { + // X,Y coordinates (in screen pixels) for origin of this update. + required int32 x = 1; + required int32 y = 2; + + // Width, height (in screen pixels) for this update. + required int32 width = 3; + required int32 height = 4; + + // The encoding used for this image update. + optional UpdateStreamEncoding encoding = 5 [default=EncodingNone]; + + // The pixel format of this image. + optional PixelFormat pixel_format = 6 [default=PixelFormatRgb24]; +} + +// A message to denote a partial update stream. +// NEXT ID: 3 +message UpdateStreamPacketMessage { + // TODO(garykac): Make this required and fix unit tests. + optional UpdateStreamPacketHeader header = 2; + optional bytes data = 1; +} + +// Defines the message that is sent from the host to the client. +// Only one of these messages should be present. +// NEXT ID: 5 +message HostMessage { + optional InitClientMessage init_client= 1; + optional BeginUpdateStreamMessage begin_update_stream = 2; + optional EndUpdateStreamMessage end_update_stream = 3; + optional UpdateStreamPacketMessage update_stream_packet = 4; +} + +// Defines a keyboard event. +// NEXT ID: 3 +message KeyEvent { + // The POSIX key code. + required int32 key = 1; + required bool pressed = 2; +} + +// Sets the position of the mouse cursor. +// The coordinate value is between [0 .. 1] which is relative to the +// dimension of the screen area. +// NEXT ID: 3 +message MouseSetPositionEvent { + required float x = 1; + required float y = 2; +} + +// Adjust the position of the mouse cursor by an offset. +// NEXT ID: 3 +message MouseMoveEvent { + required int32 offset_x = 1; + required int32 offset_y = 2; +} + +// Motion of the mouse wheel. +// NEXT ID: 3 +message MouseWheelEvent { + required int32 offset_x = 1; + required int32 offset_y = 2; +} + +// Mouse button is pressed down. +// NEXT ID: 2 +message MouseDownEvent { + enum Button { + LEFT = 0; + MIDDLE = 1; + RIGHT = 2; + } + required Button button = 1; +} + +// Mouse button is released. +// NEXT ID: 2 +message MouseUpEvent { + enum Button { + LEFT = 0; + MIDDLE = 1; + RIGHT = 2; + } + required Button button = 1; +} + +// Defines the message that is sent from the client to the host. +// Only one of these messages should be present. +// NEXT ID: 7 +message ClientMessage { + optional KeyEvent key_event = 1; + optional MouseSetPositionEvent mouse_set_position_event = 2; + optional MouseMoveEvent mouse_move_event = 3; + optional MouseWheelEvent mouse_wheel_event = 4; + optional MouseDownEvent mouse_down_event = 5; + optional MouseUpEvent mouse_up_event = 6; +} |