Skip to content

Commit c180136

Browse files
Google APIscopybara-github
authored andcommitted
feat: added OutputType field to the Clip resource to support MP4 clipping
feat: added DVRSession methods to support DVR feature docs: Clarified GCS in the comment for method `DeleteClip` in service `LivestreamService` docs: Updated comment for field `update_mask` in message `.google.cloud.video.livestream.v1.UpdateInputRequest` to indicate updates in `tier` field are allowed docs: A comment for field `requested_cancellation` in message `.google.cloud.video.livestream.v1.OperationMetadata` is changed to clarify error type PiperOrigin-RevId: 758761402
1 parent 84f0429 commit c180136

4 files changed

Lines changed: 369 additions & 6 deletions

File tree

google/cloud/video/livestream/v1/livestream_grpc_service_config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "ListInputs" },
77
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "GetInput" },
88
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "ListEvents" },
9-
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "GetEvent" }
9+
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "GetEvent" },
10+
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "ListClips" },
11+
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "GetClip" },
12+
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "GetAsset" },
13+
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "ListAssets" },
14+
{ "service": "google.cloud.video.livestream.v1.LivestreamService", "method": "GetPool" }
1015
],
1116
"timeout": "60s",
1217
"retryPolicy": {

google/cloud/video/livestream/v1/outputs.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ syntax = "proto3";
1717
package google.cloud.video.livestream.v1;
1818

1919
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
2021
import "google/protobuf/duration.proto";
2122
import "google/type/datetime.proto";
2223

google/cloud/video/livestream/v1/resources.proto

Lines changed: 146 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,20 @@ message Clip {
667667
string output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
668668
}
669669

670+
// OutputType represents the output type of the clip.
671+
enum OutputType {
672+
// OutputType is not specified.
673+
OUTPUT_TYPE_UNSPECIFIED = 0;
674+
675+
// OutputType is a VOD manifest. This is the default value.
676+
MANIFEST = 1;
677+
678+
// OutputType is an MP4 file.
679+
MP4 = 2;
680+
}
681+
670682
// The resource name of the clip, in the following format:
671-
// `projects/{project}/locations/{location}/channels/{c}/clips/{clipId}`.
683+
// `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`.
672684
// `{clipId}` is a user-specified resource id that conforms to the following
673685
// criteria:
674686
//
@@ -715,6 +727,139 @@ message Clip {
715727
// allowed.
716728
repeated ClipManifest clip_manifests = 12
717729
[(google.api.field_behavior) = REQUIRED];
730+
731+
// Optional. OutputType of the clip. If not specified, the default value is
732+
// MANIFEST.
733+
OutputType output_type = 13 [(google.api.field_behavior) = OPTIONAL];
734+
}
735+
736+
// TimeInterval represents a time interval.
737+
message TimeInterval {
738+
// Optional. The start time of the interval.
739+
google.protobuf.Timestamp start_time = 1
740+
[(google.api.field_behavior) = OPTIONAL];
741+
742+
// Optional. The end time of the interval.
743+
google.protobuf.Timestamp end_time = 2
744+
[(google.api.field_behavior) = OPTIONAL];
745+
}
746+
747+
// DvrSession is a sub-resource under channel. Each DvrSession represents a DVR
748+
// recording of the live stream for a specific time range.
749+
message DvrSession {
750+
option (google.api.resource) = {
751+
type: "livestream.googleapis.com/DvrSession"
752+
pattern: "projects/{project}/locations/{location}/channels/{channel}/dvrSessions/{dvr_session}"
753+
plural: "dvrSessions"
754+
singular: "dvrSession"
755+
};
756+
757+
// State of the DVR session.
758+
enum State {
759+
// State is not specified.
760+
STATE_UNSPECIFIED = 0;
761+
762+
// The operation is pending to be picked up by the server.
763+
PENDING = 1;
764+
765+
// The session is being updated.
766+
UPDATING = 2;
767+
768+
// The session is scheduled and waiting for the start time.
769+
SCHEDULED = 3;
770+
771+
// The session is currently in progress and the outputs are available in the
772+
// specified Cloud Storage bucket. For additional information, see the
773+
// `dvr_manifests.output_uri` field.
774+
LIVE = 4;
775+
776+
// Outputs are available in the specified Cloud Storage bucket. For
777+
// additional information, see the `dvr_manifests.output_uri` field.
778+
FINISHED = 5;
779+
780+
// The operation has failed. For additional information, see the `error`
781+
// field.
782+
FAILED = 6;
783+
784+
// The session is being deleted.
785+
DELETING = 7;
786+
787+
// The session is being post processed.
788+
POST_PROCESSING = 8;
789+
790+
// The session is in cooldown. The cooldown period lasts for 60 seconds.
791+
// When the DVR session is updated by the user to have a new end time that
792+
// is likely already in the past, the DVR manifest will end as soon as
793+
// possible and the DVR session will move to this state. This is done to
794+
// prevent the players to receive a manifest update that removes a segment
795+
// that has already been played. After the cooldown period ends, a new
796+
// manifest is generated that honors the new end time.
797+
COOLDOWN = 9;
798+
799+
// The session is being stopped. The session will move to STOPPING state, if
800+
// the parent channel is updated.
801+
STOPPING = 10;
802+
}
803+
804+
// DvrManifest identifies a source manifest and specifies a file name for the
805+
// generated DVR manifest.
806+
message DvrManifest {
807+
// Required. A unique key that identifies a manifest config in the parent
808+
// channel. This key is the same as `channel.manifests.key` for the selected
809+
// manifest.
810+
string manifest_key = 1 [(google.api.field_behavior) = REQUIRED];
811+
812+
// Output only. The output URI of the DVR manifest. The DVR output will be
813+
// placed in a directory named `dvr/dvrSessionId/` under the parent
814+
// channel's output uri. Format:
815+
// {channel.output.uri}/dvr/{dvrSessionId}/{channel.manifests.fileName}
816+
// Example: gs://my-bucket/outputs/dvr/my-dvr-session/main.m3u8
817+
string output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
818+
}
819+
820+
// DvrWindow represents a DVR window.
821+
message DvrWindow {
822+
// The allowlist forms of a DVR window.
823+
oneof kind {
824+
// A time interval in the form of a tuple of Unix epoch time.
825+
TimeInterval time_interval = 1;
826+
}
827+
}
828+
829+
// Identifier. The resource name of the DVR session, in the following format:
830+
// `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`.
831+
// `{dvrSessionId}` is a user-specified resource id that conforms to the
832+
// following criteria:
833+
//
834+
// 1. 1 character minimum, 63 characters maximum
835+
// 2. Only contains letters, digits, underscores, and hyphens
836+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
837+
838+
// Output only. The creation time.
839+
google.protobuf.Timestamp create_time = 2
840+
[(google.api.field_behavior) = OUTPUT_ONLY];
841+
842+
// Output only. The update time.
843+
google.protobuf.Timestamp update_time = 3
844+
[(google.api.field_behavior) = OUTPUT_ONLY];
845+
846+
// Optional. User-defined key/value metadata.
847+
map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
848+
849+
// Output only. The state of the clip.
850+
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
851+
852+
// Output only. An error object that describes the reason for the failure.
853+
// This property only presents when `state` is `FAILED`.
854+
google.rpc.Status error = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
855+
856+
// Required. A list of DVR manifests. Currently only one DVR manifest is
857+
// allowed.
858+
repeated DvrManifest dvr_manifests = 7
859+
[(google.api.field_behavior) = REQUIRED];
860+
861+
// Required. The specified ranges of segments to generate a DVR recording.
862+
repeated DvrWindow dvr_windows = 8 [(google.api.field_behavior) = REQUIRED];
718863
}
719864

720865
// An asset represents a video or an image.

0 commit comments

Comments
 (0)