mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
aggregator: make GstAggregatorPadForeachFunc take an GstAggregatorPad
This commit is contained in:
parent
2054d94d50
commit
c1f6ef5f53
2 changed files with 16 additions and 15 deletions
|
@ -297,7 +297,7 @@ gst_aggregator_iterate_sinkpads (GstAggregator * self,
|
||||||
switch (gst_iterator_next (iter, &item)) {
|
switch (gst_iterator_next (iter, &item)) {
|
||||||
case GST_ITERATOR_OK:
|
case GST_ITERATOR_OK:
|
||||||
{
|
{
|
||||||
GstPad *pad;
|
GstAggregatorPad *pad;
|
||||||
|
|
||||||
pad = g_value_get_object (&item);
|
pad = g_value_get_object (&item);
|
||||||
|
|
||||||
|
@ -307,8 +307,9 @@ gst_aggregator_iterate_sinkpads (GstAggregator * self,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "calling function on pad %s:%s",
|
GST_LOG_OBJECT (pad, "calling function %s on pad",
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_FUNCPTR_NAME (func));
|
||||||
|
|
||||||
result = func (self, pad, user_data);
|
result = func (self, pad, user_data);
|
||||||
|
|
||||||
done = !result;
|
done = !result;
|
||||||
|
@ -346,7 +347,7 @@ no_iter:
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
_check_all_pads_with_data_or_eos (GstAggregator * self,
|
gst_aggregator_check_all_pads_with_data_or_eos (GstAggregator * self,
|
||||||
GstAggregatorPad * aggpad, gpointer user_data)
|
GstAggregatorPad * aggpad, gpointer user_data)
|
||||||
{
|
{
|
||||||
if (aggpad->buffer || aggpad->eos) {
|
if (aggpad->buffer || aggpad->eos) {
|
||||||
|
@ -498,8 +499,7 @@ _wait_and_check (GstAggregator * self, gboolean * timeout)
|
||||||
gst_aggregator_get_latency (self, &live, &latency_min, &latency_max);
|
gst_aggregator_get_latency (self, &live, &latency_min, &latency_max);
|
||||||
|
|
||||||
if (gst_aggregator_iterate_sinkpads (self,
|
if (gst_aggregator_iterate_sinkpads (self,
|
||||||
(GstAggregatorPadForeachFunc) _check_all_pads_with_data_or_eos,
|
gst_aggregator_check_all_pads_with_data_or_eos, NULL)) {
|
||||||
NULL)) {
|
|
||||||
GST_DEBUG_OBJECT (self, "all pads have data");
|
GST_DEBUG_OBJECT (self, "all pads have data");
|
||||||
SRC_STREAM_UNLOCK (self);
|
SRC_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
|
@ -577,7 +577,7 @@ _wait_and_check (GstAggregator * self, gboolean * timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
res = gst_aggregator_iterate_sinkpads (self,
|
res = gst_aggregator_iterate_sinkpads (self,
|
||||||
(GstAggregatorPadForeachFunc) _check_all_pads_with_data_or_eos, NULL);
|
gst_aggregator_check_all_pads_with_data_or_eos, NULL);
|
||||||
SRC_STREAM_UNLOCK (self);
|
SRC_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -868,8 +868,9 @@ eat:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static inline gboolean
|
||||||
_stop_pad (GstAggregator * self, GstAggregatorPad * pad, gpointer unused_udata)
|
gst_aggregator_stop_pad (GstAggregator * self, GstAggregatorPad * pad,
|
||||||
|
gpointer unused_udata)
|
||||||
{
|
{
|
||||||
_aggpad_flush (pad, self);
|
_aggpad_flush (pad, self);
|
||||||
|
|
||||||
|
@ -884,8 +885,7 @@ gst_aggregator_stop (GstAggregator * agg)
|
||||||
|
|
||||||
_reset_flow_values (agg);
|
_reset_flow_values (agg);
|
||||||
|
|
||||||
gst_aggregator_iterate_sinkpads (agg,
|
gst_aggregator_iterate_sinkpads (agg, gst_aggregator_stop_pad, NULL);
|
||||||
(GstAggregatorPadForeachFunc) _stop_pad, NULL);
|
|
||||||
|
|
||||||
if (agg->priv->tags)
|
if (agg->priv->tags)
|
||||||
gst_tag_list_unref (agg->priv->tags);
|
gst_tag_list_unref (agg->priv->tags);
|
||||||
|
@ -1722,7 +1722,7 @@ _chain (GstPad * pad, GstObject * object, GstBuffer * buffer)
|
||||||
|
|
||||||
SRC_STREAM_LOCK (self);
|
SRC_STREAM_LOCK (self);
|
||||||
if (gst_aggregator_iterate_sinkpads (self,
|
if (gst_aggregator_iterate_sinkpads (self,
|
||||||
(GstAggregatorPadForeachFunc) _check_all_pads_with_data_or_eos, NULL))
|
gst_aggregator_check_all_pads_with_data_or_eos, NULL))
|
||||||
SRC_STREAM_BROADCAST_UNLOCKED (self);
|
SRC_STREAM_BROADCAST_UNLOCKED (self);
|
||||||
SRC_STREAM_UNLOCK (self);
|
SRC_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
|
|
|
@ -267,10 +267,11 @@ void gst_aggregator_set_latency (GstAggregator
|
||||||
|
|
||||||
GType gst_aggregator_get_type(void);
|
GType gst_aggregator_get_type(void);
|
||||||
|
|
||||||
/* API that should eventually land in GstElement itself*/
|
/* API that should eventually land in GstElement itself (FIXME) */
|
||||||
typedef gboolean (*GstAggregatorPadForeachFunc) (GstAggregator * self,
|
typedef gboolean (*GstAggregatorPadForeachFunc) (GstAggregator * aggregator,
|
||||||
GstPad * pad,
|
GstAggregatorPad * aggregator_pad,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
gboolean gst_aggregator_iterate_sinkpads (GstAggregator * self,
|
gboolean gst_aggregator_iterate_sinkpads (GstAggregator * self,
|
||||||
GstAggregatorPadForeachFunc func,
|
GstAggregatorPadForeachFunc func,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
Loading…
Reference in a new issue