ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Fri Apr 19 14:59:29 2024 +0200| [1d17d84b7d564228629d78c1c510de467662c5bc] | 
committer: Andreas Rheinhardt

avcodec/progressframe: Explain how unnamed union can simplify accesses

This relies on the common initial seqence guarantee
(and on C11 support for unnamed members).

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d17d84b7d564228629d78c1c510de467662c5bc
---

 libavcodec/progressframe.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/progressframe.h b/libavcodec/progressframe.h
index dc841f30d2..428a461659 100644
--- a/libavcodec/progressframe.h
+++ b/libavcodec/progressframe.h
@@ -58,6 +58,18 @@
 
 struct AVCodecContext;
 
+/**
+ * The ProgressFrame structure.
+ * Hint: It is guaranteed that the AVFrame pointer is at the start
+ *       of ProgressFrame. This allows to use an unnamed
+ *       union {
+ *            struct {
+ *                AVFrame *f;
+ *            };
+ *            ProgressFrame pf;
+ *       };
+ *       to simplify accessing the embedded AVFrame.
+ */
 typedef struct ProgressFrame {
     struct AVFrame *f;
     struct ProgressInternal *progress;

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

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

Reply via email to