summaryrefslogtreecommitdiff
path: root/libavcodec/qsvenc.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/qsvenc.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/qsvenc.c')
-rw-r--r--libavcodec/qsvenc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 3d99e846e3..be8cbee884 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -872,6 +872,14 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
return ret;
qf->surface = *(mfxFrameSurface1*)qf->frame->data[3];
+
+ if (q->frames_ctx.mids) {
+ ret = ff_qsv_find_surface_idx(&q->frames_ctx, qf);
+ if (ret < 0)
+ return ret;
+
+ qf->surface.Data.MemId = &q->frames_ctx.mids[ret];
+ }
} else {
/* make a copy if the input is not padded as libmfx requires */
if (frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) {