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>
This commit is contained in:
Anton Khirnov
2016-08-10 08:29:23 +02:00
parent 404e51478e
commit 00aeedd841
4 changed files with 47 additions and 5 deletions

View File

@@ -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;