From b5936efc9866eb1a171247150c28d18f874b5718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 1 Jul 2014 19:17:11 +0200 Subject: [PATCH] identity: Proxy the accept-caps query We always work in passthrough mode so there's no point in doing something more clever in basetransform. Also the basetransform code leads to problems with incomplete caps and downstream elements that use GST_PAD_FLAG_ACCEPT_INTERSECT. https://bugzilla.gnome.org/show_bug.cgi?id=732559 --- plugins/elements/gstidentity.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 4151dad37c..dbc9494e4f 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -110,6 +110,8 @@ static gboolean gst_identity_start (GstBaseTransform * trans); static gboolean gst_identity_stop (GstBaseTransform * trans); static GstStateChangeReturn gst_identity_change_state (GstElement * element, GstStateChange transition); +static gboolean gst_identity_accept_caps (GstBaseTransform * base, + GstPadDirection direction, GstCaps * caps); static guint gst_identity_signals[LAST_SIGNAL] = { 0 }; @@ -235,6 +237,8 @@ gst_identity_class_init (GstIdentityClass * klass) GST_DEBUG_FUNCPTR (gst_identity_transform_ip); gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_identity_start); gstbasetrans_class->stop = GST_DEBUG_FUNCPTR (gst_identity_stop); + gstbasetrans_class->accept_caps = + GST_DEBUG_FUNCPTR (gst_identity_accept_caps); } static void @@ -745,6 +749,25 @@ gst_identity_stop (GstBaseTransform * trans) return TRUE; } +static gboolean +gst_identity_accept_caps (GstBaseTransform * base, + GstPadDirection direction, GstCaps * caps) +{ + gboolean ret; + GstPad *pad; + + /* Proxy accept-caps */ + + if (direction == GST_PAD_SRC) + pad = GST_BASE_TRANSFORM_SINK_PAD (base); + else + pad = GST_BASE_TRANSFORM_SRC_PAD (base); + + ret = gst_pad_peer_query_accept_caps (pad, caps); + + return ret; +} + static GstStateChangeReturn gst_identity_change_state (GstElement * element, GstStateChange transition) {