本文整理汇总了C++中GstAggregatorClass::clip方法的典型用法代码示例。如果您正苦于以下问题:C++ GstAggregatorClass::clip方法的具体用法?C++ GstAggregatorClass::clip怎么用?C++ GstAggregatorClass::clip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstAggregatorClass
的用法示例。
在下文中一共展示了GstAggregatorClass::clip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static GstFlowReturn
_chain (GstPad * pad, GstObject * object, GstBuffer * buffer)
{
GstBuffer *actual_buf = buffer;
GstAggregator *self = GST_AGGREGATOR (object);
GstAggregatorPrivate *priv = self->priv;
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
GstAggregatorClass *aggclass = GST_AGGREGATOR_GET_CLASS (object);
GST_DEBUG_OBJECT (aggpad, "Start chaining a buffer %" GST_PTR_FORMAT, buffer);
if (g_atomic_int_get (&aggpad->priv->flushing) == TRUE)
goto flushing;
if (g_atomic_int_get (&aggpad->priv->pending_eos) == TRUE)
goto eos;
PAD_LOCK_EVENT (aggpad);
if (aggpad->buffer) {
GST_DEBUG_OBJECT (aggpad, "Waiting for buffer to be consumed");
PAD_WAIT_EVENT (aggpad);
}
PAD_UNLOCK_EVENT (aggpad);
if (g_atomic_int_get (&aggpad->priv->flushing) == TRUE)
goto flushing;
if (aggclass->clip) {
aggclass->clip (self, aggpad, buffer, &actual_buf);
}
PAD_LOCK_EVENT (aggpad);
if (aggpad->buffer)
gst_buffer_unref (aggpad->buffer);
aggpad->buffer = actual_buf;
PAD_UNLOCK_EVENT (aggpad);
_add_aggregate_gsource (self);
GST_DEBUG_OBJECT (aggpad, "Done chaining");
return priv->flow_return;
flushing:
gst_buffer_unref (buffer);
GST_DEBUG_OBJECT (aggpad, "We are flushing");
return GST_FLOW_FLUSHING;
eos:
gst_buffer_unref (buffer);
GST_DEBUG_OBJECT (pad, "We are EOS already...");
return GST_FLOW_EOS;
}
示例2:
static GstFlowReturn
_chain (GstPad * pad, GstObject * object, GstBuffer * buffer)
{
GstBuffer *actual_buf = buffer;
GstAggregator *self = GST_AGGREGATOR (object);
GstAggregatorPrivate *priv = self->priv;
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
GstAggregatorClass *aggclass = GST_AGGREGATOR_GET_CLASS (object);
GstClockTime timeout = gst_aggregator_get_timeout (self);
GstClockTime now;
GST_DEBUG_OBJECT (aggpad, "Start chaining a buffer %" GST_PTR_FORMAT, buffer);
if (aggpad->priv->timeout_id) {
gst_clock_id_unschedule (aggpad->priv->timeout_id);
gst_clock_id_unref (aggpad->priv->timeout_id);
aggpad->priv->timeout_id = NULL;
}
g_atomic_int_set (&aggpad->unresponsive, FALSE);
PAD_STREAM_LOCK (aggpad);
if (g_atomic_int_get (&aggpad->priv->flushing) == TRUE)
goto flushing;
if (g_atomic_int_get (&aggpad->priv->pending_eos) == TRUE)
goto eos;
PAD_LOCK_EVENT (aggpad);
if (aggpad->buffer) {
GST_DEBUG_OBJECT (aggpad, "Waiting for buffer to be consumed");
PAD_WAIT_EVENT (aggpad);
}
PAD_UNLOCK_EVENT (aggpad);
if (g_atomic_int_get (&aggpad->priv->flushing) == TRUE)
goto flushing;
if (aggclass->clip) {
aggclass->clip (self, aggpad, buffer, &actual_buf);
}
PAD_LOCK_EVENT (aggpad);
if (aggpad->buffer)
gst_buffer_unref (aggpad->buffer);
aggpad->buffer = actual_buf;
PAD_UNLOCK_EVENT (aggpad);
PAD_STREAM_UNLOCK (aggpad);
QUEUE_PUSH (self);
if (GST_CLOCK_TIME_IS_VALID (timeout)) {
now = gst_clock_get_time (self->clock);
aggpad->priv->timeout_id =
gst_clock_new_single_shot_id (self->clock, now + timeout);
gst_clock_id_wait_async (aggpad->priv->timeout_id, _unresponsive_timeout,
gst_object_ref (aggpad), gst_object_unref);
}
GST_DEBUG_OBJECT (aggpad, "Done chaining");
return priv->flow_return;
flushing:
PAD_STREAM_UNLOCK (aggpad);
gst_buffer_unref (buffer);
GST_DEBUG_OBJECT (aggpad, "We are flushing");
return GST_FLOW_FLUSHING;
eos:
PAD_STREAM_UNLOCK (aggpad);
gst_buffer_unref (buffer);
GST_DEBUG_OBJECT (pad, "We are EOS already...");
return GST_FLOW_EOS;
}