// Copyright 2022 LTN Global Communications, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package tv.make.api; import "input/stream/stream.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option go_package = "git.ltnglobal.com/make.tv/genproto/api;api"; service StreamService { // Lists active streams. // // If the input is a DeprecatedUserDevice the returned value is not feature complete. There // are several missing informations: Id, AssetID, StartTime, StopTime // Please use the ProductionService.ListStreams and a StreamService.BatchGetStreams to retrieve // further information. rpc ListStreams(ListStreamsRequest) returns (ListStreamsResponse) { option (google.api.http) = { get: "/v1/teams/{team_id}/inputs/{input_id}/streams" }; } // Gets a stream. rpc GetStream(GetStreamRequest) returns (Stream) { option (google.api.http) = { get: "/v1/teams/{team_id}/inputs/{input_id}/streams/{stream_id}" }; } // Creates a stream. rpc CreateStream(CreateStreamRequest) returns (Stream) { option (google.api.http) = { post: "/v1/teams/{team_id}/inputs/{stream.input_id}/streams" body: "stream" }; } // Updates a stream. rpc UpdateStream(UpdateStreamRequest) returns (Stream) { option (google.api.http) = { patch: "/v1/teams/{team_id}/inputs/{stream.input_id}/streams/{stream.id}" body: "stream" }; } // Deletes a stream. rpc DeleteStream(DeleteStreamRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/teams/{team_id}/inputs/{input_id}/streams/{stream_id}" }; } // --- // Gets a batch of streams. rpc BatchGetStreams(BatchGetStreamsRequest) returns (BatchGetStreamsResponse) { option (google.api.http) = { get: "/v1/teams/-/inputs/-/streams:batchGet" }; } // Watch a single stream for stat updates. rpc WatchStreamStats(WatchStreamStatsRequest) returns (stream WatchStreamStatsResponse) { option (google.api.http) = { post: "/v1/teams/-/inputs/-/streams/{stream_id}:watchStats" }; } // Add metadata to a stream. rpc AddStreamMetadata(stream AddStreamMetadataRequest) returns (AddStreamMetadataResponse) { option (google.api.http) = { post: "/v1/teams/-/inputs/-/streams/-:addMetadata" // this path is awkward but no path params are allowed for client streaming body: "*" }; } } // Request message for [ListStreams][tv.make.api.StreamService.ListStreams]. message ListStreamsRequest { // The unique identifier of the team owning the input. string team_id = 1; // The unique identifier of the input owning the stream. // // Note that if this is omitted, all streams for a team are returned. // // [Optional] string input_id = 2; // The maximum number of items to return. // // [Optional] int32 page_size = 3; // The next_page_token value returned from a previous List request, if any. // // [Optional] string page_token = 4; } // Response message for [ListStreams][tv.make.api.StreamService.ListStreams]. message ListStreamsResponse { // The list of streams. repeated Stream streams = 1; // Token to retrieve the next page of results, or empty if there are no // more results in the list. string next_page_token = 3; } // Request message for [GetStream][tv.make.api.StreamService.GetStream]. message GetStreamRequest { // The unique identifier of the stream. string stream_id = 1; // The unique identifier of the input owning the stream. string input_id = 2; // The unique identifier of the team. string team_id = 3; } // Request message for [CreateStream][tv.make.api.StreamService.CreateStream]. message CreateStreamRequest { // The unique identifier of the team owning the input. string team_id = 1; // The stream to create. Stream stream = 2; } // Request message for [UpdateStream][tv.make.api.StreamService.UpdateStream]. message UpdateStreamRequest { // The stream resource which replaces the resource on the server. Stream stream = 1; // The unique identifier of the team. string team_id = 2; // The update mask applies to the resource. For the `FieldMask` definition, // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask google.protobuf.FieldMask update_mask = 3; } // Request message for [DeleteStream][tv.make.api.StreamService.DeleteStream]. message DeleteStreamRequest { // The unique identifier of the stream. string stream_id = 1; // The unique identifier of the input. string input_id = 2; // The unique identifier of the team. string team_id = 3; } // Request message for [BatchGetStreams][tv.make.api.StreamService.BatchGetStreams]. message BatchGetStreamsRequest { // The unique identifier of the streams to retrieve. repeated string stream_ids = 1; // The unique identifier of the teams owning the streams. repeated string team_ids = 2; } // Response message for [BatchGetStreams][tv.make.api.StreamService.BatchGetStreams]. message BatchGetStreamsResponse { // The list of streams. repeated Stream streams = 1; } // Request message for [WatchStreamStats][tv.make.api.StreamService.WatchStreamStats]. message WatchStreamStatsRequest { // The unique stream identifier. string stream_id = 1; } // Response message for [WatchStreamStats][tv.make.api.StreamService.WatchStreamStats]. message WatchStreamStatsResponse { // The unique stream identifier. string stream_id = 1; // The current bytes per second. double bps = 2; // Timestamp of the stats. google.protobuf.Timestamp timestamp = 3; // The current frames per second. double fps = 4; // The current TCP latency. double tcp_latency_ms = 5; // The rate of TCP packet retransmissions per second. double tcp_retransmit_pps = 6; // The current PHI Level. double phi_level = 7; // The current video bytes per second. double video_bps = 8; // The current audio bytes per second. double audio_bps = 9; // The current fill bytes per second. // // Typically CBR streams contain filler data to achieve a constant bitrate. double filler_bps = 10; // The current metadata bytes per second. double metadata_rate_bps = 11; // The current width of the video in pixels. int32 width_pixels = 13; // The current height of the video in pixels. int32 height_pixels = 14; // The current GOP size in seconds. double gop_seconds = 15; } // Request message for [AddStreamMetadata][tv.make.api.StreamService.AddStreamMetadata]. message AddStreamMetadataRequest { // The unique identifier of the stream. string stream_id = 1; // The metadata to add to the stream. Stream.Metadata metadata = 2; } // Response message for [AddStreamMetadata][tv.make.api.StreamService.AddStreamMetadata]. message AddStreamMetadataResponse {}