After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652957 - ff-load: Needs to be updated to new ffmpeg/avutils API
ff-load: Needs to be updated to new ffmpeg/avutils API
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: build
git master
Other Linux
: Normal blocker
: ---
Assigned To: Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2011-06-19 19:33 UTC by Marcel
Modified: 2011-10-02 19:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch ff-load.c to comply to new libavutil API (1.17 KB, patch)
2011-09-06 13:30 UTC, Marcel
rejected Details | Review
Revised patch to allow building against ffmpeg versions 52 & 53 (1.35 KB, patch)
2011-09-22 21:37 UTC, David Evans
committed Details | Review

Description Marcel 2011-06-19 19:33:00 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.
Comment 1 André Klapper 2011-06-19 19:55:46 UTC
Which distro is this about/on?
Also see https://bugs.gentoo.org/show_bug.cgi?id=365433
Comment 2 Jon Nordby 2011-06-19 20:11:15 UTC
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.
Comment 3 Marcel 2011-06-21 15:17:39 UTC
@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
Comment 4 Marcel 2011-08-09 11:49:51 UTC
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
Comment 5 Jon Nordby 2011-09-03 17:38:22 UTC
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.
Comment 6 Jon Nordby 2011-09-03 17:49:51 UTC
Problem occurs with ffmpeg 0.7+
Comment 7 Marcel 2011-09-06 13:30:56 UTC
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
Comment 8 David Evans 2011-09-22 21:37:13 UTC
Created attachment 197296 [details] [review]
Revised patch to allow building against ffmpeg versions 52 & 53
Comment 9 David Evans 2011-09-22 21:41:21 UTC
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.
Comment 10 Jon Nordby 2011-10-02 19:09:19 UTC
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.
Comment 11 Jon Nordby 2011-10-02 19:10:49 UTC
Review of attachment 195782 [details] [review]:

Obsoleted by attachment #197296 [details]