[vlc-devel] [PATCH 10/14] mmal: Restore old buffer configuration

Julian Scheel julian at jusst.de
Mon Jan 19 11:30:29 CET 2015


With previours cleanups we reduced the number of allocated mmal buffers and
buffer headers. This caused some issues as the mmal components had to wait for
buffers frequently, which slowed them down. To avoid framedrops and even
picture stalls revert to the old buffer configuration, which wastes a bit
memory in theory but works way more reliable and smooth.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 modules/hw/mmal/codec.c        | 10 ++++++----
 modules/hw/mmal/mmal_picture.h |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 5e2bd83..d151d75 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -38,10 +38,11 @@
 
 #include "mmal_picture.h"
 
-/* These are only required when combined with image_fx filter. But as they
- * won't do much harm besides using a few MB GPU memory, keep them always on
+/* 
+ * This seems to be a bit high, but reducing it causes instabilities
  */
-#define NUM_EXTRA_BUFFERS 5
+#define NUM_EXTRA_BUFFERS 20
+#define NUM_DECODER_BUFFER_HEADERS 20
 
 #define MIN_NUM_BUFFERS_IN_TRANSIT 2
 
@@ -317,12 +318,13 @@ static int change_output_format(decoder_t *dec)
 
     if (sys->opaque) {
         sys->output->buffer_num = NUM_ACTUAL_OPAQUE_BUFFERS;
+        pool_size = NUM_DECODER_BUFFER_HEADERS;
     } else {
         sys->output->buffer_num = __MAX(sys->output->buffer_num_recommended,
                 MIN_NUM_BUFFERS_IN_TRANSIT);
+        pool_size = sys->output->buffer_num;
     }
 
-    pool_size = sys->output->buffer_num;
     sys->output->buffer_size = sys->output->buffer_size_recommended;
 
     status = mmal_port_enable(sys->output, output_port_cb);
diff --git a/modules/hw/mmal/mmal_picture.h b/modules/hw/mmal/mmal_picture.h
index e5276af..f30a277 100644
--- a/modules/hw/mmal/mmal_picture.h
+++ b/modules/hw/mmal/mmal_picture.h
@@ -25,7 +25,7 @@
 #include <interface/mmal/mmal.h>
 
 /* Think twice before changing this. Incorrect values cause havoc. */
-#define NUM_ACTUAL_OPAQUE_BUFFERS 20
+#define NUM_ACTUAL_OPAQUE_BUFFERS 40
 
 struct picture_sys_t {
     vlc_object_t *owner;
-- 
2.2.1




More information about the vlc-devel mailing list