From: Wim Taymans Date: Thu, 4 Aug 2011 08:54:29 +0000 (+0200) Subject: bufferpool: add gst_buffer_pool_is_active() X-Git-Tag: RELEASE-0.11.1~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c9be852bcec689a22263a46bd62fe8ce742a415;p=platform%2Fupstream%2Fgstreamer.git bufferpool: add gst_buffer_pool_is_active() --- diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 19a0ee4..1701106 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -293,6 +293,13 @@ do_stop (GstBufferPool * pool) * Control the active state of @pool. When the pool is active, new calls to * gst_buffer_pool_acquire_buffer() will return with GST_FLOW_WRONG_STATE. * + * Activating the bufferpool will preallocate all resources in the pool based on + * the configuration of the pool. + * + * Deactivating will free the resources again when there are no outstanding + * buffers. When there are outstanding buffers, they will be freed as soon as + * they are all returned to the pool. + * * Returns: %FALSE when the pool was not configured or when preallocation of the * buffers failed. */ @@ -368,6 +375,27 @@ stop_failed: } } +/** + * gst_buffer_pool_is_active: + * @pool: a #GstBufferPool + * + * Check if @pool is active. A pool can be activated with the + * gst_buffer_pool_set_active() call. + * + * Returns: %TRUE when the pool is active. + */ +gboolean +gst_buffer_pool_is_active (GstBufferPool * pool) +{ + gboolean res; + + GST_BUFFER_POOL_LOCK (pool); + res = pool->active; + GST_BUFFER_POOL_UNLOCK (pool); + + return res; +} + static gboolean default_set_config (GstBufferPool * pool, GstStructure * config) { diff --git a/gst/gstbufferpool.h b/gst/gstbufferpool.h index 115b052..4d6ce6d 100644 --- a/gst/gstbufferpool.h +++ b/gst/gstbufferpool.h @@ -179,6 +179,7 @@ GstBufferPool * gst_buffer_pool_new (void); /* state management */ gboolean gst_buffer_pool_set_active (GstBufferPool *pool, gboolean active); +gboolean gst_buffer_pool_is_active (GstBufferPool *pool); gboolean gst_buffer_pool_set_config (GstBufferPool *pool, GstStructure *config); GstStructure * gst_buffer_pool_get_config (GstBufferPool *pool); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 35ad278..76e02f0 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -135,6 +135,7 @@ EXPORTS gst_buffer_pool_get_options gst_buffer_pool_get_type gst_buffer_pool_has_option + gst_buffer_pool_is_active gst_buffer_pool_new gst_buffer_pool_release_buffer gst_buffer_pool_set_active