Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit 7fbc619

Browse files
docs(samples): update samples to use mapping_ attribute of AudioStream (#142)
* fix: revise samples with fix from #138 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e8a85da commit 7fbc619

File tree

2 files changed

+14
-48
lines changed

2 files changed

+14
-48
lines changed

samples/snippets/create_job_with_embedded_captions.py

+7-24
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,14 @@ def create_job_with_embedded_captions(
8181
),
8282
transcoder_v1.types.ElementaryStream(
8383
key="cea-stream0",
84-
# The following doesn't work because "mapping" is a reserved
85-
# argument name in GCP python client libraries (see
86-
# https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447):
87-
#
88-
# text_stream=transcoder_v1.types.TextStream(
89-
# codec="cea608",
90-
# mapping=[
91-
# transcoder_v1.types.TextStream.TextMapping(
92-
# atom_key="atom0",
93-
# input_key="caption-input0",
94-
# input_track=0,
95-
# ),
96-
# ],
97-
# ),
98-
# Use a python dictionary as a workaround:
99-
text_stream={
100-
"codec": "cea608",
101-
"mapping": [
102-
{
103-
"atom_key": "atom0",
104-
"input_key": "caption-input0",
105-
"input_track": 0,
106-
}
84+
text_stream=transcoder_v1.types.TextStream(
85+
codec="cea608",
86+
mapping_=[
87+
transcoder_v1.types.TextStream.TextMapping(
88+
atom_key="atom0", input_key="caption-input0", input_track=0,
89+
),
10790
],
108-
},
91+
),
10992
),
11093
],
11194
mux_streams=[

samples/snippets/create_job_with_standalone_captions.py

+7-24
Original file line numberDiff line numberDiff line change
@@ -82,31 +82,14 @@ def create_job_with_standalone_captions(
8282
),
8383
transcoder_v1.types.ElementaryStream(
8484
key="vtt-stream0",
85-
# The following doesn't work because "mapping" is a reserved
86-
# argument name in GCP python client libraries (see
87-
# https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447):
88-
#
89-
# text_stream=transcoder_v1.types.TextStream(
90-
# codec="webvtt",
91-
# mapping=[
92-
# transcoder_v1.types.TextStream.TextMapping(
93-
# atom_key="atom0",
94-
# input_key="caption-input0",
95-
# input_track=0,
96-
# ),
97-
# ],
98-
# ),
99-
# Use a python dictionary as a workaround:
100-
text_stream={
101-
"codec": "webvtt",
102-
"mapping": [
103-
{
104-
"atom_key": "atom0",
105-
"input_key": "caption-input0",
106-
"input_track": 0,
107-
}
85+
text_stream=transcoder_v1.types.TextStream(
86+
codec="webvtt",
87+
mapping_=[
88+
transcoder_v1.types.TextStream.TextMapping(
89+
atom_key="atom0", input_key="caption-input0", input_track=0,
90+
),
10891
],
109-
},
92+
),
11093
),
11194
],
11295
mux_streams=[

0 commit comments

Comments
 (0)