bufferpool: add gst_buffer_pool_is_active()

This commit is contained in:
Wim Taymans 2011-08-04 10:54:29 +02:00
parent 6366d976d1
commit 7c9be852bc
3 changed files with 30 additions and 0 deletions

View file

@ -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)
{

View file

@ -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);

View file

@ -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