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 ())
61 * @list: the #GstTagList
62 * @tag: a name of a tag in @list
63 * @user_data: user data
65 * A function that will be called in gst_tag_list_foreach(). The function may
66 * not modify the tag list.
68 typedef void (*GstTagForeachFunc) (const GstTagList *list,
72 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
74 /* initialize tagging system */
75 void _gst_tag_initialize (void);
76 GType gst_tag_list_get_type (void);
78 void gst_tag_register (const gchar * name,
83 GstTagMergeFunc func);
84 /* some default merging functions */
85 void gst_tag_merge_use_first (GValue * dest,
87 void gst_tag_merge_strings_with_comma (GValue * dest,
90 /* basic tag support */
91 gboolean gst_tag_exists (const gchar * tag);
92 GType gst_tag_get_type (const gchar * tag);
93 G_CONST_RETURN gchar *
94 gst_tag_get_nick (const gchar * tag);
95 G_CONST_RETURN gchar *
96 gst_tag_get_description (const gchar * tag);
97 GstTagFlag gst_tag_get_flag (const gchar * tag);
98 gboolean gst_tag_is_fixed (const gchar * tag);
101 GstTagList * gst_tag_list_new (void);
102 gboolean gst_is_tag_list (gconstpointer p);
103 GstTagList * gst_tag_list_copy (const GstTagList * list);
104 void gst_tag_list_insert (GstTagList * into,
105 const GstTagList * from,
106 GstTagMergeMode mode);
107 GstTagList * gst_tag_list_merge (const GstTagList * list1,
108 const GstTagList * list2,
109 GstTagMergeMode mode);
110 void gst_tag_list_free (GstTagList * list);
111 guint gst_tag_list_get_tag_size (const GstTagList * list,
113 void gst_tag_list_add (GstTagList * list,
114 GstTagMergeMode mode,
116 ...) G_GNUC_NULL_TERMINATED;
117 void gst_tag_list_add_values (GstTagList * list,
118 GstTagMergeMode mode,
120 ...) G_GNUC_NULL_TERMINATED;
121 void gst_tag_list_add_valist (GstTagList * list,
122 GstTagMergeMode mode,
125 void gst_tag_list_add_valist_values (GstTagList * list,
126 GstTagMergeMode mode,
129 void gst_tag_list_remove_tag (GstTagList * list,
131 void gst_tag_list_foreach (const GstTagList * list,
132 GstTagForeachFunc func,
135 G_CONST_RETURN GValue *
136 gst_tag_list_get_value_index (const GstTagList * list,
139 gboolean gst_tag_list_copy_value (GValue * dest,
140 const GstTagList * list,
143 /* simplifications (FIXME: do we want them?) */
144 gboolean gst_tag_list_get_char (const GstTagList * list,
147 gboolean gst_tag_list_get_char_index (const GstTagList * list,
151 gboolean gst_tag_list_get_uchar (const GstTagList * list,
154 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
158 gboolean gst_tag_list_get_boolean (const GstTagList * list,
161 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
165 gboolean gst_tag_list_get_int (const GstTagList * list,
168 gboolean gst_tag_list_get_int_index (const GstTagList * list,
172 gboolean gst_tag_list_get_uint (const GstTagList * list,
175 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
179 gboolean gst_tag_list_get_long (const GstTagList * list,
182 gboolean gst_tag_list_get_long_index (const GstTagList * list,
186 gboolean gst_tag_list_get_ulong (const GstTagList * list,
189 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
193 gboolean gst_tag_list_get_int64 (const GstTagList * list,
196 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
200 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
203 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
207 gboolean gst_tag_list_get_float (const GstTagList * list,
210 gboolean gst_tag_list_get_float_index (const GstTagList * list,
214 gboolean gst_tag_list_get_double (const GstTagList * list,
217 gboolean gst_tag_list_get_double_index (const GstTagList * list,
221 gboolean gst_tag_list_get_string (const GstTagList * list,
224 gboolean gst_tag_list_get_string_index (const GstTagList * list,
228 gboolean gst_tag_list_get_pointer (const GstTagList * list,
231 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
235 gboolean gst_tag_list_get_date (const GstTagList * list,
238 gboolean gst_tag_list_get_date_index (const GstTagList * list,
243 /* GStreamer core tags (need to be discussed) */
247 * commonly used title
249 #define GST_TAG_TITLE "title"
253 * person(s) responsible for the recording
255 #define GST_TAG_ARTIST "artist"
259 * album containing this data
261 #define GST_TAG_ALBUM "album"
265 * date the data was created (#GDate structure)
267 #define GST_TAG_DATE "date"
271 * genre this data belongs to
273 #define GST_TAG_GENRE "genre"
277 * free text commenting the data
279 #define GST_TAG_COMMENT "comment"
281 * GST_TAG_TRACK_NUMBER:
283 * track number inside a collection
285 #define GST_TAG_TRACK_NUMBER "track-number"
287 * GST_TAG_TRACK_COUNT:
289 * count of tracks inside collection this track belongs to
291 #define GST_TAG_TRACK_COUNT "track-count"
293 * GST_TAG_ALBUM_VOLUME_NUMBER:
295 * disc number inside a collection
297 #define GST_TAG_ALBUM_VOLUME_NUMBER "album-disc-number"
299 * GST_TAG_ALBUM_VOLUME_COUNT:
301 * count of discs inside collection this disc belongs to
303 #define GST_TAG_ALBUM_VOLUME_COUNT "album-disc-count"
307 * original location of file as a URI
309 #define GST_TAG_LOCATION "location"
311 * GST_TAG_DESCRIPTION:
313 * short text describing the content of the data
315 #define GST_TAG_DESCRIPTION "description"
319 * version of this data
321 #define GST_TAG_VERSION "version"
325 * International Standard Recording Code - see http://www.ifpi.org/isrc/
327 #define GST_TAG_ISRC "isrc"
329 * GST_TAG_ORGANIZATION:
333 #define GST_TAG_ORGANIZATION "organization"
337 * copyright notice of the data
339 #define GST_TAG_COPYRIGHT "copyright"
343 * contact information
345 #define GST_TAG_CONTACT "contact"
351 #define GST_TAG_LICENSE "license"
355 * person(s) performing
357 #define GST_TAG_PERFORMER "performer"
361 * length in GStreamer time units (nanoseconds)
363 #define GST_TAG_DURATION "duration"
367 * codec the data is stored in
369 #define GST_TAG_CODEC "codec"
371 * GST_TAG_VIDEO_CODEC:
373 * codec the video data is stored in
375 #define GST_TAG_VIDEO_CODEC "video-codec"
377 * GST_TAG_AUDIO_CODEC:
379 * codec the audio data is stored in
381 #define GST_TAG_AUDIO_CODEC "audio-codec"
385 * exact or average bitrate in bits/s
387 #define GST_TAG_BITRATE "bitrate"
389 * GST_TAG_NOMINAL_BITRATE:
391 * nominal bitrate in bits/s
393 #define GST_TAG_NOMINAL_BITRATE "nominal-bitrate"
395 * GST_TAG_MINIMUM_BITRATE:
397 * minimum bitrate in bits/s
399 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
401 * GST_TAG_MAXIMUM_BITRATE:
403 * maximum bitrate in bits/s
405 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
409 * serial number of track
411 #define GST_TAG_SERIAL "serial"
415 * encoder used to encode this stream
417 #define GST_TAG_ENCODER "encoder"
419 * GST_TAG_ENCODER_VERSION:
421 * version of the encoder used to encode this stream
423 #define GST_TAG_ENCODER_VERSION "encoder-version"
425 * GST_TAG_TRACK_GAIN:
429 #define GST_TAG_TRACK_GAIN "replaygain-track-gain"
431 * GST_TAG_TRACK_PEAK:
435 #define GST_TAG_TRACK_PEAK "replaygain-track-peak"
437 * GST_TAG_ALBUM_GAIN:
441 #define GST_TAG_ALBUM_GAIN "replaygain-album-gain"
443 * GST_TAG_ALBUM_PEAK:
447 #define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
449 * GST_TAG_LANGUAGE_CODE:
451 * Language code (ISO-639-1)
453 #define GST_TAG_LANGUAGE_CODE "language-code"
457 #endif /* __GST_TAGLIST_H__ */