diff mbox

[FFmpeg-devel] Added require fallback for libmfx in the case that pkg-config cannot find libmfx

Message ID 33bc7046-e846-0d24-b6b9-008ef6e76183@aracnet.com
State Superseded
Headers show

Commit Message

Aaron Levinson May 5, 2017, 7:11 a.m. UTC
On 4/19/2017 10:43 AM, Aaron Levinson wrote:
> On 4/14/2017 6:51 PM, Aaron Levinson wrote:
>> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
>> From: Aaron Levinson <alevinsn@aracnet.com>
>> Date: Fri, 14 Apr 2017 18:38:37 -0700
>> Subject: [PATCH] Added require fallback for libmfx in the case that
>>  pkg-config cannot find libmfx
>>
>> Purpose: Added require fallback for libmfx in the case that pkg-config
>> cannot find libmfx.  On Linux, most people likely get libmfx via
>> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
>> well-known way to get libmfx is via the Intel Media SDK, which
>> provides a static build of libmfx.lib and also provides the source
>> code for building libmfx yourself.  If built this way, there are no
>> pkg-config files to be found.  The changes utilize a similar approach
>> to that already done for libx264 in configure.
>>
>> Comments:
>>
>> -- configure: Altered enabled libmfx step to use use_pkg_config()
>>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
>>    falls back to require().  Note that the reason that require() is
>>    passed -llibmfx as the last argument, instead of -lmfx, is the file
>>    name for the library produced from the Intel Media SDK starts with
>>    "libmfx".  Apparently, the filename for the library produced via
>>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
>> ---
>>  configure | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 3bea057..b20a0b4 100755
>> --- a/configure
>> +++ b/configure
>> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
>> "gsm.h" "gsm/gsm.h"; do
>>                                 done || die "ERROR: libgsm not found"; }
>>  enabled libilbc           && require libilbc ilbc.h
>> WebRtcIlbcfix_InitDecode -lilbc
>>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
>> kvazaar.h kvz_api_get
>> -enabled libmfx            && require_pkg_config libmfx
>> "mfx/mfxvideo.h" MFXInit
>> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
>> MFXInit ||
>> +                               { require libmfx "mfx/mfxvideo.h"
>> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
>>  enabled libmodplug        && require_pkg_config libmodplug
>> libmodplug/modplug.h ModPlug_Load
>>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
>> lame/lame.h lame_set_VBR_quality -lmp3lame
>>  enabled libnut            && require libnut libnut.h nut_demuxer_init
>> -lnut
>>
> 
> Pinging this patch submission again.
> 
> Thanks,
> Aaron Levinson

And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264, I don't see why there would be any issue with it being applied to libmfx as well.  Here's a new version of this patch with some of the text altered slightly.

Thanks,
Aaron Levinson

----------------------------------------------------------------------

From aa427b09435eb99de6b308d32f066fbca71e4b18 Mon Sep 17 00:00:00 2001
From: Aaron Levinson <alevinsn@aracnet.com>
Date: Fri, 5 May 2017 00:06:42 -0700
Subject: [PATCH] configure:  Added require fallback for libmfx

Purpose: Added require fallback for libmfx in the case that pkg-config
cannot find libmfx.  On Linux, most people likely get libmfx via
https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
well-known way to get libmfx is via the Intel Media SDK, which
provides a static build of libmfx.lib and also provides the source
code for building libmfx yourself.  If built this way, there are no
pkg-config files to be found.  The changes utilize a similar approach
to that already done for libx264 in configure.

Comments:

-- configure: Altered enabled libmfx step to use use_pkg_config()
   instead of require_pkg_config(), and, if use_pkg_config() fails, it
   falls back to require().  Note that the reason that require() is
   passed -llibmfx as the last argument, instead of -lmfx, is the file
   name for the library produced from the Intel Media SDK starts with
   "libmfx".  Apparently, the filename for the library produced via
   https://github.com/lu-zero/mfx_dispatch starts with "mfx".

Signed-off-by: Aaron Levinson <alevinsn@aracnet.com>
---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Carl Eugen Hoyos May 5, 2017, 7:22 a.m. UTC | #1
2017-05-05 9:11 GMT+02:00 Aaron Levinson <alevinsn@aracnet.com>:

> And again.  This patch is pretty straightforward, and considering that
> this approach was deemed suitable for libx264, I don't see why there
> would be any issue with it being applied to libmfx as well.

That's exactly what I thought when it was denied for libx265 and
libspeex (where this was a user-reported regression).

Carl Eugen
Clément Bœsch May 5, 2017, 7:42 a.m. UTC | #2
On Fri, May 05, 2017 at 12:11:27AM -0700, Aaron Levinson wrote:
> On 4/19/2017 10:43 AM, Aaron Levinson wrote:
> > On 4/14/2017 6:51 PM, Aaron Levinson wrote:
> >> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
> >> From: Aaron Levinson <alevinsn@aracnet.com>
> >> Date: Fri, 14 Apr 2017 18:38:37 -0700
> >> Subject: [PATCH] Added require fallback for libmfx in the case that
> >>  pkg-config cannot find libmfx
> >>
> >> Purpose: Added require fallback for libmfx in the case that pkg-config
> >> cannot find libmfx.  On Linux, most people likely get libmfx via
> >> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
> >> well-known way to get libmfx is via the Intel Media SDK, which
> >> provides a static build of libmfx.lib and also provides the source
> >> code for building libmfx yourself.  If built this way, there are no
> >> pkg-config files to be found.  The changes utilize a similar approach
> >> to that already done for libx264 in configure.
> >>
> >> Comments:
> >>
> >> -- configure: Altered enabled libmfx step to use use_pkg_config()
> >>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
> >>    falls back to require().  Note that the reason that require() is
> >>    passed -llibmfx as the last argument, instead of -lmfx, is the file
> >>    name for the library produced from the Intel Media SDK starts with
> >>    "libmfx".  Apparently, the filename for the library produced via
> >>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
> >> ---
> >>  configure | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/configure b/configure
> >> index 3bea057..b20a0b4 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
> >> "gsm.h" "gsm/gsm.h"; do
> >>                                 done || die "ERROR: libgsm not found"; }
> >>  enabled libilbc           && require libilbc ilbc.h
> >> WebRtcIlbcfix_InitDecode -lilbc
> >>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
> >> kvazaar.h kvz_api_get
> >> -enabled libmfx            && require_pkg_config libmfx
> >> "mfx/mfxvideo.h" MFXInit
> >> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
> >> MFXInit ||
> >> +                               { require libmfx "mfx/mfxvideo.h"
> >> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
> >>  enabled libmodplug        && require_pkg_config libmodplug
> >> libmodplug/modplug.h ModPlug_Load
> >>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
> >> lame/lame.h lame_set_VBR_quality -lmp3lame
> >>  enabled libnut            && require libnut libnut.h nut_demuxer_init
> >> -lnut
> >>
> > 
> > Pinging this patch submission again.
> > 
> > Thanks,
> > Aaron Levinson
> 
> And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264

It wasn't, Carl Eugen insisted in doing this against everyone opinion, but
we tolerated his whim because he didn't want to use or install a 80kB
package installed on virtually every system that supports x264.

Anyway, here is a nasty side effect of doing this: you use PKG_CONFIG_PATH
to make sure it's linking against a specific local build of your lib, but
you did it wrong and it ends up linking silently against the system one
instead of failing like you would like to.

We predicted that allowing this hack for x264 was going to bring up
patches like this and we were right.

So maybe we should actually drop the hack for libx264.

Back to your issue: you should fix the .pc in the upstream project, this
is the correct fix.

Regards,
wm4 May 5, 2017, 7:48 a.m. UTC | #3
On Fri, 5 May 2017 09:42:51 +0200
Clément Bœsch <u@pkh.me> wrote:

> On Fri, May 05, 2017 at 12:11:27AM -0700, Aaron Levinson wrote:
> > On 4/19/2017 10:43 AM, Aaron Levinson wrote:  
> > > On 4/14/2017 6:51 PM, Aaron Levinson wrote:  
> > >> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
> > >> From: Aaron Levinson <alevinsn@aracnet.com>
> > >> Date: Fri, 14 Apr 2017 18:38:37 -0700
> > >> Subject: [PATCH] Added require fallback for libmfx in the case that
> > >>  pkg-config cannot find libmfx
> > >>
> > >> Purpose: Added require fallback for libmfx in the case that pkg-config
> > >> cannot find libmfx.  On Linux, most people likely get libmfx via
> > >> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
> > >> well-known way to get libmfx is via the Intel Media SDK, which
> > >> provides a static build of libmfx.lib and also provides the source
> > >> code for building libmfx yourself.  If built this way, there are no
> > >> pkg-config files to be found.  The changes utilize a similar approach
> > >> to that already done for libx264 in configure.
> > >>
> > >> Comments:
> > >>
> > >> -- configure: Altered enabled libmfx step to use use_pkg_config()
> > >>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
> > >>    falls back to require().  Note that the reason that require() is
> > >>    passed -llibmfx as the last argument, instead of -lmfx, is the file
> > >>    name for the library produced from the Intel Media SDK starts with
> > >>    "libmfx".  Apparently, the filename for the library produced via
> > >>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
> > >> ---
> > >>  configure | 3 ++-
> > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/configure b/configure
> > >> index 3bea057..b20a0b4 100755
> > >> --- a/configure
> > >> +++ b/configure
> > >> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
> > >> "gsm.h" "gsm/gsm.h"; do
> > >>                                 done || die "ERROR: libgsm not found"; }
> > >>  enabled libilbc           && require libilbc ilbc.h
> > >> WebRtcIlbcfix_InitDecode -lilbc
> > >>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
> > >> kvazaar.h kvz_api_get
> > >> -enabled libmfx            && require_pkg_config libmfx
> > >> "mfx/mfxvideo.h" MFXInit
> > >> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
> > >> MFXInit ||
> > >> +                               { require libmfx "mfx/mfxvideo.h"
> > >> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
> > >>  enabled libmodplug        && require_pkg_config libmodplug
> > >> libmodplug/modplug.h ModPlug_Load
> > >>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
> > >> lame/lame.h lame_set_VBR_quality -lmp3lame
> > >>  enabled libnut            && require libnut libnut.h nut_demuxer_init
> > >> -lnut
> > >>  
> > > 
> > > Pinging this patch submission again.
> > > 
> > > Thanks,
> > > Aaron Levinson  
> > 
> > And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264  
> 
> It wasn't, Carl Eugen insisted in doing this against everyone opinion, but
> we tolerated his whim because he didn't want to use or install a 80kB
> package installed on virtually every system that supports x264.
> 
> Anyway, here is a nasty side effect of doing this: you use PKG_CONFIG_PATH
> to make sure it's linking against a specific local build of your lib, but
> you did it wrong and it ends up linking silently against the system one
> instead of failing like you would like to.
> 
> We predicted that allowing this hack for x264 was going to bring up
> patches like this and we were right.
> 
> So maybe we should actually drop the hack for libx264.

+1

> 
> Back to your issue: you should fix the .pc in the upstream project, this
> is the correct fix.

+1
Aaron Levinson May 5, 2017, 7:54 a.m. UTC | #4
On 5/5/2017 12:42 AM, Clément Bœsch wrote:
> On Fri, May 05, 2017 at 12:11:27AM -0700, Aaron Levinson wrote:
>> On 4/19/2017 10:43 AM, Aaron Levinson wrote:
>>> On 4/14/2017 6:51 PM, Aaron Levinson wrote:
>>>> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
>>>> From: Aaron Levinson <alevinsn@aracnet.com>
>>>> Date: Fri, 14 Apr 2017 18:38:37 -0700
>>>> Subject: [PATCH] Added require fallback for libmfx in the case that
>>>>  pkg-config cannot find libmfx
>>>>
>>>> Purpose: Added require fallback for libmfx in the case that pkg-config
>>>> cannot find libmfx.  On Linux, most people likely get libmfx via
>>>> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
>>>> well-known way to get libmfx is via the Intel Media SDK, which
>>>> provides a static build of libmfx.lib and also provides the source
>>>> code for building libmfx yourself.  If built this way, there are no
>>>> pkg-config files to be found.  The changes utilize a similar approach
>>>> to that already done for libx264 in configure.
>>>>
>>>> Comments:
>>>>
>>>> -- configure: Altered enabled libmfx step to use use_pkg_config()
>>>>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
>>>>    falls back to require().  Note that the reason that require() is
>>>>    passed -llibmfx as the last argument, instead of -lmfx, is the file
>>>>    name for the library produced from the Intel Media SDK starts with
>>>>    "libmfx".  Apparently, the filename for the library produced via
>>>>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
>>>> ---
>>>>  configure | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index 3bea057..b20a0b4 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
>>>> "gsm.h" "gsm/gsm.h"; do
>>>>                                 done || die "ERROR: libgsm not found"; }
>>>>  enabled libilbc           && require libilbc ilbc.h
>>>> WebRtcIlbcfix_InitDecode -lilbc
>>>>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
>>>> kvazaar.h kvz_api_get
>>>> -enabled libmfx            && require_pkg_config libmfx
>>>> "mfx/mfxvideo.h" MFXInit
>>>> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
>>>> MFXInit ||
>>>> +                               { require libmfx "mfx/mfxvideo.h"
>>>> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
>>>>  enabled libmodplug        && require_pkg_config libmodplug
>>>> libmodplug/modplug.h ModPlug_Load
>>>>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
>>>> lame/lame.h lame_set_VBR_quality -lmp3lame
>>>>  enabled libnut            && require libnut libnut.h nut_demuxer_init
>>>> -lnut
>>>>
>>>
>>> Pinging this patch submission again.
>>>
>>> Thanks,
>>> Aaron Levinson
>>
>> And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264
>
> It wasn't, Carl Eugen insisted in doing this against everyone opinion, but
> we tolerated his whim because he didn't want to use or install a 80kB
> package installed on virtually every system that supports x264.
>
> Anyway, here is a nasty side effect of doing this: you use PKG_CONFIG_PATH
> to make sure it's linking against a specific local build of your lib, but
> you did it wrong and it ends up linking silently against the system one
> instead of failing like you would like to.
>
> We predicted that allowing this hack for x264 was going to bring up
> patches like this and we were right.
>
> So maybe we should actually drop the hack for libx264.
>
> Back to your issue: you should fix the .pc in the upstream project, this
> is the correct fix.

The "upstream project" in this case is the Intel Media SDK.  This is not 
an open source project, and developers get it through Intel in the form 
of an installation package on Windows.  So, there is no opportunity to 
"fix the .pc"--there isn't one, nor is there any way to contribute one. 
The https://github.com/lu-zero/mfx_dispatch project is not maintained by 
Intel, and I would argue that it is preferable to obtain the relevant 
files via the official Intel release.  This is not the same situation as 
exists with libx264, which is an open source project.  This is not much 
different in concept than the approach someone needs to take to get the 
Blackmagic header files, which are available via the Blackmagic SDK, and 
I don't see it using pkg-config for Blackmagic.

Aaron Levinson
Clément Bœsch May 5, 2017, 7:57 a.m. UTC | #5
On Fri, May 05, 2017 at 12:54:12AM -0700, Aaron Levinson wrote:
[...]
> > Back to your issue: you should fix the .pc in the upstream project, this
> > is the correct fix.
> 
> The "upstream project" in this case is the Intel Media SDK.  This is not an
> open source project, and developers get it through Intel in the form of an
> installation package on Windows.  So, there is no opportunity to "fix the
> .pc"--there isn't one, nor is there any way to contribute one.

OK so we have a common configure flag for supporting two different
projects with different authors, licensing, etc?

Maybe we should have 2 configure flags? Add --enable-libmfxintel or
whatever?
Aaron Levinson May 5, 2017, 8:40 a.m. UTC | #6
On 5/5/2017 12:57 AM, Clément Bœsch wrote:
> On Fri, May 05, 2017 at 12:54:12AM -0700, Aaron Levinson wrote:
> [...]
>>> Back to your issue: you should fix the .pc in the upstream project, this
>>> is the correct fix.
>>
>> The "upstream project" in this case is the Intel Media SDK.  This is not an
>> open source project, and developers get it through Intel in the form of an
>> installation package on Windows.  So, there is no opportunity to "fix the
>> .pc"--there isn't one, nor is there any way to contribute one.
>
> OK so we have a common configure flag for supporting two different
> projects with different authors, licensing, etc?
>
> Maybe we should have 2 configure flags? Add --enable-libmfxintel or
> whatever?

The licensing is the same--lu_zero's (Luca Barbato's) libmfx project 
just packages the files from the Intel Media SDK (or more likely Intel 
Media Server Studio).  And this means that there is effectively one 
author as well.  While the licensing for libmfx (really, mfx_dispatch) 
is suitable for open source projects, I don't think the same can be 
claimed for the Intel Media SDK or the Intel Media Server Studio as a 
whole, and it is technically necessary to install one of those to get 
the mfx_dispatch sources.  I really didn't want this to turn into 
another non-free discussion ala Blackmagic.  I'm fairly certain that 
Intel's intention is that the mfx_dispatch sources are suitable for use 
in open source projects, but it would be helpful if Intel offered the 
mfx_dispatch sources independent of either the Intel Media SDK or Intel 
Media Server Studio.

Nevertheless, it does seem reasonable to have another configure flag to 
enable the use of libmfx via Intel's official installers, which don't 
provide anything for pkg-config.  Even Intel Media Server Studio, which 
is available for Linux, doesn't provide anything for pkg-config, and the 
instructions at 
http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/quicksync-video-ffmpeg-install-valid.pdf 
describe a process for manually creating a libmfx.pc file in order to be 
able to build ffmpeg with Intel Media Server Studio.  I'll scrap this 
patch and work on a different patch that uses this approach.

Aaron
Hendrik Leppkes May 5, 2017, 9:36 a.m. UTC | #7
On Fri, May 5, 2017 at 9:57 AM, Clément Bœsch <u@pkh.me> wrote:
> On Fri, May 05, 2017 at 12:54:12AM -0700, Aaron Levinson wrote:
> [...]
>> > Back to your issue: you should fix the .pc in the upstream project, this
>> > is the correct fix.
>>
>> The "upstream project" in this case is the Intel Media SDK.  This is not an
>> open source project, and developers get it through Intel in the form of an
>> installation package on Windows.  So, there is no opportunity to "fix the
>> .pc"--there isn't one, nor is there any way to contribute one.
>
> OK so we have a common configure flag for supporting two different
> projects with different authors, licensing, etc?
>
> Maybe we should have 2 configure flags? Add --enable-libmfxintel or
> whatever?
>

I think having separate flags would just be annoying. Lucas
redistribution is in no sense "official" in any way, and what if
someone else comes up with another re-package of the same thing?
The key information here is, upstream libmfx does not actually have a
pkg-config file, that some re-distributions add one is nice and all,
and we can use that if present, but we should also be able to use the
upstream variant which does not come with one at all.

- Hendrik
Michael Niedermayer May 5, 2017, 11:50 a.m. UTC | #8
On Fri, May 05, 2017 at 11:36:05AM +0200, Hendrik Leppkes wrote:
> On Fri, May 5, 2017 at 9:57 AM, Clément Bœsch <u@pkh.me> wrote:
> > On Fri, May 05, 2017 at 12:54:12AM -0700, Aaron Levinson wrote:
> > [...]
> >> > Back to your issue: you should fix the .pc in the upstream project, this
> >> > is the correct fix.
> >>
> >> The "upstream project" in this case is the Intel Media SDK.  This is not an
> >> open source project, and developers get it through Intel in the form of an
> >> installation package on Windows.  So, there is no opportunity to "fix the
> >> .pc"--there isn't one, nor is there any way to contribute one.
> >
> > OK so we have a common configure flag for supporting two different
> > projects with different authors, licensing, etc?
> >
> > Maybe we should have 2 configure flags? Add --enable-libmfxintel or
> > whatever?
> >
> 
> I think having separate flags would just be annoying. Lucas
> redistribution is in no sense "official" in any way, and what if
> someone else comes up with another re-package of the same thing?

> The key information here is, upstream libmfx does not actually have a
> pkg-config file, that some re-distributions add one is nice and all,
> and we can use that if present, but we should also be able to use the
> upstream variant which does not come with one at all.

+1

[...]
Michael Niedermayer May 5, 2017, 12:12 p.m. UTC | #9
On Fri, May 05, 2017 at 09:42:51AM +0200, Clément Bœsch wrote:
> On Fri, May 05, 2017 at 12:11:27AM -0700, Aaron Levinson wrote:
> > On 4/19/2017 10:43 AM, Aaron Levinson wrote:
> > > On 4/14/2017 6:51 PM, Aaron Levinson wrote:
> > >> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
> > >> From: Aaron Levinson <alevinsn@aracnet.com>
> > >> Date: Fri, 14 Apr 2017 18:38:37 -0700
> > >> Subject: [PATCH] Added require fallback for libmfx in the case that
> > >>  pkg-config cannot find libmfx
> > >>
> > >> Purpose: Added require fallback for libmfx in the case that pkg-config
> > >> cannot find libmfx.  On Linux, most people likely get libmfx via
> > >> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
> > >> well-known way to get libmfx is via the Intel Media SDK, which
> > >> provides a static build of libmfx.lib and also provides the source
> > >> code for building libmfx yourself.  If built this way, there are no
> > >> pkg-config files to be found.  The changes utilize a similar approach
> > >> to that already done for libx264 in configure.
> > >>
> > >> Comments:
> > >>
> > >> -- configure: Altered enabled libmfx step to use use_pkg_config()
> > >>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
> > >>    falls back to require().  Note that the reason that require() is
> > >>    passed -llibmfx as the last argument, instead of -lmfx, is the file
> > >>    name for the library produced from the Intel Media SDK starts with
> > >>    "libmfx".  Apparently, the filename for the library produced via
> > >>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
> > >> ---
> > >>  configure | 3 ++-
> > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/configure b/configure
> > >> index 3bea057..b20a0b4 100755
> > >> --- a/configure
> > >> +++ b/configure
> > >> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
> > >> "gsm.h" "gsm/gsm.h"; do
> > >>                                 done || die "ERROR: libgsm not found"; }
> > >>  enabled libilbc           && require libilbc ilbc.h
> > >> WebRtcIlbcfix_InitDecode -lilbc
> > >>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
> > >> kvazaar.h kvz_api_get
> > >> -enabled libmfx            && require_pkg_config libmfx
> > >> "mfx/mfxvideo.h" MFXInit
> > >> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
> > >> MFXInit ||
> > >> +                               { require libmfx "mfx/mfxvideo.h"
> > >> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
> > >>  enabled libmodplug        && require_pkg_config libmodplug
> > >> libmodplug/modplug.h ModPlug_Load
> > >>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
> > >> lame/lame.h lame_set_VBR_quality -lmp3lame
> > >>  enabled libnut            && require libnut libnut.h nut_demuxer_init
> > >> -lnut
> > >>
> > > 
> > > Pinging this patch submission again.
> > > 
> > > Thanks,
> > > Aaron Levinson
> > 
> > And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264
> 
> It wasn't, Carl Eugen insisted in doing this


> against everyone opinion, but
> we tolerated his whim because he didn't want to use or install a 80kB
> package installed on virtually every system that supports x264.

i remember it somewhat different but
Do you belive this text belongs on a technical open source mailing list
?

[...]
wm4 May 5, 2017, 12:17 p.m. UTC | #10
On Fri, 5 May 2017 14:12:56 +0200
Michael Niedermayer <michael@niedermayer.cc> wrote:

> On Fri, May 05, 2017 at 09:42:51AM +0200, Clément Bœsch wrote:
> > On Fri, May 05, 2017 at 12:11:27AM -0700, Aaron Levinson wrote:  
> > > On 4/19/2017 10:43 AM, Aaron Levinson wrote:  
> > > > On 4/14/2017 6:51 PM, Aaron Levinson wrote:  
> > > >> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
> > > >> From: Aaron Levinson <alevinsn@aracnet.com>
> > > >> Date: Fri, 14 Apr 2017 18:38:37 -0700
> > > >> Subject: [PATCH] Added require fallback for libmfx in the case that
> > > >>  pkg-config cannot find libmfx
> > > >>
> > > >> Purpose: Added require fallback for libmfx in the case that pkg-config
> > > >> cannot find libmfx.  On Linux, most people likely get libmfx via
> > > >> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
> > > >> well-known way to get libmfx is via the Intel Media SDK, which
> > > >> provides a static build of libmfx.lib and also provides the source
> > > >> code for building libmfx yourself.  If built this way, there are no
> > > >> pkg-config files to be found.  The changes utilize a similar approach
> > > >> to that already done for libx264 in configure.
> > > >>
> > > >> Comments:
> > > >>
> > > >> -- configure: Altered enabled libmfx step to use use_pkg_config()
> > > >>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
> > > >>    falls back to require().  Note that the reason that require() is
> > > >>    passed -llibmfx as the last argument, instead of -lmfx, is the file
> > > >>    name for the library produced from the Intel Media SDK starts with
> > > >>    "libmfx".  Apparently, the filename for the library produced via
> > > >>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
> > > >> ---
> > > >>  configure | 3 ++-
> > > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >>
> > > >> diff --git a/configure b/configure
> > > >> index 3bea057..b20a0b4 100755
> > > >> --- a/configure
> > > >> +++ b/configure
> > > >> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
> > > >> "gsm.h" "gsm/gsm.h"; do
> > > >>                                 done || die "ERROR: libgsm not found"; }
> > > >>  enabled libilbc           && require libilbc ilbc.h
> > > >> WebRtcIlbcfix_InitDecode -lilbc
> > > >>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
> > > >> kvazaar.h kvz_api_get
> > > >> -enabled libmfx            && require_pkg_config libmfx
> > > >> "mfx/mfxvideo.h" MFXInit
> > > >> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
> > > >> MFXInit ||
> > > >> +                               { require libmfx "mfx/mfxvideo.h"
> > > >> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
> > > >>  enabled libmodplug        && require_pkg_config libmodplug
> > > >> libmodplug/modplug.h ModPlug_Load
> > > >>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
> > > >> lame/lame.h lame_set_VBR_quality -lmp3lame
> > > >>  enabled libnut            && require libnut libnut.h nut_demuxer_init
> > > >> -lnut
> > > >>  
> > > > 
> > > > Pinging this patch submission again.
> > > > 
> > > > Thanks,
> > > > Aaron Levinson  
> > > 
> > > And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264  
> > 
> > It wasn't, Carl Eugen insisted in doing this  
> 
> 
> > against everyone opinion, but
> > we tolerated his whim because he didn't want to use or install a 80kB
> > package installed on virtually every system that supports x264.  
> 
> i remember it somewhat different but
> Do you belive this text belongs on a technical open source mailing list
> ?

Do you believe we should just let CE continually sabotage development
and let him openly insult us and others?
Michael Niedermayer May 5, 2017, 1:02 p.m. UTC | #11
On Fri, May 05, 2017 at 02:17:40PM +0200, wm4 wrote:
> On Fri, 5 May 2017 14:12:56 +0200
> Michael Niedermayer <michael@niedermayer.cc> wrote:
> 
> > On Fri, May 05, 2017 at 09:42:51AM +0200, Clément Bœsch wrote:
> > > On Fri, May 05, 2017 at 12:11:27AM -0700, Aaron Levinson wrote:  
> > > > On 4/19/2017 10:43 AM, Aaron Levinson wrote:  
> > > > > On 4/14/2017 6:51 PM, Aaron Levinson wrote:  
> > > > >> From e0c73c054add0137901d0bf7a7893e42e7e566c8 Mon Sep 17 00:00:00 2001
> > > > >> From: Aaron Levinson <alevinsn@aracnet.com>
> > > > >> Date: Fri, 14 Apr 2017 18:38:37 -0700
> > > > >> Subject: [PATCH] Added require fallback for libmfx in the case that
> > > > >>  pkg-config cannot find libmfx
> > > > >>
> > > > >> Purpose: Added require fallback for libmfx in the case that pkg-config
> > > > >> cannot find libmfx.  On Linux, most people likely get libmfx via
> > > > >> https://github.com/lu-zero/mfx_dispatch , but on Windows, the most
> > > > >> well-known way to get libmfx is via the Intel Media SDK, which
> > > > >> provides a static build of libmfx.lib and also provides the source
> > > > >> code for building libmfx yourself.  If built this way, there are no
> > > > >> pkg-config files to be found.  The changes utilize a similar approach
> > > > >> to that already done for libx264 in configure.
> > > > >>
> > > > >> Comments:
> > > > >>
> > > > >> -- configure: Altered enabled libmfx step to use use_pkg_config()
> > > > >>    instead of require_pkg_config(), and, if use_pkg_config() fails, it
> > > > >>    falls back to require().  Note that the reason that require() is
> > > > >>    passed -llibmfx as the last argument, instead of -lmfx, is the file
> > > > >>    name for the library produced from the Intel Media SDK starts with
> > > > >>    "libmfx".  Apparently, the filename for the library produced via
> > > > >>    https://github.com/lu-zero/mfx_dispatch starts with "mfx".
> > > > >> ---
> > > > >>  configure | 3 ++-
> > > > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > >>
> > > > >> diff --git a/configure b/configure
> > > > >> index 3bea057..b20a0b4 100755
> > > > >> --- a/configure
> > > > >> +++ b/configure
> > > > >> @@ -5819,7 +5819,8 @@ enabled libgsm            && { for gsm_hdr in
> > > > >> "gsm.h" "gsm/gsm.h"; do
> > > > >>                                 done || die "ERROR: libgsm not found"; }
> > > > >>  enabled libilbc           && require libilbc ilbc.h
> > > > >> WebRtcIlbcfix_InitDecode -lilbc
> > > > >>  enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1"
> > > > >> kvazaar.h kvz_api_get
> > > > >> -enabled libmfx            && require_pkg_config libmfx
> > > > >> "mfx/mfxvideo.h" MFXInit
> > > > >> +enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h"
> > > > >> MFXInit ||
> > > > >> +                               { require libmfx "mfx/mfxvideo.h"
> > > > >> MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
> > > > >>  enabled libmodplug        && require_pkg_config libmodplug
> > > > >> libmodplug/modplug.h ModPlug_Load
> > > > >>  enabled libmp3lame        && require "libmp3lame >= 3.98.3"
> > > > >> lame/lame.h lame_set_VBR_quality -lmp3lame
> > > > >>  enabled libnut            && require libnut libnut.h nut_demuxer_init
> > > > >> -lnut
> > > > >>  
> > > > > 
> > > > > Pinging this patch submission again.
> > > > > 
> > > > > Thanks,
> > > > > Aaron Levinson  
> > > > 
> > > > And again.  This patch is pretty straightforward, and considering that this approach was deemed suitable for libx264  
> > > 
> > > It wasn't, Carl Eugen insisted in doing this  
> > 
> > 
> > > against everyone opinion, but
> > > we tolerated his whim because he didn't want to use or install a 80kB
> > > package installed on virtually every system that supports x264.  
> > 
> > i remember it somewhat different but
> > Do you belive this text belongs on a technical open source mailing list
> > ?
> 
> Do you believe we should just let CE continually sabotage development
> and let him openly insult us and others?

I belive all developers have good intends and many put huge amounts of
time into improving FFmpeg. But they themselfs see each other sometimes
as enemies ...

[...]
diff mbox

Patch

diff --git a/configure b/configure
index c3fa9d858f..883ec390d6 100755
--- a/configure
+++ b/configure
@@ -5787,7 +5787,8 @@  enabled libgsm            && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
                                done || die "ERROR: libgsm not found"; }
 enabled libilbc           && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
 enabled libkvazaar        && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
-enabled libmfx            && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
+enabled libmfx            && { use_pkg_config libmfx "mfx/mfxvideo.h" MFXInit ||
+                               { require libmfx "mfx/mfxvideo.h" MFXInit -llibmfx && warn "using libmfx without pkg-config"; } }
 enabled libmodplug        && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame        && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
 enabled libnut            && require libnut libnut.h nut_demuxer_init -lnut