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

Michael Niedermayer michaelni at gmx.at
Mon Jul 18 01:57:45 CEST 2011


On Sat, Jul 16, 2011 at 10:25:58AM +0200, Stefano Sabatini wrote:
> 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.

>  doc/APIchanges      |    3 +++
>  libavformat/dvenc.c |    4 ++--
>  libavutil/avutil.h  |    3 +++
>  libavutil/fifo.h    |   30 +++++++++++++++++++++++++++---
>  4 files changed, 35 insertions(+), 5 deletions(-)
> 7b8a087c888ac40e4191bbf77a9d63fb5a524555  0001-fifo-add-av_fifo_peek2-and-deprecate-av_fifo_peek.patch
> From 8c3618c4c65be777a2a3769e3c235b7510489cd0 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(), and deprecate av_fifo_peek()
> 
> The new function provides a more generic interface than av_fifo_peek()
> for peeking at a FIFO buffer data.

LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110718/f14afe6c/attachment.asc>


More information about the ffmpeg-devel mailing list