diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-11-14 15:19:43 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-11-14 15:19:43 +0100 |
commit | 1bc6cdf2fcbd3caea7b78d0a617c6e338606d756 (patch) | |
tree | 9b0050a5d72d12d67b1fb82ffcc1a2a2effea7e9 /libavcodec/qsvdec.c | |
parent | e122a725fbe9bc5c1bb6047d6be8e0f504d660b9 (diff) | |
parent | 536bb17e9659c5ed7576a218d4085cdd6d5742fa (diff) | |
download | ffmpeg-1bc6cdf2fcbd3caea7b78d0a617c6e338606d756.tar.gz |
Merge commit '536bb17e9659c5ed7576a218d4085cdd6d5742fa'
* commit '536bb17e9659c5ed7576a218d4085cdd6d5742fa':
qsvdec: make ff_qsv_map_pixfmt() return a MFX fourcc as well
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r-- | libavcodec/qsvdec.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 51da8f850c..9d3a6dac6d 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -40,17 +40,6 @@ #include "qsv_internal.h" #include "qsvdec.h" -int ff_qsv_map_pixfmt(enum AVPixelFormat format) -{ - switch (format) { - case AV_PIX_FMT_YUV420P: - case AV_PIX_FMT_YUVJ420P: - return AV_PIX_FMT_NV12; - default: - return AVERROR(ENOSYS); - } -} - static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession session, AVBufferRef *hw_frames_ref) { @@ -150,7 +139,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) param.mfx.FrameInfo.BitDepthLuma = 8; param.mfx.FrameInfo.BitDepthChroma = 8; param.mfx.FrameInfo.Shift = 0; - param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12; + param.mfx.FrameInfo.FourCC = q->fourcc; param.mfx.FrameInfo.Width = avctx->coded_width; param.mfx.FrameInfo.Height = avctx->coded_height; param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; @@ -474,7 +463,7 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q, AV_PIX_FMT_NONE }; enum AVPixelFormat qsv_format; - qsv_format = ff_qsv_map_pixfmt(q->parser->format); + qsv_format = ff_qsv_map_pixfmt(q->parser->format, &q->fourcc); if (qsv_format < 0) { av_log(avctx, AV_LOG_ERROR, "Only 8-bit YUV420 streams are supported.\n"); |