diff options
author | Anton Khirnov <anton@khirnov.net> | 2017-07-01 12:09:58 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2017-07-26 23:24:07 +0200 |
commit | badf0951f54c1332e77455dc40398f3512540c1b (patch) | |
tree | 091044be61b9fa9c1d57a5e9764fb6fea35c99b1 /libavcodec/decode.h | |
parent | 359a8a3e2d1194b52b6c386f94fd0929567dfb67 (diff) | |
download | ffmpeg-badf0951f54c1332e77455dc40398f3512540c1b.tar.gz |
decode: add a mechanism for performing delayed processing on the decoded frames
This will be useful in the CUVID hwaccel.
Diffstat (limited to 'libavcodec/decode.h')
-rw-r--r-- | libavcodec/decode.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/decode.h b/libavcodec/decode.h index 61b53b2445..72052f1de5 100644 --- a/libavcodec/decode.h +++ b/libavcodec/decode.h @@ -22,6 +22,7 @@ #define AVCODEC_DECODE_H #include "libavutil/buffer.h" +#include "libavutil/frame.h" #include "avcodec.h" @@ -34,6 +35,20 @@ typedef struct FrameDecodeData { * The original user-set opaque_ref. */ AVBufferRef *user_opaque_ref; + + /** + * The callback to perform some delayed processing on the frame right + * before it is returned to the caller. + * + * @note This code is called at some unspecified point after the frame is + * returned from the decoder's decode/receive_frame call. Therefore it cannot rely + * on AVCodecContext being in any specific state, so it does not get to + * access AVCodecContext directly at all. All the state it needs must be + * stored in the post_process_opaque object. + */ + int (*post_process)(void *logctx, AVFrame *frame); + void *post_process_opaque; + void (*post_process_opaque_free)(void *opaque); } FrameDecodeData; /** |