summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-11-03 18:06:11 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-12-31 00:53:50 +0000
commit7c7acac0dbf8872adfae1773bcb57021bb0a0e43 (patch)
tree92d72d86057d1945ccfc2f8cbdb637cbeb398e11
parentb09bf81f150728f1324db8d1178c46c36c2e7523 (diff)
inputselector: install an acceptcaps function
Install a custom acceptcaps function instead of using the default expensive check. We accept whatever downstream accepts so we pass along the acceptcaps call to the downstream peer. Merged from gst-plugins-base, 5b72f2adf996739036e8d9b5f91005455d1fface.
-rw-r--r--plugins/elements/gstinputselector.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index 329b1305bb..95c711ff2d 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -149,6 +149,7 @@ static gint64 gst_selector_pad_get_running_time (GstSelectorPad * pad);
static void gst_selector_pad_reset (GstSelectorPad * pad);
static gboolean gst_selector_pad_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_selector_pad_getcaps (GstPad * pad);
+static gboolean gst_selector_pad_acceptcaps (GstPad * pad, GstCaps * caps);
static GstIterator *gst_selector_pad_iterate_linked_pads (GstPad * pad);
static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstBuffer * buf);
static GstFlowReturn gst_selector_pad_bufferalloc (GstPad * pad,
@@ -465,6 +466,21 @@ gst_selector_pad_getcaps (GstPad * pad)
return caps;
}
+static gboolean
+gst_selector_pad_acceptcaps (GstPad * pad, GstCaps * caps)
+{
+ GstInputSelector *sel;
+ gboolean res;
+
+ sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
+
+ GST_DEBUG_OBJECT (sel, "Checking acceptcaps of srcpad peer");
+ res = gst_pad_peer_accept_caps (sel->srcpad, caps);
+ gst_object_unref (sel);
+
+ return res;
+}
+
static GstFlowReturn
gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
guint size, GstCaps * caps, GstBuffer ** buf)
@@ -1247,6 +1263,8 @@ gst_input_selector_request_new_pad (GstElement * element,
GST_DEBUG_FUNCPTR (gst_selector_pad_event));
gst_pad_set_getcaps_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_selector_pad_getcaps));
+ gst_pad_set_acceptcaps_function (sinkpad,
+ GST_DEBUG_FUNCPTR (gst_selector_pad_acceptcaps));
gst_pad_set_chain_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_selector_pad_chain));
gst_pad_set_iterate_internal_links_function (sinkpad,