update manual code examples for new _get_caps()

This commit is contained in:
Wim Taymans 2011-05-16 16:10:49 +02:00
parent 6bff1f968a
commit bd1c4506b8
2 changed files with 5 additions and 4 deletions

View file

@ -344,7 +344,7 @@ cb_newpad (GstElement *element,
{ {
GstCaps *caps; GstCaps *caps;
caps = gst_pad_get_caps (pad); caps = gst_pad_get_caps (pad, NULL);
try_to_plug (pad, caps); try_to_plug (pad, caps);
gst_caps_unref (caps); gst_caps_unref (caps);
} }
@ -389,7 +389,7 @@ close_link (GstPad *srcpad,
switch (templ->presence) { switch (templ->presence) {
case GST_PAD_ALWAYS: { case GST_PAD_ALWAYS: {
GstPad *pad = gst_element_get_static_pad (sinkelement, templ->name_template); GstPad *pad = gst_element_get_static_pad (sinkelement, templ->name_template);
GstCaps *caps = gst_pad_get_caps (pad); GstCaps *caps = gst_pad_get_caps (pad, NULL);
/* link */ /* link */
try_to_plug (pad, caps); try_to_plug (pad, caps);
@ -436,7 +436,8 @@ try_to_plug (GstPad *pad,
} }
/* can it link to the audiopad? */ /* can it link to the audiopad? */
audiocaps = gst_pad_get_caps (gst_element_get_static_pad (audiosink, "sink")); audiocaps = gst_pad_get_caps (gst_element_get_static_pad (audiosink, "sink"),
NULL);
res = gst_caps_intersect (caps, audiocaps); res = gst_caps_intersect (caps, audiocaps);
if (res && !gst_caps_is_empty (res)) { if (res && !gst_caps_is_empty (res)) {
g_print ("Found pad to link to audiosink - plugging is now done\n"); g_print ("Found pad to link to audiosink - plugging is now done\n");

View file

@ -253,7 +253,7 @@ cb_newpad (GstElement *decodebin,
} }
/* check media type */ /* check media type */
caps = gst_pad_get_caps (pad); caps = gst_pad_get_caps (pad, NULL);
str = gst_caps_get_structure (caps, 0); str = gst_caps_get_structure (caps, 0);
if (!g_strrstr (gst_structure_get_name (str), "audio")) { if (!g_strrstr (gst_structure_get_name (str), "audio")) {
gst_caps_unref (caps); gst_caps_unref (caps);