summaryrefslogtreecommitdiffstats
path: root/gst/switch
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2004-01-19 23:23:54 +0000
committerJulien Moutte <julien@moutte.net>2004-01-19 23:23:54 +0000
commitb733064d2f697dedee5489c719aa3e32ddf67cd3 (patch)
tree94700c70787c61a6f6de09315732911c3c914402 /gst/switch
parent3bd71333b6d02e8a83580aaeba3efa5eaf6e86fc (diff)
downloadgst-plugins-bad-b733064d2f697dedee5489c719aa3e32ddf67cd3.tar.gz
gst-plugins-bad-b733064d2f697dedee5489c719aa3e32ddf67cd3.tar.bz2
gst-plugins-bad-b733064d2f697dedee5489c719aa3e32ddf67cd3.zip
gst/switch/gstswitch.c: Fixed switch element : proxying link and setting caps from src to sink on request.
Original commit message from CVS: 2004-01-20 Julien MOUTTE <julien@moutte.net> * gst/switch/gstswitch.c: (gst_switch_request_new_pad), (gst_switch_init): Fixed switch element : proxying link and setting caps from src to sink on request.
Diffstat (limited to 'gst/switch')
-rw-r--r--gst/switch/gstswitch.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gst/switch/gstswitch.c b/gst/switch/gstswitch.c
index e6c9d03a..e68647cc 100644
--- a/gst/switch/gstswitch.c
+++ b/gst/switch/gstswitch.c
@@ -81,8 +81,11 @@ 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);
+ /* That pad will proxy caps and link */
+ gst_pad_set_link_function (sinkpad,
+ GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
+ gst_pad_set_getcaps_function (sinkpad,
+ GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
gst_element_add_pad (GST_ELEMENT (gstswitch), sinkpad);
@@ -98,6 +101,10 @@ gst_switch_request_new_pad (GstElement *element,
gstswitch->nb_sinkpads);
gstswitch->nb_sinkpads++;
+ if (GST_PAD_CAPS (gstswitch->srcpad)) {
+ gst_pad_try_set_caps (sinkpad, GST_PAD_CAPS (gstswitch->srcpad));
+ }
+
return sinkpad;
}
@@ -238,7 +245,10 @@ 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_pad_set_link_function (gstswitch->srcpad,
+ GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
+ gst_pad_set_getcaps_function (gstswitch->srcpad,
+ GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
gst_element_set_loop_function (GST_ELEMENT (gstswitch), gst_switch_loop);
gstswitch->sinkpads = NULL;