Bug 255035 - multimedia/ffmpeg: fix build with lensfun option enabled
Summary: multimedia/ffmpeg: fix build with lensfun option enabled
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-13 14:23 UTC by Oleg Sidorkin
Modified: 2021-04-15 19:36 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (multimedia)


Attachments
git diff to make ffmpeg to use lensfun API from the last tagged version (instead of trunk one) (2.61 KB, patch)
2021-04-13 14:23 UTC, Oleg Sidorkin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Sidorkin 2021-04-13 14:23:59 UTC
Created attachment 224083 [details]
git diff to make ffmpeg to use lensfun API from the last tagged version (instead of trunk one)

ffmpeg 4.4 switched to trunk lensfun API that is incompartible with lensfun version from our ports. So build of ffmpeg with lensfun option enabled fails with the following message:
libavfilter/vf_lensfun.c:231:119: error: too few arguments to function call, expected 5, have 3
                lf_modifier_enable_vignetting_correction(lensfun->modifier, lensfun->aperture, lensfun->focus_distance);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                              ^
/usr/local/include/lensfun/lensfun.h:3097:15: note: 'lf_modifier_enable_vignetting_correction' declared here
LF_EXPORT int lf_modifier_enable_vignetting_correction (
              ^
libavfilter/vf_lensfun.c:233:75: error: too few arguments to function call, expected 3, have 1

and others.

The attached patch rollbacks some upstream changes to make ffmpeg buildable again.
This patch is intended to be removed after lensfun upgrade.
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-04-15 19:35:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=eabfea6cac19287dcb343a48d8a35942d8d33d42

commit eabfea6cac19287dcb343a48d8a35942d8d33d42
Author:     Oleg Sidorkin <osidorkin@gmail.com>
AuthorDate: 2021-04-13 14:23:59 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-04-15 19:34:43 +0000

    multimedia/ffmpeg: unbreak LENSFUN=ON after 3d7938b00655

    libavfilter/vf_lensfun.c:229:63: error: too many arguments to function call, expected 5, have 7
                                                       inlink->h, LF_PF_U8, lensfun->reverse);
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/lensfun/lensfun.h:3075:11: note: 'lf_modifier_create' declared here
    LF_EXPORT lfModifier *lf_modifier_create (
              ^
    libavfilter/vf_lensfun.c:231:119: error: too few arguments to function call, expected 5, have 3
                    lf_modifier_enable_vignetting_correction(lensfun->modifier, lensfun->aperture, lensfun->focus_distance);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                              ^
    /usr/local/include/lensfun/lensfun.h:3097:11: note: 'lf_modifier_enable_vignetting_correction' declared here
    LF_EXPORT int lf_modifier_enable_vignetting_correction (
              ^
    libavfilter/vf_lensfun.c:233:75: error: too few arguments to function call, expected 3, have 1
                    lf_modifier_enable_distortion_correction(lensfun->modifier);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ^
    /usr/local/include/lensfun/lensfun.h:3091:11: note: 'lf_modifier_enable_distortion_correction' declared here
    LF_EXPORT int lf_modifier_enable_distortion_correction (lfModifier *modifier, const lfLens* lens, float focal);
              ^
    libavfilter/vf_lensfun.c:234:100: error: too few arguments to function call, expected 4, have 2
                    lf_modifier_enable_projection_transform(lensfun->modifier, lensfun->target_geometry);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                            ^
    /usr/local/include/lensfun/lensfun.h:3101:11: note: 'lf_modifier_enable_projection_transform' declared here
    LF_EXPORT cbool lf_modifier_enable_projection_transform (
              ^
    /usr/local/include/lensfun/lensfun.h:115:15: note: expanded from macro 'cbool'
     #define cbool int
                   ^
    libavfilter/vf_lensfun.c:238:68: error: too few arguments to function call, expected 3, have 1
                    lf_modifier_enable_tca_correction(lensfun->modifier);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ^
    /usr/local/include/lensfun/lensfun.h:3094:11: note: 'lf_modifier_enable_tca_correction' declared here
    LF_EXPORT int lf_modifier_enable_tca_correction (lfModifier *modifier, const lfLens* lens, float focal);
              ^

    PR:             255035

 .../files/patch-libavfilter_vf__lensfun.c (new)    | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)