[vlc-commits] mmal: vout: use the decoder device to get the VCSM mode

Steve Lhomme git at videolan.org
Fri Jan 24 14:15:38 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 22 14:48:24 2020 +0100| [84d4c886213d1adb08df0a6f60f0ac49b12bc4a3] | committer: Steve Lhomme

mmal: vout: use the decoder device to get the VCSM mode

Otherwise initialize the hardware locally.

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

 modules/hw/mmal/vout.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index f47e116da9..06089d5feb 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -95,7 +95,7 @@ typedef struct vout_subpic_s {
 struct vout_display_sys_t {
     vlc_mutex_t manage_mutex;
 
-    vcsm_init_type_t init_type;
+    vlc_decoder_device *dec_dev;
     MMAL_COMPONENT_T *component;
     MMAL_PORT_T *input;
     MMAL_POOL_T *pool; /* mmal buffer headers, used for pushing pictures to component*/
@@ -1076,7 +1076,8 @@ static void CloseMmalVout(vout_display_t * vd)
             msg_Warn(vd, "Could not reset hvs field mode");
     }
 
-    cma_vcsm_exit(sys->init_type);
+    if (sys->dec_dev)
+        vlc_decoder_device_Release(sys->dec_dev);
 
     free(sys);
 }
@@ -1101,7 +1102,7 @@ static int find_display_num(const char * name)
 }
 
 static int OpenMmalVout(vout_display_t *vd, const vout_display_cfg_t *cfg,
-                        video_format_t *fmtp, vlc_video_context *context)
+                        video_format_t *fmtp, vlc_video_context *vctx)
 {
     vout_display_sys_t *sys;
     MMAL_DISPLAYREGION_T display_region;
@@ -1117,14 +1118,26 @@ static int OpenMmalVout(vout_display_t *vd, const vout_display_cfg_t *cfg,
         return VLC_ENOMEM;
     vd->sys = sys;
 
-    vlc_mutex_init(&sys->manage_mutex);
+    if (vctx)
+    {
+        sys->dec_dev = vlc_video_context_HoldDevice(vctx);
+        if (sys->dec_dev && sys->dec_dev->type != VLC_DECODER_DEVICE_MMAL)
+        {
+            vlc_decoder_device_Release(sys->dec_dev);
+            sys->dec_dev = NULL;
+        }
+    }
 
-    if ((sys->init_type = cma_vcsm_init()) == VCSM_INIT_NONE)
+    if (sys->dec_dev == NULL)
+        sys->dec_dev = vlc_decoder_device_Create(VLC_OBJECT(vd), cfg->window);
+    if (sys->dec_dev == NULL || sys->dec_dev->type != VLC_DECODER_DEVICE_MMAL)
     {
-        msg_Err(vd, "VCSM init fail");
+        msg_Err(vd, "Missing decoder device");
         goto fail;
     }
 
+    vlc_mutex_init(&sys->manage_mutex);
+
     vc_tv_register_callback(tvservice_cb, vd);
 
     sys->layer = var_InheritInteger(vd, MMAL_LAYER_NAME);



More information about the vlc-commits mailing list