30 * before calling your setup function. Also, elements deriving from |
30 * before calling your setup function. Also, elements deriving from |
31 * #GstAudioFilter may use gst_audio_filter_class_add_pad_templates() from |
31 * #GstAudioFilter may use gst_audio_filter_class_add_pad_templates() from |
32 * their base_init function to easily configure the set of caps/formats that |
32 * their base_init function to easily configure the set of caps/formats that |
33 * the element is able to handle. |
33 * the element is able to handle. |
34 * |
34 * |
35 * Derived classes should override the #GstAudioFilterClass.setup() and |
35 * Derived classes should override the GstAudioFilter::setup() and |
36 * #GstBaseTransformClass.transform_ip() and/or |
36 * GstBaseTransform::transform_ip() and/or GstBaseTransform::transform() |
37 * #GstBaseTransformClass.transform() |
|
38 * virtual functions in their class_init function. |
37 * virtual functions in their class_init function. |
39 * |
38 * |
|
39 * Since: 0.10.12 |
|
40 * |
40 * Last reviewed on 2007-02-03 (0.10.11.1) |
41 * Last reviewed on 2007-02-03 (0.10.11.1) |
41 * |
|
42 * Since: 0.10.12 |
|
43 */ |
42 */ |
44 |
43 |
45 #ifdef HAVE_CONFIG_H |
44 #ifdef HAVE_CONFIG_H |
46 #include "config.h" |
45 #include "config.h" |
47 #endif |
46 #endif |
167 { |
166 { |
168 GstAudioFilterClass *klass; |
167 GstAudioFilterClass *klass; |
169 GstAudioFilter *filter; |
168 GstAudioFilter *filter; |
170 gboolean ret = TRUE; |
169 gboolean ret = TRUE; |
171 |
170 |
|
171 g_assert (gst_caps_is_equal (incaps, outcaps)); |
|
172 |
172 filter = GST_AUDIO_FILTER (btrans); |
173 filter = GST_AUDIO_FILTER (btrans); |
173 |
174 |
174 GST_LOG_OBJECT (filter, "caps: %" GST_PTR_FORMAT, incaps); |
175 GST_LOG_OBJECT (filter, "caps: %" GST_PTR_FORMAT, incaps); |
175 |
176 |
176 if (!gst_ring_buffer_parse_caps (&filter->format, incaps)) { |
177 if (!gst_ring_buffer_parse_caps (&filter->format, incaps)) { |
224 void |
225 void |
225 gst_audio_filter_class_add_pad_templates (GstAudioFilterClass * klass, |
226 gst_audio_filter_class_add_pad_templates (GstAudioFilterClass * klass, |
226 const GstCaps * allowed_caps) |
227 const GstCaps * allowed_caps) |
227 { |
228 { |
228 GstElementClass *element_class = GST_ELEMENT_CLASS (klass); |
229 GstElementClass *element_class = GST_ELEMENT_CLASS (klass); |
229 GstPadTemplate *pad_template; |
|
230 |
230 |
231 g_return_if_fail (GST_IS_AUDIO_FILTER_CLASS (klass)); |
231 g_return_if_fail (GST_IS_AUDIO_FILTER_CLASS (klass)); |
232 g_return_if_fail (allowed_caps != NULL); |
232 g_return_if_fail (allowed_caps != NULL); |
233 g_return_if_fail (GST_IS_CAPS (allowed_caps)); |
233 g_return_if_fail (GST_IS_CAPS (allowed_caps)); |
234 |
234 |
235 pad_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, |
235 gst_element_class_add_pad_template (element_class, |
236 gst_caps_copy (allowed_caps)); |
236 gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, |
237 gst_element_class_add_pad_template (element_class, pad_template); |
237 gst_caps_copy (allowed_caps))); |
238 gst_object_unref (pad_template); |
238 |
239 |
239 gst_element_class_add_pad_template (element_class, |
240 pad_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, |
240 gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, |
241 gst_caps_copy (allowed_caps)); |
241 gst_caps_copy (allowed_caps))); |
242 gst_element_class_add_pad_template (element_class, pad_template); |
242 } |
243 gst_object_unref (pad_template); |
|
244 } |
|