From patchwork Sat Oct 30 03:16:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Oliver X-Patchwork-Id: 31257 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:a610:0:0:0:0:0 with SMTP id q16csp240586ioi; Fri, 29 Oct 2021 20:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+z9XSJcyDenJNrnltVoOw8sq0dOJo0EE3GO/2kgREqfiGAxmQ73efV0YhKTV6y/Ww+J/S X-Received: by 2002:a05:6402:50cb:: with SMTP id h11mr20423547edb.377.1635563797699; Fri, 29 Oct 2021 20:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635563797; cv=none; d=google.com; s=arc-20160816; b=F75e0gy1F70Chk+cmcbRdg7LG+g9r5hegaWseseIGso1qVzxqa5+5pdz3NSbpevl2s fuFZFayrL2GMnx2ohEnTIpOeJRcEtEAXSRTAXJBosWkbHvDckrC+HISDQTBO7WMy7EWm DCoK3WIahJzpMzcXSUI+hmhrgCMAvnwUdtsqrERw9H//q6r8qArFgQlrFT3BojBzq07M v6U6qoigGjcCo5Dw4TtacZ5jCd7rWRTotI51oS+9qi+N1VBqEj9EUzpqqxq5+7vncfgq YPN4wGhbu/Yined9PofddzMxdZU6DTsCb2QSoSqTolIrlULtfLnxkSZ86TVMMR3idsyw GAhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=uVzeoOPfXuStdbo80ToUWdMH746y6MJEgjKzVMYG3Ds=; b=hzA0Iu/iUiiD6ll+KhPWzU7wWp/041w1xtjatEMpKzQsxU6Kwo4b3PKU15TkxWQGta rpOn9z73FYiBOPO097Hl+5aJgD8OC+gjPb0A/rdUkC6uRCIPrSbVtfDq0Xv9AJXUjSbZ q7rPhw+BWZVsjk/vEtzZhg95SMkq8XQ5kY848yk+akou8IY1CbrFlkrXJER2eNqUOGEx 5n+KGtvQ8mT88CREipOskG+G9POhUH7cAREbTKaTiAKN67e1p+CSTzO4SSO0h0WPxiGw 7I6szRQLdtVEY20ja9PSUC0keOYl+le72CXBC2cxAvm46mAL+AE6nJ9zXx8xdxCWE5l8 HqXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=VECY+QzJ; 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 c12si12673149edx.280.2021.10.29.20.16.37; Fri, 29 Oct 2021 20:16:37 -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=VECY+QzJ; 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 6F6A668A044; Sat, 30 Oct 2021 06:16:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 70C3A6804A0 for ; Sat, 30 Oct 2021 06:16:28 +0300 (EEST) Received: by mail-ed1-f53.google.com with SMTP id ee16so31955054edb.10 for ; Fri, 29 Oct 2021 20:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=otYGzzn3LKG4yWyp25apfp60MaXyLD3mfWJVy1ltrA8=; b=VECY+QzJTLuLEHFEVmiE5Z5TWgd1EYpr1Hz8iNzBlnYxkoIgYOonYrA+Eb6a2GYGev AmXg0Kv/Mc3SPv6nBqHZHhlAIs1rORlx/XpecTsurH5jN0+AMtSAR7WfhSkNwfWTjM9k +FEdJ+mphbt+F8En8Bv1YNy8BQBU+D8EQzUcvE+RrDOt/IY+/+X0kT+mbX2yaE2Lk89E 02KbBFEMi5HXCiMG2j8TA/nODxGUKn3v7bUw5WCefJ1b6IphH3fhr0eWxyd7l8YBp3lX zv5E68rGQV4W01ILIBfNOLgUFaWTLJeCI+yiwqaYP86/E1VHJQy+KVYBGpILQ+WhbR28 0hLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=otYGzzn3LKG4yWyp25apfp60MaXyLD3mfWJVy1ltrA8=; b=n9sTf9Vchto+ofPYPPgvFP+I1DXTrPVRM5aUCWwg64cLPCNFh2wU+jSbfdb9ePqKbo 3ra05jMoQ33jduzVj2qu03yGZfBeroGct1RCQx3TrpYiso79r2YzVXMK380y1Sa/y30p NNvmVtp40ne6hemgRafOy9Cr4TmOhbTkP7VzhDJCyZkrc3G8iS+7WNP3iUzL3rTQG9+G xk2CDMRX9dqeBRHofePWalbJo/YRb6RwDFY/tND6KgYo2qk3ky4c5Oaqe7DcDb/pztiO Hms698g8zA+0li2V2xYuakQcLiLZAJzxfIpJlzlqj7FwGj3wjnNko7f8jbjQ2dT/NH6V vybA== X-Gm-Message-State: AOAM531/YenRQfpJNDWvkoYNKNncy7jh5aYHaZxRUhMa1UuC4Ca90H7x 2F4sJ0jpJJagGBxOEc8NvUy0y35v9au8eZ+ogDkYXePiYfQ= X-Received: by 2002:a17:906:c301:: with SMTP id s1mr18635614ejz.409.1635563787686; Fri, 29 Oct 2021 20:16:27 -0700 (PDT) MIME-Version: 1.0 From: Matt Oliver Date: Sat, 30 Oct 2021 14:16:16 +1100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] libx264: Do not explicitly set X264_API_IMPORTS 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3KlGIosWuPT6 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. Alternatively we can detect the x264 build version in configure and keep the fallback of manually setting the flag on older x264 builds that aren't using pkgconfig (to keep the old behaviour) but that requires some complex configure changes that I'm not sure how best to do (assistance welcome). Signed-off-by: Matt Oliver --- configure | 8 +++----- libavcodec/libx264.c | 4 ---- 2 files changed, 3 insertions(+), 9 deletions(-) -- diff --git a/configure b/configure index ede8f9777b..b35728aace 100755 --- a/configure +++ b/configure @@ -6535,11 +6535,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" && + check_cpp_condition libx264 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" diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 21f434d06d..efbc9608c7 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -34,10 +34,6 @@ #include "atsc_a53.h" #include "sei.h" -#if defined(_MSC_VER) -#define X264_API_IMPORTS 1 -#endif - #include #include #include