Commit 0e5857ea authored by Sebastian Dröge's avatar Sebastian Dröge

gst-libs/gst/audio/gstaudiofilter.c: Implement get_unit_size() vmethod of GstBaseTransform.

Original commit message from CVS:
* gst-libs/gst/audio/gstaudiofilter.c:
(gst_audio_filter_class_init), (gst_audio_filter_get_unit_size):
Implement get_unit_size() vmethod of GstBaseTransform.
parent 7701190c
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:
......@@ -65,6 +65,8 @@ static GstStateChangeReturn gst_audio_filter_change_state (GstElement * element,
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;
......@@ -117,6 +119,8 @@ gst_audio_filter_class_init (gpointer klass, gpointer class_data)
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
......@@ -189,6 +193,25 @@ gst_audio_filter_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment