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>
36 #define GST_TYPE_OMX_VIDEO_DEC \
37 (gst_omx_video_dec_get_type())
38 #define GST_OMX_VIDEO_DEC(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VIDEO_DEC,GstOMXVideoDec))
40 #define GST_OMX_VIDEO_DEC_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VIDEO_DEC,GstOMXVideoDecClass))
42 #define GST_OMX_VIDEO_DEC_GET_CLASS(obj) \
43 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VIDEO_DEC,GstOMXVideoDecClass))
44 #define GST_IS_OMX_VIDEO_DEC(obj) \
45 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VIDEO_DEC))
46 #define GST_IS_OMX_VIDEO_DEC_CLASS(obj) \
47 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VIDEO_DEC))
49 #define EXTRA_DECODER_OUTPUT_BUF 4
51 typedef struct _GstOMXVideoDec GstOMXVideoDec;
52 typedef struct _GstOMXVideoDecClass GstOMXVideoDecClass;
54 struct _GstOMXVideoDec
56 GstVideoDecoder parent;
60 GstOMXPort *dec_in_port, *dec_out_port;
62 GstBufferPool *in_port_pool, *out_port_pool;
65 GstVideoCodecState *input_state;
66 GstBuffer *codec_data;
67 /* TRUE if the component is configured and saw
71 GstClockTime last_upstream_ts;
76 /* TRUE if EOS buffers shouldn't be forwarded */
79 GstFlowReturn downstream_flow_ret;
80 #ifdef TIZEN_FEATURE_OMX
84 #ifdef USE_OMX_TARGET_RPI
85 GstOMXComponent *egl_render;
86 GstOMXPort *egl_in_port, *egl_out_port;
91 struct _GstOMXVideoDecClass
93 GstVideoDecoderClass parent_class;
95 GstOMXClassData cdata;
97 gboolean (*is_format_change) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoCodecState * state);
98 gboolean (*set_format) (GstOMXVideoDec * self, GstOMXPort * port, GstVideoCodecState * state);
99 GstFlowReturn (*prepare_frame) (GstOMXVideoDec * self, GstVideoCodecFrame *frame);
102 GType gst_omx_video_dec_get_type (void);
106 #endif /* __GST_OMX_VIDEO_DEC_H__ */