2 * Copyright (C) 2011, Hewlett-Packard Development Company, L.P.
3 * Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>, Collabora Ltd.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation
8 * version 2.1 of the License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __GST_OMX_VIDEO_DEC_H__
22 #define __GST_OMX_VIDEO_DEC_H__
29 #include <gst/video/video.h>
30 #include <gst/video/gstvideodecoder.h>
34 #define OMX_VERSION_MAJOR 1
35 #define OMX_VERSION_MINOR 1
36 #define OMX_VERSION_REVISION 2
37 #define OMX_VERSION_STEP 0
39 #define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR)
41 #define OMX_INIT_STRUCTURE(a) \
42 memset(&(a), 0, sizeof(a)); \
43 (a).nSize = sizeof(a); \
44 (a).nVersion.nVersion = OMX_VERSION; \
45 (a).nVersion.s.nVersionMajor = OMX_VERSION_MAJOR; \
46 (a).nVersion.s.nVersionMinor = OMX_VERSION_MINOR; \
47 (a).nVersion.s.nRevision = OMX_VERSION_REVISION; \
48 (a).nVersion.s.nStep = OMX_VERSION_STEP
52 #define GST_TYPE_OMX_VIDEO_DEC \
53 (gst_omx_video_dec_get_type())
54 #define GST_OMX_VIDEO_DEC(obj) \
55 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VIDEO_DEC,GstOMXVideoDec))
56 #define GST_OMX_VIDEO_DEC_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VIDEO_DEC,GstOMXVideoDecClass))
58 #define GST_OMX_VIDEO_DEC_GET_CLASS(obj) \
59 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VIDEO_DEC,GstOMXVideoDecClass))
60 #define GST_IS_OMX_VIDEO_DEC(obj) \
61 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VIDEO_DEC))
62 #define GST_IS_OMX_VIDEO_DEC_CLASS(obj) \
63 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VIDEO_DEC))
65 typedef struct _GstOMXVideoDec GstOMXVideoDec;
66 typedef struct _GstOMXVideoDecClass GstOMXVideoDecClass;
68 struct _GstOMXVideoDec
70 GstVideoDecoder parent;
74 GstOMXPort *dec_in_port, *dec_out_port;
76 GstBufferPool *in_port_pool, *out_port_pool;
79 GstVideoCodecState *input_state;
80 GstBuffer *codec_data;
81 /* TRUE if the component is configured and saw
85 GstClockTime last_upstream_ts;
90 /* TRUE if EOS buffers shouldn't be forwarded */
93 GstFlowReturn downstream_flow_ret;
94 #ifdef GST_TIZEN_MODIFICATION
96 tbm_bufmgr hTBMBufMgr;
98 #ifdef USE_OMX_TARGET_RPI
99 GstOMXComponent *egl_render;
100 GstOMXPort *egl_in_port, *egl_out_port;
105 struct _GstOMXVideoDecClass
107 GstVideoDecoderClass parent_class;
109 GstOMXClassData cdata;
111 gboolean (*is_format_change) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoCodecState * state);
112 gboolean (*set_format) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoCodecState * state);
113 GstFlowReturn (*prepare_frame) (GstOMXVideoDec * self, GstVideoCodecFrame *frame);
116 GType gst_omx_video_dec_get_type (void);
120 #endif /* __GST_OMX_VIDEO_DEC_H__ */