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 typedef struct _GstOMXVideoDec GstOMXVideoDec;
50 typedef struct _GstOMXVideoDecClass GstOMXVideoDecClass;
52 struct _GstOMXVideoDec
54 GstVideoDecoder parent;
58 GstOMXPort *dec_in_port, *dec_out_port;
60 GstBufferPool *in_port_pool, *out_port_pool;
63 GstVideoCodecState *input_state;
64 GstBuffer *codec_data;
65 /* TRUE if the component is configured and saw
68 /* TRUE if the ports where disabled after being activated the first time. */
71 GstClockTime last_upstream_ts;
76 /* TRUE if EOS buffers shouldn't be forwarded */
77 gboolean draining; /* protected by drain_lock */
79 GstFlowReturn downstream_flow_ret;
80 /* Initially FALSE. Switched to TRUE when all requirements
81 * are met to try setting up the decoder with OMX_UseBuffer.
82 * Switched to FALSE if this trial fails so that the decoder
83 * can fallback to OMX_AllocateBuffer. */
86 #if defined (USE_OMX_TARGET_RPI)
87 GstOMXComponent *egl_render;
88 GstOMXPort *egl_in_port, *egl_out_port;
91 #if defined (HAVE_GST_GL)
95 /* TRUE if decoder is producing dmabuf */
97 GstOMXBufferAllocation input_allocation;
100 #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
101 guint32 internal_entropy_buffers;
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);
115 GType gst_omx_video_dec_get_type (void);
119 #endif /* __GST_OMX_VIDEO_DEC_H__ */