2 * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
4 * gsttag.h: Header for tag support
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
26 #include <gst/gststructure.h>
27 #include <gst/gstevent.h>
32 GST_TAG_MERGE_UNDEFINED,
33 GST_TAG_MERGE_REPLACE_ALL,
34 GST_TAG_MERGE_REPLACE,
36 GST_TAG_MERGE_PREPEND,
38 GST_TAG_MERGE_KEEP_ALL,
42 #define GST_TAG_MODE_IS_VALID(mode) (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
44 typedef GstStructure GstTagList;
45 #define GST_TAG_LIST(x) ((GstTagList *) (x))
46 #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
48 typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
49 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
51 /* initialize tagging system */
52 void _gst_tag_initialize (void);
54 void gst_tag_register (gchar * name,
58 GstTagMergeFunc func);
59 /* some default merging functions */
60 void gst_tag_merge_use_first (GValue * dest,
61 const GValue * values);
62 void gst_tag_merge_strings_with_comma (GValue * dest,
63 const GValue * values);
65 /* basic tag support */
66 gboolean gst_tag_exists (const gchar * tag);
67 GType gst_tag_get_type (const gchar * tag);
68 const gchar * gst_tag_get_nick (const gchar * tag);
69 const gchar * gst_tag_get_description (const gchar * tag);
70 gboolean gst_tag_is_fixed (const gchar * tag);
73 GstTagList * gst_tag_list_new (void);
74 gboolean gst_is_tag_list (gconstpointer p);
75 GstTagList * gst_tag_list_copy (const GstTagList * list);
76 void gst_tag_list_insert (GstTagList * into,
77 const GstTagList * from,
78 GstTagMergeMode mode);
79 GstTagList * gst_tag_list_merge (const GstTagList * list1,
80 const GstTagList * list2,
81 GstTagMergeMode mode);
82 void gst_tag_list_free (GstTagList * list);
83 guint gst_tag_list_get_tag_size (const GstTagList * list,
85 void gst_tag_list_add (GstTagList * list,
89 void gst_tag_list_add_valist (GstTagList * list,
93 void gst_tag_list_remove_tag (GstTagList * list,
95 void gst_tag_list_foreach (GstTagList * list,
96 GstTagForeachFunc func,
99 G_CONST_RETURN GValue *
100 gst_tag_list_get_value_index (const GstTagList * list,
103 gboolean gst_tag_list_copy_value (GValue * dest,
104 const GstTagList * list,
107 /* simplifications (FIXME: do we want them?) */
108 gboolean gst_tag_list_get_char (const GstTagList * list,
111 gboolean gst_tag_list_get_char_index (const GstTagList * list,
115 gboolean gst_tag_list_get_uchar (const GstTagList * list,
118 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
122 gboolean gst_tag_list_get_boolean (const GstTagList * list,
125 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
129 gboolean gst_tag_list_get_int (const GstTagList * list,
132 gboolean gst_tag_list_get_int_index (const GstTagList * list,
136 gboolean gst_tag_list_get_uint (const GstTagList * list,
139 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
143 gboolean gst_tag_list_get_long (const GstTagList * list,
146 gboolean gst_tag_list_get_long_index (const GstTagList * list,
150 gboolean gst_tag_list_get_ulong (const GstTagList * list,
153 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
157 gboolean gst_tag_list_get_int64 (const GstTagList * list,
160 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
164 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
167 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
171 gboolean gst_tag_list_get_float (const GstTagList * list,
174 gboolean gst_tag_list_get_float_index (const GstTagList * list,
178 gboolean gst_tag_list_get_double (const GstTagList * list,
181 gboolean gst_tag_list_get_double_index (const GstTagList * list,
185 gboolean gst_tag_list_get_string (const GstTagList * list,
188 gboolean gst_tag_list_get_string_index (const GstTagList * list,
192 gboolean gst_tag_list_get_pointer (const GstTagList * list,
195 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
201 GstEvent * gst_event_new_tag (GstTagList * list);
202 GstTagList * gst_event_tag_get_list (GstEvent * tag_event);
205 /* GStreamer core tags (need to be discussed) */
206 #define GST_TAG_TITLE "title"
207 #define GST_TAG_ARTIST "artist"
208 #define GST_TAG_ALBUM "album"
209 #define GST_TAG_DATE "date"
210 #define GST_TAG_GENRE "genre"
211 #define GST_TAG_COMMENT "comment"
212 #define GST_TAG_TRACK_NUMBER "track-number"
213 #define GST_TAG_TRACK_COUNT "track-count"
214 #define GST_TAG_LOCATION "location"
215 #define GST_TAG_DESCRIPTION "description"
216 #define GST_TAG_VERSION "version"
217 #define GST_TAG_ISRC "isrc"
218 #define GST_TAG_ORGANIZATION "organization"
219 #define GST_TAG_COPYRIGHT "copyright"
220 #define GST_TAG_CONTACT "contact"
221 #define GST_TAG_LICENSE "license"
222 #define GST_TAG_PERFORMER "performer"
223 #define GST_TAG_DURATION "duration"
224 #define GST_TAG_CODEC "codec"
225 #define GST_TAG_BITRATE "bitrate"
226 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
227 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
232 #endif /* __GST_EVENT_H__ */