return gst_pad_get_bufferpool (identity->srcpad);
}
+static GstPadConnectReturn
+gst_identity_connect_sink (GstPad *pad, GstCaps *caps)
+{
+ GstIdentity *identity;
+
+ identity = GST_IDENTITY (gst_pad_get_parent (pad));
+
+ if (GST_CAPS_IS_FIXED (caps))
+ if (gst_pad_try_set_caps (identity->srcpad, caps))
+ return GST_PAD_CONNECT_OK;
+ else
+ return GST_PAD_CONNECT_REFUSED;
+ else
+ return GST_PAD_CONNECT_DELAYED;
+}
+
static void
gst_identity_init (GstIdentity *identity)
{
gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
+ gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect_sink);
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
return gst_pad_get_bufferpool (identity->srcpad);
}
+static GstPadConnectReturn
+gst_identity_connect_sink (GstPad *pad, GstCaps *caps)
+{
+ GstIdentity *identity;
+
+ identity = GST_IDENTITY (gst_pad_get_parent (pad));
+
+ if (GST_CAPS_IS_FIXED (caps))
+ if (gst_pad_try_set_caps (identity->srcpad, caps))
+ return GST_PAD_CONNECT_OK;
+ else
+ return GST_PAD_CONNECT_REFUSED;
+ else
+ return GST_PAD_CONNECT_DELAYED;
+}
+
static void
gst_identity_init (GstIdentity *identity)
{
gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
+ gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect_sink);
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);