2 * Copyright (C) 2006 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.
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_CODEC_H_
21 #define _SWFDEC_CODEC_H_
24 #include <libswfdec/swfdec_audio_internal.h>
25 #include <libswfdec/swfdec_buffer.h>
27 typedef struct _SwfdecCodec SwfdecCodec
;
30 SWFDEC_AUDIO_FORMAT_UNDEFINED
= 0,
31 SWFDEC_AUDIO_FORMAT_ADPCM
= 1,
32 SWFDEC_AUDIO_FORMAT_MP3
= 2,
33 SWFDEC_AUDIO_FORMAT_UNCOMPRESSED
= 3,
34 SWFDEC_AUDIO_FORMAT_NELLYMOSER
= 6
38 SWFDEC_VIDEO_FORMAT_UNDEFINED
42 gpointer (* init
) (gboolean width
,
43 SwfdecAudioOut format
);
44 SwfdecAudioOut (* get_format
) (gpointer codec_data
);
45 SwfdecBuffer
* (* decode
) (gpointer codec_data
,
46 SwfdecBuffer
* buffer
);
47 SwfdecBuffer
* (* finish
) (gpointer codec_data
);
50 const SwfdecCodec
* swfdec_codec_get_audio (SwfdecAudioFormat format
);
51 const SwfdecCodec
* swfdec_codec_get_video (SwfdecVideoFormat format
);
53 #define swfdec_codec_init(codec,width,format) (codec)->init (width, format)
54 #define swfdec_codec_get_format(codec, codec_data) (codec)->get_format (codec_data)
55 #define swfdec_codec_decode(codec, codec_data, buffer) (codec)->decode (codec_data, buffer)
56 #define swfdec_codec_finish(codec, codec_data) (codec)->finish (codec_data)