mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
tools: avoid using pad caps
Avoid directly accessing the pad caps, use gst_pad_get_current_caps() instead.
This commit is contained in:
parent
24573211c6
commit
22d64af104
3 changed files with 14 additions and 5 deletions
|
@ -758,7 +758,7 @@ gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
caps = pad->caps;
|
caps = gst_pad_get_current_caps (pad);
|
||||||
|
|
||||||
if (!caps) {
|
if (!caps) {
|
||||||
string_append_indent (buf, indent);
|
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);
|
s = gst_caps_to_string (caps);
|
||||||
g_string_append (buf, s);
|
g_string_append (buf, s);
|
||||||
g_free (s);
|
g_free (s);
|
||||||
|
|
||||||
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -793,6 +793,7 @@ print_pad_info (GstElement * element)
|
||||||
pads = element->pads;
|
pads = element->pads;
|
||||||
while (pads) {
|
while (pads) {
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
pad = GST_PAD (pads->data);
|
pad = GST_PAD (pads->data);
|
||||||
pads = g_list_next (pads);
|
pads = g_list_next (pads);
|
||||||
|
@ -854,9 +855,11 @@ print_pad_info (GstElement * element)
|
||||||
if (pad->padtemplate)
|
if (pad->padtemplate)
|
||||||
n_print (" Pad Template: '%s'\n", pad->padtemplate->name_template);
|
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");
|
n_print (" Capabilities:\n");
|
||||||
print_caps (pad->caps, " ");
|
print_caps (caps, " ");
|
||||||
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -550,6 +550,8 @@ print_element_info (GstElementFactory * factory)
|
||||||
|
|
||||||
pads = element->pads;
|
pads = element->pads;
|
||||||
while (pads) {
|
while (pads) {
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
pad = GST_PAD (pads->data);
|
pad = GST_PAD (pads->data);
|
||||||
pads = g_list_next (pads);
|
pads = g_list_next (pads);
|
||||||
|
|
||||||
|
@ -592,8 +594,10 @@ print_element_info (GstElementFactory * factory)
|
||||||
|
|
||||||
PUT_END_TAG (3, "implementation");
|
PUT_END_TAG (3, "implementation");
|
||||||
|
|
||||||
if (pad->caps) {
|
caps = gst_pad_get_current_caps (pad);
|
||||||
print_caps (pad->caps, 3);
|
if (caps) {
|
||||||
|
print_caps (caps, 3);
|
||||||
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
PUT_END_TAG (2, "pad");
|
PUT_END_TAG (2, "pad");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue