From patchwork Fri Mar 18 08:15:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 34835 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp1583910nkb; Fri, 18 Mar 2022 01:15:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycag1//vioQzDWg2dKoRqCga7xrV4Q/PPkX3jhnArqLFQa+vfq6RShSkaX3YTUVaNy2U2N X-Received: by 2002:a17:907:d03:b0:6da:9618:7ddd with SMTP id gn3-20020a1709070d0300b006da96187dddmr7843677ejc.341.1647591335690; Fri, 18 Mar 2022 01:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647591335; cv=none; d=google.com; s=arc-20160816; b=aZ8rm12+xNod+GRaV/mEKwWnDwXTRody+WF2MiEczNH3HURU8caW7Uxrl2mgg/74Tc pOBYwF5QNcllBSekDaLtvl9bBYqugAnYEJnnTVEgtkz2dhjMxRxfEqnHTIy5JSUGdS5Q QCtgP4aQkvk+1FXAewuexw1D9XBv0S0QAtNBcjpuswtkgaGJmwM9zQ6z8tPu78rS2Cmi hrEVKJdkgNlfiTUbQujBhktuh4ASf8wlVbUBnW6VK6mDPGYzNI2sHN9GylgOPTa9zj1/ fVFMHw+t4hoyjUWHeXUzL4B9ml95JEHTnuNsUp4WFfv55YeUIi+IDo3ahf/WxQged5Ke uKqA== 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:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=Vdw/yRKhsxmO5l0/7crKRV0pFo5eaY/zcujkTfqNHMw=; b=EtRUWhEy4I1zlWBkla48YAMtsEWWe1XPfvSNyZOts9LI4T6vLhCm/MX9VUuJdwJqkj YJfyv9L+LeJdpFHst0MHTcBmoXukA1kFhAUh0WTbIYzMWlvxuZatAH5BLek04WBh7cbz IX14l3TYQfQQNokkHNlpGu0wtOwsKgqjr+/Ox8y1qP5Pv4m3iqBLv/m2+VRkRgTHYnjp KxqNaDVlY91Csq1/Sltosof7Wx4H5sSCHY8sGjxdo5gvNTcYWK3Mmec9AlI5ls+SNg1g eNteFJIx+g1sb2/9H9vSaJB0DZi0XGA9bFDTu4mnKFWVbhh5E7eR6wOulxjdZk34zfWH DISA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=IEkmOHvP; 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 d21-20020a50cd55000000b00418c2b5bea5si3197675edj.391.2022.03.18.01.15.34; Fri, 18 Mar 2022 01:15:35 -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=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=IEkmOHvP; 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 6229F68AEE9; Fri, 18 Mar 2022 10:15:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFBBD68020A for ; Fri, 18 Mar 2022 10:15:23 +0200 (EET) Received: by mail-lj1-f178.google.com with SMTP id r21so3147463ljp.8 for ; Fri, 18 Mar 2022 01:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=LF56y9pet0tslqp/rqeJJn+zjiInKn7cliX6znnMWl4=; b=IEkmOHvPJfbYweMsF45rn5fuqpo3cEUDvgU7G2aXTyGJPsxRbozLrBTF2FGYAjyU/v yqSdeSiFcxHJKT7VdPvNYZtOANcSe1ZVJ5Pu9SSevauz1e/qihG8fsSxKosGJBkp5xJ0 TNuOPKeG+WNaOcfMRbgfkvzzT1jLmowAytYaqFQjfPgNRv7BW7irQvzEXYbNg+LEVUB7 LoveLzQPI36b+7mQcoyE/UXB6/RhBrxdU8zQoaXfNMdOcVt1Fzp+GDGGCgwJlGFvSo5m RoMl8aBmzk+PA9AfoFiIOQZKu49jrx/0qxF5IUFfPz+3Cktppwt5rqcKw1I5UUePJXdz 78Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=LF56y9pet0tslqp/rqeJJn+zjiInKn7cliX6znnMWl4=; b=vktt11YKW/Z+FoPuMCtpH/IsjZSktQv000e4lEHGkUHNWDn+IZpJc0qK5n0oMxR3Ef dXU/RSkitC6z3zKYuFzYWjiB91Xw4UHfS3Pkc4kkcsCAYpkIhRVjPjHjZqMdt5oOj8pi yxfoDLmQAvKz8zn/XGSI9ICW/kjVATrSpEbCBX7tkOV5iGNgemHfVkPkeRYtKpBcR8np jCkxoSj0VKWVt9X5YfvzdBrAI724sRUwT/nKuvNY2gMvWPR7U/jDoNMv1S6Ffxv4Ofzz AEw/lakrIIVEgfjX/ZC/Ay2yObW5dMzIhZTnFzBuU3XEWU2agZ7MexfynL18pYnJQoQ1 3Q0g== X-Gm-Message-State: AOAM533U3l7s0MkbGnPC0lwOF2p7fmVqCXBqie9SWiygnCkTtwmmZWmm Slbgz0Jn/mv2WzsQDslt2UAb4l2AgcbhVGVT X-Received: by 2002:a05:651c:1541:b0:248:de2a:862d with SMTP id y1-20020a05651c154100b00248de2a862dmr5726783ljp.10.1647591322859; Fri, 18 Mar 2022 01:15:22 -0700 (PDT) Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id a17-20020a194f51000000b0044947eead41sm591880lfk.100.2022.03.18.01.15.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 18 Mar 2022 01:15:22 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 18 Mar 2022 10:15:21 +0200 Message-Id: <20220318081521.60218-1-martin@martin.st> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Keep including the full version.h when headers are included externally 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: hbhJU5bu8s++ This avoids unnecessary churn and build breakage for users, by making sure the whole version.h is included like it has been so far, while keeping the benefit of not needing to rebuild most files in the ffmpeg tree on minor/micro bumps. --- Surprisingly many downstream users do seem to rely on the version defines. --- doc/APIchanges | 9 ++------- libavcodec/avcodec.h | 6 ++++++ libavdevice/avdevice.h | 6 ++++++ libavfilter/avfilter.h | 6 ++++++ libavformat/avformat.h | 6 ++++++ libpostproc/postprocess.h | 6 ++++++ libswresample/swresample.h | 6 ++++++ libswscale/swscale.h | 6 ++++++ 8 files changed, 44 insertions(+), 7 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 7b324f48fa..41662da84f 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,15 +14,10 @@ libavutil: 2021-04-27 API changes, most recent first: -2022-03-16 - xxxxxxxxxx - all libraries - version.h, version_major.h - No longer implicitly include lib/version.h in lib/.h. - Users who depend on defines from these files (LIB_VERSION*, - LIB_IDENT) must explicitly include these headers instead of - relying on them being included implicitly. +2022-03-16 - xxxxxxxxxx - all libraries - version_major.h Add lib/version_major.h as new installed headers, which only contain the major version number (and corresponding API deprecation - defines). These headers are still implicitly included from the - library main headers. + defines). 2022-03-10 - xxxxxxxxxx - lavu 57.23.100 - cpu.h Add AV_CPU_FLAG_AVX512ICL. diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c6512f12c4..4dae23d06e 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -44,6 +44,12 @@ #include "defs.h" #include "packet.h" #include "version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "version.h" +#endif /** * @defgroup libavc libavcodec diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h index 6de0e33819..0b32e59fed 100644 --- a/libavdevice/avdevice.h +++ b/libavdevice/avdevice.h @@ -20,6 +20,12 @@ #define AVDEVICE_AVDEVICE_H #include "version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "version.h" +#endif /** * @file diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 3fb41d777c..2e8197c9a6 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -48,6 +48,12 @@ #include "libavutil/rational.h" #include "libavfilter/version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "libavfilter/version.h" +#endif /** * Return the LIBAVFILTER_VERSION_INT constant. diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 03df76af92..f12fa7d904 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -320,6 +320,12 @@ #include "avio.h" #include "libavformat/version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "libavformat/version.h" +#endif struct AVFormatContext; struct AVStream; diff --git a/libpostproc/postprocess.h b/libpostproc/postprocess.h index cf4e78c83a..5decb7e8a9 100644 --- a/libpostproc/postprocess.h +++ b/libpostproc/postprocess.h @@ -35,6 +35,12 @@ */ #include "libpostproc/version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "libpostproc/version.h" +#endif /** * Return the LIBPOSTPROC_VERSION_INT constant. diff --git a/libswresample/swresample.h b/libswresample/swresample.h index 2c4eb3562d..26d42fab8d 100644 --- a/libswresample/swresample.h +++ b/libswresample/swresample.h @@ -126,6 +126,12 @@ #include "libavutil/samplefmt.h" #include "libswresample/version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "libswresample/version.h" +#endif /** * @name Option constants diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 07c69e1ae7..3ebf7c698d 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -34,6 +34,12 @@ #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "version_major.h" +#ifndef HAVE_AV_CONFIG_H +/* When included as part of the ffmpeg build, only include the major version + * to avoid unnecessary rebuilds. When included externally, keep including + * the full version information. */ +#include "version.h" +#endif /** * @defgroup libsws libswscale