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>
27 #include <gst/glib-compat.h>
33 * @GST_TAG_MERGE_UNDEFINED: undefined merge mode
34 * @GST_TAG_MERGE_REPLACE_ALL: replace all tags
35 * @GST_TAG_MERGE_REPLACE: replace tags
36 * @GST_TAG_MERGE_APPEND: append tags
37 * @GST_TAG_MERGE_PREPEND: prepend tags
38 * @GST_TAG_MERGE_KEEP: keep existing tags
39 * @GST_TAG_MERGE_KEEP_ALL: keep all existing tags
40 * @GST_TAG_MERGE_COUNT: the number of merge modes
42 * The different tag merging modes.
45 GST_TAG_MERGE_UNDEFINED,
46 GST_TAG_MERGE_REPLACE_ALL,
47 GST_TAG_MERGE_REPLACE,
49 GST_TAG_MERGE_PREPEND,
51 GST_TAG_MERGE_KEEP_ALL,
56 #define GST_TAG_MODE_IS_VALID(mode) (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
60 * @GST_TAG_FLAG_UNDEFINED: undefined flag
61 * @GST_TAG_FLAG_META: tag is meta data
62 * @GST_TAG_FLAG_ENCODED: tag is encoded
63 * @GST_TAG_FLAG_DECODED: tag is decoded
64 * @GST_TAG_FLAG_COUNT: number of tag flags
66 * Extra tag flags used when registering tags.
69 GST_TAG_FLAG_UNDEFINED,
76 #define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
81 * Opaque #GstTagList data structure.
83 typedef GstStructure GstTagList;
84 #define GST_TAG_LIST(x) ((GstTagList *) (x))
85 #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
86 #define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
90 * @list: the #GstTagList
91 * @tag: a name of a tag in @list
92 * @user_data: user data
94 * A function that will be called in gst_tag_list_foreach(). The function may
95 * not modify the tag list.
97 typedef void (*GstTagForeachFunc) (const GstTagList *list,
103 * @dest: the destination #GValue
104 * @src: the source #GValue
106 * A function for merging multiple values of a tag used when registering
109 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
111 /* initialize tagging system */
112 void _gst_tag_initialize (void);
113 GType gst_tag_list_get_type (void);
115 void gst_tag_register (const gchar * name,
120 GstTagMergeFunc func);
121 /* some default merging functions */
122 void gst_tag_merge_use_first (GValue * dest,
124 void gst_tag_merge_strings_with_comma (GValue * dest,
127 /* basic tag support */
128 gboolean gst_tag_exists (const gchar * tag);
129 GType gst_tag_get_type (const gchar * tag);
130 G_CONST_RETURN gchar *
131 gst_tag_get_nick (const gchar * tag);
132 G_CONST_RETURN gchar *
133 gst_tag_get_description (const gchar * tag);
134 GstTagFlag gst_tag_get_flag (const gchar * tag);
135 gboolean gst_tag_is_fixed (const gchar * tag);
138 GstTagList * gst_tag_list_new (void);
139 gboolean gst_is_tag_list (gconstpointer p);
140 GstTagList * gst_tag_list_copy (const GstTagList * list);
141 void gst_tag_list_insert (GstTagList * into,
142 const GstTagList * from,
143 GstTagMergeMode mode);
144 GstTagList * gst_tag_list_merge (const GstTagList * list1,
145 const GstTagList * list2,
146 GstTagMergeMode mode);
147 void gst_tag_list_free (GstTagList * list);
148 guint gst_tag_list_get_tag_size (const GstTagList * list,
150 void gst_tag_list_add (GstTagList * list,
151 GstTagMergeMode mode,
153 ...) G_GNUC_NULL_TERMINATED;
154 void gst_tag_list_add_values (GstTagList * list,
155 GstTagMergeMode mode,
157 ...) G_GNUC_NULL_TERMINATED;
158 void gst_tag_list_add_valist (GstTagList * list,
159 GstTagMergeMode mode,
162 void gst_tag_list_add_valist_values (GstTagList * list,
163 GstTagMergeMode mode,
166 void gst_tag_list_remove_tag (GstTagList * list,
168 void gst_tag_list_foreach (const GstTagList * list,
169 GstTagForeachFunc func,
172 G_CONST_RETURN GValue *
173 gst_tag_list_get_value_index (const GstTagList * list,
176 gboolean gst_tag_list_copy_value (GValue * dest,
177 const GstTagList * list,
180 /* simplifications (FIXME: do we want them?) */
181 gboolean gst_tag_list_get_char (const GstTagList * list,
184 gboolean gst_tag_list_get_char_index (const GstTagList * list,
188 gboolean gst_tag_list_get_uchar (const GstTagList * list,
191 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
195 gboolean gst_tag_list_get_boolean (const GstTagList * list,
198 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
202 gboolean gst_tag_list_get_int (const GstTagList * list,
205 gboolean gst_tag_list_get_int_index (const GstTagList * list,
209 gboolean gst_tag_list_get_uint (const GstTagList * list,
212 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
216 gboolean gst_tag_list_get_long (const GstTagList * list,
219 gboolean gst_tag_list_get_long_index (const GstTagList * list,
223 gboolean gst_tag_list_get_ulong (const GstTagList * list,
226 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
230 gboolean gst_tag_list_get_int64 (const GstTagList * list,
233 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
237 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
240 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
244 gboolean gst_tag_list_get_float (const GstTagList * list,
247 gboolean gst_tag_list_get_float_index (const GstTagList * list,
251 gboolean gst_tag_list_get_double (const GstTagList * list,
254 gboolean gst_tag_list_get_double_index (const GstTagList * list,
258 gboolean gst_tag_list_get_string (const GstTagList * list,
261 gboolean gst_tag_list_get_string_index (const GstTagList * list,
265 gboolean gst_tag_list_get_pointer (const GstTagList * list,
268 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
272 gboolean gst_tag_list_get_date (const GstTagList * list,
275 gboolean gst_tag_list_get_date_index (const GstTagList * list,
280 /* GStreamer core tags */
284 * commonly used title (string)
286 #define GST_TAG_TITLE "title"
290 * person(s) responsible for the recording (string)
292 #define GST_TAG_ARTIST "artist"
296 * album containing this data (string)
298 #define GST_TAG_ALBUM "album"
302 * date the data was created (#GDate structure)
304 #define GST_TAG_DATE "date"
308 * genre this data belongs to (string)
310 #define GST_TAG_GENRE "genre"
314 * free text commenting the data (string)
316 #define GST_TAG_COMMENT "comment"
318 * GST_TAG_TRACK_NUMBER:
320 * track number inside a collection (unsigned integer)
322 #define GST_TAG_TRACK_NUMBER "track-number"
324 * GST_TAG_TRACK_COUNT:
326 * count of tracks inside collection this track belongs to (unsigned integer)
328 #define GST_TAG_TRACK_COUNT "track-count"
330 * GST_TAG_ALBUM_VOLUME_NUMBER:
332 * disc number inside a collection (unsigned integer)
334 #define GST_TAG_ALBUM_VOLUME_NUMBER "album-disc-number"
336 * GST_TAG_ALBUM_VOLUME_COUNT:
338 * count of discs inside collection this disc belongs to (unsigned integer)
340 #define GST_TAG_ALBUM_VOLUME_COUNT "album-disc-count"
344 * original location of file as a URI (string)
346 #define GST_TAG_LOCATION "location"
348 * GST_TAG_DESCRIPTION:
350 * short text describing the content of the data (string)
352 #define GST_TAG_DESCRIPTION "description"
356 * version of this data (string)
358 #define GST_TAG_VERSION "version"
362 * International Standard Recording Code - see http://www.ifpi.org/isrc/ (string)
364 #define GST_TAG_ISRC "isrc"
366 * GST_TAG_ORGANIZATION:
368 * organization (string)
370 #define GST_TAG_ORGANIZATION "organization"
374 * copyright notice of the data (string)
376 #define GST_TAG_COPYRIGHT "copyright"
380 * contact information (string)
382 #define GST_TAG_CONTACT "contact"
386 * license of data (string)
388 #define GST_TAG_LICENSE "license"
392 * person(s) performing (string)
394 #define GST_TAG_PERFORMER "performer"
398 * length in GStreamer time units (nanoseconds) (unsigned 64-bit integer)
400 #define GST_TAG_DURATION "duration"
404 * codec the data is stored in (string)
406 #define GST_TAG_CODEC "codec"
408 * GST_TAG_VIDEO_CODEC:
410 * codec the video data is stored in (string)
412 #define GST_TAG_VIDEO_CODEC "video-codec"
414 * GST_TAG_AUDIO_CODEC:
416 * codec the audio data is stored in (string)
418 #define GST_TAG_AUDIO_CODEC "audio-codec"
422 * exact or average bitrate in bits/s (unsigned integer)
424 #define GST_TAG_BITRATE "bitrate"
426 * GST_TAG_NOMINAL_BITRATE:
428 * nominal bitrate in bits/s (unsigned integer)
430 #define GST_TAG_NOMINAL_BITRATE "nominal-bitrate"
432 * GST_TAG_MINIMUM_BITRATE:
434 * minimum bitrate in bits/s (unsigned integer)
436 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
438 * GST_TAG_MAXIMUM_BITRATE:
440 * maximum bitrate in bits/s (unsigned integer)
442 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
446 * serial number of track (unsigned integer)
448 #define GST_TAG_SERIAL "serial"
452 * encoder used to encode this stream (string)
454 #define GST_TAG_ENCODER "encoder"
456 * GST_TAG_ENCODER_VERSION:
458 * version of the encoder used to encode this stream (unsigned integer)
460 #define GST_TAG_ENCODER_VERSION "encoder-version"
462 * GST_TAG_TRACK_GAIN:
464 * track gain in db (double)
466 #define GST_TAG_TRACK_GAIN "replaygain-track-gain"
468 * GST_TAG_TRACK_PEAK:
470 * peak of the track (double)
472 #define GST_TAG_TRACK_PEAK "replaygain-track-peak"
474 * GST_TAG_ALBUM_GAIN:
476 * album gain in db (double)
478 #define GST_TAG_ALBUM_GAIN "replaygain-album-gain"
480 * GST_TAG_ALBUM_PEAK:
482 * peak of the album (double)
484 #define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
486 * GST_TAG_LANGUAGE_CODE:
488 * Language code (ISO-639-1) (string)
490 #define GST_TAG_LANGUAGE_CODE "language-code"
494 * image (buffer) (buffer caps should specify the content type)
498 #define GST_TAG_IMAGE "image"
502 #endif /* __GST_TAGLIST_H__ */