clipper/proto/media_set.proto

99 lines
2.0 KiB
Protocol Buffer
Raw Normal View History

2021-10-22 19:30:09 +00:00
syntax = "proto3";
package media_set;
option go_package = "pb/media_set";
import "google/protobuf/duration.proto";
2021-11-30 19:41:34 +00:00
// TODO: use uints where appropriate.
2021-10-22 19:30:09 +00:00
message MediaSet {
string id = 1;
2021-11-01 19:33:45 +00:00
string youtube_id = 2;
string title = 12;
string description = 13;
string author = 14;
2021-11-02 16:20:47 +00:00
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;
2021-10-22 19:30:09 +00:00
};
2021-11-01 05:28:40 +00:00
message GetRequest {
string youtube_id = 1;
2021-10-22 19:30:09 +00:00
}
message GetPeaksRequest {
2021-10-22 19:30:09 +00:00
string id = 1;
2021-10-27 19:34:59 +00:00
int32 num_bins = 2;
2021-10-22 19:30:09 +00:00
}
message GetPeaksProgress {
repeated int32 peaks = 1;
float percent_complete = 2;
string url = 3;
}
message GetPeaksForSegmentRequest {
2021-11-16 06:48:30 +00:00
string id = 1;
int32 num_bins = 2;
int64 start_frame = 3;
int64 end_frame = 4;
}
message GetPeaksForSegmentResponse {
2021-11-16 06:48:30 +00:00
repeated int32 peaks = 1;
}
2021-12-29 15:38:25 +00:00
enum AudioFormat {
WAV = 0;
MP3 = 1;
}
message GetAudioSegmentRequest {
string id = 1;
int64 start_frame = 2;
int64 end_frame = 3;
AudioFormat format = 4;
}
message GetAudioSegmentProgress {
float percent_complete = 3;
bytes audio_data = 4;
}
message GetVideoRequest {
string id = 1;
}
message GetVideoProgress {
float percent_complete = 1;
string url = 2;
}
2021-11-21 19:43:40 +00:00
message GetVideoThumbnailRequest {
string id = 1;
}
message GetVideoThumbnailResponse {
bytes image = 1;
int32 width = 2;
int32 height = 3;
}
2021-11-01 05:28:40 +00:00
service MediaSetService {
rpc Get(GetRequest) returns (MediaSet) {}
rpc GetPeaks(GetPeaksRequest) returns (stream GetPeaksProgress) {}
rpc GetPeaksForSegment(GetPeaksForSegmentRequest) returns (GetPeaksForSegmentResponse) {}
2021-12-29 15:38:25 +00:00
rpc GetAudioSegment(GetAudioSegmentRequest) returns (stream GetAudioSegmentProgress) {}
rpc GetVideo(GetVideoRequest) returns (stream GetVideoProgress) {}
2021-11-21 19:43:40 +00:00
rpc GetVideoThumbnail(GetVideoThumbnailRequest) returns (GetVideoThumbnailResponse) {}
2021-10-22 19:30:09 +00:00
}