tools: avoid using pad caps

Avoid directly accessing the pad caps, use gst_pad_get_current_caps() instead.
This commit is contained in:
Wim Taymans 2011-05-09 10:54:10 +02:00
parent 24573211c6
commit 22d64af104
3 changed files with 14 additions and 5 deletions

View file

@ -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);
}
}

View file

@ -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);
}
}
}

View file

@ -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");
}