2 * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
4 * gsttaglist.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.
23 #ifndef __GST_TAGLIST_H__
24 #define __GST_TAGLIST_H__
26 #include <gst/gststructure.h>
31 GST_TAG_MERGE_UNDEFINED,
32 GST_TAG_MERGE_REPLACE_ALL,
33 GST_TAG_MERGE_REPLACE,
35 GST_TAG_MERGE_PREPEND,
37 GST_TAG_MERGE_KEEP_ALL,
42 #define GST_TAG_MODE_IS_VALID(mode) (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
45 GST_TAG_FLAG_UNDEFINED,
52 #define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
54 typedef GstStructure GstTagList;
55 #define GST_TAG_LIST(x) ((GstTagList *) (x))
56 #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
57 #define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
59 typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
60 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
62 /* initialize tagging system */
63 void _gst_tag_initialize (void);
64 GType gst_tag_list_get_type (void);
66 void gst_tag_register (const gchar * name,
71 GstTagMergeFunc func);
72 /* some default merging functions */
73 void gst_tag_merge_use_first (GValue * dest,
75 void gst_tag_merge_strings_with_comma (GValue * dest,
78 /* basic tag support */
79 gboolean gst_tag_exists (const gchar * tag);
80 GType gst_tag_get_type (const gchar * tag);
81 G_CONST_RETURN gchar *
82 gst_tag_get_nick (const gchar * tag);
83 G_CONST_RETURN gchar *
84 gst_tag_get_description (const gchar * tag);
85 GstTagFlag gst_tag_get_flag (const gchar * tag);
86 gboolean gst_tag_is_fixed (const gchar * tag);
89 GstTagList * gst_tag_list_new (void);
90 gboolean gst_is_tag_list (gconstpointer p);
91 GstTagList * gst_tag_list_copy (const GstTagList * list);
92 void gst_tag_list_insert (GstTagList * into,
93 const GstTagList * from,
94 GstTagMergeMode mode);
95 GstTagList * gst_tag_list_merge (const GstTagList * list1,
96 const GstTagList * list2,
97 GstTagMergeMode mode);
98 void gst_tag_list_free (GstTagList * list);
99 guint gst_tag_list_get_tag_size (const GstTagList * list,
101 void gst_tag_list_add (GstTagList * list,
102 GstTagMergeMode mode,
105 void gst_tag_list_add_values (GstTagList * list,
106 GstTagMergeMode mode,
109 void gst_tag_list_add_valist (GstTagList * list,
110 GstTagMergeMode mode,
113 void gst_tag_list_add_valist_values (GstTagList * list,
114 GstTagMergeMode mode,
117 void gst_tag_list_remove_tag (GstTagList * list,
119 void gst_tag_list_foreach (GstTagList * list,
120 GstTagForeachFunc func,
123 G_CONST_RETURN GValue *
124 gst_tag_list_get_value_index (const GstTagList * list,
127 gboolean gst_tag_list_copy_value (GValue * dest,
128 const GstTagList * list,
131 /* simplifications (FIXME: do we want them?) */
132 gboolean gst_tag_list_get_char (const GstTagList * list,
135 gboolean gst_tag_list_get_char_index (const GstTagList * list,
139 gboolean gst_tag_list_get_uchar (const GstTagList * list,
142 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
146 gboolean gst_tag_list_get_boolean (const GstTagList * list,
149 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
153 gboolean gst_tag_list_get_int (const GstTagList * list,
156 gboolean gst_tag_list_get_int_index (const GstTagList * list,
160 gboolean gst_tag_list_get_uint (const GstTagList * list,
163 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
167 gboolean gst_tag_list_get_long (const GstTagList * list,
170 gboolean gst_tag_list_get_long_index (const GstTagList * list,
174 gboolean gst_tag_list_get_ulong (const GstTagList * list,
177 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
181 gboolean gst_tag_list_get_int64 (const GstTagList * list,
184 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
188 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
191 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
195 gboolean gst_tag_list_get_float (const GstTagList * list,
198 gboolean gst_tag_list_get_float_index (const GstTagList * list,
202 gboolean gst_tag_list_get_double (const GstTagList * list,
205 gboolean gst_tag_list_get_double_index (const GstTagList * list,
209 gboolean gst_tag_list_get_string (const GstTagList * list,
212 gboolean gst_tag_list_get_string_index (const GstTagList * list,
216 gboolean gst_tag_list_get_pointer (const GstTagList * list,
219 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
224 /* GStreamer core tags (need to be discussed) */
228 * commonly used title
230 #define GST_TAG_TITLE "title"
234 * person(s) responsible for the recording
236 #define GST_TAG_ARTIST "artist"
240 * album containing this data
242 #define GST_TAG_ALBUM "album"
246 * date the data was created (in Julian calendar days)
248 #define GST_TAG_DATE "date"
252 * genre this data belongs to
254 #define GST_TAG_GENRE "genre"
258 * free text commenting the data
260 #define GST_TAG_COMMENT "comment"
262 * GST_TAG_TRACK_NUMBER:
264 * track number inside a collection
266 #define GST_TAG_TRACK_NUMBER "track-number"
268 * GST_TAG_TRACK_COUNT:
270 * count of tracks inside collection this track belongs to
272 #define GST_TAG_TRACK_COUNT "track-count"
274 * GST_TAG_ALBUM_VOLUME_NUMBER:
276 * disc number inside a collection
278 #define GST_TAG_ALBUM_VOLUME_NUMBER "album-disc-number"
280 * GST_TAG_ALBUM_VOLUME_COUNT:
282 * count of discs inside collection this disc belongs to
284 #define GST_TAG_ALBUM_VOLUME_COUNT "album-disc-count"
288 * original location of file as a URI
290 #define GST_TAG_LOCATION "location"
292 * GST_TAG_DESCRIPTION:
294 * short text describing the content of the data
296 #define GST_TAG_DESCRIPTION "description"
300 * version of this data
302 #define GST_TAG_VERSION "version"
306 * International Standard Recording Code - see http://www.ifpi.org/isrc/
308 #define GST_TAG_ISRC "isrc"
310 * GST_TAG_ORGANIZATION:
314 #define GST_TAG_ORGANIZATION "organization"
318 * copyright notice of the data
320 #define GST_TAG_COPYRIGHT "copyright"
324 * contact information
326 #define GST_TAG_CONTACT "contact"
332 #define GST_TAG_LICENSE "license"
336 * person(s) performing
338 #define GST_TAG_PERFORMER "performer"
342 * length in GStreamer time units (nanoseconds)
344 #define GST_TAG_DURATION "duration"
348 * codec the data is stored in
350 #define GST_TAG_CODEC "codec"
352 * GST_TAG_VIDEO_CODEC:
354 * codec the video data is stored in
356 #define GST_TAG_VIDEO_CODEC "video-codec"
358 * GST_TAG_AUDIO_CODEC:
360 * codec the audio data is stored in
362 #define GST_TAG_AUDIO_CODEC "audio-codec"
366 * exact or average bitrate in bits/s
368 #define GST_TAG_BITRATE "bitrate"
370 * GST_TAG_NOMINAL_BITRATE:
372 * nominal bitrate in bits/s
374 #define GST_TAG_NOMINAL_BITRATE "nominal-bitrate"
376 * GST_TAG_MINIMUM_BITRATE:
378 * minimum bitrate in bits/s
380 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
382 * GST_TAG_MAXIMUM_BITRATE:
384 * maximum bitrate in bits/s
386 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
390 * serial number of track
392 #define GST_TAG_SERIAL "serial"
396 * encoder used to encode this stream
398 #define GST_TAG_ENCODER "encoder"
400 * GST_TAG_ENCODER_VERSION:
402 * version of the encoder used to encode this stream
404 #define GST_TAG_ENCODER_VERSION "encoder-version"
406 * GST_TAG_TRACK_GAIN:
410 #define GST_TAG_TRACK_GAIN "replaygain-track-gain"
412 * GST_TAG_TRACK_PEAK:
416 #define GST_TAG_TRACK_PEAK "replaygain-track-peak"
418 * GST_TAG_ALBUM_GAIN:
422 #define GST_TAG_ALBUM_GAIN "replaygain-album-gain"
424 * GST_TAG_ALBUM_PEAK:
428 #define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
430 * GST_TAG_LANGUAGE_CODE:
432 * Language code (ISO-639-1)
434 #define GST_TAG_LANGUAGE_CODE "language-code"
438 #endif /* __GST_TAGLIST_H__ */