Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] Keep including the full version.h when headers are included externally
Date: Fri, 18 Mar 2022 10:15:21 +0200
Message-ID: <20220318081521.60218-1-martin@martin.st> (raw)

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<name>/version.h in lib<name>/<name>.h.
-  Users who depend on defines from these files (LIB<name>_VERSION*,
-  LIB<name>_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<name>/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
-- 
2.32.0 (Apple Git-132)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

             reply	other threads:[~2022-03-18  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  8:15 Martin Storsjö [this message]
2022-03-18 22:13 ` Martin Storsjö

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220318081521.60218-1-martin@martin.st \
    --to=martin@martin.st \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git