GNOME Bugzilla – Bug 534390
Patch: use av_picture_copy instead of swscale to copy pictures
Last modified: 2008-05-26 07:38:59 UTC
This patch changes gst-ffmpeg to use av_picture_copy instead of swscale to copy pictures, using swscale to simply copy pictures is way overkill. Note that with this patch the linking of libgstffmpeg.so to libswscale isn't needed anymore AFAIK, so that probably can be removed too. Besides saving the overkill of swscale to simply copy the picture this alsso works around a bug in some version of swscale, which is exposed by using the system ffmpeg on Fedora. Normally I wouldn't dare mentioning the use of a system ffmpeg, but I'm very happy to see system ffmpeg related patches were accepted into 0.10.4 and that 0.10.4 now works well with newer ffmpeg snapshots.
Created attachment 111357 [details] [review] Patch: use av_picture_copy instead of swscale to copy pictures
Does av_picture_copy() handle stride changes?
(In reply to comment #2) > Does av_picture_copy() handle stride changes? > I assume you mean that the source and dest stride are different, yes it handles that, see: http://www.irisa.fr/texmex/people/dufouil/ffmpegdoxy/imgconvert_8c-source.html For the source, where you can clearly see it does.
Great, then your patch(es) look fine. I'll commit them after gst-ffmpeg is unfrozen again...
2008-05-26 Sebastian Dröge <slomo@circular-chaos.org> Patch by: Hans de Goede <j dot w dot r degoede at hhs dot nl> * configure.ac: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_avpicture_fill): * ext/ffmpeg/gstffmpegcodecmap.h: * ext/ffmpeg/gstffmpegdec.c: (get_output_buffer): * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_collected): Use av_picture_copy() instead of libswscale to copy pictures. This removes the swscale dependency and is faster. Fixes bug #534390.