Skip to content

Commit

Permalink
docs(samples): update samples to use mapping_ attribute of AudioStream (
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
irataxy and gcf-owl-bot[bot] authored Feb 24, 2022
1 parent 9b83f93 commit 25de789
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,14 @@ def create_job_with_embedded_captions(
),
transcoder_v1.types.ElementaryStream(
key="cea-stream0",
# The following doesn't work because "mapping" is a reserved
# argument name in GCP python client libraries (see
# https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447):
#
# text_stream=transcoder_v1.types.TextStream(
# codec="cea608",
# mapping=[
# transcoder_v1.types.TextStream.TextMapping(
# atom_key="atom0",
# input_key="caption-input0",
# input_track=0,
# ),
# ],
# ),
# Use a python dictionary as a workaround:
text_stream={
"codec": "cea608",
"mapping": [
{
"atom_key": "atom0",
"input_key": "caption-input0",
"input_track": 0,
}
text_stream=transcoder_v1.types.TextStream(
codec="cea608",
mapping_=[
transcoder_v1.types.TextStream.TextMapping(
atom_key="atom0", input_key="caption-input0", input_track=0,
),
],
},
),
),
],
mux_streams=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,14 @@ def create_job_with_standalone_captions(
),
transcoder_v1.types.ElementaryStream(
key="vtt-stream0",
# The following doesn't work because "mapping" is a reserved
# argument name in GCP python client libraries (see
# https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447):
#
# text_stream=transcoder_v1.types.TextStream(
# codec="webvtt",
# mapping=[
# transcoder_v1.types.TextStream.TextMapping(
# atom_key="atom0",
# input_key="caption-input0",
# input_track=0,
# ),
# ],
# ),
# Use a python dictionary as a workaround:
text_stream={
"codec": "webvtt",
"mapping": [
{
"atom_key": "atom0",
"input_key": "caption-input0",
"input_track": 0,
}
text_stream=transcoder_v1.types.TextStream(
codec="webvtt",
mapping_=[
transcoder_v1.types.TextStream.TextMapping(
atom_key="atom0", input_key="caption-input0", input_track=0,
),
],
},
),
),
],
mux_streams=[
Expand Down

0 comments on commit 25de789

Please sign in to comment.