From patchwork Wed May 25 09:31:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 35919 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp966504pzj; Wed, 25 May 2022 02:31:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysI8onNAxGqkN5GjPGfDACL2pR+E7FZr62zyVGwvtbWypecVfMpQRuvjm76j/05QZu0Xvf X-Received: by 2002:a17:907:7ea8:b0:6f5:941:cba9 with SMTP id qb40-20020a1709077ea800b006f50941cba9mr27170995ejc.213.1653471082611; Wed, 25 May 2022 02:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653471082; cv=none; d=google.com; s=arc-20160816; b=kOBiGJ8JPKog52XUvp7OvstjoHkt9yxTerL6flo46eEN1yIXUk8gYFaZaH5Zd4IUUS jDhCOsRWLC/Xm75oc90DWRlcOkhCSchDFVMiC9ZpQ67iOrCy6B7SJpWcr+GAB5T0kQvU Pts7tpk+LFpqirq//GFldNrMlaS0XTSdraRYOy+0e/SNfTBOpzslBMW3thBDbD11o4a6 tvjw7YqEhI4+8X14VBC25QQQGh6ewF/XNJeMs6HEw6mCiX+RvDB9dfZxtBVtmN6fuqpQ Fpti3qFr6bH2oOuJrE3eN/SxFhbrGBeA8mJUzxf13I+FXa0x4pl6wa39dj3yIe8D++3B rOMw== 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=WbkB5V27lPzT+2zWvbg7nDACgDwvtV0ZAuE+hnKbz54=; b=vYsup3ZsFfPauM+XxxdKbnXG8fXSmTpytDpM+pla/1IciUv70xW8eRtJzelSlvtRYg ajVlwjNIh+tTHJZWlRqAt8uuuviG4TmQFjqOFEx7wuS8T58U90doMY6UFKxk35cOuG+w TFGRbVnBESzeJOEfVXGK1zFqpRgWQd1J/3eYMoKBTATITaU1UoJ9D5YB/XzU2hjddlmI aLlw44RydhTyPHl1TttNTKdBIVod4SkdF+LgmJ2FC+GFXj4v04X3EeHBUzmV3Sg/x/w1 Hmue8eD+OsRlfJjDuLjycLNIDIHP9OH6CFFhIqmHkZSjCgchZFLXY8WuBriIY+naQxk5 rfKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=TYM9dNN0; 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 c17-20020a170906341100b006f4314a3fb0si9065876ejb.866.2022.05.25.02.31.21; Wed, 25 May 2022 02:31:22 -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=TYM9dNN0; 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 42B4468B4F1; Wed, 25 May 2022 12:31:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B3CD68B34E for ; Wed, 25 May 2022 12:31:12 +0300 (EEST) Received: by mail-pj1-f50.google.com with SMTP id q92-20020a17090a17e500b001e0817e77f6so1153603pja.5 for ; Wed, 25 May 2022 02:31: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=/AFsWv6kT+LqwvSwr+XBbUytIPL5Jn++VehJfnqiw28=; b=TYM9dNN0WtPOWDpXu5i1GhrduztvUn7XLk4QJ8BpZ+e71SMxUJJvxEcxQLkY/+PjPe VRR+P9X0lYdYT5chiy8Jv3XYJgDMsTfxRa9q3sSLQTwRSRmss+dR8IUqrFxFGX2uQUeJ t9ZYFM7m0tf9DqPOvCEWkk0wwrnirJHmmoPzbYAHnfIlXYWTte3vgVs4yjXkvx8uRK7d hyiQOqENEsf1BTqy2k3o134a6bgFODBdyB9BVrF+13+qIQsB/WLHUYsT1MPIRaS03ugl jH/LjJ/m0M9b4BIrVIv+mudU9UKaoQRqYs23j8b9sHuVs7FG1QlBEaiZYCZ5rxgR+gN5 4NuA== 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=/AFsWv6kT+LqwvSwr+XBbUytIPL5Jn++VehJfnqiw28=; b=NzhUsL5zzqHoFz1SUOhHaeHj7Uk9Eax0XcUp43hpYsMOHPOYlbgGcoz1L6bFAol16b JpugNypA7V1DZt39uujM4LSDfqSW9DfebxfC9EavGnd4nU7u6gWhbKtY1leUzrYP7M3G y4OKyAVqQxlYVSaoDUu8DP5zrAzz2irwWjarA+YIqVLdvBdCkXcKforN/zBPlc9iB/hm b0tudeqUkJOwzgZtlDQQgRfX7GJABNfGmFMNuXxh42DDTlK1zRojqAZ3KKFGzeHfundT ZPnOU4mMWDjB06ci6AHm9dSaQNBBZ8CK+RkZIZuHNyrU4hB9Hgiaf+Bfjbd7FGxTCYOz mv/g== X-Gm-Message-State: AOAM530i6Cf/oBBLmOq5KQmoOo/4UFuRzHaOv8U1pyvzSSfr7/aI/F5j kkI5XHmbOYQtj7pCq+fr+tx7Pvd8Upxn9Q== X-Received: by 2002:a17:902:d2c8:b0:161:bc97:2805 with SMTP id n8-20020a170902d2c800b00161bc972805mr32625548plc.4.1653471069512; Wed, 25 May 2022 02:31:09 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id f12-20020a170902e98c00b001614cd997a8sm1786356plb.236.2022.05.25.02.31.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 May 2022 02:31:09 -0700 (PDT) From: softworkz X-Google-Original-From: softworkz Message-Id: In-Reply-To: References: Date: Wed, 25 May 2022 09:31:07 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v2] 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: softworkz Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: TIQTw6KFymhI From: softworkz 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 requirement for 158 is applied for msvc builds only, no change is made for all other cases. 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 Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-30%2Fsoftworkz%2Fsubmit_x264_api_imports_matt-v2 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-30/softworkz/submit_x264_api_imports_matt-v2 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/30 Range-diff vs v1: 1: bbe97f5e1b ! 1: 1696684de3 libx264: Set min build version to 158 @@ ## Metadata ## -Author: Matt Oliver +Author: softworkz ## Commit message ## 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. - Alternatively we can detect the x264 build version in configure - and keep the fallback of manually setting the flag on older x264 - builds that arent using pkgconfig (to keep the old behaviour) but - that requires some complex configure changes. + The requirement for 158 is applied for msvc builds only, + no change is made for all other cases. - Submitted-by: softworkz + Co-authored-by: softworkz + Signed-off-by: softworkz Signed-off-by: Matt Oliver ## configure ## @@ configure: enabled libvpx && { - 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 >= 158" ++ require_cpp_condition libx264 x264.h "X264_BUILD >= 158" || ++ { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; } 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" configure | 8 +++----- libavcodec/libx264.c | 4 ---- 2 files changed, 3 insertions(+), 9 deletions(-) base-commit: b033913d1c5998a29dfd13e9906dd707ff6eff12 diff --git a/configure b/configure index f115b21064..9de9b7763a 100755 --- a/configure +++ b/configure @@ -6656,11 +6656,9 @@ 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" && - 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 >= 158" || + { "$toolchain" != msvc && require_cpp_condition libx264 x264.h "X264_BUILD >= 118"; } 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" 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