2 * Copyright (C) 2014, Sebastian Dröge <sebastian@centricular.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation
7 * version 2.1 of the License.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __GST_OMX_AUDIO_DEC_H__
21 #define __GST_OMX_AUDIO_DEC_H__
28 #include <gst/audio/audio.h>
29 #include <gst/audio/gstaudiodecoder.h>
35 #define GST_TYPE_OMX_AUDIO_DEC \
36 (gst_omx_audio_dec_get_type())
37 #define GST_OMX_AUDIO_DEC(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_AUDIO_DEC,GstOMXAudioDec))
39 #define GST_OMX_AUDIO_DEC_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_AUDIO_DEC,GstOMXAudioDecClass))
41 #define GST_OMX_AUDIO_DEC_GET_CLASS(obj) \
42 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_AUDIO_DEC,GstOMXAudioDecClass))
43 #define GST_IS_OMX_AUDIO_DEC(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_AUDIO_DEC))
45 #define GST_IS_OMX_AUDIO_DEC_CLASS(obj) \
46 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_AUDIO_DEC))
48 typedef struct _GstOMXAudioDec GstOMXAudioDec;
49 typedef struct _GstOMXAudioDecClass GstOMXAudioDecClass;
51 struct _GstOMXAudioDec
53 GstAudioDecoder parent;
57 GstOMXPort *dec_in_port, *dec_out_port;
59 GstBufferPool *in_port_pool, *out_port_pool;
63 GstAudioChannelPosition position[OMX_AUDIO_MAXCHANNELS];
64 gint reorder_map[OMX_AUDIO_MAXCHANNELS];
65 gboolean needs_reorder;
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 GstAdapter *output_adapter;
81 GstFlowReturn downstream_flow_ret;
84 struct _GstOMXAudioDecClass
86 GstAudioDecoderClass parent_class;
88 GstOMXClassData cdata;
90 gboolean (*is_format_change) (GstOMXAudioDec * self, GstOMXPort * port, GstCaps * caps);
91 gboolean (*set_format) (GstOMXAudioDec * self, GstOMXPort * port, GstCaps * caps);
92 gint (*get_samples_per_frame) (GstOMXAudioDec * self, GstOMXPort * port);
93 gboolean (*get_channel_positions) (GstOMXAudioDec * self, GstOMXPort * port, GstAudioChannelPosition position[OMX_AUDIO_MAXCHANNELS]);
96 GType gst_omx_audio_dec_get_type (void);
100 #endif /* __GST_OMX_AUDIO_DEC_H__ */