[vlc-devel] [PATCH 5/5] video_output: remove write-only vout_device_configuration_t structure

Steve Lhomme robux4 at ycbcr.xyz
Wed Jan 22 11:44:05 CET 2020


We don't use the video_format from it anymore. Only the vout pointer was used.
---
 modules/hw/nvdec/nvdec.c         | 17 +++++++++--------
 src/input/decoder.c              | 10 ++--------
 src/video_output/vout_internal.h |  5 -----
 3 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index 19b45e25297..5ece171bbb6 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -788,6 +788,15 @@ static int OpenDecoder(vlc_object_t *p_this)
         goto error;
     }
 
+    vlc_decoder_device *dec_device = decoder_GetDecoderDevice( p_dec );
+    if (dec_device == NULL)
+        goto error;
+    if (dec_device->type == VLC_DECODER_DEVICE_NVDEC)
+    {
+        p_sys->vctx_out = vlc_video_context_Create( dec_device, VLC_VIDEO_CONTEXT_NVDEC, 0, NULL );
+    }
+    vlc_decoder_device_Release(dec_device);
+
     uint8_t i_depth_luma;
     cudaVideoChromaFormat cudaChroma;
 
@@ -912,14 +921,6 @@ static int OpenDecoder(vlc_object_t *p_this)
         goto error;
     }
 
-    vlc_decoder_device *dec_device = decoder_GetDecoderDevice( p_dec );
-    if (dec_device == NULL)
-        goto error;
-    if (dec_device->type == VLC_DECODER_DEVICE_NVDEC)
-    {
-        p_sys->vctx_out = vlc_video_context_Create( dec_device, VLC_VIDEO_CONTEXT_NVDEC, 0, NULL );
-    }
-    vlc_decoder_device_Release(dec_device);
     if (unlikely(p_sys->vctx_out == NULL))
     {
         msg_Err(p_dec, "failed to create a video context");
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 8f250fb2b0d..3c5ce0fdf0b 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -539,11 +539,8 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
                 *pp_vout = p_owner->p_vout;
             if ( pp_dec_dev )
                 *pp_dec_dev = NULL;
-            vout_device_configuration_t cfg = {
-                .vout = p_owner->p_vout, .fmt = &p_dec->fmt_out.video,
-            };
             input_resource_GetVoutDecoderDevice( p_owner->p_resource,
-                                                cfg.vout, order, pp_dec_dev );
+                                                p_owner->p_vout, order, pp_dec_dev );
             *order = p_owner->vout_order;
             vlc_mutex_unlock( &p_owner->lock );
         }
@@ -557,11 +554,8 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
     vlc_mutex_unlock( &p_owner->lock );
 
     if ( pp_dec_dev ) *pp_dec_dev = NULL;
-    vout_device_configuration_t cfg = {
-        .vout = p_vout, .fmt = &p_dec->fmt_out.video,
-    };
     p_vout = input_resource_GetVoutDecoderDevice( p_owner->p_resource,
-                                    cfg.vout, order, pp_dec_dev );
+                                    p_vout, order, pp_dec_dev );
 
     if (pp_vout)
         *pp_vout = p_vout;
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 95643a52ef0..43536e935fa 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -46,11 +46,6 @@
 /**
  * Vout configuration
  */
-typedef struct {
-    vout_thread_t        *vout;
-    const video_format_t *fmt; // for the initial window dimensions
-} vout_device_configuration_t;
-
 typedef struct {
     vout_thread_t        *vout;
     vlc_clock_t          *clock;
-- 
2.17.1



More information about the vlc-devel mailing list