Skip to content
Discussion options

You must be logged in to vote

You can and should share Inputs and InputTracks as much as possible. Sharing the Input means you'll share the underlying Source and its caching mechanism, meaning writes from different places will hit the same cache. Generally, for each input media file, it's best to just have one Input for it around to maximize caching and reuse.

For reading, you can also share Sinks since they're not really stateful, they're more just namespaces for media data accessors. The only thing stateful are the things the sink returns, like the iterators. Those you should create one per usage, unless you wanna really optimize things and use the same decoder to drive multiple tracks - however, this only works if …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by thurinus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants