Commit graph

10 commits

Author SHA1 Message Date
Zaggy1024
bd1c9aedbc LibMedia: Only set data provider error state from the decoding thread
...and use that assumption to avoid locking when checking if we're in
that state.
2025-12-03 12:20:49 -06:00
Zaggy1024
2bd541c70c LibMedia: Keep data providers suspended until they are active
This allows us to avoid waiting on the condition variable for the error
handler to be set when an error occurs.
2025-12-03 12:20:49 -06:00
Zaggy1024
8bfaae473d LibMedia: Use only the ThreadData::wake() function in data providers 2025-12-03 12:20:49 -06:00
Zaggy1024
40d1f42418 LibMedia: Keep data providers' ThreadDatas alive in deferred_invoke
We need strong references to the thread data in order to prevent a UAF
when, for example, a seek starts as GC is destroying a media element.
2025-11-21 10:28:01 -06:00
Zaggy1024
9037f4e832 LibMedia: Signal EOF to decoders in the data providers
This lets the FFmpeg H.264 decoder know when we've reached the end of
the available data, so that it will output the remaining buffered video
frames.

Not sure why it needs this signal to output the buffered frames, but
surely there's a good reason. :^)
2025-11-05 18:40:02 +01:00
Zaggy1024
634e5ff491 LibMedia: Move CICP values from CodedFrame to Track
All our current demuxers have these constant for an entire track, so we
don't need to get them for every frame we output.
2025-11-05 18:40:02 +01:00
Zaggy1024
6f0d7f1caf LibMedia: Don't lock while calling data providers' seeking handlers
We already take locks for the important parts of the data providers'
handle_seek methods, but holding the lock for the entire duration of
the method call prevents cancelling a seek. With this change, locks are
only only held in the thread's loops when updating the loop conditions
and waiting, allowing the seek ID to increase during a seek.
2025-11-03 16:39:24 -06:00
Zaggy1024
ccf4b3f6e9 LibMedia: Implement media seeking
This implementation allows:
- Accurate seeking to an exact timestamp
- Seeking to the keyframe before a timestamp
- Seeking to the keyframe after a timestamp
These three options will be used to satisfy the playback position
selection in the media element's seeking steps.
2025-10-27 17:28:49 -07:00
Zaggy1024
9117f661a8 LibMedia: Split some repeated code in VideoDataProvider to functions 2025-10-27 17:28:49 -07:00
Zaggy1024
7e238cd724 LibMedia: Add separate classes managing decoding and displaying video
These are unused in this commit, but will later be used to output video
via PlaybackManager, or to decode video directly to some consumer.
2025-10-27 17:28:49 -07:00