1 /* GStreamer
2  * Copyright (C) 2003 Christophe Fergeau <teuf@gnome.org>
3  * Copyright (C) 2008 Jonathan Matthew <jonathan@d14n.org>
4  * Copyright (C) 2008 Sebastian Dröge <sebastian.droege@collabora.co.uk>
5  *
6  * gstflactag.c: plug-in for reading/modifying vorbis comments in flac files
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef GST_FLAC_TAG_H
25 #define GST_FLAC_TAG_H
26 
27 #include <gst/gst.h>
28 #include <gst/base/gstadapter.h>
29 
30 #define GST_TYPE_FLAC_TAG (gst_flac_tag_get_type())
31 #define GST_FLAC_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLAC_TAG, GstFlacTag))
32 #define GST_FLAC_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLAC_TAG, GstFlacTag))
33 #define GST_IS_FLAC_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLAC_TAG))
34 #define GST_IS_FLAC_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLAC_TAG))
35 
36 typedef struct _GstFlacTag GstFlacTag;
37 typedef struct _GstFlacTagClass GstFlacTagClass;
38 
39 typedef enum
40 {
41   GST_FLAC_TAG_STATE_INIT,
42   GST_FLAC_TAG_STATE_METADATA_BLOCKS,
43   GST_FLAC_TAG_STATE_METADATA_NEXT_BLOCK,
44   GST_FLAC_TAG_STATE_WRITING_METADATA_BLOCK,
45   GST_FLAC_TAG_STATE_VC_METADATA_BLOCK,
46   GST_FLAC_TAG_STATE_ADD_VORBIS_COMMENT,
47   GST_FLAC_TAG_STATE_AUDIO_DATA
48 }
49 GstFlacTagState;
50 
51 struct _GstFlacTag
52 {
53   GstElement element;
54 
55   /* < private > */
56 
57   /* pads */
58   GstPad *sinkpad;
59   GstPad *srcpad;
60 
61   GstFlacTagState state;
62 
63   GstAdapter *adapter;
64   GstBuffer *vorbiscomment;
65   GstTagList *tags;
66 
67   guint metadata_block_size;
68   gboolean metadata_last_block;
69 };
70 
71 struct _GstFlacTagClass
72 {
73   GstElementClass parent_class;
74 };
75 
76 GType gst_flac_tag_get_type (void);
77 
78 #endif /* GST_FLAC_TAG_H */
79