[vlc-devel] [RFC] Get delta of last and first picture in a picture_fifo.
fenrir at elivagar.org
Thu May 10 22:04:31 CEST 2012
On Thu, May 10, 2012 at 09:23:13PM +0200, Jean-Paul Saman wrote:
> Dear VLC developers,
> The attached 2 patches provide a solution for limiting the growth of a
> picture_fifo. Please review.
> Patch 0001-* provides the function picture_fifo_GetDeltaDate() that
> returns the amount of time worth of pictures is in the given fifo.
> It calculates this by giving the difference in time between the last
> and first picture.
> The second patch 0002- shows how this new function can be used.
For the scene.c filter, if the goal of the thread is to hide
the latency of writing the data by taking advantage that only
a subset of pictures are written, I think a simpler and more
efficient way to prevent the growth of the fifo, is to use a
picture_pool of a few pictures. This way, limiting the amount
of pictures is done by the pool, and it avoids repeated huge
If you prefer the time limit, then it is simpler/faster IMHO
to use picture_fifo_Peek() and check the limit before pushing
into the pool (picture_fifo_Peek does a safe hold() for you).
More information about the vlc-devel