mirror of https://git.ffmpeg.org/ffmpeg.git
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.rheinhardt@outlook.com>
This commit is contained in:
parent
822e2843ca
commit
1d17d84b7d
|
@ -58,6 +58,18 @@
|
||||||
|
|
||||||
struct AVCodecContext;
|
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 {
|
typedef struct ProgressFrame {
|
||||||
struct AVFrame *f;
|
struct AVFrame *f;
|
||||||
struct ProgressInternal *progress;
|
struct ProgressInternal *progress;
|
||||||
|
|
Loading…
Reference in New Issue