本文整理汇总了C++中GstAggregatorClass类的典型用法代码示例。如果您正苦于以下问题:C++ GstAggregatorClass类的具体用法?C++ GstAggregatorClass怎么用?C++ GstAggregatorClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GstAggregatorClass类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: src_query_func
static gboolean
src_query_func (GstPad * pad, GstObject * parent, GstQuery * query)
{
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (parent);
return klass->src_query (GST_AGGREGATOR (parent), query);
}
示例2: aggregate_func
static gboolean
aggregate_func (GstAggregator * self)
{
GstAggregatorPrivate *priv = self->priv;
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (self);
GST_LOG_OBJECT (self, "Checking aggregate");
while (priv->send_eos && gst_aggregator_iterate_sinkpads (self,
(GstAggregatorPadForeachFunc) _check_all_pads_with_data_or_eos,
NULL) && priv->running) {
GST_TRACE_OBJECT (self, "Actually aggregating!");
priv->flow_return = klass->aggregate (self);
if (priv->flow_return == GST_FLOW_EOS) {
g_main_context_wakeup (self->priv->mcontext);
_remove_all_sources (self);
_push_eos (self);
}
if (priv->flow_return == GST_FLOW_FLUSHING &&
g_atomic_int_get (&priv->flush_seeking))
priv->flow_return = GST_FLOW_OK;
GST_LOG_OBJECT (self, "flow return is %s",
gst_flow_get_name (priv->flow_return));
if (priv->flow_return != GST_FLOW_OK)
break;
}
return G_SOURCE_REMOVE;
}
示例3: src_event_func
static gboolean
src_event_func (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (parent);
return klass->src_event (GST_AGGREGATOR (parent), event);
}
示例4: src_activate_mode
static gboolean
src_activate_mode (GstPad * pad,
GstObject * parent, GstPadMode mode, gboolean active)
{
GstAggregator *self = GST_AGGREGATOR (parent);
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (parent);
if (klass->src_activate) {
if (klass->src_activate (self, mode, active) == FALSE) {
return FALSE;
}
}
if (active == TRUE) {
switch (mode) {
case GST_PAD_MODE_PUSH:
{
GST_INFO_OBJECT (pad, "Activating pad!");
_start_srcpad_task (self);
return TRUE;
}
default:
{
GST_ERROR_OBJECT (pad, "Only supported mode is PUSH");
return FALSE;
}
}
}
/* deactivating */
GST_INFO_OBJECT (self, "Deactivating srcpad");
_stop_srcpad_task (self, FALSE);
return TRUE;
}
示例5: _chain
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;
}
示例6: _flush
static GstFlowReturn
_flush (GstAggregator * self)
{
GstFlowReturn ret = GST_FLOW_OK;
GstAggregatorPrivate *priv = self->priv;
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (self);
GST_DEBUG_OBJECT (self, "Flushing everything");
g_atomic_int_set (&priv->send_segment, TRUE);
g_atomic_int_set (&priv->flush_seeking, FALSE);
g_atomic_int_set (&priv->tags_changed, FALSE);
if (klass->flush)
ret = klass->flush (self);
return ret;
}
示例7: aggregate_func
static void
aggregate_func (GstAggregator * self)
{
GstAggregatorPrivate *priv = self->priv;
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (self);
if (self->priv->running == FALSE) {
GST_DEBUG_OBJECT (self, "Not running anymore");
return;
}
QUEUE_POP (self);
GST_LOG_OBJECT (self, "Checking aggregate");
while (priv->send_eos && gst_aggregator_iterate_sinkpads (self,
(GstAggregatorPadForeachFunc)
_check_all_pads_with_data_or_eos_or_timeout, NULL) && priv->running) {
GST_TRACE_OBJECT (self, "Actually aggregating!");
priv->flow_return = klass->aggregate (self);
if (priv->flow_return == GST_FLOW_EOS) {
QUEUE_FLUSH (self);
_push_eos (self);
}
if (priv->flow_return == GST_FLOW_FLUSHING &&
g_atomic_int_get (&priv->flush_seeking))
priv->flow_return = GST_FLOW_OK;
GST_LOG_OBJECT (self, "flow return is %s",
gst_flow_get_name (priv->flow_return));
if (priv->flow_return != GST_FLOW_OK)
break;
}
}
示例8: _chain
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;
}