import "common.proto"; package Remote; enum AudioCodecType { CodecTypeOGA = 1; } enum VideoCodecType { CodecTypeOGV = 1; } message MediaRequest { message Prepare { message Audio { required int64 track_id = 1; // Id if the media optional AudioCodecType codec_type = 2; optional uint32 bitrate = 3; optional uint32 stream_idx = 4; optional uint32 offset_secs = 5; } message Video { required int64 video_id = 1; // Id if the media optional VideoCodecType codec_type = 2; optional uint32 bitrate = 3; optional uint32 offset_secs = 4; optional uint32 audio_stream_idx = 5; optional uint32 video_stream_idx = 6; optional uint32 subtitle_stream_idx = 7; } enum Type { AudioRequest = 1; VideoRequest = 2; } required Type type = 1; optional Audio audio = 2; optional Video video = 3; } message GetPart { required uint32 requested_data_size = 1; // Amount of data requested. May receive more or less. May receive 0 byte if complete } message Terminate { } enum Type { TypeMediaPrepare = 1; TypeMediaGetPart = 2; TypeMediaTerminate = 3; } required Type type = 1; optional Prepare prepare = 2; optional GetPart get_part = 3; optional Terminate terminate = 4; } // MediaRequest message MediaResponse { message Part { required bytes data = 1; } enum Type { TypeError = 1; TypePart = 2; } required Type type = 1; optional Error error = 2; optional Part part = 3; }