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_AUDIO_ENC_H__
22 #define __GST_OMX_AUDIO_ENC_H__
25 #include <gst/audio/audio.h>
26 #include <gst/audio/gstaudioencoder.h>
32 #define GST_TYPE_OMX_AUDIO_ENC \
33 (gst_omx_audio_enc_get_type())
34 #define GST_OMX_AUDIO_ENC(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_AUDIO_ENC,GstOMXAudioEnc))
36 #define GST_OMX_AUDIO_ENC_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_AUDIO_ENC,GstOMXAudioEncClass))
38 #define GST_OMX_AUDIO_ENC_GET_CLASS(obj) \
39 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_AUDIO_ENC,GstOMXAudioEncClass))
40 #define GST_IS_OMX_AUDIO_ENC(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_AUDIO_ENC))
42 #define GST_IS_OMX_AUDIO_ENC_CLASS(obj) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_AUDIO_ENC))
45 typedef struct _GstOMXAudioEnc GstOMXAudioEnc;
46 typedef struct _GstOMXAudioEncClass GstOMXAudioEncClass;
48 struct _GstOMXAudioEnc
50 GstAudioEncoder parent;
54 GstOMXPort *enc_in_port, *enc_out_port;
57 /* TRUE if the component is configured and saw
61 GstClockTime last_upstream_ts;
66 /* TRUE if EOS buffers shouldn't be forwarded */
69 GstFlowReturn downstream_flow_ret;
72 struct _GstOMXAudioEncClass
74 GstAudioEncoderClass parent_class;
76 GstOMXClassData cdata;
78 gboolean (*set_format) (GstOMXAudioEnc * self, GstOMXPort * port, GstAudioInfo * info);
79 GstCaps *(*get_caps) (GstOMXAudioEnc * self, GstOMXPort * port, GstAudioInfo * info);
80 guint (*get_num_samples) (GstOMXAudioEnc * self, GstOMXPort * port, GstAudioInfo * info, GstOMXBuffer * buffer);
83 GType gst_omx_audio_enc_get_type (void);
87 #endif /* __GST_OMX_AUDIO_ENC_H__ */