clipper/proto/media_set.proto

77 lines
1.5 KiB
Protocol Buffer

syntax = "proto3";
package media_set;
option go_package = "pb/media_set";
import "google/protobuf/duration.proto";
message MediaSet {
string id = 1;
string youtube_id = 2;
int32 audio_channels = 3;
int64 audio_approx_frames = 4;
int64 audio_frames = 5;
int32 audio_sample_rate = 6;
int32 audio_youtube_itag = 7;
string audio_mime_type = 8;
google.protobuf.Duration video_duration = 9;
int32 video_youtube_itag = 10;
string video_mime_type = 11;
};
message GetAudioProgress {
repeated int32 peaks = 1;
float percent_complete = 2;
string url = 3;
}
message GetRequest {
string youtube_id = 1;
}
message GetAudioRequest {
string id = 1;
int32 num_bins = 2;
}
message GetAudioSegmentRequest {
string id = 1;
int32 num_bins = 2;
int64 start_frame = 3;
int64 end_frame = 4;
}
message GetAudioSegmentResponse {
repeated int32 peaks = 1;
}
message GetVideoRequest {
string id = 1;
}
message GetVideoProgress {
float percent_complete = 1;
string url = 2;
}
message GetVideoThumbnailRequest {
string id = 1;
}
message GetVideoThumbnailResponse {
bytes image = 1;
int32 width = 2;
int32 height = 3;
}
service MediaSetService {
rpc Get(GetRequest) returns (MediaSet) {}
rpc GetAudio(GetAudioRequest) returns (stream GetAudioProgress) {}
rpc GetAudioSegment(GetAudioSegmentRequest) returns (GetAudioSegmentResponse) {}
rpc GetVideo(GetVideoRequest) returns (stream GetVideoProgress) {}
rpc GetVideoThumbnail(GetVideoThumbnailRequest) returns (GetVideoThumbnailResponse) {}
}