+2007-07-24 Edward Hervey <bilboed@bilboed.com>
+
+ * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init),
+ (gst_capsfilter_transform_size), (gst_capsfilter_prepare_buf):
+ Fix capsfilter for cases where the caps set on capsfilter will provide
+ additional information.
+ Fixes #449197
+
2007-07-24 Stefan Kost <ensonic@users.sf.net>
* gst/gsttypefindfactory.c:
GstBuffer * buf);
static GstFlowReturn gst_capsfilter_prepare_buf (GstBaseTransform * trans,
GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf);
+static gboolean gst_capsfilter_transform_size (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps, guint size,
+ GstCaps * othercaps, guint * othersize);
static void
gst_capsfilter_base_init (gpointer g_class)
trans_class->transform_caps = gst_capsfilter_transform_caps;
trans_class->transform_ip = gst_capsfilter_transform_ip;
trans_class->prepare_output_buffer = gst_capsfilter_prepare_buf;
+ trans_class->transform_size = gst_capsfilter_transform_size;
}
static void
return ret;
}
+static gboolean
+gst_capsfilter_transform_size (GstBaseTransform * trans,
+ GstPadDirection direction, GstCaps * caps, guint size,
+ GstCaps * othercaps, guint * othersize)
+{
+ /* return the same size */
+ *othersize = size;
+ return TRUE;
+}
+
+
static GstFlowReturn
gst_capsfilter_transform_ip (GstBaseTransform * base, GstBuffer * buf)
{
{
if (GST_BUFFER_CAPS (input) != NULL) {
/* Output buffer already has caps */
- GST_DEBUG_OBJECT (trans, "Input buffer already has caps");
+ GST_DEBUG_OBJECT (trans,
+ "Input buffer already has caps (implicitely fixed)");
+ /* FIXME : Move this behaviour to basetransform. The given caps are the ones
+ * of the source pad, therefore our outgoing buffers should always have
+ * those caps. */
+ gst_buffer_set_caps (input, caps);
gst_buffer_ref (input);
*buf = input;
} else {