mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
aggregator: Remove pad iterator function
Use new gst_element_foreach_sink_pad() from core instead. https://bugzilla.gnome.org/show_bug.cgi?id=785679
This commit is contained in:
parent
1116bb00ca
commit
98ac205a4d
4 changed files with 0 additions and 88 deletions
|
@ -1850,7 +1850,6 @@ GstAggregator
|
||||||
GstAggregatorClass
|
GstAggregatorClass
|
||||||
gst_aggregator_finish_buffer
|
gst_aggregator_finish_buffer
|
||||||
gst_aggregator_set_src_caps
|
gst_aggregator_set_src_caps
|
||||||
gst_aggregator_iterate_sinkpads
|
|
||||||
gst_aggregator_get_latency
|
gst_aggregator_get_latency
|
||||||
gst_aggregator_get_buffer_pool
|
gst_aggregator_get_buffer_pool
|
||||||
gst_aggregator_get_allocator
|
gst_aggregator_get_allocator
|
||||||
|
|
|
@ -356,87 +356,6 @@ enum
|
||||||
static GstFlowReturn gst_aggregator_pad_chain_internal (GstAggregator * self,
|
static GstFlowReturn gst_aggregator_pad_chain_internal (GstAggregator * self,
|
||||||
GstAggregatorPad * aggpad, GstBuffer * buffer, gboolean head);
|
GstAggregatorPad * aggpad, GstBuffer * buffer, gboolean head);
|
||||||
|
|
||||||
/**
|
|
||||||
* gst_aggregator_iterate_sinkpads:
|
|
||||||
* @self: The #GstAggregator
|
|
||||||
* @func: (scope call): The function to call.
|
|
||||||
* @user_data: (closure): The data to pass to @func.
|
|
||||||
*
|
|
||||||
* Iterate the sinkpads of aggregator to call a function on them.
|
|
||||||
*
|
|
||||||
* This method guarantees that @func will be called only once for each
|
|
||||||
* sink pad.
|
|
||||||
*
|
|
||||||
* Returns: %FALSE if there are no sinkpads or if @func returned %FALSE
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
gst_aggregator_iterate_sinkpads (GstAggregator * self,
|
|
||||||
GstAggregatorPadForeachFunc func, gpointer user_data)
|
|
||||||
{
|
|
||||||
gboolean result = FALSE;
|
|
||||||
GstIterator *iter;
|
|
||||||
gboolean done = FALSE;
|
|
||||||
GValue item = { 0, };
|
|
||||||
GList *seen_pads = NULL;
|
|
||||||
|
|
||||||
iter = gst_element_iterate_sink_pads (GST_ELEMENT (self));
|
|
||||||
|
|
||||||
if (!iter)
|
|
||||||
goto no_iter;
|
|
||||||
|
|
||||||
while (!done) {
|
|
||||||
switch (gst_iterator_next (iter, &item)) {
|
|
||||||
case GST_ITERATOR_OK:
|
|
||||||
{
|
|
||||||
GstAggregatorPad *pad;
|
|
||||||
|
|
||||||
pad = g_value_get_object (&item);
|
|
||||||
|
|
||||||
/* if already pushed, skip. FIXME, find something faster to tag pads */
|
|
||||||
if (pad == NULL || g_list_find (seen_pads, pad)) {
|
|
||||||
g_value_reset (&item);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_LOG_OBJECT (pad, "calling function %s on pad",
|
|
||||||
GST_DEBUG_FUNCPTR_NAME (func));
|
|
||||||
|
|
||||||
result = func (self, pad, user_data);
|
|
||||||
|
|
||||||
done = !result;
|
|
||||||
|
|
||||||
seen_pads = g_list_prepend (seen_pads, pad);
|
|
||||||
|
|
||||||
g_value_reset (&item);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GST_ITERATOR_RESYNC:
|
|
||||||
gst_iterator_resync (iter);
|
|
||||||
break;
|
|
||||||
case GST_ITERATOR_ERROR:
|
|
||||||
GST_ERROR_OBJECT (self,
|
|
||||||
"Could not iterate over internally linked pads");
|
|
||||||
done = TRUE;
|
|
||||||
break;
|
|
||||||
case GST_ITERATOR_DONE:
|
|
||||||
done = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_value_unset (&item);
|
|
||||||
gst_iterator_free (iter);
|
|
||||||
|
|
||||||
if (seen_pads == NULL) {
|
|
||||||
GST_DEBUG_OBJECT (self, "No pad seen");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_list_free (seen_pads);
|
|
||||||
|
|
||||||
no_iter:
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_aggregator_pad_queue_is_empty (GstAggregatorPad * pad)
|
gst_aggregator_pad_queue_is_empty (GstAggregatorPad * pad)
|
||||||
{
|
{
|
||||||
|
|
|
@ -330,11 +330,6 @@ typedef gboolean (*GstAggregatorPadForeachFunc) (GstAggregator
|
||||||
GstAggregatorPad * aggregator_pad,
|
GstAggregatorPad * aggregator_pad,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
GST_EXPORT
|
|
||||||
gboolean gst_aggregator_iterate_sinkpads (GstAggregator * self,
|
|
||||||
GstAggregatorPadForeachFunc func,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
GST_EXPORT
|
GST_EXPORT
|
||||||
GstClockTime gst_aggregator_get_latency (GstAggregator * self);
|
GstClockTime gst_aggregator_get_latency (GstAggregator * self);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ EXPORTS
|
||||||
gst_aggregator_get_buffer_pool
|
gst_aggregator_get_buffer_pool
|
||||||
gst_aggregator_get_latency
|
gst_aggregator_get_latency
|
||||||
gst_aggregator_get_type
|
gst_aggregator_get_type
|
||||||
gst_aggregator_iterate_sinkpads
|
|
||||||
gst_aggregator_pad_drop_buffer
|
gst_aggregator_pad_drop_buffer
|
||||||
gst_aggregator_pad_get_buffer
|
gst_aggregator_pad_get_buffer
|
||||||
gst_aggregator_pad_get_type
|
gst_aggregator_pad_get_type
|
||||||
|
|
Loading…
Reference in a new issue