aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsv.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-04-13 19:58:05 -0300
committerJames Almer <jamrial@gmail.com>2018-04-13 19:58:05 -0300
commit6f277e1f76121736baf98aedb2bf55d8bb413fa7 (patch)
tree660a1641c04a4bcea7fb5b1ad15554a20444e3fd /libavcodec/qsv.c
parentb13a1210a242d2b3177592ec8687c6f579bff156 (diff)
parent52ed83fa1a7f5170447eff6fad0b6c57119596e9 (diff)
downloadffmpeg-6f277e1f76121736baf98aedb2bf55d8bb413fa7.tar.gz
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/qsv.c')
-rw-r--r--libavcodec/qsv.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 5217adfa9d..6d1fbde452 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -195,6 +195,30 @@ int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
return AVERROR_BUG;
}
+enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
+{
+ enum AVPictureType type;
+ switch (mfx_pic_type & 0x7) {
+ case MFX_FRAMETYPE_I:
+ if (mfx_pic_type & MFX_FRAMETYPE_S)
+ type = AV_PICTURE_TYPE_SI;
+ else
+ type = AV_PICTURE_TYPE_I;
+ break;
+ case MFX_FRAMETYPE_B:
+ type = AV_PICTURE_TYPE_B;
+ break;
+ case MFX_FRAMETYPE_P:
+ if (mfx_pic_type & MFX_FRAMETYPE_S)
+ type = AV_PICTURE_TYPE_SP;
+ else
+ type = AV_PICTURE_TYPE_P;
+ break;
+ }
+
+ return type;
+}
+
static int qsv_load_plugins(mfxSession session, const char *load_plugins,
void *logctx)
{