本文整理汇总了C++中GstBufferPoolClass::flush_start方法的典型用法代码示例。如果您正苦于以下问题:C++ GstBufferPoolClass::flush_start方法的具体用法?C++ GstBufferPoolClass::flush_start怎么用?C++ GstBufferPoolClass::flush_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstBufferPoolClass
的用法示例。
在下文中一共展示了GstBufferPoolClass::flush_start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/* must be called with the lock */
static void
do_set_flushing (GstBufferPool * pool, gboolean flushing)
{
GstBufferPoolPrivate *priv = pool->priv;
GstBufferPoolClass *pclass;
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
if (GST_BUFFER_POOL_IS_FLUSHING (pool) == flushing)
return;
if (flushing) {
g_atomic_int_set (&pool->flushing, 1);
gst_poll_write_control (priv->poll);
if (pclass->flush_start)
pclass->flush_start (pool);
} else {
if (pclass->flush_stop)
pclass->flush_stop (pool);
gst_poll_read_control (priv->poll);
g_atomic_int_set (&pool->flushing, 0);
}
}
示例2: while
/* must be called with the lock */
static void
do_set_flushing (GstBufferPool * pool, gboolean flushing)
{
GstBufferPoolPrivate *priv = pool->priv;
GstBufferPoolClass *pclass;
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
if (GST_BUFFER_POOL_IS_FLUSHING (pool) == flushing)
return;
if (flushing) {
g_atomic_int_set (&pool->flushing, 1);
/* Write the flush token to wake up any waiters */
gst_poll_write_control (priv->poll);
if (pclass->flush_start)
pclass->flush_start (pool);
} else {
if (pclass->flush_stop)
pclass->flush_stop (pool);
while (!gst_poll_read_control (priv->poll)) {
if (errno == EWOULDBLOCK) {
/* This should not really happen unless flushing and unflushing
* happens on different threads. Let's wait a bit to get back flush
* token from the thread that was setting it to flushing */
g_thread_yield ();
continue;
} else {
/* Critical error but GstPoll already complained */
break;
}
}
g_atomic_int_set (&pool->flushing, 0);
}
}