summaryrefslogtreecommitdiff
path: root/libavcodec/qsv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-06-22 11:41:26 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-03 09:13:29 +0200
commit536bb17e9659c5ed7576a218d4085cdd6d5742fa (patch)
tree2cd8eb3c14f5552967172f635bbfd1c833b7ec2b /libavcodec/qsv.c
parentd20c118975220a0256027d1c2410bade94b8534d (diff)
qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as well
Stop hardcoding NV12. Also, move this function to the shared code, it will be used by the encoder as well.
Diffstat (limited to 'libavcodec/qsv.c')
-rw-r--r--libavcodec/qsv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 8596f0d94e..5be6405d47 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -89,6 +89,18 @@ int ff_qsv_error(int mfx_err)
}
}
+int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
+{
+ switch (format) {
+ case AV_PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUVJ420P:
+ *fourcc = MFX_FOURCC_NV12;
+ return AV_PIX_FMT_NV12;
+ default:
+ return AVERROR(ENOSYS);
+ }
+}
+
static int qsv_load_plugins(mfxSession session, const char *load_plugins,
void *logctx)
{