+2008-01-02 Sebastian Dröge <slomo@circular-chaos.org>
+
+ * gst-libs/gst/audio/gstaudiofilter.c:
+ (gst_audio_filter_class_init), (gst_audio_filter_get_unit_size):
+ Implement get_unit_size() vmethod of GstBaseTransform.
+
2008-01-01 Edward Hervey <edward.hervey@collabora.co.uk>
* gst-libs/gst/pbutils/Makefile.am:
GstStateChange transition);
static gboolean gst_audio_filter_set_caps (GstBaseTransform * btrans,
GstCaps * incaps, GstCaps * outcaps);
+static gboolean gst_audio_filter_get_unit_size (GstBaseTransform * btrans,
+ GstCaps * caps, guint * size);
static GstElementClass *parent_class = NULL;
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_audio_filter_change_state);
basetrans_class->set_caps = GST_DEBUG_FUNCPTR (gst_audio_filter_set_caps);
+ basetrans_class->get_unit_size =
+ GST_DEBUG_FUNCPTR (gst_audio_filter_get_unit_size);
}
static void
return ret;
}
+static gboolean
+gst_audio_filter_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
+ guint * size)
+{
+ GstStructure *structure;
+ gboolean ret = TRUE;
+ gint width, channels;
+
+ structure = gst_caps_get_structure (caps, 0);
+
+ ret &= gst_structure_get_int (structure, "width", &width);
+ ret &= gst_structure_get_int (structure, "channels", &channels);
+
+ if (ret)
+ *size = (width / 8) * channels;
+
+ return ret;
+}
+
/**
* gst_audio_filter_class_add_pad_templates:
* @klass: an #GstAudioFilterClass