From patchwork Sat May 6 01:32:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aaron Levinson X-Patchwork-Id: 3591 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp490350vsd; Fri, 5 May 2017 18:32:31 -0700 (PDT) X-Received: by 10.223.151.13 with SMTP id r13mr33248227wrb.6.1494034351450; Fri, 05 May 2017 18:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494034351; cv=none; d=google.com; s=arc-20160816; b=Ii5xxDmbOE4mGGsiMB2HZFtijF/bMhfE+ya4aq5v0RNqTSrhPtp6jvmOvBQgurIhGK wu8756nQ6TiC4UD4cuxnPfoDx2uIyHu0ZO9cEEMIhXnw4W6eihV0QUmGJ6RxFmjoXLSw 8WMGrjFdS48Zo4bfZib8zWh+4qpMEIx7D+HI6gmb+c3dXQLe1T7uiPVKPUSMEoCEByNL R6cgJaTcRynWybFcNyr3/8n5yU6hueYSuaxdI1vDiZZvj4MTy+oropP8jij5iLsM2VCR a9sK97A4wAMlhxE4dCELzOKHdY9f/kIWDt6e0P51SBR030/sVu0X44pACfCWdQw089Ij iaeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:delivered-to :arc-authentication-results; bh=F0Ax1zJd54Dn42YEeiZB+OiytBNWL9owu1AWmf+YNSg=; b=oCG+SpyjO9HLKtQoGAwuiGBd8K3QXt1H+3HHf+12+quEDkrJABlKbJ9MLD9Y7YzDyN iZZMpVAPFkf5OrgEDOwx4OjlC+yH234FOvphidmW002rSEjvPMnC50ZEAVYD9MnwM2GO bQfH4nW7qpFPIpitwnA7dBCfIVLvfI1qYUvtz2jHMfuqBSeHe7k/LmuCXryfVhU80GHR cgR37mIWeugAf8/K7GmFqpXozZ3QMLCiQGORjJzamLfTDK+xRhW57h/3X9zQHGt0FHzk SbdUeZylKNBtuz7bijSGE8nPwHbF4L1IdQ2O/Jh2bhkqvGsI9VDhHuP0o1/IYDM2zQF9 tZcA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w144si3878843wmd.5.2017.05.05.18.32.31; Fri, 05 May 2017 18:32:31 -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 4AE20680656; Sat, 6 May 2017 04:32:23 +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 54047680384 for ; Sat, 6 May 2017 04:32:16 +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 42BE273404AA for ; Fri, 5 May 2017 18:32:20 -0700 (PDT) To: FFmpeg development discussions and patches References: <39dd74f3-28fc-4b59-ada3-77ac7f645cfc@aracnet.com> <33bc7046-e846-0d24-b6b9-008ef6e76183@aracnet.com> <20170505074251.GE3867@golem.pkh.me> <7abc1122-9052-6525-b50e-fd1572052132@aracnet.com> <20170505075656.GG3867@golem.pkh.me> <20170505115006.GQ4759@nb4> From: Aaron Levinson Message-ID: <26a73910-b0bb-a2d7-85fe-52339a25029a@aracnet.com> Date: Fri, 5 May 2017 18:32:18 -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: <20170505115006.GQ4759@nb4> 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 5/5/2017 4:50 AM, Michael Niedermayer wrote: > 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 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 Per some discussion on IRC, I've created a new patch that includes a detailed comment in configure for why require is being used. I also altered the text for the patch. Thanks, Aaron Levinson ----------------------------------------------------------------------- From 5d8fb32801accc06655c4fae700652958bc4350e Mon Sep 17 00:00:00 2001 From: Aaron Levinson Date: Fri, 5 May 2017 18:16:03 -0700 Subject: [PATCH] configure: Added require alternative for libmfx to support alternate installation options Purpose: Added require alternative 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. 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(). Also added explanatory comment. 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index a008b41473..296bff9dc7 100755 --- a/configure +++ b/configure @@ -5788,7 +5788,14 @@ 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 +# While it may appear that require is being used as a pkg-config +# fallback for libmfx, it is actually being used to detect a different +# installation route altogether. If libmfx is installed via the Intel +# Media SDK or Intel Media Server Studio, these don't come with +# pkg-config support. Instead, users should make sure that the build +# can find the libraries and headers through other means. +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