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>
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,
43 #define GST_TAG_MODE_IS_VALID(mode) (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
46 GST_TAG_FLAG_UNDEFINED,
53 #define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
55 typedef GstStructure GstTagList;
56 #define GST_TAG_LIST(x) ((GstTagList *) (x))
57 #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
58 #define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
62 * @list: the #GstTagList
63 * @tag: a name of a tag in @list
64 * @user_data: user data
66 * A function that will be called in gst_tag_list_foreach(). The function may
67 * not modify the tag list.
69 typedef void (*GstTagForeachFunc) (const GstTagList *list,
73 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
75 /* initialize tagging system */
76 void _gst_tag_initialize (void);
77 GType gst_tag_list_get_type (void);
79 void gst_tag_register (const gchar * name,
84 GstTagMergeFunc func);
85 /* some default merging functions */
86 void gst_tag_merge_use_first (GValue * dest,
88 void gst_tag_merge_strings_with_comma (GValue * dest,
91 /* basic tag support */
92 gboolean gst_tag_exists (const gchar * tag);
93 GType gst_tag_get_type (const gchar * tag);
94 G_CONST_RETURN gchar *
95 gst_tag_get_nick (const gchar * tag);
96 G_CONST_RETURN gchar *
97 gst_tag_get_description (const gchar * tag);
98 GstTagFlag gst_tag_get_flag (const gchar * tag);
99 gboolean gst_tag_is_fixed (const gchar * tag);
102 GstTagList * gst_tag_list_new (void);
103 gboolean gst_is_tag_list (gconstpointer p);
104 GstTagList * gst_tag_list_copy (const GstTagList * list);
105 void gst_tag_list_insert (GstTagList * into,
106 const GstTagList * from,
107 GstTagMergeMode mode);
108 GstTagList * gst_tag_list_merge (const GstTagList * list1,
109 const GstTagList * list2,
110 GstTagMergeMode mode);
111 void gst_tag_list_free (GstTagList * list);
112 guint gst_tag_list_get_tag_size (const GstTagList * list,
114 void gst_tag_list_add (GstTagList * list,
115 GstTagMergeMode mode,
117 ...) G_GNUC_NULL_TERMINATED;
118 void gst_tag_list_add_values (GstTagList * list,
119 GstTagMergeMode mode,
121 ...) G_GNUC_NULL_TERMINATED;
122 void gst_tag_list_add_valist (GstTagList * list,
123 GstTagMergeMode mode,
126 void gst_tag_list_add_valist_values (GstTagList * list,
127 GstTagMergeMode mode,
130 void gst_tag_list_remove_tag (GstTagList * list,
132 void gst_tag_list_foreach (const GstTagList * list,
133 GstTagForeachFunc func,
136 G_CONST_RETURN GValue *
137 gst_tag_list_get_value_index (const GstTagList * list,
140 gboolean gst_tag_list_copy_value (GValue * dest,
141 const GstTagList * list,
144 /* simplifications (FIXME: do we want them?) */
145 gboolean gst_tag_list_get_char (const GstTagList * list,
148 gboolean gst_tag_list_get_char_index (const GstTagList * list,
152 gboolean gst_tag_list_get_uchar (const GstTagList * list,
155 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
159 gboolean gst_tag_list_get_boolean (const GstTagList * list,
162 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
166 gboolean gst_tag_list_get_int (const GstTagList * list,
169 gboolean gst_tag_list_get_int_index (const GstTagList * list,
173 gboolean gst_tag_list_get_uint (const GstTagList * list,
176 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
180 gboolean gst_tag_list_get_long (const GstTagList * list,
183 gboolean gst_tag_list_get_long_index (const GstTagList * list,
187 gboolean gst_tag_list_get_ulong (const GstTagList * list,
190 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
194 gboolean gst_tag_list_get_int64 (const GstTagList * list,
197 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
201 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
204 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
208 gboolean gst_tag_list_get_float (const GstTagList * list,
211 gboolean gst_tag_list_get_float_index (const GstTagList * list,
215 gboolean gst_tag_list_get_double (const GstTagList * list,
218 gboolean gst_tag_list_get_double_index (const GstTagList * list,
222 gboolean gst_tag_list_get_string (const GstTagList * list,
225 gboolean gst_tag_list_get_string_index (const GstTagList * list,
229 gboolean gst_tag_list_get_pointer (const GstTagList * list,
232 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
236 gboolean gst_tag_list_get_date (const GstTagList * list,
239 gboolean gst_tag_list_get_date_index (const GstTagList * list,
244 /* GStreamer core tags (need to be discussed) */
248 * commonly used title
250 #define GST_TAG_TITLE "title"
254 * person(s) responsible for the recording
256 #define GST_TAG_ARTIST "artist"
260 * album containing this data
262 #define GST_TAG_ALBUM "album"
266 * date the data was created (#GDate structure)
268 #define GST_TAG_DATE "date"
272 * genre this data belongs to
274 #define GST_TAG_GENRE "genre"
278 * free text commenting the data
280 #define GST_TAG_COMMENT "comment"
282 * GST_TAG_TRACK_NUMBER:
284 * track number inside a collection
286 #define GST_TAG_TRACK_NUMBER "track-number"
288 * GST_TAG_TRACK_COUNT:
290 * count of tracks inside collection this track belongs to
292 #define GST_TAG_TRACK_COUNT "track-count"
294 * GST_TAG_ALBUM_VOLUME_NUMBER:
296 * disc number inside a collection
298 #define GST_TAG_ALBUM_VOLUME_NUMBER "album-disc-number"
300 * GST_TAG_ALBUM_VOLUME_COUNT:
302 * count of discs inside collection this disc belongs to
304 #define GST_TAG_ALBUM_VOLUME_COUNT "album-disc-count"
308 * original location of file as a URI
310 #define GST_TAG_LOCATION "location"
312 * GST_TAG_DESCRIPTION:
314 * short text describing the content of the data
316 #define GST_TAG_DESCRIPTION "description"
320 * version of this data
322 #define GST_TAG_VERSION "version"
326 * International Standard Recording Code - see http://www.ifpi.org/isrc/
328 #define GST_TAG_ISRC "isrc"
330 * GST_TAG_ORGANIZATION:
334 #define GST_TAG_ORGANIZATION "organization"
338 * copyright notice of the data
340 #define GST_TAG_COPYRIGHT "copyright"
344 * contact information
346 #define GST_TAG_CONTACT "contact"
352 #define GST_TAG_LICENSE "license"
356 * person(s) performing
358 #define GST_TAG_PERFORMER "performer"
362 * length in GStreamer time units (nanoseconds)
364 #define GST_TAG_DURATION "duration"
368 * codec the data is stored in
370 #define GST_TAG_CODEC "codec"
372 * GST_TAG_VIDEO_CODEC:
374 * codec the video data is stored in
376 #define GST_TAG_VIDEO_CODEC "video-codec"
378 * GST_TAG_AUDIO_CODEC:
380 * codec the audio data is stored in
382 #define GST_TAG_AUDIO_CODEC "audio-codec"
386 * exact or average bitrate in bits/s
388 #define GST_TAG_BITRATE "bitrate"
390 * GST_TAG_NOMINAL_BITRATE:
392 * nominal bitrate in bits/s
394 #define GST_TAG_NOMINAL_BITRATE "nominal-bitrate"
396 * GST_TAG_MINIMUM_BITRATE:
398 * minimum bitrate in bits/s
400 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
402 * GST_TAG_MAXIMUM_BITRATE:
404 * maximum bitrate in bits/s
406 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
410 * serial number of track
412 #define GST_TAG_SERIAL "serial"
416 * encoder used to encode this stream
418 #define GST_TAG_ENCODER "encoder"
420 * GST_TAG_ENCODER_VERSION:
422 * version of the encoder used to encode this stream
424 #define GST_TAG_ENCODER_VERSION "encoder-version"
426 * GST_TAG_TRACK_GAIN:
430 #define GST_TAG_TRACK_GAIN "replaygain-track-gain"
432 * GST_TAG_TRACK_PEAK:
436 #define GST_TAG_TRACK_PEAK "replaygain-track-peak"
438 * GST_TAG_ALBUM_GAIN:
442 #define GST_TAG_ALBUM_GAIN "replaygain-album-gain"
444 * GST_TAG_ALBUM_PEAK:
448 #define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
450 * GST_TAG_LANGUAGE_CODE:
452 * Language code (ISO-639-1)
454 #define GST_TAG_LANGUAGE_CODE "language-code"
458 #endif /* __GST_TAGLIST_H__ */