[Ffmpeg-devel] Eliminating some memcpy() & memory allocationsfrom the v4l2 input (original) (raw)

Luca Abeni lucabe72
Thu Feb 2 10:31:17 CET 2006


Hi Michael,

On Wed, 2006-02-01 at 17:12 +0100, Michael Niedermayer wrote: [...]

> > VIDIOCQBUF will be called only when libavformat does not > > need the packet anymore, and I am planning to use the destruct() > > method > > of AVPacket for this. Does this usage of AVPacket (and of its > > destruct() > > method) make sense?

yes Thanks for confirming

> Or am I misunderstanding its purpose? > > You could add some args to avnewpacket(),

no not without forking :) Of course I do not want to fork :) My goal is to implement this feature without modifying the libavformat infrastructure.

> or an extended version > like: > avnewpacketdest(void *data, void (*destruct)(void *, void *), void * > cookie); > > and keep the cookie in AVPacket, then call destruct() with both data > and cookie. > So you can pass the fd to ioctl() in the cookie.

well, yes thats possible but why would we want that extra layer? is there some advatge i dont see? I guess Fran?ois does not like these parts of my patch:

This was just a quick hack to get things working in a short time.

Or do you think it is better to define a struct buffer_descriptor{ int fd; int index; }; and to use pkt->priv as a pointer to it?

        Thanks,
            Luca

-- _____________________________________________________________________________ Copy this in your signature, if you think it is important: N O W A R ! ! !

Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor: Vinci con Suzi Wan: sfida la sorte, in palio ben 2 wok al giorno!

* Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4722&d=2-2



More information about the ffmpeg-devel mailing list