mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 01:54:17 +00:00
bufferpool: add gst_buffer_pool_is_active()
This commit is contained in:
parent
6366d976d1
commit
7c9be852bc
3 changed files with 30 additions and 0 deletions
|
@ -293,6 +293,13 @@ do_stop (GstBufferPool * pool)
|
||||||
* Control the active state of @pool. When the pool is active, new calls to
|
* 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.
|
* 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
|
* Returns: %FALSE when the pool was not configured or when preallocation of the
|
||||||
* buffers failed.
|
* 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
|
static gboolean
|
||||||
default_set_config (GstBufferPool * pool, GstStructure * config)
|
default_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
{
|
{
|
||||||
|
|
|
@ -179,6 +179,7 @@ GstBufferPool * gst_buffer_pool_new (void);
|
||||||
|
|
||||||
/* state management */
|
/* state management */
|
||||||
gboolean gst_buffer_pool_set_active (GstBufferPool *pool, gboolean active);
|
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);
|
gboolean gst_buffer_pool_set_config (GstBufferPool *pool, GstStructure *config);
|
||||||
GstStructure * gst_buffer_pool_get_config (GstBufferPool *pool);
|
GstStructure * gst_buffer_pool_get_config (GstBufferPool *pool);
|
||||||
|
|
|
@ -135,6 +135,7 @@ EXPORTS
|
||||||
gst_buffer_pool_get_options
|
gst_buffer_pool_get_options
|
||||||
gst_buffer_pool_get_type
|
gst_buffer_pool_get_type
|
||||||
gst_buffer_pool_has_option
|
gst_buffer_pool_has_option
|
||||||
|
gst_buffer_pool_is_active
|
||||||
gst_buffer_pool_new
|
gst_buffer_pool_new
|
||||||
gst_buffer_pool_release_buffer
|
gst_buffer_pool_release_buffer
|
||||||
gst_buffer_pool_set_active
|
gst_buffer_pool_set_active
|
||||||
|
|
Loading…
Reference in a new issue