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

François Revol revol
Wed Feb 1 16:25:58 CET 2006


So, my idea is to avoid dinamically allocating the memory for the packet, and to set pkt->data = . 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? Or am I misunderstanding its purpose?

You could add some args to av_new_packet(), or an extended version like: av_new_packet_dest(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.

Fran?ois.



More information about the ffmpeg-devel mailing list