mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
LibVideo: Implement accurate seeking to inter frames in PlaybackManager
This implements the PlaybackManager portion of seeking, so that it can seek to any frame in the video by dropping all preceding frames until it reaches the seek point. MatroskaDemuxer currently will only seek to the start of the video. That means that every seek has to drop all the frames until it comes across the target timestamp.
This commit is contained in:
parent
9a9fe08449
commit
5c2cede2c9
3 changed files with 65 additions and 24 deletions
|
@ -53,15 +53,13 @@ DecoderErrorOr<MatroskaDemuxer::TrackStatus*> MatroskaDemuxer::get_track_status(
|
|||
return &m_track_statuses.get(track).release_value();
|
||||
}
|
||||
|
||||
DecoderErrorOr<void> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, Time timestamp)
|
||||
DecoderErrorOr<void> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, Time)
|
||||
{
|
||||
if (timestamp.is_zero()) {
|
||||
// Removing the track status will cause us to start from the beginning.
|
||||
m_track_statuses.remove(track);
|
||||
return {};
|
||||
}
|
||||
|
||||
return DecoderError::not_implemented();
|
||||
// Removing the track status will cause us to start from the beginning.
|
||||
// FIXME: We just go back to the beginning always, so that the PlaybackManager seeking
|
||||
// technology can be tested.
|
||||
m_track_statuses.remove(track);
|
||||
return {};
|
||||
}
|
||||
|
||||
DecoderErrorOr<NonnullOwnPtr<Sample>> MatroskaDemuxer::get_next_sample_for_track(Track track)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue