rewrite SwfdecAudioFormat handling
[swfdec.git] / libswfdec / swfdec_flv_decoder.h
blob79fcb35395f309cc38519fe310965fe19d95d650
1 /* Swfdec
2 * Copyright (C) 2007 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_FLV_DECODER_H__
21 #define __SWFDEC_FLV_DECODER_H__
23 #include <libswfdec/swfdec_codec_audio.h>
24 #include <libswfdec/swfdec_codec_video.h>
25 #include <libswfdec/swfdec_decoder.h>
27 G_BEGIN_DECLS
30 typedef struct _SwfdecFlvDecoder SwfdecFlvDecoder;
31 typedef struct _SwfdecFlvDecoderClass SwfdecFlvDecoderClass;
33 #define SWFDEC_TYPE_FLV_DECODER (swfdec_flv_decoder_get_type())
34 #define SWFDEC_IS_FLV_DECODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_FLV_DECODER))
35 #define SWFDEC_IS_FLV_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_FLV_DECODER))
36 #define SWFDEC_FLV_DECODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_FLV_DECODER, SwfdecFlvDecoder))
37 #define SWFDEC_FLV_DECODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_FLV_DECODER, SwfdecFlvDecoderClass))
38 #define SWFDEC_FLV_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_FLV_DECODER, SwfdecFlvDecoderClass))
40 struct _SwfdecFlvDecoder
42 SwfdecDecoder decoder;
44 int version; /* only version 1 is known for now */
45 int state; /* parsing state we're in */
46 GArray * audio; /* audio tags */
47 GArray * video; /* video tags */
48 GArray * data; /* data tags (if any) */
51 struct _SwfdecFlvDecoderClass {
52 SwfdecDecoderClass decoder_class;
55 GType swfdec_flv_decoder_get_type (void);
57 gboolean swfdec_flv_decoder_is_eof (SwfdecFlvDecoder * flv);
58 void swfdec_flv_decoder_eof (SwfdecFlvDecoder * flv);
60 SwfdecBuffer * swfdec_flv_decoder_get_video (SwfdecFlvDecoder * flv,
61 guint timestamp,
62 gboolean keyframe,
63 SwfdecVideoCodec * format,
64 guint * real_timestamp,
65 guint * next_timestamp);
66 gboolean swfdec_flv_decoder_get_video_info (SwfdecFlvDecoder * flv,
67 guint * first_timestamp,
68 guint * last_timestamp);
69 SwfdecBuffer * swfdec_flv_decoder_get_audio (SwfdecFlvDecoder * flv,
70 guint timestamp,
71 SwfdecAudioCodec * codec,
72 SwfdecAudioFormat * format,
73 guint * real_timestamp,
74 guint * next_timestamp);
75 SwfdecBuffer * swfdec_flv_decoder_get_data (SwfdecFlvDecoder * flv,
76 guint timestamp,
77 guint * real_timestamp);
79 SwfdecMovie * swfdec_flv_decoder_add_movie (SwfdecFlvDecoder * flv,
80 SwfdecMovie * parent);
81 G_END_DECLS
83 #endif