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 G_CONST_RETURN gchar *
69 gst_tag_get_nick (const gchar * tag);
70 G_CONST_RETURN gchar *
71 gst_tag_get_description (const gchar * tag);
72 gboolean gst_tag_is_fixed (const gchar * tag);
75 GstTagList * gst_tag_list_new (void);
76 gboolean gst_is_tag_list (gconstpointer p);
77 GstTagList * gst_tag_list_copy (const GstTagList * list);
78 void gst_tag_list_insert (GstTagList * into,
79 const GstTagList * from,
80 GstTagMergeMode mode);
81 GstTagList * gst_tag_list_merge (const GstTagList * list1,
82 const GstTagList * list2,
83 GstTagMergeMode mode);
84 void gst_tag_list_free (GstTagList * list);
85 guint gst_tag_list_get_tag_size (const GstTagList * list,
87 void gst_tag_list_add (GstTagList * list,
91 void gst_tag_list_add_values (GstTagList * list,
95 void gst_tag_list_add_valist (GstTagList * list,
99 void gst_tag_list_add_valist_values (GstTagList * list,
100 GstTagMergeMode mode,
103 void gst_tag_list_remove_tag (GstTagList * list,
105 void gst_tag_list_foreach (GstTagList * list,
106 GstTagForeachFunc func,
109 G_CONST_RETURN GValue *
110 gst_tag_list_get_value_index (const GstTagList * list,
113 gboolean gst_tag_list_copy_value (GValue * dest,
114 const GstTagList * list,
117 /* simplifications (FIXME: do we want them?) */
118 gboolean gst_tag_list_get_char (const GstTagList * list,
121 gboolean gst_tag_list_get_char_index (const GstTagList * list,
125 gboolean gst_tag_list_get_uchar (const GstTagList * list,
128 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
132 gboolean gst_tag_list_get_boolean (const GstTagList * list,
135 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
139 gboolean gst_tag_list_get_int (const GstTagList * list,
142 gboolean gst_tag_list_get_int_index (const GstTagList * list,
146 gboolean gst_tag_list_get_uint (const GstTagList * list,
149 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
153 gboolean gst_tag_list_get_long (const GstTagList * list,
156 gboolean gst_tag_list_get_long_index (const GstTagList * list,
160 gboolean gst_tag_list_get_ulong (const GstTagList * list,
163 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
167 gboolean gst_tag_list_get_int64 (const GstTagList * list,
170 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
174 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
177 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
181 gboolean gst_tag_list_get_float (const GstTagList * list,
184 gboolean gst_tag_list_get_float_index (const GstTagList * list,
188 gboolean gst_tag_list_get_double (const GstTagList * list,
191 gboolean gst_tag_list_get_double_index (const GstTagList * list,
195 gboolean gst_tag_list_get_string (const GstTagList * list,
198 gboolean gst_tag_list_get_string_index (const GstTagList * list,
202 gboolean gst_tag_list_get_pointer (const GstTagList * list,
205 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
211 GstEvent * gst_event_new_tag (GstTagList * list);
212 GstTagList * gst_event_tag_get_list (GstEvent * tag_event);
215 /* GStreamer core tags (need to be discussed) */
216 #define GST_TAG_TITLE "title"
217 #define GST_TAG_ARTIST "artist"
218 #define GST_TAG_ALBUM "album"
219 #define GST_TAG_DATE "date"
220 #define GST_TAG_GENRE "genre"
221 #define GST_TAG_COMMENT "comment"
222 #define GST_TAG_TRACK_NUMBER "track-number"
223 #define GST_TAG_TRACK_COUNT "track-count"
224 #define GST_TAG_LOCATION "location"
225 #define GST_TAG_DESCRIPTION "description"
226 #define GST_TAG_VERSION "version"
227 #define GST_TAG_ISRC "isrc"
228 #define GST_TAG_ORGANIZATION "organization"
229 #define GST_TAG_COPYRIGHT "copyright"
230 #define GST_TAG_CONTACT "contact"
231 #define GST_TAG_LICENSE "license"
232 #define GST_TAG_PERFORMER "performer"
233 #define GST_TAG_DURATION "duration"
234 #define GST_TAG_CODEC "codec"
235 #define GST_TAG_BITRATE "bitrate"
236 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
237 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
242 #endif /* __GST_EVENT_H__ */