From 22d64af1046e41889dbd1060287984ce7085210f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 9 May 2011 10:54:10 +0200 Subject: [PATCH] tools: avoid using pad caps Avoid directly accessing the pad caps, use gst_pad_get_current_caps() instead. --- gst/gstutils.c | 4 +++- tools/gst-inspect.c | 7 +++++-- tools/gst-xmlinspect.c | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gst/gstutils.c b/gst/gstutils.c index 5013fdd3f7..559da70993 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -758,7 +758,7 @@ gst_print_pad_caps (GString * buf, gint indent, GstPad * pad) { GstCaps *caps; - caps = pad->caps; + caps = gst_pad_get_current_caps (pad); if (!caps) { string_append_indent (buf, indent); @@ -770,6 +770,8 @@ gst_print_pad_caps (GString * buf, gint indent, GstPad * pad) s = gst_caps_to_string (caps); g_string_append (buf, s); g_free (s); + + gst_caps_unref (caps); } } diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 8f077386ca..8f8e00fba0 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -793,6 +793,7 @@ print_pad_info (GstElement * element) pads = element->pads; while (pads) { gchar *name; + GstCaps *caps; pad = GST_PAD (pads->data); pads = g_list_next (pads); @@ -854,9 +855,11 @@ print_pad_info (GstElement * element) if (pad->padtemplate) n_print (" Pad Template: '%s'\n", pad->padtemplate->name_template); - if (pad->caps) { + caps = gst_pad_get_current_caps (pad); + if (caps) { n_print (" Capabilities:\n"); - print_caps (pad->caps, " "); + print_caps (caps, " "); + gst_caps_unref (caps); } } } diff --git a/tools/gst-xmlinspect.c b/tools/gst-xmlinspect.c index c70c0969a7..acf984a81e 100644 --- a/tools/gst-xmlinspect.c +++ b/tools/gst-xmlinspect.c @@ -550,6 +550,8 @@ print_element_info (GstElementFactory * factory) pads = element->pads; while (pads) { + GstCaps *caps; + pad = GST_PAD (pads->data); pads = g_list_next (pads); @@ -592,8 +594,10 @@ print_element_info (GstElementFactory * factory) PUT_END_TAG (3, "implementation"); - if (pad->caps) { - print_caps (pad->caps, 3); + caps = gst_pad_get_current_caps (pad); + if (caps) { + print_caps (caps, 3); + gst_caps_unref (caps); } PUT_END_TAG (2, "pad"); }