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

Move stream options and frame output structs to dedicated headers #620

Merged
merged 6 commits into from
Apr 7, 2025

Conversation

dvrogozh
Copy link
Contributor

@dvrogozh dvrogozh commented Apr 4, 2025

Fixes: #618

Commit moves stream options and frame output structs to dedicated headers:

  • Frame.h now defines FrameOutput, FrameBatchOutput and AudioFrameOutput
  • Stream.h now defines VideoStreamOptions, AudioStreamOptions, StreamMetadata and ContainerMetadata

Commit also resolves circular dependency between DeviceInterface.h and SingleStreamDecoder.h, forward declaration of class DeviceInterface no longer needed.

CC: @scotts, @NicolasHug


std::optional<int> sampleRate;
};

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the PR @dvrogozh . Was it necessary to move the StreamMetadata and ContainerMetadata classes into this new header?
If yes, then I'd suggest moving them into their own metadata.h header
If not, then it might be best to leave them in the SingleStreamDecoder files

In both cases, I'd also suggest to rename Stream.h into just StreamOptions.h since this file should only contain option-related structs.

Otherwise, this PR LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed with @NicolasHug - if we need to move the metadata definitions, let's put them in their own file. If we don't need to, let's leave them be for now. And also agreed on naming.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the last update I've pushed:

  • Stream.h renamed to StreamOptions.h
  • Created Medata.h to hold StreamMetadata and ContainerMetadata

@NicolasHug , @scotts : The reason why I moved metadata to header was that StreamMetadata is used by FrameBatchOutput which I also moved:

explicit FrameBatchOutput(
int64_t numFrames,
const VideoStreamOptions& videoStreamOptions,
const StreamMetadata& streamMetadata);

That being said, note that I moved ContainerMetadata only for consistency - it's not used by any of the structures we really need to be in headers. Let me know if you want to avoid moving ContainerMetadata. Also, if we don't want to separately expose FrameBatchOutput we can avoid moving metadata to separate header entirely.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dvrogozh, looks good, thanks for cleaning this up!

@scotts scotts merged commit 5402e7d into pytorch:main Apr 7, 2025
46 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.

Move stream options and frame output structs to dedicated header(s)
4 participants