mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 20:25:25 +00:00
docs/manual/: Avoid using a bad function in the example code.
Original commit message from CVS: * docs/manual/advanced-autoplugging.xml: * docs/manual/basics-helloworld.xml: * docs/manual/basics-pads.xml: * docs/manual/highlevel-components.xml: Avoid using a bad function in the example code.
This commit is contained in:
parent
06eeefd70b
commit
e52bc83dd2
5 changed files with 17 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-05-21 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* docs/manual/advanced-autoplugging.xml:
|
||||||
|
* docs/manual/basics-helloworld.xml:
|
||||||
|
* docs/manual/basics-pads.xml:
|
||||||
|
* docs/manual/highlevel-components.xml:
|
||||||
|
Avoid using a bad function in the example code.
|
||||||
|
|
||||||
2008-05-21 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-05-21 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* gst/gstclock.c: (gst_clock_set_calibration):
|
* gst/gstclock.c: (gst_clock_set_calibration):
|
||||||
|
|
|
@ -366,7 +366,7 @@ close_link (GstPad *srcpad,
|
||||||
gst_bin_add (GST_BIN (pipeline), sinkelement);
|
gst_bin_add (GST_BIN (pipeline), sinkelement);
|
||||||
gst_element_set_state (sinkelement, GST_STATE_READY);
|
gst_element_set_state (sinkelement, GST_STATE_READY);
|
||||||
}
|
}
|
||||||
pad = gst_element_get_pad (sinkelement, padname);
|
pad = gst_element_get_static_pad (sinkelement, padname);
|
||||||
gst_pad_link (srcpad, pad);
|
gst_pad_link (srcpad, pad);
|
||||||
if (sinkelement != audiosink) {
|
if (sinkelement != audiosink) {
|
||||||
gst_element_set_state (sinkelement, GST_STATE_PAUSED);
|
gst_element_set_state (sinkelement, GST_STATE_PAUSED);
|
||||||
|
@ -386,7 +386,7 @@ close_link (GstPad *srcpad,
|
||||||
|
|
||||||
switch (templ->presence) {
|
switch (templ->presence) {
|
||||||
case GST_PAD_ALWAYS: {
|
case GST_PAD_ALWAYS: {
|
||||||
GstPad *pad = gst_element_get_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);
|
||||||
|
|
||||||
/* link */
|
/* link */
|
||||||
|
@ -419,7 +419,7 @@ try_to_plug (GstPad *pad,
|
||||||
GstCaps *res, *audiocaps;
|
GstCaps *res, *audiocaps;
|
||||||
|
|
||||||
/* don't plug if we're already plugged - FIXME: memleak for pad */
|
/* don't plug if we're already plugged - FIXME: memleak for pad */
|
||||||
if (GST_PAD_IS_LINKED (gst_element_get_pad (audiosink, "sink"))) {
|
if (GST_PAD_IS_LINKED (gst_element_get_static_pad (audiosink, "sink"))) {
|
||||||
g_print ("Omitting link for pad %s:%s because we're already linked\n",
|
g_print ("Omitting link for pad %s:%s because we're already linked\n",
|
||||||
GST_OBJECT_NAME (parent), GST_OBJECT_NAME (pad));
|
GST_OBJECT_NAME (parent), GST_OBJECT_NAME (pad));
|
||||||
return;
|
return;
|
||||||
|
@ -434,7 +434,7 @@ 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_pad (audiosink, "sink"));
|
audiocaps = gst_pad_get_caps (gst_element_get_static_pad (audiosink, "sink"));
|
||||||
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");
|
||||||
|
@ -503,7 +503,7 @@ cb_typefound (GstElement *typefind,
|
||||||
g_free (s);
|
g_free (s);
|
||||||
|
|
||||||
/* actually plug now */
|
/* actually plug now */
|
||||||
pad = gst_element_get_pad (typefind, "src");
|
pad = gst_element_get_static_pad (typefind, "src");
|
||||||
try_to_plug (pad, caps);
|
try_to_plug (pad, caps);
|
||||||
gst_object_unref (GST_OBJECT (pad));
|
gst_object_unref (GST_OBJECT (pad));
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ new_pad (GstElement *element,
|
||||||
/* We can now link this pad with the audio decoder */
|
/* We can now link this pad with the audio decoder */
|
||||||
g_print ("Dynamic pad created, linking parser/decoder\n");
|
g_print ("Dynamic pad created, linking parser/decoder\n");
|
||||||
|
|
||||||
sinkpad = gst_element_get_pad (decoder, "sink");
|
sinkpad = gst_element_get_static_pad (decoder, "sink");
|
||||||
gst_pad_link (pad, sinkpad);
|
gst_pad_link (pad, sinkpad);
|
||||||
|
|
||||||
gst_object_unref (sinkpad);
|
gst_object_unref (sinkpad);
|
||||||
|
|
|
@ -656,7 +656,7 @@ main (int argc,
|
||||||
gst_bin_add (GST_BIN (bin), sink);
|
gst_bin_add (GST_BIN (bin), sink);
|
||||||
|
|
||||||
/* add ghostpad */
|
/* add ghostpad */
|
||||||
pad = gst_element_get_pad (sink, "sink");
|
pad = gst_element_get_static_pad (sink, "sink");
|
||||||
gst_element_add_pad (bin, gst_ghost_pad_new ("sink", pad));
|
gst_element_add_pad (bin, gst_ghost_pad_new ("sink", pad));
|
||||||
gst_object_unref (GST_OBJECT (pad));
|
gst_object_unref (GST_OBJECT (pad));
|
||||||
<!-- example-end ghostpad.c a -->
|
<!-- example-end ghostpad.c a -->
|
||||||
|
|
|
@ -243,7 +243,7 @@ cb_newpad (GstElement *decodebin,
|
||||||
GstPad *audiopad;
|
GstPad *audiopad;
|
||||||
|
|
||||||
/* only link once */
|
/* only link once */
|
||||||
audiopad = gst_element_get_pad (audio, "sink");
|
audiopad = gst_element_get_static_pad (audio, "sink");
|
||||||
if (GST_PAD_IS_LINKED (audiopad)) {
|
if (GST_PAD_IS_LINKED (audiopad)) {
|
||||||
g_object_unref (audiopad);
|
g_object_unref (audiopad);
|
||||||
return;
|
return;
|
||||||
|
@ -299,7 +299,7 @@ main (gint argc,
|
||||||
/* create audio output */
|
/* create audio output */
|
||||||
audio = gst_bin_new ("audiobin");
|
audio = gst_bin_new ("audiobin");
|
||||||
conv = gst_element_factory_make ("audioconvert", "aconv");
|
conv = gst_element_factory_make ("audioconvert", "aconv");
|
||||||
audiopad = gst_element_get_pad (conv, "sink");
|
audiopad = gst_element_get_static_pad (conv, "sink");
|
||||||
sink = gst_element_factory_make ("alsasink", "sink");
|
sink = gst_element_factory_make ("alsasink", "sink");
|
||||||
gst_bin_add_many (GST_BIN (audio), conv, sink, NULL);
|
gst_bin_add_many (GST_BIN (audio), conv, sink, NULL);
|
||||||
gst_element_link (conv, sink);
|
gst_element_link (conv, sink);
|
||||||
|
|
Loading…
Reference in a new issue