gst/gstdebugutils.c: Improve handling ghost/proxy pads.
authorStefan Kost <ensonic@users.sourceforge.net>
Mon, 31 Mar 2008 07:49:26 +0000 (07:49 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Mon, 31 Mar 2008 07:49:26 +0000 (07:49 +0000)
Original commit message from CVS:
* gst/gstdebugutils.c:
Improve handling ghost/proxy pads.

ChangeLog
gst/gstdebugutils.c

index 977966ed3e2ff8ca5bee0c37caf447bdc73cc119..e72d3b35395968de38ab406fdb9751542746d522 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-31  Stefan Kost  <ensonic@users.sf.net>
+
+       * gst/gstdebugutils.c:
+         Improve handling ghost/proxy pads.
+
 2008-03-27  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/gst/gstreamer-sections.txt:
index 9cdf0ff9c6fe1e6b1ed8f97196eff0269416d0d7..77e23fb8073485fa6c2405924dcea6b7a66c12b0 100644 (file)
@@ -134,7 +134,7 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
   GstIterator *element_iter, *pad_iter;
   gboolean elements_done, pads_done;
   GstElement *element, *peer_element, *target_element;
-  GstPad *pad, *peer_pad, *target_pad;
+  GstPad *pad, *peer_pad, *target_pad, *tmp_pad;
   GstPadDirection dir;
   GstCaps *caps;
   GstStructure *structure;
@@ -317,58 +317,64 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
                     }
 
                     if (GST_IS_GHOST_PAD (pad)) {
-                      if ((target_pad =
+                      if ((tmp_pad =
                               gst_ghost_pad_get_target (GST_GHOST_PAD (pad)))) {
-                        target_pad_name =
-                            debug_dump_make_object_name (GST_OBJECT
-                            (target_pad));
-                        if ((target_element =
-                                gst_pad_get_parent_element (target_pad))) {
-                          target_element_name =
+                        if ((target_pad = gst_pad_get_peer (tmp_pad))) {
+                          target_pad_name =
                               debug_dump_make_object_name (GST_OBJECT
-                              (target_element));
-                        } else {
-                          target_element_name = "";
-                        }
-                        /* src ghostpad relationship */
-                        fprintf (out, "%s%s_%s -> %s_%s [style=dashed]\n", spc,
-                            target_element_name, target_pad_name, element_name,
-                            pad_name);
-
-                        g_free (target_pad_name);
-                        if (target_element) {
-                          g_free (target_element_name);
-                          gst_object_unref (target_element);
+                              (target_pad));
+                          if ((target_element =
+                                  gst_pad_get_parent_element (target_pad))) {
+                            target_element_name =
+                                debug_dump_make_object_name (GST_OBJECT
+                                (target_element));
+                          } else {
+                            target_element_name = "";
+                          }
+                          /* src ghostpad relationship */
+                          fprintf (out, "%s%s_%s -> %s_%s [style=dashed]\n",
+                              spc, target_element_name, target_pad_name,
+                              element_name, pad_name);
+
+                          g_free (target_pad_name);
+                          if (target_element) {
+                            g_free (target_element_name);
+                            gst_object_unref (target_element);
+                          }
+                          gst_object_unref (target_pad);
                         }
-                        gst_object_unref (target_pad);
+                        gst_object_unref (tmp_pad);
                       }
                     }
                     if (GST_IS_GHOST_PAD (peer_pad)) {
-                      if ((target_pad =
+                      if ((tmp_pad =
                               gst_ghost_pad_get_target (GST_GHOST_PAD
                                   (peer_pad)))) {
-                        target_pad_name =
-                            debug_dump_make_object_name (GST_OBJECT
-                            (target_pad));
-                        if ((target_element =
-                                gst_pad_get_parent_element (target_pad))) {
-                          target_element_name =
+                        if ((target_pad = gst_pad_get_peer (tmp_pad))) {
+                          target_pad_name =
                               debug_dump_make_object_name (GST_OBJECT
-                              (target_element));
-                        } else {
-                          target_element_name = "";
-                        }
-                        /* sink ghostpad relationship */
-                        fprintf (out, "%s%s_%s -> %s_%s [style=dashed]\n", spc,
-                            peer_element_name, peer_pad_name,
-                            target_element_name, target_pad_name);
-
-                        g_free (target_pad_name);
-                        if (target_element) {
-                          g_free (target_element_name);
-                          gst_object_unref (target_element);
+                              (target_pad));
+                          if ((target_element =
+                                  gst_pad_get_parent_element (target_pad))) {
+                            target_element_name =
+                                debug_dump_make_object_name (GST_OBJECT
+                                (target_element));
+                          } else {
+                            target_element_name = "";
+                          }
+                          /* sink ghostpad relationship */
+                          fprintf (out, "%s%s_%s -> %s_%s [style=dashed]\n",
+                              spc, peer_element_name, peer_pad_name,
+                              target_element_name, target_pad_name);
+
+                          g_free (target_pad_name);
+                          if (target_element) {
+                            g_free (target_element_name);
+                            gst_object_unref (target_element);
+                          }
+                          gst_object_unref (target_pad);
                         }
-                        gst_object_unref (target_pad);
+                        gst_object_unref (tmp_pad);
                       }
                     }