[Ffmpeg-devel] Patch for testing: remove a memcpy() in v4l2.c

Luca Abeni lucabe72
Tue Feb 13 14:44:27 CET 2007


Hi all,

when reading a frame from the video device, v4l2.c currently allocates a
buffer and copies the frame into it.

The attached patch eliminates the memory copy, by directly passing the
v4l2 buffer in the AVPacket. I tested it on some machines with bt87x
based cards, and it seems to work without problems.
But I'd like other people with different cards and drivers to test this
patch, before committing it.

A little benchmark: before applying the patch,
time ./ffmpeg -y -v 0 -vframes 1200 -s 352x288 -pix_fmt yuv420p -f yuv4mpegpipe /dev/null &> /dev/null
returns
real    0m48.127s
user    0m0.197s
sys     0m0.137s
after applying this patch I get
real    0m48.127s
user    0m0.151s
sys     0m0.012s


			Thanks,
				Luca
-- 
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zerocopy-new-3.diff
Type: text/x-patch
Size: 3102 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070213/66ab324d/attachment.bin>



More information about the ffmpeg-devel mailing list