GNOME Bugzilla – Bug 789379
wrong ffmpeg headers used during compilation
Last modified: 2018-01-13 12:20:42 UTC
When user defines include path in CPPFLAGS and upstream ffmpeg is installed in that path, then gst-ffmpeg includes wrong ffmpeg header files for ext/libav plugin compilation when configured to use internal ffmpeg (i.e. it uses the headers from CPPFLAGS path). As of today, the upstream ffmpeg headers are not compatible with gst-ffmpeg and this causes compilation failure. The gcc command line that gets generated by autotools ends up like (assuming CPPFLAGS=-I/opt/local/include): libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -I ../../gst-libs/ext/libav -I ../../gst-libs/ext/libav -Wno-deprecated-declarations ... Instead, it should be something like: libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I ../../gst-libs/ext/libav -I ../../gst-libs/ext/libav -I/opt/local/include -Wno-deprecated-declarations
Created attachment 362127 [details] [review] Fix for internal ffmpeg include path ordering
I guess it should do things differently depending on whether it is compiling against the internal gst-ffmpeg snapshot or an installed one? > As of today, the upstream ffmpeg headers are not compatible > with gst-ffmpeg and this causes compilation failure. How do you mean? Our internal ffmpeg snapshot is 'upstream ffmpeg', no?
(In reply to Tim-Philipp Müller from comment #2) > I guess it should do things differently depending on whether it is compiling > against the internal gst-ffmpeg snapshot or an installed one? > Yes, it already does. Except if you want to compile against internal snapshot, it doesn't work if you already have one installed. That is what this bug is reporting. And the patch fixes that. > > > As of today, the upstream ffmpeg headers are not compatible > > with gst-ffmpeg and this causes compilation failure. > > How do you mean? Our internal ffmpeg snapshot is 'upstream ffmpeg', no? Right. But it's not always the latest. At the time of writing, gst-ffmpeg did not compile against ffmpeg master ToT.
Thanks for the patch! commit 7a951369c7f7b3c16c4c4555e0df9f5ee693fc38 (HEAD -> master) Author: U. Artie Eoff <ullysses.a.eoff@intel.com> Date: Mon Oct 23 19:35:31 2017 -0700 libav: use LIBAV_CPPFLAGS for -I include paths Autotools automatically appends user CPPFLAGS after target CPPFLAGS. Also, it puts all CPPFLAGS before CFLAGS in final generated gcc compile command. The internal ffmpeg include paths need to come before any other external include paths to ensure we don't accidentally pickup external ffmpeg headers first (i.e. from user CPPFLAGS include paths). Thus, move the internal LIBAV include paths to LIBAV_CPPFLAGS so that they come before any user defined CPPFLAGS. This allows ffmpeg and gst-ffmpeg to coexist on users system. https://bugzilla.gnome.org/show_bug.cgi?id=789379