mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
element: Specify the order of pad iterators
The order of returned pads wasn't specified before, so let's specify it and use an order which might prove the most useful : the order in which pads were added to the element. If someone changes the order, make sure users of those iterators from now on don't rely on that order !
This commit is contained in:
parent
c0f1ff5f79
commit
7a89e5d046
1 changed files with 12 additions and 3 deletions
|
@ -668,17 +668,17 @@ gst_element_add_pad (GstElement * element, GstPad * pad)
|
|||
/* add it to the list */
|
||||
switch (gst_pad_get_direction (pad)) {
|
||||
case GST_PAD_SRC:
|
||||
element->srcpads = g_list_prepend (element->srcpads, pad);
|
||||
element->srcpads = g_list_append (element->srcpads, pad);
|
||||
element->numsrcpads++;
|
||||
break;
|
||||
case GST_PAD_SINK:
|
||||
element->sinkpads = g_list_prepend (element->sinkpads, pad);
|
||||
element->sinkpads = g_list_append (element->sinkpads, pad);
|
||||
element->numsinkpads++;
|
||||
break;
|
||||
default:
|
||||
goto no_direction;
|
||||
}
|
||||
element->pads = g_list_prepend (element->pads, pad);
|
||||
element->pads = g_list_append (element->pads, pad);
|
||||
element->numpads++;
|
||||
element->pads_cookie++;
|
||||
GST_OBJECT_UNLOCK (element);
|
||||
|
@ -1114,6 +1114,9 @@ gst_element_iterate_pad_list (GstElement * element, GList ** padlist)
|
|||
* be freed after usage. Also more specialized iterators exists such as
|
||||
* gst_element_iterate_src_pads() or gst_element_iterate_sink_pads().
|
||||
*
|
||||
* The order of pads returned by the iterator will be the order in which
|
||||
* the pads were added to the element.
|
||||
*
|
||||
* Returns: (transfer full): the #GstIterator of #GstPad. Unref each pad
|
||||
* after use.
|
||||
*
|
||||
|
@ -1133,6 +1136,9 @@ gst_element_iterate_pads (GstElement * element)
|
|||
*
|
||||
* Retrieves an iterator of @element's source pads.
|
||||
*
|
||||
* The order of pads returned by the iterator will be the order in which
|
||||
* the pads were added to the element.
|
||||
*
|
||||
* Returns: (transfer full): the #GstIterator of #GstPad. Unref each pad
|
||||
* after use.
|
||||
*
|
||||
|
@ -1152,6 +1158,9 @@ gst_element_iterate_src_pads (GstElement * element)
|
|||
*
|
||||
* Retrieves an iterator of @element's sink pads.
|
||||
*
|
||||
* The order of pads returned by the iterator will be the order in which
|
||||
* the pads were added to the element.
|
||||
*
|
||||
* Returns: (transfer full): the #GstIterator of #GstPad. Unref each pad
|
||||
* after use.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue