diff options
author | James Almer <jamrial@gmail.com> | 2018-04-14 01:58:05 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-04-14 01:58:05 +0300 |
commit | 6f277e1f76121736baf98aedb2bf55d8bb413fa7 (patch) | |
tree | 660a1641c04a4bcea7fb5b1ad15554a20444e3fd /libavcodec/qsvdec.c | |
parent | b13a1210a242d2b3177592ec8687c6f579bff156 (diff) | |
parent | 52ed83fa1a7f5170447eff6fad0b6c57119596e9 (diff) |
Merge commit '52ed83fa1a7f5170447eff6fad0b6c57119596e9'
* commit '52ed83fa1a7f5170447eff6fad0b6c57119596e9':
lavc/qsvdec: expose frame pic_type and key_frame
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r-- | libavcodec/qsvdec.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 45bedf9a7b..80e1e645eb 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -232,6 +232,11 @@ static int alloc_frame(AVCodecContext *avctx, QSVContext *q, QSVFrame *frame) frame->surface.Data.MemId = &q->frames_ctx.mids[ret]; } + frame->surface.Data.ExtParam = &frame->ext_param; + frame->surface.Data.NumExtParam = 1; + frame->ext_param = (mfxExtBuffer*)&frame->dec_info; + frame->dec_info.Header.BufferId = MFX_EXTBUFF_DECODED_FRAME_INFO; + frame->dec_info.Header.BufferSz = sizeof(frame->dec_info); frame->used = 1; @@ -416,6 +421,10 @@ FF_ENABLE_DEPRECATION_WARNINGS outsurf->Info.PicStruct & MFX_PICSTRUCT_FIELD_TFF; frame->interlaced_frame = !(outsurf->Info.PicStruct & MFX_PICSTRUCT_PROGRESSIVE); + frame->pict_type = ff_qsv_map_pictype(out_frame->dec_info.FrameType); + //Key frame is IDR frame is only suitable for H264. For HEVC, IRAPs are key frames. + if (avctx->codec_id == AV_CODEC_ID_H264) + frame->key_frame = !!(out_frame->dec_info.FrameType & MFX_FRAMETYPE_IDR); /* update the surface properties */ if (avctx->pix_fmt == AV_PIX_FMT_QSV) |