[annodex-dev] Proposal for prebuffering of videos in the Annodex
Plugin
Shane Stephens
shane.stephens at gmail.com
Thu Oct 25 18:51:22 PDT 2007
Hi all,
A little while ago, Michael Dale asked about the possibility of
pre-buffering of media in the Annodex Plugin's playlist. There's two
possible uses that I can think of:
(1) While the movie at position 'm' is being played, the movie at position
'm+1' is preloaded, so that the transition between the two movies is
perfectly smooth.
(2) A javascript interface that allows HTML pages to request a particular
playlist item be preloaded, and also allows HTML pages to query whether each
playlist item is preloaded already.
So, first question: anyone have any other features that they'd like to see
supported with regards to pre-buffering?
One potential problem with pre-buffering is that if the current video is
being downloaded at not much more than the required data rate to provide
smooth playback, then starting to download an additional video might reduce
the data rate of the first one to below the smooth playback threshold, which
would be a Bad Thing to have happen automatically.
Hence, I've made a list of potential code changes that would only start
pre-buffering the video after the currently playing one in a playlist
automatically, and only after the currently playing video has finished
downloading (videos are downloaded and stored in a local temporary file in
disk, often well in advance of actual decoding if bandwidth is good). On
top of this, a javascript interface will allow additional pre-buffer
requests and status checks.
Second question: can anyone see any other potential gotchas here?
Final question: any other ideas / suggestions / etc?
----------------------------
Here's the code change list:
(1) add a method
int reader_finished_retrieving(Reader *reader);
which returns FALSE if the reader is still fetching data, and TRUE if all
data is now local. FileReader implementations should always return TRUE.
(2) expose this method to the oggplay interface, to allow querying from e.g.
the plugin, as
int oggplay_media_finished_retrieving(OggPlay *oggplay);
(3) Use oggplay_media_finished_retrieving within the plugin's decode loop
(once per frame decoded, in plugin_oggplay.c), and indicate completion to
the plugin class in plugin.cpp
(4) When plugin.cpp is notified that an oggplay instance has finished
downloading, then it can start the next instance. This will require a
vector of oggplay instances which is manipulated at the same time as the
vector representing the playlist.
(5) When the movie changes (for whatever reason) the oggplay preloaded
instances vector is checked first, before a new oggplay instance is created.
(6) Add a function to the javascript interface of the plugin which allows
additional prebuffering to be requested on any movie in the playlist.
(7) Add a function to the javascript interface of the plugin which allows
the prebuffering status of any movie in the playlist to be queried.
------------------------
Cheers,
-Shane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/annodex-dev/attachments/20071026/6627e42d/attachment.htm
More information about the annodex-dev
mailing list