From fa66fa64c5db783088aaa9341d653375edc64c3f Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Sun, 11 Jan 2004 17:32:37 +0000 Subject: configure.ac: Adding examples/switch/Makefile Original commit message from CVS: 2004-01-11 Julien MOUTTE * 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. --- gst/switch/gstswitch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gst') 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; -- cgit v1.2.1