5ade8e2b2e92dbc473d083ce79fe16e0b027b6f4
[profile/ivi/gst-openmax0.10.git] / omx / gstomx_base_filter.h
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 #ifndef GSTOMX_BASE_FILTER_H
23 #define GSTOMX_BASE_FILTER_H
24
25 #include <gst/gst.h>
26
27 G_BEGIN_DECLS
28 #define GST_OMX_BASE_FILTER(obj) (GstOmxBaseFilter *) (obj)
29 #define GST_OMX_BASE_FILTER_TYPE (gst_omx_base_filter_get_type ())
30 #define GST_OMX_BASE_FILTER_CLASS(obj) (GstOmxBaseFilterClass *) (obj)
31 typedef struct GstOmxBaseFilter GstOmxBaseFilter;
32 typedef struct GstOmxBaseFilterClass GstOmxBaseFilterClass;
33 typedef void (*GstOmxBaseFilterCb) (GstOmxBaseFilter * self);
34
35 #include "gstomx_util.h"
36 #include <async_queue.h>
37
38 /* Add extended_color_format */
39 typedef enum _EXT_OMX_COLOR_FORMATTYPE {
40     OMX_EXT_COLOR_FormatNV12TPhysicalAddress = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */
41     OMX_EXT_COLOR_FormatNV12LPhysicalAddress = 0x7F000002,
42     OMX_EXT_COLOR_FormatNV12Tiled            = 0x7FC00002  /* 0x7FC00002 */
43 }EXT_OMX_COLOR_FORMATTYPE;
44
45 struct GstOmxBaseFilter
46 {
47   GstElement element;
48
49   GstPad *sinkpad;
50   GstPad *srcpad;
51
52   GOmxCore *gomx;
53   GOmxPort *in_port;
54   GOmxPort *out_port;
55
56   gboolean use_timestamps;   /** @todo remove; timestamps should always be used */
57   gboolean ready;
58   GMutex *ready_lock;
59
60   GstOmxBaseFilterCb omx_setup;
61   GstFlowReturn last_pad_push_return;
62   GstBuffer *codec_data;
63
64     /** @todo these are hacks, OpenMAX IL spec should be revised. */
65   gboolean share_input_buffer;
66   gboolean share_output_buffer;
67
68   /* STATE_TUNING */
69   GstCaps *sink_set_caps;
70   gboolean use_state_tuning;
71 };
72
73 struct GstOmxBaseFilterClass
74 {
75   GstElementClass parent_class;
76 };
77
78 GType gst_omx_base_filter_get_type (void);
79
80 G_END_DECLS
81 #endif /* GSTOMX_BASE_FILTER_H */