summaryrefslogtreecommitdiff
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-08-10 08:29:23 +0200
committerAnton Khirnov <anton@khirnov.net>2016-11-07 12:47:54 +0100
commit00aeedd84105a17f414185bd33ecadebeddb3a27 (patch)
tree6b65d33f3ad9b28e89198e67cab5edf85cd16e17 /libavcodec/qsvdec.c
parent404e51478ecad060249d5b9bee6ab39a8a9d8c1c (diff)
qsv{dec,enc}: use a struct as a memory id with internal memory allocator
This will allow implementing the allocator more fully, which is needed by the HEVC encoder plugin with video memory input. Signed-off-by: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 8353d252d2..398c319b30 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -188,6 +188,14 @@ static int alloc_frame(AVCodecContext *avctx, QSVContext *q, QSVFrame *frame)
frame->surface.Data.UV = frame->frame->data[1];
}
+ if (q->frames_ctx.mids) {
+ ret = ff_qsv_find_surface_idx(&q->frames_ctx, frame);
+ if (ret < 0)
+ return ret;
+
+ frame->surface.Data.MemId = &q->frames_ctx.mids[ret];
+ }
+
frame->used = 1;
return 0;