Initialize Tizen 2.3
[framework/multimedia/gst-openmax.git] / wearable / omx / gstomx_wmvdec.c
1 /*
2  * Copyright (C) 2007-2009 Nokia Corporation.
3  *
4  * Author: Felipe Contreras <felipe.contreras@nokia.com>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #include "gstomx_wmvdec.h"
23 #include "gstomx.h"
24
25 GSTOMX_BOILERPLATE (GstOmxWmvDec, gst_omx_wmvdec, GstOmxBaseVideoDec,
26     GST_OMX_BASE_VIDEODEC_TYPE);
27
28
29 static void instance_init (GstElement * element);
30
31
32 static void
33 type_base_init (gpointer g_class)
34 {
35   GstElementClass *element_class;
36
37   element_class = GST_ELEMENT_CLASS (g_class);
38
39   gst_element_class_set_details_simple (element_class,
40       "OpenMAX IL WMV video decoder",
41       "Codec/Decoder/Video",
42       "Decodes video in WMV format with OpenMAX IL", "Felipe Contreras");
43
44   gst_element_class_add_pad_template (element_class,
45       gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
46           gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink")));
47
48   gst_element_class_add_pad_template (element_class,
49       gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
50           gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src")));
51 }
52
53 static void
54 type_class_init (gpointer g_class, gpointer class_data)
55 {
56   GstOmxBaseFilterClass *basefilter_class;
57
58   basefilter_class = GST_OMX_BASE_FILTER_CLASS (g_class);
59
60   basefilter_class->instance_init = instance_init;
61 }
62
63 static void
64 instance_private_value_init(GstElement * element)
65 {
66   GstOmxBaseVideoDec *omx_base;
67   GstOmxBaseFilter *omx_base_filter;
68
69   omx_base_filter = GST_OMX_BASE_FILTER (element);
70   omx_base = GST_OMX_BASE_VIDEODEC (element);
71
72   omx_base->compression_format = OMX_VIDEO_CodingWMV;
73   omx_base_filter->gomx->compression_format = OMX_VIDEO_CodingWMV;
74 }
75
76 static void
77 instance_init (GstElement * element)
78 {
79   GST_OMX_BASE_FILTER_CLASS (parent_class)->instance_init(element);
80
81   instance_private_value_init(element);
82 }
83
84 static void
85 type_instance_init (GTypeInstance * instance, gpointer g_class)
86 {
87   instance_private_value_init(GST_ELEMENT(instance));
88 }