Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/8] lavu: add macros to help making future-proof structures
@ 2023-04-28  9:55 Nicolas George
  2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 2/8] lavu: new AVWriter API Nicolas George
                   ` (8 more replies)
  0 siblings, 9 replies; 38+ messages in thread
From: Nicolas George @ 2023-04-28  9:55 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: Nicolas George <george@nsup.org>
---
 libavutil/extendable.h | 59 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 libavutil/extendable.h


FFReservedPadding is used by the WIP JSON writer.


diff --git a/libavutil/extendable.h b/libavutil/extendable.h
new file mode 100644
index 0000000000..79980fa202
--- /dev/null
+++ b/libavutil/extendable.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2021 The FFmpeg project
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_EXTENDABLE_H
+#define AVUTIL_EXTENDABLE_H
+
+/**
+ * @defgroup ff_extendable FFExtendable
+ *
+ * Types and macros to help designing structures that can be allocated by
+ * the application, including on the stack, but will not break ABI when
+ * extendded.
+ *
+ * This should not be used outside FFmpeg.
+ *
+ * @{
+ */
+
+/**
+ * Define a value of type as a compound literal (hidden local variable)
+ * with the field self_size filled.
+ */
+#define FF_NEW_SZ(type) ((type){ .self_size = sizeof(type) })
+
+/**
+ * Type suitable for paddign at the end of a structure, with maximum
+ * alignment.
+ */
+typedef union FFReservedPadding {
+    union {
+        double d;
+        void *p;
+        void (*f)(void);
+        intmax_t i;
+    } dummy;
+} FFReservedPadding;
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_EXTENDABLE_H */
-- 
2.39.2

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2023-05-02 18:47 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28  9:55 [FFmpeg-devel] [PATCH 1/8] lavu: add macros to help making future-proof structures Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 2/8] lavu: new AVWriter API Nicolas George
2023-04-28 10:37   ` Rodney Baker
2023-04-28 11:20     ` Nicolas George
2023-05-02 15:53   ` Rémi Denis-Courmont
2023-05-02 16:53     ` Nicolas George
2023-05-02 18:29       ` Rémi Denis-Courmont
2023-05-02 18:36         ` Nicolas George
2023-05-02 18:46           ` Rémi Denis-Courmont
2023-05-02 18:47             ` Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 3/8] lavu/writer: add test Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 4/8] lavf/dump: use a writer Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 5/8] lavu: add a JSON writer API (WIP) Nicolas George
2023-04-29  9:11   ` Nicolas George
2023-04-29  9:41     ` Anton Khirnov
2023-04-29 14:06       ` James Almer
2023-04-29 17:17         ` Nicolas George
2023-04-29 15:06       ` Derek Buitenhuis
2023-04-30  0:29         ` Kieran Kunhya
2023-05-01  6:20           ` Vittorio Giovara
2023-04-29 17:11       ` Nicolas George
2023-04-29 18:27         ` Anton Khirnov
2023-04-29 18:33           ` Nicolas George
2023-05-01  6:57             ` Leo Izen
2023-05-01  9:51               ` Nicolas George
2023-05-01 10:18               ` Jean-Baptiste Kempf
2023-04-30 15:06           ` Michael Niedermayer
2023-04-30 21:51             ` Kieran Kunhya
2023-05-01  9:46             ` Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 6/8] lavu: add JSON writer test (WIP) Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 7/8] lavf/options: add av_disposition_write() Nicolas George
2023-04-28  9:55 ` [FFmpeg-devel] [PATCH 8/8] lavf/dump: use av_disposition_write() Nicolas George
2023-04-29  8:17 ` [FFmpeg-devel] [PATCH 1/8] lavu: add macros to help making future-proof structures Anton Khirnov
2023-04-29 15:11   ` Derek Buitenhuis
2023-05-02 15:36 ` Rémi Denis-Courmont
2023-05-02 16:42   ` Nicolas George
2023-05-02 18:31     ` Rémi Denis-Courmont
2023-05-02 18:38       ` Nicolas George

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