[vlc-devel] [PATCH 3/5] video_output: do not allocate VOUT_MAX_PICTURES by default

Steve Lhomme robux4 at ycbcr.xyz
Wed Dec 5 09:59:04 CET 2018


In "indirect" rendering. The pool can expand later.
---
 src/video_output/vout_wrapper.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 47637c15af..9a7b030b42 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -105,6 +105,12 @@ static void NoDrInit(vout_thread_sys_t *sys)
         sys->display_pool = NULL;
 }
 
+static picture_t *DecoderPoolAlloc(void *ctx, const video_format_t *fmt)
+{
+    (void)ctx;
+    return picture_NewFromFormat(fmt);
+}
+
 int vout_InitWrapper(vout_thread_t *vout)
 {
     vout_thread_sys_t *sys = vout->p;
@@ -137,16 +143,16 @@ int vout_InitWrapper(vout_thread_t *vout)
         sys->display_pool = display_pool;
     } else if (!sys->decoder_pool) {
         sys->decoder_pool =
-            picture_pool_NewFromFormat(&vd->source,
-                                       __MAX(VOUT_MAX_PICTURES,
-                                             reserved_picture + decoder_picture - DISPLAY_PICTURE_COUNT));
+            picture_pool_NewFromFormatEx(&vd->source,
+                                         reserved_picture + decoder_picture - DISPLAY_PICTURE_COUNT,
+                                         NULL, DecoderPoolAlloc);
         if (!sys->decoder_pool)
             return VLC_EGENERIC;
         if (allow_dr) {
             msg_Warn(vout, "Not enough direct buffers, using system memory");
             sys->dpb_size = 0;
         } else {
-            sys->dpb_size = picture_pool_GetSize(sys->decoder_pool) - reserved_picture;
+            sys->dpb_size = decoder_picture - DISPLAY_PICTURE_COUNT;
         }
         NoDrInit(sys);
     }
-- 
2.17.1



More information about the vlc-devel mailing list