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
This commit is contained in:
Sebastian Dröge 2014-07-01 19:17:11 +02:00
parent 2dc8839234
commit b5936efc98

View file

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