[Ffmpeg-devel] privatizing FifoBuffer into libavutil

Roman Shaposhnik rvs
Thu Sep 14 06:14:06 CEST 2006


Hi

On Tue, 2006-09-12 at 20:38 +0200, Michael Niedermayer wrote:
> >   so that put_buffer() would become:
> >       
> >       fifo_transfer(f, size, put_buffer, pb);
> > 
> >   and so on ?
> 
> sadly memcpy() doesnt fit in as the buf+=len cant be done

  I was really thinking along the lines of wrapping memcpy()
in a "thunk" that would do += but I think that's less than
an ideal solution.

> iam also against the name fifo_transfer() as its not obvious if its a read
> or write
> except that i like the idea
> maybe a 
> fifo_read(f, size, put_buffer, pb);
> and
> fifo_read(f, size, NULL, buf); 
> for the memcpy()
> 
> would be one possibility

  indeed. but pushing this complexity onto consumer might not
be the best case scenario (it sort of strikes me as 
exposing the rptr which we agree we shouldn't do it
and also the NULL doesn't really hint at memcpy() at any way). 
So how about if I leave fifo_read as it is, but instead of 
a put_buffer would introduce the generic read (I can even call it
'fifo_generic_read'). Internally we might actually have
the common "body" implementing both of them but at the
API level there'll be two: fifo_read and fifo_generic_read.

Thanks,
Roman.





More information about the ffmpeg-devel mailing list