From patchwork Thu Jun 9 23:27:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 36103 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp643911pzj; Thu, 9 Jun 2022 16:27:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdXSk8uK2x3iVjLkzAsai4R37SUMqK2qSMHsIcktqYumq/ufppSKE7CpFvVErxSusxSV2L X-Received: by 2002:a17:907:c22:b0:711:dc95:3996 with SMTP id ga34-20020a1709070c2200b00711dc953996mr16651510ejc.62.1654817240420; Thu, 09 Jun 2022 16:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654817240; cv=none; d=google.com; s=arc-20160816; b=HIXQcJXSf7oEMhhqp0v/PKMKTi99VVWfW1iwrGtMHX0yRHOGRguXxzA25nlaT1tFIW 0XD8v07PStS2QW9OXnJSHOhjcQq8j3wiX1sobqLgXmUpT+7P5/jObAPpm2HMCU9Tr0hj tKFc90CyGPVRJMOT43IGUR81BYT7O84cHoFetfEEMuCiZjDHfpqPgl8foqLpietD0H/3 G4aAeM3hAuRKJVla5sf/s4Zz+xjTq6B7oFybeMdjrWhwd4PG2nPZNgxznchFp7oiVOtP jnjZd0ut1s2kNql8nSOx5cQGxmCouGplJT3kV0/ILfHnTPI0rUeaF/D/8insbVKZpMNi jOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:to:mime-version:fcc:date:references :in-reply-to:message-id:from:dkim-signature:delivered-to; bh=dqM82W7MYT+QB0kwb6V7ERod1wd070jV4rD9NaRban0=; b=nCV+ZDS7jkyNByFfrQJCPYJrzKpM8c2/3kVmADyFsCj1k7soH+2krNJ+U0N9lJ9s6q tNNoIaU8RraPohGCR8pF6XKHbTg0118Sx1m6uVqw5ci29sx0deMwRnCgqjxK7Bu3F2aO iCgscBvaA+8ZUJVDXhdXyovlk2GAPXJiyjyhHd6yvwtI9ED/LIh17HvhZHkAqJHyONKF Yyqu6geN0/C0Lb+GgAzG28Jw1EILL9r6EIjM14CcJNiD0IeaQXXUttxarHycUuQaQOHp 76nG5VcC+TcsKPLkxy6CPtoPauicvJst3Vjke/WGesSIFlRU03FAZp0onDZqjDBPzXHB /0QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=T3+FQDnJ; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f26-20020a1709062c5a00b006ff9265af35si5959255ejh.404.2022.06.09.16.27.20; Thu, 09 Jun 2022 16:27:20 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=T3+FQDnJ; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5385F68B813; Fri, 10 Jun 2022 02:27:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2889268B7F9 for ; Fri, 10 Jun 2022 02:27:11 +0300 (EEST) Received: by mail-pg1-f181.google.com with SMTP id 184so7260013pga.12 for ; Thu, 09 Jun 2022 16:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:in-reply-to:references:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Bh/aURAz1pZiCieThhJyy1A/crQ7cGEi1f+Y6d7eopw=; b=T3+FQDnJ49TSHU90kkCK1yEj8hQD+bwB4Z+ErOfI0a7eWLw4QegLrtBFmxcCzxI0AN zZVSsoOYdONHKQSMP0OX5eQMPMJeHuylcXN1Hr8gs2AJPg8gBypV/kaWSMjMAIc8u60f rmJ5MRGbIuZidnqhz8981MNlyr/MAXYtTPVaQj9vTfh59HZMK9VY/fcARdVpwm80yVvA Zn5YFLmoBrmuOaHFJ83aT9u53BqjahK/TiYFaSZ03saFkjUOQcL1c9ZP8wHORQ2iGD7V VuBhMRt67RU8FfFNymYqU6nh0LCHLMjZfkrNaeSOPCW2iW2ZjHi9J6uk5/FYGdRsp6Ct AEZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:in-reply-to:references:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Bh/aURAz1pZiCieThhJyy1A/crQ7cGEi1f+Y6d7eopw=; b=CxUBvBCr134Vj7FWg3/8KfZuzbuKDeipZWt5gEfN8Ac9D8LG193OPygZ9hcg7o8Jg5 XmlwIISsi/wFXqwSXp7qlX0+t4GDpo3RiCWWOX3x1xhIZqj4zSQDQ8uYigynEPp+yZ6X /Il7fWKO6F+2sE1kJXh9bEgTR4LqpRW+qK0IW8H8QDiQZoLTwwS4qCxeWYGcfGF2LePY CW6KLVE5YxLOutOoaYPqV//S9fm3qAAzOuG48L9wOl+/LQRqyn0HAxXRG3EM+8vamdW/ RrRfEvyFycEaAWH6Tc8RBosEejl+xeCcmQbJdR3gWh+DS3qqmHRpjuijmcdPFiBFxP0F /5Rg== X-Gm-Message-State: AOAM5314bcA4GZ1vHA+BTo0JKx8aw9zDntbR/z7UNhuOm5/v83I6eIiP BAeoW8naZZ8Y0bOTmMMofLCkldKZ67LrUYJB X-Received: by 2002:a65:604a:0:b0:3f9:f423:b474 with SMTP id a10-20020a65604a000000b003f9f423b474mr36093324pgp.527.1654817229514; Thu, 09 Jun 2022 16:27:09 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id n10-20020a63970a000000b003fdc7e490a6sm9227009pge.20.2022.06.09.16.27.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jun 2022 16:27:08 -0700 (PDT) From: Matt Oliver X-Google-Original-From: Matt Oliver Message-Id: In-Reply-To: References: Date: Thu, 09 Jun 2022 23:27:08 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v7] libx264: Set min build version to 158 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Michael Niedermayer , Matt Oliver , softworkz , Marton Balint , Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: SWFzfA/ABRDE From: Matt Oliver Was "[PATCH] libx264: Do not explicitly set X264_API_IMPORTS" Setting X264_API_IMPORTS only affects msvc builds and it breaks linking to static builds (although is required for shared builds). This flag is set by x264 in its pkgconfig as required since build 158 (a615f027ed172e2dd5380e736d487aa858a0c4ff) from July 2019. So this patch updates configure to require a newer x264 build that correctly sets the imports flag. The min version requirement of 158 is applied for msvc builds only. This is also removing the check for 'libx264 without pkg-config' which was left for compatibility reasons about 7 years ago when the pkg-config check was introduced by commit e06263ef1e0e172b2c76070b3dc739411af08e82. Co-authored-by: softworkz Signed-off-by: softworkz Signed-off-by: Matt Oliver --- libx264: Set min build version to 158 I'm submitting this patch on behalf of Matt with his permission. There was agreement that the >= 158 version requirement should be applied to MSVC builds only. v2: restrict the version requirement to msvc builds v3: fix unintended author change v4: add missing braces v5: fixed condition (again ;-) v6: hope I got it now.. v7: add comment about dropping non-pkg-conf check, re-add libx262 check Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v7 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v7 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30 Range-diff vs v6: 1: 47843fb51e ! 1: 3baec48834 libx264: Set min build version to 158 @@ Commit message So this patch updates configure to require a newer x264 build that correctly sets the imports flag. - The requirement for 158 is applied for msvc builds only, - no change is made for all other cases. + The min version requirement of 158 is applied for msvc builds only. + + This is also removing the check for 'libx264 without pkg-config' + which was left for compatibility reasons about 7 years ago when + the pkg-config check was introduced by commit + e06263ef1e0e172b2c76070b3dc739411af08e82. Co-authored-by: softworkz Signed-off-by: softworkz @@ configure: enabled libvpx && { - { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && - warn "using libx264 without pkg-config"; } } && - require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && -- check_cpp_condition libx262 x264.h "X264_MPEG2" +enabled libx264 && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && { + [ "$toolchain" != "msvc" ] || -+ require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } ++ require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && + check_cpp_condition libx262 x264.h "X264_MPEG2" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && require_cpp_condition libx265 x265.h "X265_BUILD >= 70" - enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" ## libavcodec/libx264.c ## @@ configure | 8 ++++---- libavcodec/libx264.c | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) base-commit: 5d5a01419928d0c00bae54f730eede150cd5b268 diff --git a/configure b/configure index 5a167613a4..3dca1c4bd3 100755 --- a/configure +++ b/configure @@ -6658,10 +6658,10 @@ enabled libvpx && { enabled libwebp && { enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } -enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || - { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && - warn "using libx264 without pkg-config"; } } && - require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && +enabled libx264 && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && { + [ "$toolchain" != "msvc" ] || + require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && check_cpp_condition libx262 x264.h "X264_MPEG2" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && require_cpp_condition libx265 x265.h "X265_BUILD >= 70" diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 4ce3791ae8..14177b3016 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -37,10 +37,6 @@ #include "atsc_a53.h" #include "sei.h" -#if defined(_MSC_VER) -#define X264_API_IMPORTS 1 -#endif - #include #include #include