[vlc-commits] qsv: create the input_pool once we know the input format we want

Steve Lhomme git at videolan.org
Fri Aug 14 15:13:49 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul 15 11:40:13 2020 +0200| [bdf9ee1ddf8d51caf09f2e1b6ad6255d125ef45c] | committer: Steve Lhomme

qsv: create the input_pool once we know the input format we want

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bdf9ee1ddf8d51caf09f2e1b6ad6255d125ef45c
---

 modules/codec/qsv.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c
index 8571b499dc..92dad1c18e 100644
--- a/modules/codec/qsv.c
+++ b/modules/codec/qsv.c
@@ -555,17 +555,6 @@ static int Open(vlc_object_t *this)
         goto error;
     }
 
-    enc->fmt_in.video.i_chroma = VLC_CODEC_NV12;
-    video_format_t pool_fmt = enc->fmt_in.video;
-    pool_fmt.i_width  = sys->params.mfx.FrameInfo.Width;
-    pool_fmt.i_height = sys->params.mfx.FrameInfo.Height;
-    sys->input_pool = picture_pool_NewFromFormat( &pool_fmt, 18 );
-    if (sys->input_pool == NULL)
-    {
-        msg_Err(enc, "Failed to create the internal pool");
-        goto error;
-    }
-
     sys->params.ExtParam    = (mfxExtBuffer**)&init_params;
     sys->params.NumExtParam =
 #if QSV_HAVE_CO2
@@ -619,10 +608,19 @@ static int Open(vlc_object_t *this)
 
     /* Vlc module configuration */
     enc->fmt_in.i_codec                = VLC_CODEC_NV12; // Intel Media SDK requirement
+    enc->fmt_in.video.i_chroma         = VLC_CODEC_NV12;
     enc->fmt_in.video.i_bits_per_pixel = 12;
+    // require aligned pictures on input, a filter may be added before the encoder
     enc->fmt_in.video.i_width          = sys->params.mfx.FrameInfo.Width;
     enc->fmt_in.video.i_height         = sys->params.mfx.FrameInfo.Height;
 
+    sys->input_pool = picture_pool_NewFromFormat( &enc->fmt_in.video, 18 );
+    if (sys->input_pool == NULL)
+    {
+        msg_Err(enc, "Failed to create the internal pool");
+        goto nomem;
+    }
+
     enc->pf_encode_video = Encode;
 
     return VLC_SUCCESS;



More information about the vlc-commits mailing list