Skip to content

Consolidate addstream to solve issue 1064#1240

Draft
zy1git wants to merge 2 commits intometa-pytorch:mainfrom
zy1git:consolidate-addstream-1064
Draft

Consolidate addstream to solve issue 1064#1240
zy1git wants to merge 2 commits intometa-pytorch:mainfrom
zy1git:consolidate-addstream-1064

Conversation

@zy1git
Copy link

@zy1git zy1git commented Feb 13, 2026

This commit consolidates the two-step API (create decoder + add audio stream) into a single constructor call for AudioDecoder. Previously, creating an AudioDecoder required two separate C++ calls: first creating the decoder, then adding the audio stream. Now this is done in one consolidated operation.

As for the video decoder, we need to get metadata (to obtain height and width) and compute transform_specs using metadata.height and metadata.width between the create decoder and add audio stream ( see this code chunk), so it is hard to implement. Will continue implementing that.

Please correct me if I misunderstand anything.

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 13, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1240

Note: Links to docs will display an error until the docs builds have been completed.

❌ 27 New Failures

As of commit 649bf41 with merge base 85d1dad (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 13, 2026
@zy1git zy1git marked this pull request as draft February 13, 2026 10:30
Comment on lines +64 to +70
# Use consolidated function that creates decoder and adds audio stream in one call
self._decoder = create_audio_decoder(
source=source,
seek_mode="approximate",
stream_index=stream_index,
sample_rate=sample_rate,
num_channels=num_channels,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is to combine create decoder and add stream into one call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant