[vlc-devel] [PATCH 1/5] mmal:vout: don't lock the buffers via the pool anymore

Steve Lhomme robux4 at ycbcr.xyz
Mon Feb 25 15:49:03 CET 2019


This may not work if subsequent calls to lock didn't give the same buffer
pointers.
This pool will probably move in the decoder anyway. The unlock/lock might have
to be done in the Display() if displaying locked pictures is not possible.
---
 modules/hw/mmal/vout.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index ec16b458ca..73656a0ac1 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -455,7 +455,6 @@ static picture_pool_t *vd_pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
     picture_resource_t picture_res;
-    picture_pool_configuration_t picture_pool_cfg;
     MMAL_STATUS_T status;
     unsigned i;
 
@@ -533,14 +532,19 @@ static picture_pool_t *vd_pool(vout_display_t *vd, unsigned count)
 
         sys->pictures[i]->i_planes = sys->i_planes;
         memcpy(sys->pictures[i]->p, sys->planes, sys->i_planes * sizeof(plane_t));
+
+#if 1 /* do the lock once for now */
+        mmal_picture_lock(sys->pictures[i]);
+#endif
     }
 
-    memset(&picture_pool_cfg, 0, sizeof(picture_pool_configuration_t));
-    picture_pool_cfg.picture_count = sys->num_buffers;
-    picture_pool_cfg.picture = sys->pictures;
+#if 0
+    /* the lock needs to be done before the decoder starts using the memory
+     * if the memory changes between lock calls it needs to be kept via the pool */
     picture_pool_cfg.lock = mmal_picture_lock;
+#endif
 
-    sys->picture_pool = picture_pool_NewExtended(&picture_pool_cfg);
+    sys->picture_pool = picture_pool_New(sys->num_buffers, sys->pictures);
     if (!sys->picture_pool) {
         msg_Err(vd, "Failed to create picture pool");
         goto out;
-- 
2.17.1



More information about the vlc-devel mailing list