Commit 4ab61cd9 authored by Anton Khirnov's avatar Anton Khirnov

qsv{enc,dec}: extend the internal frame allocator

Handle the internal frame requests, which is required by the HEVC
encoding plugin.
Signed-off-by: 's avatarMaxym Dmytrychenko <maxym.dmytrychenko@intel.com>
parent 00aeedd8
This diff is collapsed.
......@@ -37,7 +37,12 @@
MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
typedef struct QSVMid {
AVBufferRef *hw_frames_ref;
mfxHDL handle;
AVFrame *locked_frame;
AVFrame *hw_frame;
mfxFrameSurface1 surf;
} QSVMid;
typedef struct QSVFrame {
......@@ -52,7 +57,13 @@ typedef struct QSVFrame {
typedef struct QSVFramesContext {
AVBufferRef *hw_frames_ctx;
mfxFrameInfo info;
void *logctx;
/* The memory ids for the external frames.
* Refcounted, since we need one reference owned by the QSVFramesContext
* (i.e. by the encoder/decoder) and another one given to the MFX session
* from the frame allocator. */
AVBufferRef *mids_buf;
QSVMid *mids;
int nb_mids;
} QSVFramesContext;
......
......@@ -416,8 +416,7 @@ int ff_qsv_decode_close(QSVContext *q)
MFXClose(q->internal_session);
av_buffer_unref(&q->frames_ctx.hw_frames_ctx);
av_freep(&q->frames_ctx.mids);
q->frames_ctx.nb_mids = 0;
av_buffer_unref(&q->frames_ctx.mids_buf);
return 0;
}
......
......@@ -1093,8 +1093,7 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
q->internal_session = NULL;
av_buffer_unref(&q->frames_ctx.hw_frames_ctx);
av_freep(&q->frames_ctx.mids);
q->frames_ctx.nb_mids = 0;
av_buffer_unref(&q->frames_ctx.mids_buf);
cur = q->work_frames;
while (cur) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment