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))
45 GST_TAG_FLAG_UNDEFINED,
51 #define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
53 typedef GstStructure GstTagList;
54 #define GST_TAG_LIST(x) ((GstTagList *) (x))
55 #define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
56 #define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
58 typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
59 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
61 /* initialize tagging system */
62 void _gst_tag_initialize (void);
63 GType gst_tag_list_get_type (void);
65 void gst_tag_register (const gchar * name,
70 GstTagMergeFunc func);
71 /* some default merging functions */
72 void gst_tag_merge_use_first (GValue * dest,
74 void gst_tag_merge_strings_with_comma (GValue * dest,
77 /* basic tag support */
78 gboolean gst_tag_exists (const gchar * tag);
79 GType gst_tag_get_type (const gchar * tag);
80 G_CONST_RETURN gchar *
81 gst_tag_get_nick (const gchar * tag);
82 G_CONST_RETURN gchar *
83 gst_tag_get_description (const gchar * tag);
84 GstTagFlag gst_tag_get_flag (const gchar * tag);
85 gboolean gst_tag_is_fixed (const gchar * tag);
88 GstTagList * gst_tag_list_new (void);
89 gboolean gst_is_tag_list (gconstpointer p);
90 GstTagList * gst_tag_list_copy (const GstTagList * list);
91 void gst_tag_list_insert (GstTagList * into,
92 const GstTagList * from,
93 GstTagMergeMode mode);
94 GstTagList * gst_tag_list_merge (const GstTagList * list1,
95 const GstTagList * list2,
96 GstTagMergeMode mode);
97 void gst_tag_list_free (GstTagList * list);
98 guint gst_tag_list_get_tag_size (const GstTagList * list,
100 void gst_tag_list_add (GstTagList * list,
101 GstTagMergeMode mode,
104 void gst_tag_list_add_values (GstTagList * list,
105 GstTagMergeMode mode,
108 void gst_tag_list_add_valist (GstTagList * list,
109 GstTagMergeMode mode,
112 void gst_tag_list_add_valist_values (GstTagList * list,
113 GstTagMergeMode mode,
116 void gst_tag_list_remove_tag (GstTagList * list,
118 void gst_tag_list_foreach (GstTagList * list,
119 GstTagForeachFunc func,
122 G_CONST_RETURN GValue *
123 gst_tag_list_get_value_index (const GstTagList * list,
126 gboolean gst_tag_list_copy_value (GValue * dest,
127 const GstTagList * list,
130 /* simplifications (FIXME: do we want them?) */
131 gboolean gst_tag_list_get_char (const GstTagList * list,
134 gboolean gst_tag_list_get_char_index (const GstTagList * list,
138 gboolean gst_tag_list_get_uchar (const GstTagList * list,
141 gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
145 gboolean gst_tag_list_get_boolean (const GstTagList * list,
148 gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
152 gboolean gst_tag_list_get_int (const GstTagList * list,
155 gboolean gst_tag_list_get_int_index (const GstTagList * list,
159 gboolean gst_tag_list_get_uint (const GstTagList * list,
162 gboolean gst_tag_list_get_uint_index (const GstTagList * list,
166 gboolean gst_tag_list_get_long (const GstTagList * list,
169 gboolean gst_tag_list_get_long_index (const GstTagList * list,
173 gboolean gst_tag_list_get_ulong (const GstTagList * list,
176 gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
180 gboolean gst_tag_list_get_int64 (const GstTagList * list,
183 gboolean gst_tag_list_get_int64_index (const GstTagList * list,
187 gboolean gst_tag_list_get_uint64 (const GstTagList * list,
190 gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
194 gboolean gst_tag_list_get_float (const GstTagList * list,
197 gboolean gst_tag_list_get_float_index (const GstTagList * list,
201 gboolean gst_tag_list_get_double (const GstTagList * list,
204 gboolean gst_tag_list_get_double_index (const GstTagList * list,
208 gboolean gst_tag_list_get_string (const GstTagList * list,
211 gboolean gst_tag_list_get_string_index (const GstTagList * list,
215 gboolean gst_tag_list_get_pointer (const GstTagList * list,
218 gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
224 GstEvent * gst_event_new_tag (GstTagList * list);
225 GstTagList * gst_event_tag_get_list (GstEvent * tag_event);
228 /* GStreamer core tags (need to be discussed) */
232 * commonly used title
234 #define GST_TAG_TITLE "title"
238 * person(s) responsible for the recording
240 #define GST_TAG_ARTIST "artist"
244 * album containing this data
246 #define GST_TAG_ALBUM "album"
250 * date the data was created (in Julian calendar days)
252 #define GST_TAG_DATE "date"
256 * genre this data belongs to
258 #define GST_TAG_GENRE "genre"
262 * free text commenting the data
264 #define GST_TAG_COMMENT "comment"
266 * GST_TAG_TRACK_NUMBER:
268 * track number inside a collection
270 #define GST_TAG_TRACK_NUMBER "track-number"
272 * GST_TAG_TRACK_COUNT:
274 * count of tracks inside collection this track belongs to
276 #define GST_TAG_TRACK_COUNT "track-count"
278 * GST_TAG_ALBUM_VOLUME_NUMBER:
280 * disc number inside a collection
282 #define GST_TAG_ALBUM_VOLUME_NUMBER "album-disc-number"
284 * GST_TAG_ALBUM_VOLUME_COUNT:
286 * count of discs inside collection this disc belongs to
288 #define GST_TAG_ALBUM_VOLUME_COUNT "album-disc-count"
292 * original location of file as a URI
294 #define GST_TAG_LOCATION "location"
296 * GST_TAG_DESCRIPTION:
298 * short text describing the content of the data
300 #define GST_TAG_DESCRIPTION "description"
304 * version of this data
306 #define GST_TAG_VERSION "version"
310 * International Standard Recording Code - see http://www.ifpi.org/isrc/
312 #define GST_TAG_ISRC "isrc"
314 * GST_TAG_ORGANIZATION:
318 #define GST_TAG_ORGANIZATION "organization"
322 * copyright notice of the data
324 #define GST_TAG_COPYRIGHT "copyright"
328 * contact information
330 #define GST_TAG_CONTACT "contact"
336 #define GST_TAG_LICENSE "license"
340 * person(s) performing
342 #define GST_TAG_PERFORMER "performer"
346 * length in GStreamer time units (nanoseconds)
348 #define GST_TAG_DURATION "duration"
352 * codec the data is stored in
354 #define GST_TAG_CODEC "codec"
356 * GST_TAG_VIDEO_CODEC:
358 * codec the video data is stored in
360 #define GST_TAG_VIDEO_CODEC "video-codec"
362 * GST_TAG_AUDIO_CODEC:
364 * codec the audio data is stored in
366 #define GST_TAG_AUDIO_CODEC "audio-codec"
370 * exact or average bitrate in bits/s
372 #define GST_TAG_BITRATE "bitrate"
374 * GST_TAG_NOMINAL_BITRATE:
376 * nominal bitrate in bits/s
378 #define GST_TAG_NOMINAL_BITRATE "nominal-bitrate"
380 * GST_TAG_MINIMUM_BITRATE:
382 * minimum bitrate in bits/s
384 #define GST_TAG_MINIMUM_BITRATE "minimum-bitrate"
386 * GST_TAG_MAXIMUM_BITRATE:
388 * maximum bitrate in bits/s
390 #define GST_TAG_MAXIMUM_BITRATE "maximum-bitrate"
394 * serial number of track
396 #define GST_TAG_SERIAL "serial"
400 * encoder used to encode this stream
402 #define GST_TAG_ENCODER "encoder"
404 * GST_TAG_ENCODER_VERSION:
406 * version of the encoder used to encode this stream
408 #define GST_TAG_ENCODER_VERSION "encoder-version"
410 * GST_TAG_TRACK_GAIN:
414 #define GST_TAG_TRACK_GAIN "replaygain-track-gain"
416 * GST_TAG_TRACK_PEAK:
420 #define GST_TAG_TRACK_PEAK "replaygain-track-peak"
422 * GST_TAG_ALBUM_GAIN:
426 #define GST_TAG_ALBUM_GAIN "replaygain-album-gain"
428 * GST_TAG_ALBUM_PEAK:
432 #define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
436 #endif /* __GST_EVENT_H__ */