[vlc-devel] commit: Replaced vout_display_t::get by ::pool. (Laurent Aimar )
git version control
git at videolan.org
Sun Dec 13 20:51:13 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Dec 13 20:48:10 2009 +0100| [149587ec70d32767467760b86e12755860edbf3a] | committer: Laurent Aimar
Replaced vout_display_t::get by ::pool.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=149587ec70d32767467760b86e12755860edbf3a
---
include/vlc_vout_display.h | 13 ++++++++-----
include/vlc_vout_wrapper.h | 6 +++---
src/video_output/display.c | 7 +++++--
src/video_output/display.h | 4 ++--
4 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 5f927e0..af486e9 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -31,6 +31,7 @@
#include <vlc_es.h>
#include <vlc_picture.h>
+#include <vlc_picture_pool.h>
#include <vlc_subpicture.h>
#include <vlc_keys.h>
#include <vlc_mouse.h>
@@ -265,14 +266,16 @@ struct vout_display_t {
*/
vout_display_info_t info;
- /* Return a new picture_t (mandatory).
+ /* Return a pointer over the current picture_pool_t* (mandatory).
*
+ * For performance reasons, it is best to provide at least count
+ * pictures but it is not mandatory.
* You can return NULL when you cannot/do not want to allocate
- * more pictures.
- * If you want to create a pool of reusable pictures, you can
- * use a picture_pool_t.
+ * pictures.
+ * The vout display module keeps the ownership of the pool and can
+ * destroy it only when closing or on invalid pictures control.
*/
- picture_t *(*get)(vout_display_t *);
+ picture_pool_t *(*pool)(vout_display_t *, unsigned count);
/* Prepare a picture for display (optional).
*
diff --git a/include/vlc_vout_wrapper.h b/include/vlc_vout_wrapper.h
index d6a9e2b..d7ff196 100644
--- a/include/vlc_vout_wrapper.h
+++ b/include/vlc_vout_wrapper.h
@@ -30,11 +30,11 @@
/* XXX DO NOT use it outside the vout module wrapper XXX */
/**
- * It retreive a picture from the display
+ * It retreives a picture pool from the display
*/
-static inline picture_t *vout_display_Get(vout_display_t *vd)
+static inline picture_pool_t *vout_display_Pool(vout_display_t *vd, unsigned count)
{
- return vd->get(vd);
+ return vd->pool(vd, count);
}
/**
diff --git a/src/video_output/display.c b/src/video_output/display.c
index eec4536..8f3681d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -58,7 +58,10 @@ static picture_t *VideoBufferNew(filter_t *filter)
vd->fmt.i_width == fmt->i_width &&
vd->fmt.i_height == fmt->i_height);
- return vout_display_Get(vd);
+ picture_pool_t *pool = vout_display_Pool(vd, 1);
+ if (!pool)
+ return NULL;
+ return picture_pool_Get(pool);
}
static void VideoBufferDelete(filter_t *filter, picture_t *picture)
{
@@ -112,7 +115,7 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
vd->info.has_pictures_invalid = false;
vd->cfg = cfg;
- vd->get = NULL;
+ vd->pool = NULL;
vd->prepare = NULL;
vd->display = NULL;
vd->control = NULL;
diff --git a/src/video_output/display.h b/src/video_output/display.h
index 89e5dc7..2fa083f 100644
--- a/src/video_output/display.h
+++ b/src/video_output/display.h
@@ -34,9 +34,9 @@
/**
* It retreive a picture from the display
*/
-static inline picture_t *vout_display_Get(vout_display_t *vd)
+static inline picture_pool_t *vout_display_Pool(vout_display_t *vd, unsigned count)
{
- return vd->get(vd);
+ return vd->pool(vd, count);
}
/**
More information about the vlc-devel
mailing list