Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-11-10 18:07:44 +0300
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-10 21:48:05 +0300
commit7fa64514c8d2ec4d3dcb5f194511609ddcc288e6 (patch)
tree1a292994bdf39db1a7eb1378fd215969bf44d45d /libavcodec/decode.c
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.c')
-rw-r--r--libavcodec/decode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 0f215d6915..8b03f61a22 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -620,6 +620,18 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
av_assert0((frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) ||
!(avctx->codec->capabilities & AV_CODEC_CAP_DR1));
+ if (frame->private_ref) {
+ FrameDecodeData *fdd = (FrameDecodeData*)frame->private_ref->data;
+
+ if (fdd->post_process) {
+ ret = fdd->post_process(avctx, frame);
+ if (ret < 0) {
+ av_frame_unref(frame);
+ return ret;
+ }
+ }
+ }
+
av_buffer_unref(&frame->private_ref);
}
@@ -1566,6 +1578,9 @@ static void decode_data_free(void *opaque, uint8_t *data)
{
FrameDecodeData *fdd = (FrameDecodeData*)data;
+ if (fdd->post_process_opaque_free)
+ fdd->post_process_opaque_free(fdd->post_process_opaque);
+
av_freep(&fdd);
}