lesavka/common/proto/lesavka.proto

27 lines
918 B
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package lesavka;
// smaller, fixed-size payloads -> less allocation and simpler decoding
message KeyboardReport { bytes data = 1; } // exactly 8 bytes
message MouseReport { bytes data = 1; } // exactly 4 bytes
// ------------ video ------------
message MonitorRequest {
uint32 id = 1; // 0/1 for now
uint32 max_bitrate = 2; // kb/s client hints, server may ignore
}
message VideoPacket {
uint32 id = 1; // monitor id
uint64 pts = 2; // monotonically increasing microseconds
bytes data = 3; // full H.264 accessunit (lengthprefixed)
}
service Relay {
rpc StreamKeyboard (stream KeyboardReport) returns (stream KeyboardReport);
rpc StreamMouse (stream MouseReport) returns (stream MouseReport);
// client requests one monitor, server pushes raw H.264
rpc CaptureVideo (MonitorRequest) returns (stream VideoPacket);
}