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.
This commit is contained in:
Julien Moutte 2004-01-19 23:23:54 +00:00
parent 3bd71333b6
commit b733064d2f
2 changed files with 19 additions and 3 deletions

View file

@ -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):

View file

@ -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;