add blend mode tests
[swfdec.git] / swfdec / swfdec_audio_decoder.h
blobee72d3ede411bb0439a9fee86f93ffe3ad673ef1
1 /* Swfdec
2 * Copyright (C) 2006-2008 Benjamin Otte <otte@gnome.org>
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.
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,
17 * Boston, MA 02110-1301 USA
20 #ifndef _SWFDEC_AUDIO_DECODER_H_
21 #define _SWFDEC_AUDIO_DECODER_H_
23 #include <swfdec/swfdec_buffer.h>
24 #include <swfdec/swfdec_audio_internal.h>
26 G_BEGIN_DECLS
29 #define SWFDEC_AUDIO_CODEC_UNDEFINED 0
30 #define SWFDEC_AUDIO_CODEC_ADPCM 1
31 #define SWFDEC_AUDIO_CODEC_MP3 2
32 #define SWFDEC_AUDIO_CODEC_UNCOMPRESSED 3
33 #define SWFDEC_AUDIO_CODEC_NELLYMOSER_16KHZ 4
34 #define SWFDEC_AUDIO_CODEC_NELLYMOSER_8KHZ 5
35 #define SWFDEC_AUDIO_CODEC_NELLYMOSER 6
36 #define SWFDEC_AUDIO_CODEC_ALAW 7
37 #define SWFDEC_AUDIO_CODEC_MULAW 8
38 #define SWFDEC_AUDIO_CODEC_AAC 10
39 #define SWFDEC_AUDIO_CODEC_SPEEX 11
40 #define SWFDEC_AUDIO_CODEC_MP3_8KHZ 14
43 typedef struct _SwfdecAudioDecoder SwfdecAudioDecoder;
44 typedef struct _SwfdecAudioDecoderClass SwfdecAudioDecoderClass;
46 #define SWFDEC_TYPE_AUDIO_DECODER (swfdec_audio_decoder_get_type())
47 #define SWFDEC_IS_AUDIO_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AUDIO_DECODER))
48 #define SWFDEC_IS_AUDIO_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AUDIO_DECODER))
49 #define SWFDEC_AUDIO_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AUDIO_DECODER, SwfdecAudioDecoder))
50 #define SWFDEC_AUDIO_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AUDIO_DECODER, SwfdecAudioDecoderClass))
51 #define SWFDEC_AUDIO_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AUDIO_DECODER, SwfdecAudioDecoderClass))
53 struct _SwfdecAudioDecoder
55 GObject object;
57 /*< private >*/
58 guint codec; /* codec this decoder uses */
59 SwfdecAudioFormat format; /* format the codec was initialized with */
60 gboolean error; /* if this decoder is in an error state */
63 struct _SwfdecAudioDecoderClass
65 /*< private >*/
66 GObjectClass object_class;
68 /*< public >*/
69 gboolean (* prepare) (guint codec,
70 SwfdecAudioFormat format,
71 char ** missing);
72 SwfdecAudioDecoder * (* create) (guint codec,
73 SwfdecAudioFormat format);
75 void (* set_codec_data)
76 (SwfdecAudioDecoder * decoder,
77 SwfdecBuffer * buffer);
78 void (* push) (SwfdecAudioDecoder * decoder,
79 SwfdecBuffer * buffer);
80 SwfdecBuffer * (* pull) (SwfdecAudioDecoder * decoder);
83 GType swfdec_audio_decoder_get_type (void);
85 void swfdec_audio_decoder_register (GType type);
87 gboolean swfdec_audio_decoder_prepare (guint codec,
88 SwfdecAudioFormat format,
89 char ** missing);
90 SwfdecAudioDecoder * swfdec_audio_decoder_new (guint codec,
91 SwfdecAudioFormat format);
93 void swfdec_audio_decoder_set_codec_data
94 (SwfdecAudioDecoder * decoder,
95 SwfdecBuffer * buffer);
96 void swfdec_audio_decoder_push (SwfdecAudioDecoder * decoder,
97 SwfdecBuffer * buffer);
98 SwfdecBuffer * swfdec_audio_decoder_pull (SwfdecAudioDecoder * decoder);
99 gboolean swfdec_audio_decoder_uses_format(SwfdecAudioDecoder * decoder,
100 guint codec,
101 SwfdecAudioFormat format);
103 /* for subclasses */
104 void swfdec_audio_decoder_error (SwfdecAudioDecoder * decoder,
105 const char * error,
106 ...) G_GNUC_PRINTF (2, 3);
107 void swfdec_audio_decoder_errorv (SwfdecAudioDecoder * decoder,
108 const char * error,
109 va_list args);
113 G_END_DECLS
114 #endif