xref: /aosp_15_r20/external/googleapis/google/cloud/video/stitcher/v1/sessions.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.video.stitcher.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/video/stitcher/v1/companions.proto";
22import "google/cloud/video/stitcher/v1/events.proto";
23import "google/cloud/video/stitcher/v1/live_configs.proto";
24import "google/protobuf/duration.proto";
25
26option go_package = "cloud.google.com/go/video/stitcher/apiv1/stitcherpb;stitcherpb";
27option java_multiple_files = true;
28option java_outer_classname = "SessionsProto";
29option java_package = "com.google.cloud.video.stitcher.v1";
30
31// Metadata for a VOD session. The session expires 4 hours after its creation.
32message VodSession {
33  option (google.api.resource) = {
34    type: "videostitcher.googleapis.com/VodSession"
35    pattern: "projects/{project}/locations/{location}/vodSessions/{vod_session}"
36  };
37
38  // Defines fields related to Google Ad Manager (GAM). This should be set if
39  // GAM is being used for ads.
40  message GamSettings {
41    // Required. Ad Manager network code.
42    string network_code = 1 [(google.api.field_behavior) = REQUIRED];
43
44    // Required. The stream ID generated by Ad Manager.
45    string stream_id = 2 [(google.api.field_behavior) = REQUIRED];
46  }
47
48  // Output only. The name of the VOD session, in the form of
49  // `projects/{project_number}/locations/{location}/vodSessions/{id}`.
50  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
51
52  // Output only. Metadata of what was stitched into the content.
53  Interstitials interstitials = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
54
55  // Output only. The playback URI of the stitched content.
56  string play_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
57
58  // Required. URI of the media to stitch.
59  string source_uri = 5 [(google.api.field_behavior) = REQUIRED];
60
61  // Required. Ad tag URI.
62  string ad_tag_uri = 6 [(google.api.field_behavior) = REQUIRED];
63
64  // Key value pairs for ad tag macro replacement. If the
65  // specified ad tag URI has macros, this field provides the mapping
66  // to the value that will replace the macro in the ad tag URI.
67  // Macros are designated by square brackets.
68  // For example:
69  //
70  //   Ad tag URI: `"https://doubleclick.google.com/ad/1?geo_id=[geoId]"`
71  //
72  //   Ad tag macro map: `{"geoId": "123"}`
73  //
74  //   Fully qualified ad tag:
75  //   `"`https://doubleclick.google.com/ad/1?geo_id=123"`
76  map<string, string> ad_tag_macro_map = 7;
77
78  // Additional options that affect the output of the manifest.
79  ManifestOptions manifest_options = 9;
80
81  // Output only. The generated ID of the VodSession's source media.
82  string asset_id = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
83
84  // Required. Determines how the ad should be tracked.
85  AdTracking ad_tracking = 11 [(google.api.field_behavior) = REQUIRED];
86
87  // This field should be set with appropriate values if GAM is being used for
88  // ads.
89  GamSettings gam_settings = 13;
90}
91
92// Describes what was stitched into a VOD session's manifest.
93message Interstitials {
94  // List of ad breaks ordered by time.
95  repeated VodSessionAdBreak ad_breaks = 1;
96
97  // Information related to the content of the VOD session.
98  VodSessionContent session_content = 2;
99}
100
101// Metadata for an inserted ad in a VOD session.
102message VodSessionAd {
103  // Duration in seconds of the ad.
104  google.protobuf.Duration duration = 1;
105
106  // Metadata of companion ads associated with the ad.
107  CompanionAds companion_ads = 2;
108
109  // The list of progress tracking events for the ad break. These can be of
110  // the following IAB types: `MUTE`, `UNMUTE`, `PAUSE`, `CLICK`,
111  // `CLICK_THROUGH`, `REWIND`, `RESUME`, `ERROR`, `FULLSCREEN`,
112  // `EXIT_FULLSCREEN`, `EXPAND`, `COLLAPSE`, `ACCEPT_INVITATION_LINEAR`,
113  // `CLOSE_LINEAR`, `SKIP`.
114  repeated Event activity_events = 3;
115}
116
117// Metadata for the entire stitched content in a VOD session.
118message VodSessionContent {
119  // The total duration in seconds of the content including the ads stitched
120  // in.
121  google.protobuf.Duration duration = 1;
122}
123
124// Metadata for an inserted ad break.
125message VodSessionAdBreak {
126  // List of events that are expected to be triggered, ordered by time.
127  repeated ProgressEvent progress_events = 1;
128
129  // Ordered list of ads stitched into the ad break.
130  repeated VodSessionAd ads = 2;
131
132  // Ad break end time in seconds relative to the start of the VOD asset.
133  google.protobuf.Duration end_time_offset = 3;
134
135  // Ad break start time in seconds relative to the start of the VOD asset.
136  google.protobuf.Duration start_time_offset = 4;
137}
138
139// Metadata for a live session. The session expires 5 minutes after the client
140// stops fetching the session's playlists.
141message LiveSession {
142  option (google.api.resource) = {
143    type: "videostitcher.googleapis.com/LiveSession"
144    pattern: "projects/{project}/locations/{location}/liveSessions/{live_session}"
145  };
146
147  // Defines fields related to Google Ad Manager (GAM). This should be set if
148  // GAM is being used for ads.
149  message GamSettings {
150    // Required. The stream ID generated by Ad Manager.
151    string stream_id = 1 [(google.api.field_behavior) = REQUIRED];
152  }
153
154  // Output only. The name of the live session, in the form of
155  // `projects/{project}/locations/{location}/liveSessions/{id}`.
156  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
157
158  // Output only. The URI to play the live session's ad-stitched stream.
159  string play_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
160
161  // Key value pairs for ad tag macro replacement. If the
162  // specified ad tag URI has macros, this field provides the mapping
163  // to the value that will replace the macro in the ad tag URI.
164  // Macros are designated by square brackets.
165  //
166  // For example:
167  //
168  //   Ad tag URI: "https://doubleclick.google.com/ad/1?geo_id=[geoId]"
169  //
170  //   Ad tag macros: `{"geoId": "123"}`
171  //
172  //   Fully qualified ad tag:
173  //   `"https://doubleclick.google.com/ad/1?geo_id=123"`
174  map<string, string> ad_tag_macros = 6;
175
176  // Additional options that affect the output of the manifest.
177  ManifestOptions manifest_options = 10;
178
179  // This field should be set with appropriate values if GAM is being used for
180  // ads.
181  GamSettings gam_settings = 15;
182
183  // Required. The resource name of the live config for this session, in the
184  // form of `projects/{project}/locations/{location}/liveConfigs/{id}`.
185  string live_config = 16 [
186    (google.api.field_behavior) = REQUIRED,
187    (google.api.resource_reference) = {
188      type: "videostitcher.googleapis.com/LiveConfig"
189    }
190  ];
191}
192
193// Options for manifest generation.
194message ManifestOptions {
195  // Defines the ordering policy during manifest generation.
196  enum OrderPolicy {
197    // Ordering policy is not specified.
198    ORDER_POLICY_UNSPECIFIED = 0;
199
200    // Order by ascending.
201    ASCENDING = 1;
202
203    // Order by descending.
204    DESCENDING = 2;
205  }
206
207  // If specified, the output manifest will only return renditions matching the
208  // specified filters.
209  repeated RenditionFilter include_renditions = 1;
210
211  // If specified, the output manifest will orders the video and muxed
212  // renditions by bitrate according to the ordering policy.
213  OrderPolicy bitrate_order = 2;
214}
215
216// Filters for a video or muxed redition.
217message RenditionFilter {
218  // Bitrate in bits per second for the rendition. If set, only renditions with
219  // the exact bitrate will match.
220  int32 bitrate_bps = 1;
221
222  // Codecs for the rendition. If set, only renditions with the exact value
223  // will match.
224  string codecs = 2;
225}
226