debugutils: Fix for GstIterator API changes

This commit is contained in:
Sebastian Dröge 2011-05-24 13:27:09 +02:00
parent 696a9a694f
commit e1cc3176d6

View file

@ -473,6 +473,8 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
{ {
GstIterator *element_iter, *pad_iter; GstIterator *element_iter, *pad_iter;
gboolean elements_done, pads_done; gboolean elements_done, pads_done;
GValue item = { 0, };
GValue item2 = { 0, };
GstElement *element; GstElement *element;
GstPad *pad; GstPad *pad;
GstPadDirection dir; GstPadDirection dir;
@ -485,8 +487,9 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
element_iter = gst_bin_iterate_elements (bin); element_iter = gst_bin_iterate_elements (bin);
elements_done = FALSE; elements_done = FALSE;
while (!elements_done) { while (!elements_done) {
switch (gst_iterator_next (element_iter, (gpointer) & element)) { switch (gst_iterator_next (element_iter, &item)) {
case GST_ITERATOR_OK: case GST_ITERATOR_OK:
element = g_value_get_object (&item);
element_name = debug_dump_make_object_name (GST_OBJECT (element)); element_name = debug_dump_make_object_name (GST_OBJECT (element));
if (details & GST_DEBUG_GRAPH_SHOW_STATES) { if (details & GST_DEBUG_GRAPH_SHOW_STATES) {
@ -519,15 +522,16 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
if ((pad_iter = gst_element_iterate_pads (element))) { if ((pad_iter = gst_element_iterate_pads (element))) {
pads_done = FALSE; pads_done = FALSE;
while (!pads_done) { while (!pads_done) {
switch (gst_iterator_next (pad_iter, (gpointer) & pad)) { switch (gst_iterator_next (pad_iter, &item2)) {
case GST_ITERATOR_OK: case GST_ITERATOR_OK:
pad = g_value_get_object (&item2);
debug_dump_element_pad (pad, element, details, out, indent); debug_dump_element_pad (pad, element, details, out, indent);
dir = gst_pad_get_direction (pad); dir = gst_pad_get_direction (pad);
if (dir == GST_PAD_SRC) if (dir == GST_PAD_SRC)
src_pads++; src_pads++;
else if (dir == GST_PAD_SINK) else if (dir == GST_PAD_SINK)
sink_pads++; sink_pads++;
gst_object_unref (pad); g_value_reset (&item2);
break; break;
case GST_ITERATOR_RESYNC: case GST_ITERATOR_RESYNC:
gst_iterator_resync (pad_iter); gst_iterator_resync (pad_iter);
@ -538,6 +542,7 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
break; break;
} }
} }
g_value_unset (&item2);
gst_iterator_free (pad_iter); gst_iterator_free (pad_iter);
} }
if (GST_IS_BIN (element)) { if (GST_IS_BIN (element)) {
@ -558,14 +563,15 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
if ((pad_iter = gst_element_iterate_pads (element))) { if ((pad_iter = gst_element_iterate_pads (element))) {
pads_done = FALSE; pads_done = FALSE;
while (!pads_done) { while (!pads_done) {
switch (gst_iterator_next (pad_iter, (gpointer) & pad)) { switch (gst_iterator_next (pad_iter, &item2)) {
case GST_ITERATOR_OK: case GST_ITERATOR_OK:
pad = g_value_get_object (&item2);
if (gst_pad_is_linked (pad) if (gst_pad_is_linked (pad)
&& gst_pad_get_direction (pad) == GST_PAD_SRC) { && gst_pad_get_direction (pad) == GST_PAD_SRC) {
debug_dump_element_pad_link (pad, element, details, out, debug_dump_element_pad_link (pad, element, details, out,
indent); indent);
} }
gst_object_unref (pad); g_value_reset (&item2);
break; break;
case GST_ITERATOR_RESYNC: case GST_ITERATOR_RESYNC:
gst_iterator_resync (pad_iter); gst_iterator_resync (pad_iter);
@ -576,9 +582,10 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
break; break;
} }
} }
g_value_unset (&item2);
gst_iterator_free (pad_iter); gst_iterator_free (pad_iter);
} }
gst_object_unref (element); g_value_reset (&item);
break; break;
case GST_ITERATOR_RESYNC: case GST_ITERATOR_RESYNC:
gst_iterator_resync (element_iter); gst_iterator_resync (element_iter);
@ -589,6 +596,7 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
break; break;
} }
} }
g_value_unset (&item);
gst_iterator_free (element_iter); gst_iterator_free (element_iter);
} }