本文整理汇总了C++中GstBufferPoolClass::free_buffer方法的典型用法代码示例。如果您正苦于以下问题:C++ GstBufferPoolClass::free_buffer方法的具体用法?C++ GstBufferPoolClass::free_buffer怎么用?C++ GstBufferPoolClass::free_buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstBufferPoolClass
的用法示例。
在下文中一共展示了GstBufferPoolClass::free_buffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
do_free_buffer (GstBufferPool * pool, GstBuffer * buffer)
{
GstBufferPoolPrivate *priv;
GstBufferPoolClass *pclass;
priv = pool->priv;
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
g_atomic_int_add (&priv->cur_buffers, -1);
GST_LOG_OBJECT (pool, "freeing buffer %p (%u left)", buffer,
priv->cur_buffers);
if (G_LIKELY (pclass->free_buffer))
pclass->free_buffer (pool, buffer);
}
示例2: while
/* must be called with the lock */
static gboolean
default_stop (GstBufferPool * pool)
{
GstBufferPoolPrivate *priv = pool->priv;
GstBuffer *buffer;
GstBufferPoolClass *pclass;
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
/* clear the pool */
while ((buffer = gst_atomic_queue_pop (priv->queue))) {
GST_LOG_OBJECT (pool, "freeing %p", buffer);
gst_poll_read_control (priv->poll);
if (G_LIKELY (pclass->free_buffer))
pclass->free_buffer (pool, buffer);
}
priv->cur_buffers = 0;
return TRUE;
}