Updated vout display modules after ::get -> ::pool change.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 13 Dec 2009 19:49:37 +0000 (20:49 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 13 Dec 2009 19:50:55 +0000 (20:50 +0100)
17 files changed:
modules/misc/dummy/dummy.c
modules/misc/dummy/dummy.h
modules/misc/dummy/vout.c
modules/video_output/aa.c
modules/video_output/caca.c
modules/video_output/directfb.c
modules/video_output/fb.c
modules/video_output/msw/direct3d.c
modules/video_output/msw/glwin32.c
modules/video_output/sdl.c
modules/video_output/snapshot.c
modules/video_output/vmem.c
modules/video_output/wrapper.c
modules/video_output/xcb/glx.c
modules/video_output/xcb/x11.c
modules/video_output/xcb/xvideo.c
modules/video_output/yuv.c

index f0e8877..da746a6 100644 (file)
@@ -98,7 +98,7 @@ vlc_module_begin ()
         set_description( N_("Dummy video output function") )
         set_section( N_( "Dummy Video output" ), NULL )
         set_capability( "vout display", 1 )
-        set_callbacks( OpenVideo, NULL )
+        set_callbacks( OpenVideo, CloseVideo )
         set_category( CAT_VIDEO )
         set_subcategory( SUBCAT_VIDEO_VOUT )
         add_category_hint( N_("Video"), NULL, false )
@@ -108,7 +108,7 @@ vlc_module_begin ()
         set_description( N_("Stats video output function") )
         set_capability( "vout display", 0 )
         add_shortcut( "stats" )
-        set_callbacks( OpenVideoStat, NULL )
+        set_callbacks( OpenVideoStat, CloseVideo )
     add_submodule ()
         set_description( N_("Dummy font renderer function") )
         set_capability( "text renderer", 1 )
index 5fded58..97837e9 100644 (file)
@@ -40,5 +40,6 @@ int  OpenAudio    ( vlc_object_t * );
 
 int  OpenVideo    ( vlc_object_t * );
 int  OpenVideoStat( vlc_object_t * );
+void CloseVideo   ( vlc_object_t * );
 
 int  OpenRenderer ( vlc_object_t * );
index 77e06af..e85e22f 100644 (file)
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get(vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static void       DisplayStat(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+struct vout_display_sys_t {
+    picture_pool_t *pool;
+};
+static picture_pool_t *Pool(vout_display_t *, unsigned count);
+static void            Display(vout_display_t *, picture_t *);
+static void            DisplayStat(vout_display_t *, picture_t *);
+static int             Control(vout_display_t *, int, va_list);
+static void            Manage (vout_display_t *);
 
 /*****************************************************************************
  * OpenVideo: activates dummy vout display method
@@ -48,6 +51,12 @@ static void       Manage (vout_display_t *);
 static int OpenVideoCommon(vlc_object_t *object, bool display_stat)
 {
     vout_display_t *vd = (vout_display_t *)object;
+    vout_display_sys_t *sys;
+
+    vd->sys = sys = calloc(1, sizeof(*sys));
+    if (!sys)
+        return VLC_EGENERIC;
+    sys->pool = NULL;
 
     /* p_vd->info is not modified */
 
@@ -60,11 +69,11 @@ static int OpenVideoCommon(vlc_object_t *object, bool display_stat)
         }
         free(chroma);
     }
-    vd->get = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = display_stat ? DisplayStat : Display;
     vd->control = Control;
-    vd->manage = Manage;
+    vd->manage  = Manage;
 
     return VLC_SUCCESS;
 }
@@ -77,10 +86,21 @@ int OpenVideoStat(vlc_object_t *object)
     return OpenVideoCommon(object, true);
 }
 
-static picture_t *Get(vout_display_t *vd)
+void CloseVideo(vlc_object_t *object)
 {
-    VLC_UNUSED(vd);
-    return picture_NewFromFormat(&vd->fmt);
+    vout_display_t *vd = (vout_display_t *)object;
+    vout_display_sys_t *sys = vd->sys;
+
+    picture_pool_Delete(sys->pool);
+    free(sys);
+}
+
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
+{
+    vout_display_sys_t *sys = vd->sys;
+    if (!sys->pool)
+        sys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
+    return sys->pool;
 }
 
 static void Display(vout_display_t *vd, picture_t *picture)
index 528f528..925ecb3 100644 (file)
@@ -58,10 +58,10 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Prepare(vout_display_t *, picture_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
+static picture_pool_t *Pool   (vout_display_t *, unsigned);
+static void            Prepare(vout_display_t *, picture_t *);
+static void            Display(vout_display_t *, picture_t *);
+static int             Control(vout_display_t *, int, va_list);
 
 /* */
 static void Manage(vout_display_t *);
@@ -115,11 +115,11 @@ static int Open(vlc_object_t *object)
     vd->fmt = fmt;
     vd->info = info;
 
-    vd->get = Get;
+    vd->pool    = Pool;
     vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
-    vd->manage = Manage;
+    vd->manage  = Manage;
 
     /* Inspect initial configuration and send correction events
      * FIXME how to handle aspect ratio with aa ? */
@@ -152,11 +152,12 @@ static void Close(vlc_object_t *object)
 }
 
 /**
- * Return a direct buffer
+ * Return a pool of direct buffers
  */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
+    VLC_UNUSED(count);
 
     if (!sys->pool) {
         picture_resource_t rsc;
@@ -171,11 +172,8 @@ static picture_t *Get(vout_display_t *vd)
             return NULL;
 
         sys->pool = picture_pool_New(1, &p_picture);
-        if (!sys->pool)
-            return NULL;
     }
-
-    return picture_pool_Get(sys->pool);
+    return sys->pool;
 }
 
 /**
index e70bbe2..8c00685 100644 (file)
@@ -55,10 +55,10 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Prepare(vout_display_t *, picture_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Prepare(vout_display_t *, picture_t *);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
 
 /* */
 static void Manage(vout_display_t *);
@@ -164,11 +164,6 @@ static int Open(vlc_object_t *object)
         fmt.i_bmask = 0x000000ff;
     }
 
-    /* */
-    sys->pool = picture_pool_NewFromFormat(&fmt, 1);
-    if (!sys->pool)
-        goto error;
-
     /* TODO */
     vout_display_info_t info = vd->info;
 
@@ -176,11 +171,11 @@ static int Open(vlc_object_t *object)
     vd->fmt = fmt;
     vd->info = info;
 
-    vd->get = Get;
+    vd->pool    = Pool;
     vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
-    vd->manage = Manage;
+    vd->manage  = Manage;
 
     /* Fix initial state */
     vout_display_SendEventFullscreen(vd, false);
@@ -215,7 +210,8 @@ static void Close(vlc_object_t *object)
     vout_display_t *vd = (vout_display_t *)object;
     vout_display_sys_t *sys = vd->sys;
 
-    picture_pool_Delete(sys->pool);
+    if (sys->pool)
+        picture_pool_Delete(sys->pool);
     if (sys->dither)
         cucul_free_dither(sys->dither);
     caca_free_display(sys->dp);
@@ -229,13 +225,15 @@ static void Close(vlc_object_t *object)
 }
 
 /**
- * Return a direct buffer
+ * Return a pool of direct buffers
  */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    return picture_pool_Get(sys->pool);
+    if (!sys->pool)
+        sys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
+    return sys->pool;
 }
 
 /**
index 2378e81..1fc57d5 100644 (file)
@@ -55,10 +55,10 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
 /* */
 static int  OpenDisplay (vout_display_t *);
@@ -157,7 +157,7 @@ static int Open(vlc_object_t *object)
     /* */
     vd->fmt     = fmt;
     vd->info    = info;
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -182,16 +182,13 @@ static void Close(vlc_object_t *object)
 }
 
 /* */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    if (!sys->pool) {
-        sys->pool = picture_pool_NewFromFormat(&vd->fmt, 1);
-        if (!sys->pool)
-            return NULL;
-    }
-    return picture_pool_Get(sys->pool);
+    if (!sys->pool)
+        sys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
+    return sys->pool;
 }
 
 static void Display(vout_display_t *vd, picture_t *picture)
index 7c63129..f376a03 100644 (file)
@@ -98,10 +98,10 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
 /* */
 static int  OpenDisplay  (vout_display_t *, bool force_resolution);
@@ -262,7 +262,7 @@ static int Open(vlc_object_t *object)
     /* */
     vd->fmt     = fmt;
     vd->info    = info;
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -296,7 +296,7 @@ static void Close(vlc_object_t *object)
 }
 
 /* */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
 
@@ -322,11 +322,9 @@ static picture_t *Get(vout_display_t *vd)
         if (sys->is_hw_accel)
             sys->pool = picture_pool_New(1, &sys->picture);
         else
-            sys->pool = picture_pool_NewFromFormat(&vd->fmt, 1);
-        if (!sys->pool)
-            return NULL;
+            sys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
     }
-    return picture_pool_Get(sys->pool);
+    return sys->pool;
 }
 static void Display(vout_display_t *vd, picture_t *picture)
 {
index 282c5c1..970f3a3 100644 (file)
@@ -97,11 +97,11 @@ struct picture_sys_t
 
 static int  Open(vlc_object_t *);
 
-static picture_t *Get    (vout_display_t *);
-static void       Prepare(vout_display_t *, picture_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Prepare(vout_display_t *, picture_t *);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
 static int  Direct3DCreate (vout_display_t *);
 static int  Direct3DReset  (vout_display_t *);
@@ -177,7 +177,7 @@ static int Open(vlc_object_t *object)
     vd->fmt  = fmt;
     vd->info = info;
 
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
@@ -231,13 +231,10 @@ static void Close(vlc_object_t *object)
 }
 
 /* */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
-    vout_display_sys_t *sys = vd->sys;
-
-    if (!sys->pool)
-        return NULL;
-    return picture_pool_Get(sys->pool);
+    VLC_UNUSED(count);
+    return vd->sys->pool;
 }
 
 static int  Direct3DLockSurface(picture_t *);
index 7601fd9..2e2b240 100644 (file)
@@ -74,13 +74,13 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Prepare(vout_display_t *, picture_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Prepare(vout_display_t *, picture_t *);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
-static void       Swap   (vout_opengl_t *);
+static void           Swap   (vout_opengl_t *);
 
 /**
  * It creates an OpenGL vout display.
@@ -140,7 +140,7 @@ static int Open(vlc_object_t *object)
     vd->fmt  = fmt;
     vd->info = info;
 
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = Prepare;
     vd->display = Display;
     vd->control = Control;
@@ -177,16 +177,14 @@ static void Close(vlc_object_t *object)
 }
 
 /* */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
+    VLC_UNUSED(count);
 
-    if (!sys->pool) {
+    if (!sys->pool)
         sys->pool = vout_display_opengl_GetPool(&sys->vgl);
-        if (!sys->pool)
-            return NULL;
-    }
-    return picture_pool_Get(sys->pool);
+    return sys->pool;
 }
 
 static void Prepare(vout_display_t *vd, picture_t *picture)
index bb25cb8..7eb48ad 100644 (file)
@@ -77,10 +77,10 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage(vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage(vout_display_t *);
 
 /* */
 static int ConvertKey(SDLKey);
@@ -337,7 +337,7 @@ static int Open(vlc_object_t *object)
     vd->fmt = fmt;
     vd->info = info;
 
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -389,11 +389,12 @@ static void Close(vlc_object_t *object)
 }
 
 /**
- * Return a direct buffer
+ * Return a pool of direct buffers
  */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
+    VLC_UNUSED(count);
 
     if (!sys->pool) {
         picture_resource_t rsc;
@@ -430,11 +431,9 @@ static picture_t *Get(vout_display_t *vd)
             return NULL;
 
         sys->pool = picture_pool_New(1, &picture);
-        if (!sys->pool)
-            return NULL;
     }
 
-    return picture_pool_Get(sys->pool);
+    return sys->pool;
 }
 
 /**
index 702da33..c17a5af 100644 (file)
@@ -90,10 +90,10 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
 typedef struct {
   mtime_t date;         /* Presentation time */
@@ -243,7 +243,7 @@ static int Open(vlc_object_t *object)
     /* */
     vd->fmt     = fmt;
     vd->info    = info;
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -281,9 +281,10 @@ static void Close(vlc_object_t *object)
 /*****************************************************************************
  *
  *****************************************************************************/
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
-    return picture_pool_Get(vd->sys->pool);
+    VLC_UNUSED(count);
+    return vd->sys->pool;
 }
 
 /* Return the position in ms from the start of the movie */
index 5f9cbe0..a63be9b 100644 (file)
@@ -98,13 +98,13 @@ struct vout_display_sys_t {
     picture_pool_t *pool;
 };
 
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
-static int        Lock(picture_t *);
-static void       Unlock(picture_t *);
+static int            Lock(picture_t *);
+static void           Unlock(picture_t *);
 
 /*****************************************************************************
  * Open: allocates video thread
@@ -228,7 +228,7 @@ static int Open(vlc_object_t *object)
     /* */
     vd->fmt     = fmt;
     vd->info    = info;
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -250,9 +250,10 @@ static void Close(vlc_object_t *object)
 }
 
 /* */
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
-    return picture_pool_Get(vd->sys->pool);
+    VLC_UNUSED(count);
+    return vd->sys->pool;
 }
 
 static void Display(vout_display_t *vd, picture_t *picture)
index ebe7f72..6243893 100644 (file)
@@ -301,7 +301,10 @@ static int Init(vout_thread_t *vout)
         picture->p_sys = malloc(sizeof(*picture->p_sys));
 
         if (sys->use_dr) {
-            picture_t *direct = vout_display_Get(vd);
+            picture_pool_t *pool = vout_display_Pool(vd, picture_max);
+            if (!pool)
+                break;
+            picture_t *direct = picture_pool_Get(pool);
             if (!direct)
                 break;
             picture->format = direct->format;
index 6804c35..534d0cc 100644 (file)
@@ -76,7 +76,7 @@ struct vout_display_sys_t
     picture_pool_t *pool; /* picture pool */
 };
 
-static picture_t *Get (vout_display_t *);
+static picture_pool_t *Pool (vout_display_t *, unsigned);
 static void PictureRender (vout_display_t *, picture_t *);
 static void PictureDisplay (vout_display_t *, picture_t *);
 static int Control (vout_display_t *, int, va_list);
@@ -375,7 +375,7 @@ static int Open (vlc_object_t *obj)
     /* Setup vout_display_t once everything is fine */
     vd->info = info;
 
-    vd->get = Get;
+    vd->pool = Pool;
     vd->prepare = PictureRender;
     vd->display = PictureDisplay;
     vd->control = Control;
@@ -431,17 +431,14 @@ static void SwapBuffers (vout_opengl_t *gl)
 /**
  * Return a direct buffer
  */
-static picture_t *Get (vout_display_t *vd)
+static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
 {
     vout_display_sys_t *sys = vd->sys;
+    (void)requested_count;
 
     if (!sys->pool)
-    {
         sys->pool = vout_display_opengl_GetPool (&sys->vgl);
-        if (!sys->pool)
-            return NULL;
-    }
-    return picture_pool_Get (sys->pool);
+    return sys->pool;
 }
 
 static void PictureRender (vout_display_t *vd, picture_t *pic)
index 13b9c0b..a8a003e 100644 (file)
@@ -83,7 +83,7 @@ struct vout_display_sys_t
     picture_resource_t resource[MAX_PICTURES];
 };
 
-static picture_t *Get (vout_display_t *);
+static picture_pool_t *Pool (vout_display_t *, unsigned);
 static void Display (vout_display_t *, picture_t *);
 static int Control (vout_display_t *, int, va_list);
 static void Manage (vout_display_t *);
@@ -281,7 +281,7 @@ static int Open (vlc_object_t *obj)
     vd->fmt = fmt_pic;
     vd->info = info;
 
-    vd->get = Get;
+    vd->pool = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -317,9 +317,10 @@ static void Close (vlc_object_t *obj)
 /**
  * Return a direct buffer
  */
-static picture_t *Get (vout_display_t *vd)
+static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
 {
     vout_display_sys_t *p_sys = vd->sys;
+    (void)requested_count;
 
     if (!p_sys->pool)
     {
@@ -366,16 +367,11 @@ static picture_t *Get (vout_display_t *vd)
             return NULL;
 
         p_sys->pool = picture_pool_New (count, pic_array);
-        if (!p_sys->pool)
-        {
-            /* TODO release picture resources */
-            return NULL;
-        }
-        /* FIXME should also do it in case of error ? */
+        /* TODO release picture resources if NULL */
         xcb_flush (p_sys->conn);
     }
 
-    return picture_pool_Get (p_sys->pool);
+    return p_sys->pool;
 }
 
 /**
index 9edbbfe..03e9670 100644 (file)
@@ -94,7 +94,7 @@ struct vout_display_sys_t
     picture_resource_t resource[MAX_PICTURES];
 };
 
-static picture_t *Get (vout_display_t *);
+static picture_pool_t *Pool (vout_display_t *, unsigned);
 static void Display (vout_display_t *, picture_t *);
 static int Control (vout_display_t *, int, va_list);
 static void Manage (vout_display_t *);
@@ -514,7 +514,7 @@ static int Open (vlc_object_t *obj)
     vd->fmt = fmt;
     vd->info = info;
 
-    vd->get = Get;
+    vd->pool = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -564,9 +564,10 @@ static void Close (vlc_object_t *obj)
 /**
  * Return a direct buffer
  */
-static picture_t *Get (vout_display_t *vd)
+static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
 {
     vout_display_sys_t *p_sys = vd->sys;
+    (void)requested_count;
 
     if (!p_sys->pool)
     {
@@ -621,16 +622,11 @@ static picture_t *Get (vout_display_t *vd)
             return NULL;
 
         p_sys->pool = picture_pool_New (count, pic_array);
-        if (!p_sys->pool)
-        {
-            /* TODO release picture resources */
-            return NULL;
-        }
-        /* FIXME should also do it in case of error ? */
+        /* TODO release picture resources if NULL */
         xcb_flush (p_sys->conn);
     }
 
-    return picture_pool_Get (p_sys->pool);
+    return p_sys->pool;
 }
 
 /**
index 648124b..8113936 100644 (file)
@@ -80,10 +80,10 @@ static const char *const ppsz_vout_options[] = {
 };
 
 /* */
-static picture_t *Get    (vout_display_t *);
-static void       Display(vout_display_t *, picture_t *);
-static int        Control(vout_display_t *, int, va_list);
-static void       Manage (vout_display_t *);
+static picture_pool_t *Pool  (vout_display_t *, unsigned);
+static void           Display(vout_display_t *, picture_t *);
+static int            Control(vout_display_t *, int, va_list);
+static void           Manage (vout_display_t *);
 
 /*****************************************************************************
  * vout_display_sys_t: video output descriptor
@@ -92,7 +92,6 @@ struct vout_display_sys_t {
     FILE *f;
     bool  is_first;
     bool  is_yuv4mpeg2;
-    bool  use_dr;
 
     picture_pool_t *pool;
 };
@@ -133,7 +132,6 @@ static int Open(vlc_object_t *object)
             return VLC_EGENERIC;
         }
     }
-    sys->use_dr = chroma == vd->fmt.i_chroma;
     msg_Dbg(vd, "Using chroma %4.4s", (char *)&chroma);
 
     /* */
@@ -166,7 +164,7 @@ static int Open(vlc_object_t *object)
     /* */
     vd->fmt     = fmt;
     vd->info    = info;
-    vd->get     = Get;
+    vd->pool    = Pool;
     vd->prepare = NULL;
     vd->display = Display;
     vd->control = Control;
@@ -191,15 +189,12 @@ static void Close(vlc_object_t *object)
 /*****************************************************************************
  *
  *****************************************************************************/
-static picture_t *Get(vout_display_t *vd)
+static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
-    if (!sys->pool) {
-        sys->pool = picture_pool_NewFromFormat(&vd->fmt, sys->use_dr ? VOUT_MAX_PICTURES : 1);
-        if (!sys->pool)
-            return NULL;
-    }
-    return picture_pool_Get(sys->pool);
+    if (!sys->pool)
+        sys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
+    return sys->pool;
 }
 
 static void Display(vout_display_t *vd, picture_t *picture)