Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [video-stitcher] introduce GAM settings for GAM related configs and support ListOperations #4130

Merged
merged 15 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions packages/google-cloud-video-stitcher/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2021 Google LLC
//
// 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 google.cloud.common;

import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/common;common";
option java_multiple_files = true;
option java_package = "com.google.cloud.common";

// Represents the metadata of the long-running operation.
message OperationMetadata {
// Output only. The time the operation was created.
google.protobuf.Timestamp create_time = 1
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the operation finished running.
google.protobuf.Timestamp end_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Server-defined resource path for the target of the operation.
string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Name of the verb executed by the operation.
string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Human-readable status of the operation, if any.
string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Identifies whether the user has requested cancellation
// of the operation. Operations that have successfully been cancelled
// have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
// corresponding to `Code.CANCELLED`.
bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. API version used to start the operation.
string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
// Copyright 2023 Google LLC
//
// 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 google.cloud.video.stitcher.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";

option go_package = "cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpb";
option java_multiple_files = true;
option java_outer_classname = "LiveConfigsProto";
option java_package = "com.google.cloud.video.stitcher.v1";

// Determines the ad tracking policy.
enum AdTracking {
// The ad tracking policy is not specified.
AD_TRACKING_UNSPECIFIED = 0;

// Client-side ad tracking is specified. The client player is expected to
// trigger playback and activity events itself.
CLIENT = 1;

// The Video Stitcher API will trigger playback events on behalf of
// the client player.
SERVER = 2;
}

// Metadata for used to register live configs.
message LiveConfig {
option (google.api.resource) = {
type: "videostitcher.googleapis.com/LiveConfig"
pattern: "projects/{project}/locations/{location}/liveConfigs/{live_config}"
};

// State of the live config.
enum State {
// State is not specified.
STATE_UNSPECIFIED = 0;

// Live config is being created.
CREATING = 1;

// Live config is ready for use.
READY = 2;

// Live config is queued up for deletion.
DELETING = 3;
}

// Defines the ad stitching behavior in case the ad duration does not align
// exactly with the ad break boundaries. If not specified, the default is
// `CUT_CURRENT`.
enum StitchingPolicy {
// Stitching policy is not specified.
STITCHING_POLICY_UNSPECIFIED = 0;

// Cuts an ad short and returns to content in the middle of the ad.
CUT_CURRENT = 1;

// Finishes stitching the current ad before returning to content.
COMPLETE_AD = 2;
}

// Output only. The resource name of the live config, in the form of
// `projects/{project}/locations/{location}/liveConfigs/{id}`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. Source URI for the live stream manifest.
string source_uri = 2 [(google.api.field_behavior) = REQUIRED];

// The default ad tag associated with this live stream config.
string ad_tag_uri = 3;

// Additional metadata used to register a live stream with Google Ad Manager
// (GAM)
GamLiveConfig gam_live_config = 4;

// Output only. State of the live config.
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. Determines how the ads are tracked. If
// [gam_live_config][google.cloud.video.stitcher.v1.LiveConfig.gam_live_config]
// is set, the value must be `CLIENT` because the IMA SDK handles ad tracking.
AdTracking ad_tracking = 6 [(google.api.field_behavior) = REQUIRED];

// This must refer to a slate in the same
// project. If Google Ad Manager (GAM) is used for ads, this string sets the
// value of `slateCreativeId` in
// https://developers.google.com/ad-manager/api/reference/v202211/LiveStreamEventService.LiveStreamEvent#slateCreativeId
string default_slate = 7 [(google.api.resource_reference) = {
type: "videostitcher.googleapis.com/Slate"
}];

// Defines the stitcher behavior in case an ad does not align exactly with
// the ad break boundaries. If not specified, the default is `CUT_CURRENT`.
StitchingPolicy stitching_policy = 8;

// The configuration for prefetching ads.
PrefetchConfig prefetch_config = 10;
}

// The configuration for prefetch ads.
message PrefetchConfig {
// Required. Indicates whether the option to prefetch ad requests is enabled.
bool enabled = 1 [(google.api.field_behavior) = REQUIRED];

// The duration in seconds of the part of the break to be prefetched.
// This field is only relevant if prefetch is enabled.
// You should set this duration to as long as possible to increase the
// benefits of prefetching, but not longer than the shortest ad break
// expected. For example, for a live event with 30s and 60s ad breaks, the
// initial duration should be set to 30s.
google.protobuf.Duration initial_ad_request_duration = 2;
}

// Metadata used to register a live stream with Google Ad Manager (GAM)
message GamLiveConfig {
// Required. Ad Manager network code to associate with the live config.
string network_code = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. The asset key identifier generated for the live config.
string asset_key = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The custom asset key identifier generated for the live config.
string custom_asset_key = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -20,20 +20,31 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/video/stitcher/v1/companions.proto";
import "google/cloud/video/stitcher/v1/events.proto";
import "google/cloud/video/stitcher/v1/live_configs.proto";
import "google/protobuf/duration.proto";

option go_package = "cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpb";
option java_multiple_files = true;
option java_outer_classname = "SessionsProto";
option java_package = "com.google.cloud.video.stitcher.v1";

// Metadata for a VOD session.
// Metadata for a VOD session. The session expires 4 hours after its creation.
message VodSession {
option (google.api.resource) = {
type: "videostitcher.googleapis.com/VodSession"
pattern: "projects/{project}/locations/{location}/vodSessions/{vod_session}"
};

// Defines fields related to Google Ad Manager (GAM). This should be set if
// GAM is being used for ads.
message GamSettings {
// Required. Ad Manager network code.
string network_code = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The stream ID generated by Ad Manager.
string stream_id = 2 [(google.api.field_behavior) = REQUIRED];
}

// Output only. The name of the VOD session, in the form of
// `projects/{project_number}/locations/{location}/vodSessions/{id}`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down Expand Up @@ -64,19 +75,20 @@ message VodSession {
// `"`https://doubleclick.google.com/ad/1?geo_id=123"`
map<string, string> ad_tag_macro_map = 7;

// Indicates whether client side ad tracking is enabled. If client
// side ad tracking is enabled, then the client player is expected
// to trigger playback and activity events itself.
// If this is set to false, server side ad tracking is enabled,
// causing the Video Stitcher service will trigger playback events
// on behalf of the client player.
bool client_ad_tracking = 8;

// Additional options that affect the output of the manifest.
ManifestOptions manifest_options = 9;

// Output only. The generated ID of the VodSession's source media.
string asset_id = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. Determines how the ad should be tracked. If
// [gam_vod_config][google.cloud.video.stitcher.v1.VodSession.gam_vod_config]
// is set, the value must be `CLIENT` because the IMA SDK handles ad tracking.
AdTracking ad_tracking = 11 [(google.api.field_behavior) = REQUIRED];

// This field should be set with appropriate values if GAM is being used for
// ads.
GamSettings gam_settings = 13;
}

// Describes what was stitched into a VOD session's manifest.
Expand Down Expand Up @@ -126,24 +138,20 @@ message VodSessionAdBreak {
google.protobuf.Duration start_time_offset = 4;
}

// Metadata for a live session.
// Metadata for a live session. The session expires 5 minutes after the client
// stops fetching the session's playlists.
message LiveSession {
option (google.api.resource) = {
type: "videostitcher.googleapis.com/LiveSession"
pattern: "projects/{project}/locations/{location}/liveSessions/{live_session}"
};

// Defines the stitcher behavior in case an ad does not align exactly with
// the ad break boundaries. If not specified, the default is COMPLETE_AD.
enum StitchingPolicy {
// Stitching policy is not specified.
STITCHING_POLICY_UNSPECIFIED = 0;

// Finishes stitching the current ad before returning to content.
COMPLETE_AD = 1;

// Cuts an ad short and returns to content in the middle of the ad.
CUT_CURRENT = 3;
// Defines fields related to Google Ad Manager (GAM). This should be set if
// GAM
// is being used for ads.
message GamSettings {
// Required. The stream ID generated by Ad Manager.
string stream_id = 1 [(google.api.field_behavior) = REQUIRED];
}

// Output only. The name of the live session, in the form of
Expand All @@ -153,20 +161,6 @@ message LiveSession {
// Output only. The URI to play the live session's ad-stitched stream.
string play_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The URI of the live session's source stream.
string source_uri = 3;

// The default ad tag to use when no ad tag ids are specified in an ad break's
// SCTE-35 message.
//
// default_ad_tag_id is necessary when `adTagMap` has more than one key. Its
// value must be present in the `adTagMap`.
string default_ad_tag_id = 4;

// Key value pairs for ad tags. Ads parsed from ad tags must be MP4 videos
// each with at least one audio track.
map<string, AdTag> ad_tag_map = 5;

// Key value pairs for ad tag macro replacement. If the
// specified ad tag URI has macros, this field provides the mapping
// to the value that will replace the macro in the ad tag URI.
Expand All @@ -182,33 +176,21 @@ message LiveSession {
// `"https://doubleclick.google.com/ad/1?geo_id=123"`
map<string, string> ad_tag_macros = 6;

// Whether client side ad tracking is enabled. If enabled, the client player
// is expected to trigger playback and activity events itself. Otherwise,
// server side ad tracking is enabled and the Video Stitcher API will trigger
// playback events on behalf of the client player.
bool client_ad_tracking = 7;

// The default slate to use when no slates are specified in an ad break's
// SCTE-35 message. When specified, this value must match the ID for a slate
// that has already been created via the
// [CreateSlate](projects.locations.slates/create) method.
string default_slate_id = 8;

// Defines the stitcher behavior in case an ad does not align exactly with
// the ad break boundaries. If not specified, the default is `COMPLETE_AD`.
StitchingPolicy stitching_policy = 9;

// Additional options that affect the output of the manifest.
ManifestOptions manifest_options = 10;

// Output only. The generated ID of the LiveSession's source stream.
string stream_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Metadata of an ad tag.
message AdTag {
// Ad tag URI template.
string uri = 1;
// This field should be set with appropriate values if GAM is being used for
// ads.
GamSettings gam_settings = 15;

// Required. The resource name of the live config for this session, in the
// form of `projects/{project}/locations/{location}/liveConfigs/{id}`.
string live_config = 16 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "videostitcher.googleapis.com/LiveConfig"
}
];
}

// Options for manifest generation.
Expand Down
Loading