2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wim.taymans@chello.be>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
27 #include "gst/gst-i18n-plugin.h"
28 #include <sys/types.h>
30 #include <sys/ioctl.h>
32 #include <sys/soundcard.h>
37 #include <gst/propertyprobe/propertyprobe.h>
39 #include "gstosselement.h"
40 #include "gstossmixer.h"
49 /* elementfactory information */
50 static GstElementDetails gst_osselement_details = GST_ELEMENT_DETAILS (
53 "OSS-based mixer element",
54 "Ronald Bultje <rbultje@ronald.bitfreak.net>"
57 static void gst_osselement_base_init (GstOssElementClass *klass);
58 static void gst_osselement_class_init (GstOssElementClass *klass);
60 static void gst_ossprobe_interface_init (GstPropertyProbeInterface *iface);
61 static void gst_osselement_init (GstOssElement *oss);
62 static void gst_osselement_dispose (GObject *object);
64 static void gst_osselement_set_property (GObject *object,
68 static void gst_osselement_get_property (GObject *object,
72 static GstElementStateReturn gst_osselement_change_state (GstElement *element);
74 static GstElementClass *parent_class = NULL;
75 /*static guint gst_osssrc_signals[LAST_SIGNAL] = { 0 }; */
78 gst_osselement_get_type (void)
80 static GType osselement_type = 0;
82 if (!osselement_type) {
83 static const GTypeInfo osselement_info = {
84 sizeof(GstOssElementClass),
85 (GBaseInitFunc)gst_osselement_base_init,
87 (GClassInitFunc)gst_osselement_class_init,
90 sizeof(GstOssElement),
92 (GInstanceInitFunc)gst_osselement_init
94 static const GInterfaceInfo ossiface_info = {
95 (GInterfaceInitFunc) gst_oss_interface_init,
99 static const GInterfaceInfo ossmixer_info = {
100 (GInterfaceInitFunc) gst_ossmixer_interface_init,
104 static const GInterfaceInfo ossprobe_info = {
105 (GInterfaceInitFunc) gst_ossprobe_interface_init,
110 osselement_type = g_type_register_static (GST_TYPE_ELEMENT,
112 &osselement_info, 0);
113 g_type_add_interface_static (osselement_type,
114 GST_TYPE_IMPLEMENTS_INTERFACE,
116 g_type_add_interface_static (osselement_type,
119 g_type_add_interface_static (osselement_type,
120 GST_TYPE_PROPERTY_PROBE,
124 return osselement_type;
128 gst_osselement_base_init (GstOssElementClass *klass)
130 GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
132 klass->device_combinations = NULL;
134 gst_element_class_set_details (element_class, &gst_osselement_details);
138 gst_osselement_class_init (GstOssElementClass *klass)
140 GObjectClass *gobject_class;
141 GstElementClass *gstelement_class;
143 gobject_class = (GObjectClass*)klass;
144 gstelement_class = (GstElementClass*)klass;
146 parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
148 g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DEVICE,
149 g_param_spec_string ("device", "Device", "OSS device (/dev/dspN usually)",
150 "default", G_PARAM_READWRITE));
151 g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MIXERDEV,
152 g_param_spec_string ("mixerdev", "Mixer device",
153 "OSS mixer device (/dev/mixerN usually)",
154 "default", G_PARAM_READWRITE));
155 g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DEVICE_NAME,
156 g_param_spec_string ("device_name", "Device name", "Name of the device",
157 NULL, G_PARAM_READABLE));
159 gobject_class->set_property = gst_osselement_set_property;
160 gobject_class->get_property = gst_osselement_get_property;
161 gobject_class->dispose = gst_osselement_dispose;
163 gstelement_class->change_state = gst_osselement_change_state;
167 gst_ossprobe_get_properties (GstPropertyProbe *probe)
169 GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
170 static GList *list = NULL;
173 list = g_list_append (NULL, g_object_class_find_property (klass, "device"));
180 gst_osselement_probe (gchar *device_base,
187 /* only if yet unfilled */
192 device = g_strdup (device_base);
194 device = g_strdup_printf ("%s%d", device_base, device_num);
196 if (lstat (device, &s) || !S_ISCHR (s.st_mode))
207 gst_osselement_class_probe_devices (GstOssElementClass *klass,
210 GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
211 static gboolean init = FALSE;
212 static GList *device_combinations;
214 gint openmode = O_RDONLY;
215 gboolean mixer = FALSE;
217 /* Ok, so how do we open the device? We assume that we have (max.) one
218 * pad, and if this is a sinkpad, we're osssink (w). else, we're osssrc
220 padtempllist = gst_element_class_get_pad_template_list (eklass);
221 if (padtempllist != NULL) {
222 GstPadTemplate *firstpadtempl = padtempllist->data;
223 if (GST_PAD_TEMPLATE_DIRECTION (firstpadtempl) == GST_PAD_SINK) {
229 if (!init && !check) {
230 gchar *dsp_base[] = { "/dev/dsp", "/dev/sound/dsp", NULL };
231 gchar *mixer_base[] = { "/dev/mixer", "/dev/sound/mixer", NULL };
232 GstOssDeviceCombination devices[16];
235 while (device_combinations) {
236 GList *item = device_combinations;
237 GstOssDeviceCombination *combi = item->data;
239 device_combinations = g_list_remove (device_combinations, item);
242 g_free (combi->mixer);
246 /* probe for all /dev entries */
247 memset (devices, 0, sizeof (devices));
249 /* OSS (without devfs) allows at max. 16 devices */
250 for (n = 0; n < 16; n++) {
253 for (base = 0; dsp_base[base] != NULL; base++)
254 gst_osselement_probe (dsp_base[base], n, &devices[n].dsp);
256 for (base = 0; mixer_base[base] != NULL; base++)
257 gst_osselement_probe (mixer_base[base], n, &devices[n].mixer);
260 /* does the device exist (can we open them)? */
261 for (n = 0; n < 16; n++) {
267 /* we just check the dsp. we assume the mixer always works.
268 * we don't need a mixer anyway (says OSS)... If we are a
269 * mixer element, we use the mixer anyway. */
270 if ((fd = open (mixer ? devices[n].mixer :
271 devices[n].dsp, openmode)) > 0 || errno == EBUSY) {
272 GstOssDeviceCombination *combi;
278 combi = g_new0 (GstOssDeviceCombination, 1);
279 combi->dsp = devices[n].dsp;
280 combi->mixer = devices[n].mixer;
281 devices[n].dsp = devices[n].mixer = NULL;
283 device_combinations = g_list_append (device_combinations, combi);
288 for (n = 0; n < 16; n++) {
290 g_free (devices[n].dsp);
292 if (devices[n].mixer)
293 g_free (devices[n].mixer);
299 klass->device_combinations = device_combinations;
305 gst_osselement_class_list_devices (GstOssElementClass *klass)
308 GValue value = { 0 };
311 if (!klass->device_combinations)
314 array = g_value_array_new (g_list_length (klass->device_combinations));
315 item = klass->device_combinations;
316 g_value_init (&value, G_TYPE_STRING);
318 GstOssDeviceCombination *combi = item->data;
320 g_value_set_string (&value, combi->dsp);
321 g_value_array_append (array, &value);
325 g_value_unset (&value);
331 gst_ossprobe_probe_property (GstPropertyProbe *probe,
333 const GParamSpec *pspec)
335 GstOssElementClass *klass = GST_OSSELEMENT_GET_CLASS (probe);
339 gst_osselement_class_probe_devices (klass, FALSE);
342 G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
348 gst_ossprobe_needs_probe (GstPropertyProbe *probe,
350 const GParamSpec *pspec)
352 GstOssElementClass *klass = GST_OSSELEMENT_GET_CLASS (probe);
353 gboolean ret = FALSE;
357 ret = !gst_osselement_class_probe_devices (klass, TRUE);
360 G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
368 gst_ossprobe_get_values (GstPropertyProbe *probe,
370 const GParamSpec *pspec)
372 GstOssElementClass *klass = GST_OSSELEMENT_GET_CLASS (probe);
373 GValueArray *array = NULL;
377 array = gst_osselement_class_list_devices (klass);
380 G_OBJECT_WARN_INVALID_PROPERTY_ID (probe, prop_id, pspec);
388 gst_ossprobe_interface_init (GstPropertyProbeInterface *iface)
390 iface->get_properties = gst_ossprobe_get_properties;
391 iface->probe_property = gst_ossprobe_probe_property;
392 iface->needs_probe = gst_ossprobe_needs_probe;
393 iface->get_values = gst_ossprobe_get_values;
397 gst_osselement_init (GstOssElement *oss)
399 oss->device = g_strdup ("/dev/dsp");
400 oss->mixer_dev = g_strdup ("/dev/mixer");
403 oss->tracklist = NULL;
404 oss->device_name = NULL;
406 gst_osselement_reset (oss);
410 gst_osselement_dispose (GObject *object)
412 GstOssElement *oss = (GstOssElement *) object;
414 g_free (oss->device);
415 g_free (oss->mixer_dev);
417 G_OBJECT_CLASS (parent_class)->dispose (object);
421 gst_osselement_reset (GstOssElement *oss)
424 oss->endianness = G_BYTE_ORDER;
433 /* AFMT_*_BE not available on all OSS includes (e.g. FBSD) */
434 #ifdef WORDS_BIGENDIAN
435 oss->format = AFMT_S16_BE;
437 oss->format = AFMT_S16_LE;
438 #endif /* WORDS_BIGENDIAN */
442 gst_ossformat_get (gint law, gint endianness, gboolean sign, gint width, gint depth,
443 gint *format, gint *bps)
453 if (endianness == G_LITTLE_ENDIAN) {
454 *format = AFMT_S16_LE;
456 "16 bit signed LE, no law (%d)", *format);
458 else if (endianness == G_BIG_ENDIAN) {
459 *format = AFMT_S16_BE;
461 "16 bit signed BE, no law (%d)", *format);
465 if (endianness == G_LITTLE_ENDIAN) {
466 *format = AFMT_U16_LE;
468 "16 bit unsigned LE, no law (%d)", *format);
470 else if (endianness == G_BIG_ENDIAN) {
471 *format = AFMT_U16_BE;
473 "16 bit unsigned BE, no law (%d)", *format);
478 else if (width == 8) {
482 "8 bit signed, no law (%d)", *format);
487 "8 bit unsigned, no law (%d)", *format);
491 } else if (law == 1) {
492 *format = AFMT_MU_LAW;
494 "mu law (%d)", *format);
495 } else if (law == 2) {
496 *format = AFMT_A_LAW;
498 "a law (%d)", *format);
500 g_critical ("unknown law");
508 gst_osselement_parse_caps (GstOssElement *oss, const GstCaps *caps)
511 GstStructure *structure;
513 structure = gst_caps_get_structure (caps, 0);
515 gst_structure_get_int (structure, "width", &oss->width);
516 gst_structure_get_int (structure, "depth", &oss->depth);
518 if (oss->width != oss->depth)
521 gst_structure_get_int (structure, "law", &oss->law);
522 gst_structure_get_int (structure, "endianness", &oss->endianness);
523 gst_structure_get_boolean (structure, "signed", &oss->sign);
525 if (!gst_ossformat_get (oss->law, oss->endianness, oss->sign,
526 oss->width, oss->depth, &format, &bps))
528 GST_DEBUG ("could not get format");
532 gst_structure_get_int (structure, "channels", &oss->channels);
533 gst_structure_get_int (structure, "rate", &oss->rate);
535 oss->bps = bps * oss->channels * oss->rate;
536 oss->format = format;
541 #define GET_FIXED_INT(caps, name, dest) \
543 if (gst_caps_has_fixed_property (caps, name)) \
544 gst_structure_get_int (structure, name, dest); \
546 #define GET_FIXED_BOOLEAN(caps, name, dest) \
548 if (gst_caps_has_fixed_property (caps, name)) \
549 gst_structure_get_boolean (structure, name, dest); \
553 gst_osselement_merge_fixed_caps (GstOssElement *oss, GstCaps *caps)
556 GstStructure *structure;
558 structure = gst_caps_get_structure (caps, 0);
560 /* peel off fixed stuff from the caps */
561 gst_structure_get_int (structure, "law", &oss->law);
562 gst_structure_get_int (structure, "endianness", &oss->endianness);
563 gst_structure_get_boolean (structure, "signed", &oss->sign);
564 gst_structure_get_int (structure, "width", &oss->width);
565 gst_structure_get_int (structure, "depth", &oss->depth);
567 if (!gst_ossformat_get (oss->law, oss->endianness, oss->sign,
568 oss->width, oss->depth, &format, &bps))
573 gst_structure_get_int (structure, "rate", &oss->rate);
574 gst_structure_get_int (structure, "channels", &oss->channels);
576 oss->bps = bps * oss->channels * oss->rate;
577 oss->format = format;
583 gst_osselement_sync_parms (GstOssElement *oss)
585 audio_buf_info space;
588 gint target_channels;
590 gint fragscale, frag_ln;
595 if (oss->fragment >> 16)
596 frag = oss->fragment;
598 frag = 0x7FFF0000 | oss->fragment;
600 GST_INFO ("osselement: setting sound card to %dHz %d format %s (%08x fragment)",
601 oss->rate, oss->format,
602 (oss->channels == 2) ? "stereo" : "mono", frag);
604 ioctl (oss->fd, SNDCTL_DSP_SETFRAGMENT, &frag);
605 ioctl (oss->fd, SNDCTL_DSP_RESET, 0);
607 target_format = oss->format;
608 target_channels = oss->channels;
609 target_rate = oss->rate;
611 ioctl (oss->fd, SNDCTL_DSP_SETFMT, &oss->format);
612 ioctl (oss->fd, SNDCTL_DSP_CHANNELS, &oss->channels);
613 ioctl (oss->fd, SNDCTL_DSP_SPEED, &oss->rate);
615 ioctl (oss->fd, SNDCTL_DSP_GETBLKSIZE, &oss->fragment_size);
617 if (oss->mode == GST_OSSELEMENT_WRITE) {
618 ioctl (oss->fd, SNDCTL_DSP_GETOSPACE, &space);
621 ioctl (oss->fd, SNDCTL_DSP_GETISPACE, &space);
624 /* calculate new fragment using a poor man's logarithm function */
627 while (fragscale < space.fragsize) {
631 oss->fragment = space.fragstotal << 16 | frag_ln;
633 GST_INFO ("osselement: set sound card to %dHz, %d format, %s "
634 "(%d bytes buffer, %08x fragment)",
635 oss->rate, oss->format,
636 (oss->channels == 2) ? "stereo" : "mono",
637 space.bytes, oss->fragment);
639 oss->fragment_time = (GST_SECOND * oss->fragment_size) / oss->bps;
640 GST_INFO ("fragment time %u %" G_GUINT64_FORMAT "\n",
641 oss->bps, oss->fragment_time);
643 if (target_format != oss->format ||
644 target_channels != oss->channels ||
645 target_rate != oss->rate)
647 if (target_channels != oss->channels)
648 g_warning ("couldn't set the right number of channels, enjoy the tone difference");
649 if (target_rate != oss->rate)
650 g_warning ("couldn't set the right number of channels, enjoy the speed difference");
651 if (target_format != oss->format)
652 g_warning ("couldn't set requested OSS parameters, enjoy the noise :)");
653 /* we could eventually return FALSE here, or just do some additional tests
654 * to see that the frequencies don't differ too much etc.. */
660 gst_osselement_open_audio (GstOssElement *oss)
663 GstOssOpenMode mode = GST_OSSELEMENT_READ;
664 const GList *padlist;
666 g_return_val_if_fail (oss->fd == -1, FALSE);
667 GST_INFO ("osselement: attempting to open sound device");
669 /* Ok, so how do we open the device? We assume that we have (max.) one
670 * pad, and if this is a sinkpad, we're osssink (w). else, we're osssrc (r) */
671 padlist = gst_element_get_pad_list (GST_ELEMENT (oss));
672 if (padlist != NULL) {
673 GstPad *firstpad = padlist->data;
674 if (GST_PAD_IS_SINK (firstpad)) {
675 mode = GST_OSSELEMENT_WRITE;
681 /* first try to open the sound card */
682 if (mode == GST_OSSELEMENT_WRITE) {
683 /* open non blocking first so that it returns immediatly with an error
684 * when we cannot get to the device */
685 oss->fd = open (oss->device, O_WRONLY | O_NONBLOCK);
690 /* re-open the sound device in blocking mode */
691 oss->fd = open (oss->device, O_WRONLY);
695 oss->fd = open (oss->device, O_RDONLY);
701 GST_ELEMENT_ERROR (oss, RESOURCE, BUSY,
702 (_("OSS device \"%s\" is already in use by another program."), oss->device),
707 if (mode == GST_OSSELEMENT_WRITE)
708 GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE,
709 (_("Could not access device \"%s\", check its permissions."), oss->device),
712 GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_READ,
713 (_("Could not access device \"%s\", check its permissions."), oss->device),
719 GST_ELEMENT_ERROR (oss, RESOURCE, NOT_FOUND,
720 (_("Device \"%s\" does not exist."), oss->device),
724 /* FIXME: strerror is not threadsafe */
725 if (mode == GST_OSSELEMENT_WRITE)
726 GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_WRITE,
727 (_("Could not open device \"%s\" for writing."), oss->device),
730 GST_ELEMENT_ERROR (oss, RESOURCE, OPEN_READ,
731 (_("Could not open device \"%s\" for reading."), oss->device),
740 /* we have it, set the default parameters and go have fun */
742 ioctl (oss->fd, SNDCTL_DSP_GETCAPS, &caps);
744 GST_INFO ("osselement: Capabilities %08x", caps);
746 if (caps & DSP_CAP_DUPLEX) GST_INFO ( "osselement: Full duplex");
747 if (caps & DSP_CAP_REALTIME) GST_INFO ( "osselement: Realtime");
748 if (caps & DSP_CAP_BATCH) GST_INFO ( "osselement: Batch");
749 if (caps & DSP_CAP_COPROC) GST_INFO ( "osselement: Has coprocessor");
750 if (caps & DSP_CAP_TRIGGER) GST_INFO ( "osselement: Trigger");
751 if (caps & DSP_CAP_MMAP) GST_INFO ( "osselement: Direct access");
754 if (caps & DSP_CAP_MULTI) GST_INFO ( "osselement: Multiple open");
755 #endif /* DSP_CAP_MULTI */
758 if (caps & DSP_CAP_BIND) GST_INFO ( "osselement: Channel binding");
759 #endif /* DSP_CAP_BIND */
761 ioctl(oss->fd, SNDCTL_DSP_GETFMTS, &caps);
763 GST_INFO ( "osselement: Formats %08x", caps);
764 if (caps & AFMT_MU_LAW) GST_INFO ( "osselement: MU_LAW");
765 if (caps & AFMT_A_LAW) GST_INFO ( "osselement: A_LAW");
766 if (caps & AFMT_IMA_ADPCM) GST_INFO ( "osselement: IMA_ADPCM");
767 if (caps & AFMT_U8) GST_INFO ( "osselement: U8");
768 if (caps & AFMT_S16_LE) GST_INFO ( "osselement: S16_LE");
769 if (caps & AFMT_S16_BE) GST_INFO ( "osselement: S16_BE");
770 if (caps & AFMT_S8) GST_INFO ( "osselement: S8");
771 if (caps & AFMT_U16_LE) GST_INFO ( "osselement: U16_LE");
772 if (caps & AFMT_U16_BE) GST_INFO ( "osselement: U16_BE");
773 if (caps & AFMT_MPEG) GST_INFO ( "osselement: MPEG");
775 if (caps & AFMT_AC3) GST_INFO ( "osselement: AC3");
778 GST_INFO ("osselement: opened audio (%s) with fd=%d",
779 oss->device, oss->fd);
784 gst_ossmixer_build_list (oss);
790 gst_osselement_close_audio (GstOssElement *oss)
792 gst_ossmixer_free_list (oss);
802 gst_osselement_convert (GstOssElement *oss,
803 GstFormat src_format,
805 GstFormat *dest_format,
810 if (src_format == *dest_format) {
811 *dest_value = src_value;
815 if (oss->bps == 0 || oss->channels == 0 || oss->width == 0)
818 switch (src_format) {
819 case GST_FORMAT_BYTES:
820 switch (*dest_format) {
821 case GST_FORMAT_TIME:
822 *dest_value = src_value * GST_SECOND / oss->bps;
824 case GST_FORMAT_DEFAULT:
825 *dest_value = src_value / (oss->width * oss->channels / 8);
831 case GST_FORMAT_TIME:
832 switch (*dest_format) {
833 case GST_FORMAT_BYTES:
834 *dest_value = src_value * oss->bps / GST_SECOND;
836 case GST_FORMAT_DEFAULT:
837 *dest_value = src_value * oss->rate / GST_SECOND;
843 case GST_FORMAT_DEFAULT:
844 switch (*dest_format) {
845 case GST_FORMAT_TIME:
846 *dest_value = src_value * GST_SECOND / oss->rate;
848 case GST_FORMAT_BYTES:
849 *dest_value = src_value * oss->width * oss->channels / 8;
863 gst_osselement_set_property (GObject *object,
868 GstOssElement *oss = GST_OSSELEMENT (object);
872 /* disallow changing the device while it is opened
873 get_property("device") should return the right one */
874 if (gst_element_get_state (GST_ELEMENT (oss)) == GST_STATE_NULL) {
875 g_free (oss->device);
876 oss->device = g_strdup (g_value_get_string (value));
878 /* let's assume that if we have a device map for the mixer,
879 * we're allowed to do all that automagically here */
880 if (GST_OSSELEMENT_GET_CLASS (oss)->device_combinations != NULL) {
881 GList *list = GST_OSSELEMENT_GET_CLASS (oss)->device_combinations;
884 GstOssDeviceCombination *combi = list->data;
886 if (!strcmp (combi->dsp, oss->device)) {
887 g_free (oss->mixer_dev);
888 oss->mixer_dev = g_strdup (combi->mixer);
898 /* disallow changing the device while it is opened
899 get_property("mixerdev") should return the right one */
900 if (gst_element_get_state (GST_ELEMENT (oss)) == GST_STATE_NULL) {
901 g_free (oss->mixer_dev);
902 oss->mixer_dev = g_strdup (g_value_get_string (value));
911 gst_osselement_get_property (GObject *object,
916 GstOssElement *oss = GST_OSSELEMENT (object);
920 g_value_set_string (value, oss->device);
923 g_value_set_string (value, oss->mixer_dev);
925 case ARG_DEVICE_NAME:
926 g_value_set_string (value, oss->device_name);
929 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
934 static GstElementStateReturn
935 gst_osselement_change_state (GstElement *element)
937 GstOssElement *oss = GST_OSSELEMENT (element);
939 switch (GST_STATE_TRANSITION (element)) {
940 case GST_STATE_NULL_TO_READY:
941 if (!gst_osselement_open_audio (oss)) {
942 return GST_STATE_FAILURE;
944 GST_INFO ("osselement: opened sound device");
946 case GST_STATE_READY_TO_NULL:
947 gst_osselement_close_audio (oss);
948 gst_osselement_reset (oss);
949 GST_INFO ("osselement: closed sound device");
955 if (GST_ELEMENT_CLASS (parent_class)->change_state)
956 return GST_ELEMENT_CLASS (parent_class)->change_state (element);
958 return GST_STATE_SUCCESS;