summaryrefslogtreecommitdiff
path: root/libavcodec/decode.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-11-10 16:07:44 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-10 19:48:05 +0100
commit7fa64514c8d2ec4d3dcb5f194511609ddcc288e6 (patch)
tree1a292994bdf39db1a7eb1378fd215969bf44d45d /libavcodec/decode.h
parent9f1cfd88af88a7d7d5c56a368a46639dfdfdef75 (diff)
decode: add a mechanism for performing delayed processing on the decoded frames
This will be useful in the CUVID hwaccel. Merges Libav commit badf0951f54c1332e77455dc40398f3512540c1b.
Diffstat (limited to 'libavcodec/decode.h')
-rw-r--r--libavcodec/decode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/decode.h b/libavcodec/decode.h
index 519f875c98..51947b9ec0 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"
@@ -30,6 +31,19 @@
* private_ref.
*/
typedef struct FrameDecodeData {
+ /**
+ * 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;
/**