GNOME Bugzilla – Bug 652957
ff-load: Needs to be updated to new ffmpeg/avutils API
Last modified: 2011-10-02 19:11:17 UTC
During `make` I get these error messages: CC ff_load_la-ff-load.lo ff-load.c: In function 'print_error': ff-load.c:72:10: error: 'AVERROR_NUMEXPECTED' undeclared (first use in this function) ff-load.c:72:10: note: each undeclared identifier is reported only once for each function it appears in ff-load.c:82:10: error: 'AVERROR_NOFMT' undeclared (first use in this function) ff-load.c: In function 'prepare': ff-load.c:281:32: error: 'CODEC_TYPE_VIDEO' undeclared (first use in this function) make[3]: *** [ff_load_la-ff-load.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory `/home/mk/aur/gegl-git/src/gegl-build/operations/external' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/mk/aur/gegl-git/src/gegl-build/operations' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/mk/aur/gegl-git/src/gegl-build' make: *** [all] Error 2 A grep revealed that these constants indeed only appear once, within ff-load.c. I would expect them to be inside one of the #included .h-files, but although the system-wide ones are available and AFAIK not updated recently, I can't find them.
Which distro is this about/on? Also see https://bugs.gentoo.org/show_bug.cgi?id=365433
Please always provide the SHA id of the commit you're compiling when reporting bugs against git master. These constants should be provided by headers in libavutil. Use 'grep -rn grep -rn "AVERROR_NOFMT\|AVERROR_NUMEXPECTED" /usr/include/' to verify that they exist. If they do exist, run 'make V=1', look at the command used to compile and find out why the headers included in ff-load does not include the header that defines these constants.
@André: it's on Arch Linux, but it turned out this isn't a distro-specific issue. @Jon: the id is 1305b9615f573ec2818a01fe0dc4fe52dc898c1b. As I said, those constants don't exist, but thanks for pointing at libavutil, which is provided by ffmpeg. I also use git versions of ffmpeg and I see that at least as of May 22, libavutil/error.h doesn't contain these constants anymore. Looking at the history of that file, I notice that several constants were deleted during the last weeks: http://git.videolan.org/?p=ffmpeg.git;a=history;f=libavutil/error.h;h=47d366ebbcb1a82cefeeac2a5ecd920917b00cd8;hb=HEAD
I asked about this problem at the Libav-user ML and got this reply: [1] > Yes API was bumped, that means that backward compatibility can't be > assumed, and we don't support it anymore in master. > > So you have either to update gegl sources (should be rather trivial, > just replace CODEC_TYPE_* -> AVMEDIA_TYPE_*, don't use AVERROR_ > dropped symbols), *or* force a dependency on older versions (libav* <= > X). So I think the GEGL sources should be changed according to the former advice. [1] http://ffmpeg.org/pipermail/libav-user/2011-August/000525.html
Yes, we need to conditionally have that change for newer versions of ffmpeg then. Patches welcomed. Alternatively we could modify the check to disable the ff-load operation with the problematic versions of ffmpeg. Not a long-term solution though.
Problem occurs with ffmpeg 0.7+
Created attachment 195782 [details] [review] patch ff-load.c to comply to new libavutil API Having a further look through FFmpeg's commits, I changed these things: 1) AVERROR_NUMEXPECTED seems to be changed to AVERROR(EINVAL) [1] 2) AVERROR_NOFMT is never returned anymore, fallback to AVERROR_INVALIDDATA [2] 3) CODEC_TYPE_VIDEO → AVMEDIA_TYPE_VIDEO I managed to compile GEGL this way, but as I do not know the internals of GEGL nor Libavutil that well, I'd like someone else to have a look at this (I'm especially unsure about 1)). [1] http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=79157f400bec7fdb6385befa63fdafc727378143 [2] http://git.videolan.org/?p=ffmpeg.git&a=search&h=HEAD&st=commit&s=NOFMT
Created attachment 197296 [details] [review] Revised patch to allow building against ffmpeg versions 52 & 53
Attached patch allows gegl to build against ffmpeg versions 0.7.* and earlier (library version 52) and also versions 0.8.* and later including current git master (library version 53). Currently used with the GEGL port on Macports which I maintain.
Review of attachment 197296 [details] [review]: Committed as http://git.gnome.org/browse/gegl/commit/?id=1dfb44caf66913d90d70e840695f55018538351c. Thanks Marcel and David. In the future, please provide patches as git formatted patches.
Review of attachment 195782 [details] [review]: Obsoleted by attachment #197296 [details]