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

Remove streamType field from DecodedOutput #457

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Jan 20, 2025

We pretend to support other types than AVMEDIA_TYPE_VIDEO with this field, but this is a lie. We have strong baked-in assumptions everywhere that we currently only support video frames. The main indicator is that we don't allow to add a stream that's not a video stream.

Since we'll be tackling audio support soon, I think it's best to remove any relics from the past, since the code-base has evolved in ways that may now be incompatible with how we projected things at the time. Or, said differently, we don't want our design of audio support to be influenced by code we wrote 6 months ago.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 20, 2025
frameFormat,
expectedOutputWidth,
expectedOutputHeight};
// We need to compare the current frame context with our previous frame
Copy link
Member Author

Choose a reason for hiding this comment

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

Diff looks bigger than it actually is because this block got indented to the left.

@@ -869,7 +869,6 @@ VideoDecoder::DecodedOutput VideoDecoder::convertAVFrameToDecodedOutput(
AVFrame* frame = rawOutput.frame.get();
output.streamIndex = streamIndex;
auto& streamInfo = streams_[streamIndex];
output.streamType = streams_[streamIndex].stream->codecpar->codec_type;
Copy link
Contributor

Choose a reason for hiding this comment

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

I do think there is some value in doing a TORCH_CHECK(streamInfo.stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) here or close by to make our assumptions explicit.

@NicolasHug NicolasHug merged commit b1719e7 into pytorch:main Jan 21, 2025
31 checks passed
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.

3 participants