Automatic update of common submodule
[platform/upstream/gst-plugins-ugly.git] / ext / mpg123 / gstmpg123audiodec.h
1 /*  MP3 decoding plugin for GStreamer using the mpg123 library
2  *  Copyright (C) 2012 Carlos Rafael Giani
3  *
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; either
7  *  version 2.1 of the License, or (at your option) any later version.
8  *
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.
13  *
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 St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #ifndef __GST_MPG123_AUDIO_DEC_H__
20 #define __GST_MPG123_AUDIO_DEC_H__
21
22 /* This is what the visual studio build in mpg123 does before including the
23  * original header file. Without this we get syntax errors in the
24  * replace_reader function declarations because it doesn't know ssize_t etc.
25  * It doesn't realy matter for us if the ssize_t typedef here is correct. */
26 #ifdef _MSC_VER
27 #include <tchar.h>
28 #include <stdlib.h>
29 #include <sys/types.h>
30 typedef long ssize_t;
31 #include <stdint.h>
32 #endif
33
34 #include <gst/gst.h>
35 #include <gst/audio/gstaudiodecoder.h>
36 #include <mpg123.h>
37
38
39 G_BEGIN_DECLS
40
41
42 typedef struct _GstMpg123AudioDec GstMpg123AudioDec;
43 typedef struct _GstMpg123AudioDecClass GstMpg123AudioDecClass;
44
45
46 #define GST_TYPE_MPG123_AUDIO_DEC             (gst_mpg123_audio_dec_get_type())
47 #define GST_MPG123_AUDIO_DEC(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_MPG123_AUDIO_DEC,GstMpg123AudioDec))
48 #define GST_MPG123_AUDIO_DEC_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_MPG123_AUDIO_DEC,GstMpg123AudioDecClass))
49 #define GST_IS_MPG123_AUDIO_DEC(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_MPG123_AUDIO_DEC))
50 #define GST_IS_MPG123_AUDIO_DEC_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_MPG123_AUDIO_DEC))
51
52 struct _GstMpg123AudioDec
53 {
54   GstAudioDecoder parent;
55
56   mpg123_handle *handle;
57
58   GstAudioInfo next_audioinfo;
59   gboolean has_next_audioinfo;
60
61   off_t frame_offset;
62 };
63
64
65 struct _GstMpg123AudioDecClass
66 {
67   GstAudioDecoderClass parent_class;
68 };
69
70 G_GNUC_INTERNAL GType gst_mpg123_audio_dec_get_type (void);
71
72 G_END_DECLS
73
74 #endif