diff options
Diffstat (limited to 'gstreamer_ti_dm81xx/ti_build/gst-openmax/omx/gstomx_vorbisdec.c')
-rw-r--r-- | gstreamer_ti_dm81xx/ti_build/gst-openmax/omx/gstomx_vorbisdec.c | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/gstreamer_ti_dm81xx/ti_build/gst-openmax/omx/gstomx_vorbisdec.c b/gstreamer_ti_dm81xx/ti_build/gst-openmax/omx/gstomx_vorbisdec.c new file mode 100644 index 0000000..d082081 --- /dev/null +++ b/gstreamer_ti_dm81xx/ti_build/gst-openmax/omx/gstomx_vorbisdec.c @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2007-2009 Nokia Corporation. + * + * Author: Felipe Contreras <felipe.contreras@nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "gstomx_vorbisdec.h" +#include "gstomx.h" + +#include <string.h> /* for memset */ + +GSTOMX_BOILERPLATE (GstOmxVorbisDec, gst_omx_vorbisdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); + +static GstCaps * +generate_src_template (void) +{ + GstCaps *caps = NULL; + + caps = gst_caps_new_simple ("audio/x-raw-int", + "rate", GST_TYPE_INT_RANGE, 8000, 96000, + "signed", G_TYPE_BOOLEAN, TRUE, + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "width", G_TYPE_INT, 16, + "depth", G_TYPE_INT, 16, + "channels", GST_TYPE_INT_RANGE, 1, 256, + NULL); + + return caps; +} + +static GstCaps * +generate_sink_template (void) +{ + GstCaps *caps = NULL; + + caps = gst_caps_new_simple ("application/ogg", + NULL); + + return caps; +} + +static void +type_base_init (gpointer g_class) +{ + GstElementClass *element_class; + + element_class = GST_ELEMENT_CLASS (g_class); + + { + GstElementDetails details; + + details.longname = "OpenMAX IL Vorbis audio decoder"; + details.klass = "Codec/Decoder/Audio"; + details.description = "Decodes audio in Vorbis format with OpenMAX IL"; + details.author = "Felipe Contreras"; + + gst_element_class_set_details (element_class, &details); + } + + { + GstPadTemplate *template; + + template = gst_pad_template_new ("src", GST_PAD_SRC, + GST_PAD_ALWAYS, + generate_src_template ()); + + gst_element_class_add_pad_template (element_class, template); + } + + { + GstPadTemplate *template; + + template = gst_pad_template_new ("sink", GST_PAD_SINK, + GST_PAD_ALWAYS, + generate_sink_template ()); + + gst_element_class_add_pad_template (element_class, template); + } +} + +static void +type_class_init (gpointer g_class, + gpointer class_data) +{ +} + +static void +type_instance_init (GTypeInstance *instance, + gpointer g_class) +{ + GstOmxBaseFilter *omx_base; + + omx_base = GST_OMX_BASE_FILTER (instance); + + GST_DEBUG_OBJECT (omx_base, "start"); + + omx_base->gomx->use_timestamps = FALSE; +} |