From patchwork Fri May 5 07:11:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Levinson X-Patchwork-Id: 3575 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp75107vsd; Fri, 5 May 2017 00:11:39 -0700 (PDT) X-Received: by 10.28.59.69 with SMTP id i66mr4222563wma.22.1493968299063; Fri, 05 May 2017 00:11:39 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 57si5541701wru.100.2017.05.05.00.11.38; Fri, 05 May 2017 00:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5993D689201; Fri, 5 May 2017 10:11:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from white.spiritone.com (white.spiritone.com [216.99.193.38]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E222688379 for ; Fri, 5 May 2017 10:11:24 +0300 (EEST) Received: from [192.168.3.101] (184-100-204-251.ptld.qwest.net [184.100.204.251]) by white.spiritone.com (Postfix) with ESMTPSA id 6927A734057A for ; Fri, 5 May 2017 00:11:28 -0700 (PDT) References: <39dd74f3-28fc-4b59-ada3-77ac7f645cfc@aracnet.com> To: FFmpeg development discussions and patches From: Aaron Levinson Message-ID: <33bc7046-e846-0d24-b6b9-008ef6e76183@aracnet.com> Date: Fri, 5 May 2017 00:11:27 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] Added require fallback for libmfx in the case that pkg-config cannot find libmfx X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 >> 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 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 --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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