[FFmpeg-cvslog] Merge commit 'ce320cf1c4daab3e2e3726ed7d2e879d10f7b991'

Hendrik Leppkes git at videolan.org
Mon Nov 14 16:20:23 EET 2016


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Mon Nov 14 15:19:51 2016 +0100| [220e77391552a61d515a1d8c2b17afd876958613] | committer: Hendrik Leppkes

Merge commit 'ce320cf1c4daab3e2e3726ed7d2e879d10f7b991'

* commit 'ce320cf1c4daab3e2e3726ed7d2e879d10f7b991':
  qsvdec: use the same mfxFrameInfo for allocating frames that was passed to DECODE_Init

Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=220e77391552a61d515a1d8c2b17afd876958613
---

 libavcodec/qsvdec.c | 15 ++++++---------
 libavcodec/qsvdec.h |  1 +
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 9d3a6da..e166336 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -176,10 +176,12 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
         return ff_qsv_error(ret);
     }
 
+    q->frame_info = param.mfx.FrameInfo;
+
     return 0;
 }
 
-static int alloc_frame(AVCodecContext *avctx, QSVFrame *frame)
+static int alloc_frame(AVCodecContext *avctx, QSVContext *q, QSVFrame *frame)
 {
     int ret;
 
@@ -190,12 +192,7 @@ static int alloc_frame(AVCodecContext *avctx, QSVFrame *frame)
     if (frame->frame->format == AV_PIX_FMT_QSV) {
         frame->surface = (mfxFrameSurface1*)frame->frame->data[3];
     } else {
-        frame->surface_internal.Info.BitDepthLuma   = 8;
-        frame->surface_internal.Info.BitDepthChroma = 8;
-        frame->surface_internal.Info.FourCC         = MFX_FOURCC_NV12;
-        frame->surface_internal.Info.Width          = avctx->coded_width;
-        frame->surface_internal.Info.Height         = avctx->coded_height;
-        frame->surface_internal.Info.ChromaFormat   = MFX_CHROMAFORMAT_YUV420;
+        frame->surface_internal.Info = q->frame_info;
 
         frame->surface_internal.Data.PitchLow = frame->frame->linesize[0];
         frame->surface_internal.Data.Y        = frame->frame->data[0];
@@ -230,7 +227,7 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
     last  = &q->work_frames;
     while (frame) {
         if (!frame->surface) {
-            ret = alloc_frame(avctx, frame);
+            ret = alloc_frame(avctx, q, frame);
             if (ret < 0)
                 return ret;
             *surf = frame->surface;
@@ -251,7 +248,7 @@ static int get_surface(AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **
     }
     *last = frame;
 
-    ret = alloc_frame(avctx, frame);
+    ret = alloc_frame(avctx, q, frame);
     if (ret < 0)
         return ret;
 
diff --git a/libavcodec/qsvdec.h b/libavcodec/qsvdec.h
index 01f4cf9..41fb716 100644
--- a/libavcodec/qsvdec.h
+++ b/libavcodec/qsvdec.h
@@ -57,6 +57,7 @@ typedef struct QSVContext {
     AVCodecContext *avctx_internal;
     enum AVPixelFormat orig_pix_fmt;
     uint32_t fourcc;
+    mfxFrameInfo frame_info;
 
     // options set by the caller
     int async_depth;


======================================================================




More information about the ffmpeg-cvslog mailing list