FS#8374 - Fully frame-accurate seekable playback engine for mpegplayer

Attached to Project: Rockbox
Opened by Michael Sevakis (MikeS) - Wednesday, 26 December 2007, 14:51 GMT
Last edited by Michael Sevakis (MikeS) - Saturday, 29 December 2007, 20:25 GMT
Task Type Patches
Category Video
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This implements a playback engine with frame-accurate seeking for mpegplayer (in all streams). The UI portion for seeking during playback is not included (that's the next step after a commit) but the underlying machinery will do that. The time resolution of the current resume screen is now 1-second with 1-minute coarse browsing available on all targets.

Startup and resume should be much faster since the disk buffer is implemented as a direct-mapped file cache for random access. Addition of the UI will be rather simple with the drawing of rotated text on portrait displays being the most difficult aspect but doable.

To note: Encode with frequent GOPs (1 second or less which is the usual case). These are the random access units and guarantee a keypoint for random access. Encoding with GOPs 100s of pictures long (I have files from someone that are encoded this way) is never a good idea if you want rapid random access to a particular point in the file. Right now it doesn't give up trying to find GOPs if they're too far away. Whether that matters very much definitely depends on processor power since winding a couple-hundred frames from a keypoint to the proper frame really doesn't matter much on a gigabeat. :) That's tweakable later anyway.

Poke at it and do tell...I want to commit soon. Minor tweaks aren't the concern here. I'd like to unload it before doing deeper stuff.

EDIT: I do need to straigten out the Copyright parts in the headers. I just pasted mine in all the new files just to have the Rockbox header.
This task depends upon

Closed by  Michael Sevakis (MikeS)
Saturday, 29 December 2007, 20:25 GMT
Reason for closing:  Out of Date
Additional comments about closing:  Further updated patch added to SVN. Final work to make seeking fully useable to begin soon.
Comment by Michael Sevakis (MikeS) - Wednesday, 26 December 2007, 20:12 GMT
V2 - forgot svn add on a file. I hope that's all of them :)
Comment by Michael Sevakis (MikeS) - Friday, 28 December 2007, 03:23 GMT
Add some support for mpv and m2v elementary video stream files since there's not much to it. Seeking is not enabled for them since no time information exists and I'm not sure if a 0-100% mode would work nicely or not. To get time info a full file scan is needed which could be annoying. No big deal for now.