diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gst/switch/gstswitch.c | 16 |
2 files changed, 19 insertions, 3 deletions
@@ -1,3 +1,9 @@ +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. + 2004-01-19 Thomas Vander Stichele <thomas at apestaart dot org> * sys/v4l/v4l-overlay_calls.c: (gst_v4l_set_overlay): 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; |