[vlc-devel] [PATCH 42/42] vout: separate the configure structures for the device and the display

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 16 16:59:17 CEST 2019


vout_device_configuration_t is for device configuration
vout_configuration_t is for display configuration
---
 src/input/decoder.c              | 5 ++---
 src/input/resource.c             | 4 ++--
 src/input/resource.h             | 2 +-
 src/video_output/video_output.c  | 2 +-
 src/video_output/vout_internal.h | 7 ++++++-
 5 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 7acc828a6fc..f979fca5e1f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -608,9 +608,8 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
     vlc_mutex_unlock( &p_owner->lock );
 
     if ( pp_dec_dev ) *pp_dec_dev = NULL;
-    vout_configuration_t cfg = {
-        .vout = p_vout, .clock = p_owner->p_clock, .fmt = &fmt,
-        .mouse_event = MouseEvent, .mouse_opaque = p_dec
+    vout_device_configuration_t cfg = {
+        .vout = p_vout, .fmt = &fmt,
     };
     p_vout = input_resource_GetVoutDecoderDevice( p_owner->p_resource,
                                     &cfg, order, pp_dec_dev );
diff --git a/src/input/resource.c b/src/input/resource.c
index aa219845c58..4830d344837 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -365,11 +365,11 @@ void input_resource_PutVout(input_resource_t *p_resource,
 }
 
 vout_thread_t *input_resource_GetVoutDecoderDevice(input_resource_t *p_resource,
-                                      const vout_configuration_t *cfg,
+                                      const vout_device_configuration_t *cfg,
                                       enum vlc_vout_order *order,
                                       vlc_decoder_device **pp_dec_dev)
 {
-    vout_configuration_t cfg_buf;
+    vout_device_configuration_t cfg_buf;
     vout_thread_t *vout;
 
     assert(cfg != NULL);
diff --git a/src/input/resource.h b/src/input/resource.h
index a2990a013fb..6e85b3661db 100644
--- a/src/input/resource.h
+++ b/src/input/resource.h
@@ -38,7 +38,7 @@ void input_resource_SetInput( input_resource_t *, input_thread_t * );
 sout_instance_t *input_resource_RequestSout( input_resource_t *, sout_instance_t *, const char *psz_sout );
 
 vout_thread_t *input_resource_GetVoutDecoderDevice(input_resource_t *,
-                                      const vout_configuration_t *,
+                                      const vout_device_configuration_t *,
                                       enum vlc_vout_order *order,
                                       vlc_decoder_device **);
 int input_resource_StartVout(input_resource_t *, vlc_video_context *, const vout_configuration_t *);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cc2a407fa98..7081fc0259a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -2074,7 +2074,7 @@ int vout_Request(const vout_configuration_t *cfg, vlc_video_context *vctx, input
     return 0;
 }
 
-vlc_decoder_device *vout_GetDevice(const vout_configuration_t *cfg)
+vlc_decoder_device *vout_GetDevice(const vout_device_configuration_t *cfg)
 {
     vlc_decoder_device *dec_device = NULL;
 
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 7de42c39fea..d7bd809e5dc 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -46,6 +46,11 @@
 /**
  * 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;
@@ -202,7 +207,7 @@ vout_thread_t *vout_CreateDummy(vlc_object_t *obj) VLC_USED;
  * \param cfg the video configuration requested.
  * \return pointer to a decoder device reference to use with the vout or NULL
  */
-vlc_decoder_device *vout_GetDevice(const vout_configuration_t *cfg);
+vlc_decoder_device *vout_GetDevice(const vout_device_configuration_t *cfg);
 
 /**
  * Returns a suitable vout or release the given one.
-- 
2.17.1



More information about the vlc-devel mailing list