2 * Copyright (C) 2007-2009 Nokia Corporation.
4 * Author: Felipe Contreras <felipe.contreras@nokia.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation
9 * version 2.1 of the License.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "gstomx_g729dec.h"
25 GSTOMX_BOILERPLATE (GstOmxG729Dec, gst_omx_g729dec, GstOmxBaseAudioDec,
26 GST_OMX_BASE_AUDIODEC_TYPE);
28 static void instance_init (GstElement * element);
32 type_base_init (gpointer g_class)
34 GstElementClass *element_class;
36 element_class = GST_ELEMENT_CLASS (g_class);
38 gst_element_class_set_details_simple (element_class,
39 "OpenMAX IL G.729 audio decoder",
40 "Codec/Decoder/Audio",
41 "Decodes audio in G.729 format with OpenMAX IL", "Felipe Contreras");
43 gst_element_class_add_pad_template (element_class,
44 gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
45 gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink")));
47 gst_element_class_add_pad_template (element_class,
48 gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
49 gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src")));
53 type_class_init (gpointer g_class, gpointer class_data)
55 GstOmxBaseFilterClass *basefilter_class;
57 GST_WARNING("G.729 dec type_class_init");
58 basefilter_class = GST_OMX_BASE_FILTER_CLASS (g_class);
60 basefilter_class->instance_init = instance_init;
63 /* should we be overriding the settings_changed_cb from parent class like this?? */
65 settings_changed_cb (GOmxCore * core)
67 GstOmxBaseFilter *omx_base;
69 omx_base = core->object;
71 GST_DEBUG_OBJECT (omx_base, "settings changed");
76 new_caps = gst_caps_new_simple ("audio/x-raw-int",
77 "endianness", G_TYPE_INT, G_BYTE_ORDER,
78 "width", G_TYPE_INT, 16,
79 "depth", G_TYPE_INT, 16,
80 "rate", G_TYPE_INT, 8000,
81 "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL);
83 GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
84 gst_pad_set_caps (omx_base->srcpad, new_caps);
89 instance_private_value_init(GstElement * element)
91 GstOmxBaseFilter *omx_base;
93 omx_base = GST_OMX_BASE_FILTER (element);
95 omx_base->gomx->settings_changed_cb = settings_changed_cb;
99 instance_init (GstElement * element)
101 GST_OMX_BASE_FILTER_CLASS (parent_class)->instance_init(element);
103 instance_private_value_init(element);
107 type_instance_init (GTypeInstance * instance, gpointer g_class)
109 instance_private_value_init(GST_ELEMENT(instance));