expose try_read_decoded_frame to help with real-time use cases #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hey guys, I have a simple use case where I want to pass
XcoderDecoder
a buffer that is actually a ring buffer (rtrb in this case) rather than aVec
so that I can add frames to the decoder from another thread (eg to support real-time scaling of a live broadcast)That all works with no library changes due to the flexible iterable trait on the frames input: https://github.com/wavey-ai/xcoder-queue/blob/main/src/lib.rs
But it requires
try_read_decoded_frame
to be public so the decoder can be saturated with enough initial frames without blocking the producer:also, I had to make
mod linux_imp
public to be able to accessXcoderPixelFormat
in the test (and eventually will be needed in the prod code that uses av-rs) but I feel I may be doing something wrong, there.(I've tested this tweaked approach with NetINT Quadra on their demo server and its working well, produces a scaled, playable h264 with the decorder+scaler interleaving output frames as I add them to the decoder)