mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
update manual code examples for new _get_caps()
This commit is contained in:
parent
6bff1f968a
commit
bd1c4506b8
2 changed files with 5 additions and 4 deletions
|
@ -344,7 +344,7 @@ cb_newpad (GstElement *element,
|
|||
{
|
||||
GstCaps *caps;
|
||||
|
||||
caps = gst_pad_get_caps (pad);
|
||||
caps = gst_pad_get_caps (pad, NULL);
|
||||
try_to_plug (pad, caps);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ close_link (GstPad *srcpad,
|
|||
switch (templ->presence) {
|
||||
case GST_PAD_ALWAYS: {
|
||||
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 */
|
||||
try_to_plug (pad, caps);
|
||||
|
@ -436,7 +436,8 @@ try_to_plug (GstPad *pad,
|
|||
}
|
||||
|
||||
/* 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);
|
||||
if (res && !gst_caps_is_empty (res)) {
|
||||
g_print ("Found pad to link to audiosink - plugging is now done\n");
|
||||
|
|
|
@ -253,7 +253,7 @@ cb_newpad (GstElement *decodebin,
|
|||
}
|
||||
|
||||
/* check media type */
|
||||
caps = gst_pad_get_caps (pad);
|
||||
caps = gst_pad_get_caps (pad, NULL);
|
||||
str = gst_caps_get_structure (caps, 0);
|
||||
if (!g_strrstr (gst_structure_get_name (str), "audio")) {
|
||||
gst_caps_unref (caps);
|
||||
|
|
Loading…
Reference in a new issue