mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-11-02 23:24:01 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user