summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2004-01-11 17:32:37 +0000
committerJulien Moutte <julien@moutte.net>2004-01-11 17:32:37 +0000
commitfa66fa64c5db783088aaa9341d653375edc64c3f (patch)
tree3d7ae43cfa16136f4cfc1d93e595f1523766f125 /gst
parent1d6125fbd7a4b9a1ecac5580e19c31cb70ab24e7 (diff)
downloadgst-plugins-bad-fa66fa64c5db783088aaa9341d653375edc64c3f.tar.gz
gst-plugins-bad-fa66fa64c5db783088aaa9341d653375edc64c3f.tar.bz2
gst-plugins-bad-fa66fa64c5db783088aaa9341d653375edc64c3f.zip
configure.ac: Adding examples/switch/Makefile
Original commit message from CVS: 2004-01-11 Julien MOUTTE <julien@moutte.net> * configure.ac: Adding examples/switch/Makefile * examples/Makefile.am: Adding examples/switch * examples/switch/Makefile.am: Adding switcher example. * examples/switch/switcher.c: (got_eos), (idle_iterate), (switch_timer), (main): Adding an example demonstrating switch usage with 2 videotestsrc showing different patterns. * gst/switch/gstswitch.c: (gst_switch_request_new_pad), (gst_switch_init): Fixing switch with the new caps system.
Diffstat (limited to 'gst')
-rw-r--r--gst/switch/gstswitch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/switch/gstswitch.c b/gst/switch/gstswitch.c
index 625eba29..e6c9d03a 100644
--- a/gst/switch/gstswitch.c
+++ b/gst/switch/gstswitch.c
@@ -66,6 +66,7 @@ gst_switch_request_new_pad (GstElement *element,
g_return_val_if_fail (GST_IS_SWITCH (element), NULL);
+ /* We only provide requested sink pads */
if (templ->direction != GST_PAD_SINK) {
g_warning ("gstswitch: requested a non sink pad\n");
return NULL;
@@ -80,6 +81,9 @@ gst_switch_request_new_pad (GstElement *element,
if (name)
g_free (name);
+ /* That pad will proxy caps */
+ gst_pad_set_getcaps_function (sinkpad, gst_pad_proxy_getcaps);
+
gst_element_add_pad (GST_ELEMENT (gstswitch), sinkpad);
switchpad = g_new0 (GstSwitchPad, 1);
@@ -234,7 +238,7 @@ gst_switch_init (GstSwitch *gstswitch)
{
gstswitch->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (gstswitch), gstswitch->srcpad);
-
+ gst_pad_set_getcaps_function (gstswitch->srcpad, gst_pad_proxy_getcaps);
gst_element_set_loop_function (GST_ELEMENT (gstswitch), gst_switch_loop);
gstswitch->sinkpads = NULL;