[FFmpeg-devel] [libav-devel] [PATCH] fifo: add av_fifo_peek2()

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat Jul 16 10:25:58 CEST 2011


On date Saturday 2011-07-16 01:33:12 +0200, Stefano Sabatini encoded:
> On date Friday 2011-07-15 16:32:52 +0200, Michael Niedermayer encoded:
> > On Thu, Jul 14, 2011 at 12:18:49AM +0200, Stefano Sabatini wrote:
[...]
> > > > From 2ec24f2f0c79414edfd558f3c55b7d7969018912 Mon Sep 17 00:00:00 2001
> > > > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > > > Date: Wed, 29 Jun 2011 17:30:23 +0200
> > > > Subject: [PATCH] fifo: add av_fifo_peek2()
> > > > 
> > > > The new function provides a more generic interface than av_fifo_peek()
> > > > for peeking at a FIFO buffer data.
> > > > ---
> > > >  libavutil/fifo.h |   21 +++++++++++++++++++++
> > > >  1 files changed, 21 insertions(+), 0 deletions(-)
> > > 
> > > Ping.
> > 
> > I still think the % are a bad idea, they probably make the code 10
> > times slower ...
> > and in what use case would they be needed ?
> 
> Possibly none, I thought it could be useful to return a pointer to the
> buffer rather than NULL, without considering performance issues. I'll
> update the patch accordingly.

Patches updated.

I dropped the "circular buffer" idea due to the use of the module
operator, I'm still keeping support to negative offsets although the
same could be achieved with av_fifo_peek2(fifo, size - offs), but it
may slightly simplify the code use in some situations and with almost
no performance hits.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fifo-add-av_fifo_peek2-and-deprecate-av_fifo_peek.patch
Type: text/x-diff
Size: 3642 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110716/ba9c23c9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-fifo-add-FIFO-API-test-program-and-fate-test.patch
Type: text/x-diff
Size: 2936 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110716/ba9c23c9/attachment-0001.bin>


More information about the ffmpeg-devel mailing list