// 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 "output/output.proto"; import "output/outputtranscodingconstraints.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; option go_package = "git.ltnglobal.com/make.tv/genproto/api;api"; service OutputService { // Lists outputs of a team. rpc ListOutputs(ListOutputsRequest) returns (ListOutputsResponse) { option (google.api.http) = { get: "/v1/teams/{team_id}/outputs" }; } // Gets an output. Returns NOT_FOUND if no such output exists. rpc GetOutput(GetOutputRequest) returns (Output) { option (google.api.http) = { get: "/v1/teams/{team_id}/outputs/{output_id}" }; } // Creates an output. rpc CreateOutput(CreateOutputRequest) returns (Output) { option (google.api.http) = { post: "/v1/teams/{output.team_id}/outputs" body: "output" }; } // Updates an output. rpc UpdateOutput (UpdateOutputRequest) returns (Output) { option (google.api.http) = { patch: "/v1/teams/{output.team_id}/outputs/{output.id}" body: "output" }; } // Deletes an output. rpc DeleteOutput (DeleteOutputRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/teams/{team_id}/outputs/{output_id}" }; } // Gets a batch of outputs. rpc BatchGetOutputs (BatchGetOutputsRequest) returns (BatchGetOutputsResponse) { option (google.api.http) = { get: "/v1/teams/-/outputs:batchGet" }; } // -- // Sets the source of an output. // // The source is also known as the input signal. If no source is given the output // will disconnect any current source. rpc SetOutputSource (SetOutputSourceRequest) returns (SetOutputSourceResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/outputs/{output_id}:setSource" body: "*" }; } // Sets the overlay of an output. rpc SetOutputOverlay (stream SetOutputOverlayRequest) returns (SetOutputOverlayResponse) { option (google.api.http) = { post: "/v1/teams/-/outputs/-:setOverlay" body: "*" }; } // -- // Assign an output to a production. rpc AssignOutputToProduction (AssignOutputToProductionRequest) returns (AssignOutputToProductionResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/outputs/{output_id}:assignToProduction" body: "*" }; } // Withdraw an output from a production. rpc WithdrawOutputFromProduction (WithdrawOutputFromProductionRequest) returns (WithdrawOutputFromProductionResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/outputs/{output_id}:withdrawFromProduction" body: "*" }; } // -- // Lists transcoding constraints. rpc ListOutputTranscodingConstraints(ListOutputTranscodingConstraintsRequest) returns (ListOutputTranscodingConstraintsResponse) { option (google.api.http) = { get: "/v1/teams/{team_id}/outputs:listTranscodingConstraints" }; } // Activate rpc EngageSlate(EngageSlateRequest) returns (EngageSlateResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/outputs/{output_id}:engageSlate" body: "*" }; } rpc ReleaseSlate(ReleaseSlateRequest) returns (ReleaseSlateResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/outputs/{output_id}:releaseSlate" body: "*" }; } } // Request message for [ListOutputs][tv.make.api.OutputService.ListOutputs]. message ListOutputsRequest { // The unique identifier of the team owning the outputs. string team_id = 1; // The maximum number of items to return. int32 page_size = 2; // The next_page_token value returned from a previous List request, if any. string page_token = 3; } // Response message for [ListOutputs][tv.make.api.OutputService.ListOutputs]. message ListOutputsResponse { // The list of outputs. repeated Output outputs = 1; // Token to retrieve the next page of results, or empty if there are no // more results in the list. string next_page_token = 2; } // Request message for [GetOutput][tv.make.api.OutputService.GetOutput]. message GetOutputRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the output. string team_id = 2; } // Request message for [CreateOutput][tv.make.api.OutputService.CreateOutput]. message CreateOutputRequest { // The output to create. Output output = 1; // The unique identifier of the request. // // If present, the create request will be ignored for subsequent // retries with the same id. // // [optional] string request_id = 2; } // Request message for [UpdateOutput][tv.make.api.OutputService.UpdateOutput]. message UpdateOutputRequest { // The output resource which replaces the resource on the server. Output output = 1; // The update mask applies to the resource. For the `FieldMask` definition, // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask // // The path "transcodings" updates all transcodings at once. It is not possible to // remove or selectively update transcodings. // // To disable a transcoding, set its enabled state to false. // // To convert from a transcoded output to a passthrough, simply pass the "transcodings // path and do not provide any transcodings in the updated output. google.protobuf.FieldMask update_mask = 3; } // Request message for [DeleteOutput][tv.make.api.OutputService.DeleteOutput]. message DeleteOutputRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the output. string team_id = 2; } // Request message for [BatchGetOutputs][tv.make.api.OutputService.BatchGetOutputs]. message BatchGetOutputsRequest { // The unique identifier of the outputs to retrieve. repeated string output_ids = 1; // The unique identifier of the teams owning the outputs. repeated string team_ids = 2; } // Response message for [BatchGetOutputs][tv.make.api.OutputService.BatchGetOutputs]. message BatchGetOutputsResponse { // The list of outputs. repeated Output outputs = 1; } message StartOutputRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the output. string team_id = 2; // The production in which the output should be started. string production_id = 3; } message StopOutputRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the output. string team_id = 2; } message SetOutputSourceRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the output. string team_id = 2; // The source to publish. // // Leave the stream empty to disconnect any existing stream from this // output. // // [optional] string stream_id = 3; } message SetOutputSourceResponse {} message SetOutputOverlayRequest { message InitialRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the output. string team_id = 2; // Size of the overlay image in bytes int64 size_bytes = 3; // Width of the overlay image in pixels. int32 width_pixels = 4; // Height of the overlay image in pixels. int32 height_pixels = 5; // The x-position of the overlay. int32 offset_x_pixels = 6; // The y-position of the overlay. int32 offset_y_pixels = 7; // Mime-type of the overlay. // // Accepted mime-types are: // - image/jpeg // - image/png // - image/svg+xml string mime_type = 8; // The index of the output's transcoding to use. // // The client SHOULD provide an overlay for each transcoding individually. int32 transcoding_index = 9; // Whether or not the overlay should be enabled. bool enabled = 10; } // One chunk of data. message DataChunk { bytes data = 1; } // End of stream message EndOfStream{} oneof set_output_overlay_request_type { // The initial request MUST be sent at the beginning of the stream. InitialRequest initial_request = 1; // One or more data chunks. // // Accumulated size of data chunks most not exceed size_bytes. DataChunk data_chunk = 2; // Signals the end of the stream. EndOfStream end_of_stream = 3; } } message SetOutputOverlayResponse {} // Request message for [ListOutputTranscodingConstraints][tv.make.api.OutputService.ListOutputTranscodingConstraints]. message ListOutputTranscodingConstraintsRequest { // The unique identifier of the team owning the outputs. string team_id = 1; // The maximum number of items to return. int32 page_size = 2; // The next_page_token value returned from a previous List request, if any. string page_token = 3; } // Response message for [ListOutputTranscodingConstraints][tv.make.api.OutputService.ListOutputTranscodingConstraints]. message ListOutputTranscodingConstraintsResponse { // The ordered list of constraints. // // Constraints at index 0 apply to transcodings at index 0; // constraints at index 1 apply to transcodings at index 1; // constraints at index x apply to transcodings at index x. repeated OutputTranscodingConstraints output_transcoding_constraints = 1; // Token to retrieve the next page of results, or empty if there are no // more results in the list. string next_page_token = 2; } // Request message for [AssignOutputToProduction][tv.make.api.OutputService.AssignOutputToProduction]. message AssignOutputToProductionRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the production. string production_id = 2; // The unique identifier of the team owning the output and production. string team_id = 3; // The position of the output. // // Counting starts at zero. A negative value will put the output to the end of the list. // For reordering it is save to recall [AssignOutputToProduction][tv.make.api.OutputService.AssignOutputToProduction] // with the desired index. Default value is 0. // 1 ) [a,b,c] -> Assign(-1, b) -> [a,c,b] // append to end // 2 ) [a,b,c] -> Assign(100, b) -> [a,c,b] // append to end // 3 ) [a,b,c] -> Assign(1, b) -> [a, b , c] // keep position // 3.1 ) [a,b,c] -> Assign(2, b) -> [a,c,b] // move position // 4 ) [a,b,c] -> Assign(-1, d) -> [a, b, c, d] // append to end // 5 ) [a,b,c] -> Assign(100, d) -> [a, b, c, d] // append to end // 6 ) [a,b,c] -> Assign(1, d) -> [a, d , b, c] // insert // 7 ) [a,b,c] -> Assign(0, d) -> [d, a, b, c] // insert ( default behaviour if the index has not been set) int32 index = 4; } message AssignOutputToProductionResponse {} message WithdrawOutputFromProductionRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the production. string production_id = 2; // The unique identifier of the team owning the output and production. string team_id = 3; } message WithdrawOutputFromProductionResponse {} message EngageSlateRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the outputs. string team_id = 2; // The unique identifier of the slate. string slate_id = 3; } message EngageSlateResponse { } message ReleaseSlateRequest { // The unique identifier of the output. string output_id = 1; // The unique identifier of the team owning the outputs. string team_id = 2; } message ReleaseSlateResponse { // Last activated slate if it exists string released_slate_id = 1; }