taglist: add gst_clear_tag_list()
[platform/upstream/gstreamer.git] / gst / gsttaglist.h
1 /* GStreamer
2  * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
3  *
4  * gsttaglist.h: Header for tag support
5  *
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.
10  *
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.
15  *
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., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22
23 #ifndef __GST_TAGLIST_H__
24 #define __GST_TAGLIST_H__
25
26 #include <gst/gstdatetime.h>
27 #include <gst/gstsample.h>
28 #include <gst/gstbuffer.h>
29 #include <gst/glib-compat.h>
30
31 G_BEGIN_DECLS
32
33 /**
34  * GstTagMergeMode:
35  * @GST_TAG_MERGE_UNDEFINED: undefined merge mode
36  * @GST_TAG_MERGE_REPLACE_ALL: replace all tags (clear list and append)
37  * @GST_TAG_MERGE_REPLACE: replace tags
38  * @GST_TAG_MERGE_APPEND: append tags
39  * @GST_TAG_MERGE_PREPEND: prepend tags
40  * @GST_TAG_MERGE_KEEP: keep existing tags
41  * @GST_TAG_MERGE_KEEP_ALL: keep all existing tags
42  * @GST_TAG_MERGE_COUNT: the number of merge modes
43  *
44  * The different tag merging modes are basically replace, overwrite and append,
45  * but they can be seen from two directions. Given two taglists: (A) the tags
46  * already in the element and (B) the ones that are supplied to the element (
47  * e.g. via gst_tag_setter_merge_tags() / gst_tag_setter_add_tags() or a
48  * %GST_EVENT_TAG), how are these tags merged?
49  * In the table below this is shown for the cases that a tag exists in the list
50  * (A) or does not exists (!A) and combinations thereof.
51  *
52  * <table frame="all" colsep="1" rowsep="1">
53  *   <title>merge mode</title>
54  *   <tgroup cols='5' align='left'>
55  *     <thead>
56  *       <row>
57  *         <entry>merge mode</entry>
58  *         <entry>A + B</entry>
59  *         <entry>A + !B</entry>
60  *         <entry>!A + B</entry>
61  *         <entry>!A + !B</entry>
62  *       </row>
63  *     </thead>
64  *     <tbody>
65  *       <row>
66  *         <entry>REPLACE_ALL</entry>
67  *         <entry>B</entry>
68  *         <entry>-</entry>
69  *         <entry>B</entry>
70  *         <entry>-</entry>
71  *       </row>
72  *       <row>
73  *         <entry>REPLACE</entry>
74  *         <entry>B</entry>
75  *         <entry>A</entry>
76  *         <entry>B</entry>
77  *         <entry>-</entry>
78  *       </row>
79  *       <row>
80  *         <entry>APPEND</entry>
81  *         <entry>A, B</entry>
82  *         <entry>A</entry>
83  *         <entry>B</entry>
84  *         <entry>-</entry>
85  *       </row>
86  *       <row>
87  *         <entry>PREPEND</entry>
88  *         <entry>B, A</entry>
89  *         <entry>A</entry>
90  *         <entry>B</entry>
91  *         <entry>-</entry>
92  *       </row>
93  *       <row>
94  *         <entry>KEEP</entry>
95  *         <entry>A</entry>
96  *         <entry>A</entry>
97  *         <entry>B</entry>
98  *         <entry>-</entry>
99  *       </row>
100  *       <row>
101  *         <entry>KEEP_ALL</entry>
102  *         <entry>A</entry>
103  *         <entry>A</entry>
104  *         <entry>-</entry>
105  *         <entry>-</entry>
106  *       </row>
107  *     </tbody>
108  *   </tgroup>
109  * </table>
110  */
111 typedef enum {
112   GST_TAG_MERGE_UNDEFINED,
113   GST_TAG_MERGE_REPLACE_ALL,
114   GST_TAG_MERGE_REPLACE,
115   GST_TAG_MERGE_APPEND,
116   GST_TAG_MERGE_PREPEND,
117   GST_TAG_MERGE_KEEP,
118   GST_TAG_MERGE_KEEP_ALL,
119   /* add more */
120   GST_TAG_MERGE_COUNT
121 } GstTagMergeMode;
122
123 #define GST_TAG_MODE_IS_VALID(mode)     (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
124
125 /**
126  * GstTagFlag:
127  * @GST_TAG_FLAG_UNDEFINED: undefined flag
128  * @GST_TAG_FLAG_META: tag is meta data
129  * @GST_TAG_FLAG_ENCODED: tag is encoded
130  * @GST_TAG_FLAG_DECODED: tag is decoded
131  * @GST_TAG_FLAG_COUNT: number of tag flags
132  *
133  * Extra tag flags used when registering tags.
134  */
135 /* FIXME: these are not really flags .. */
136 typedef enum {
137   GST_TAG_FLAG_UNDEFINED,
138   GST_TAG_FLAG_META,
139   GST_TAG_FLAG_ENCODED,
140   GST_TAG_FLAG_DECODED,
141   GST_TAG_FLAG_COUNT
142 } GstTagFlag;
143
144 #define GST_TAG_FLAG_IS_VALID(flag)     (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
145
146 /**
147  * GstTagList:
148  * @mini_object: the parent type
149  *
150  * Object describing tags / metadata.
151  */
152 typedef struct _GstTagList GstTagList;
153 struct _GstTagList {
154   GstMiniObject mini_object;
155 };
156
157 GST_API GType _gst_tag_list_type;
158
159 #define GST_TAG_LIST(x)       ((GstTagList *) (x))
160 #define GST_TYPE_TAG_LIST     (_gst_tag_list_type)
161 #define GST_IS_TAG_LIST(obj)  (GST_IS_MINI_OBJECT_TYPE((obj), GST_TYPE_TAG_LIST))
162
163 /**
164  * GstTagForeachFunc:
165  * @list: the #GstTagList
166  * @tag: a name of a tag in @list
167  * @user_data: user data
168  *
169  * A function that will be called in gst_tag_list_foreach(). The function may
170  * not modify the tag list.
171  */
172 typedef void (*GstTagForeachFunc) (const GstTagList * list,
173                                    const gchar      * tag,
174                                    gpointer           user_data);
175
176 /**
177  * GstTagMergeFunc:
178  * @dest: the destination #GValue
179  * @src: the source #GValue
180  *
181  * A function for merging multiple values of a tag used when registering
182  * tags.
183  */
184 typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
185
186 GST_API
187 GType        gst_tag_list_get_type (void);
188
189 /* tag registration */
190
191 GST_API
192 void         gst_tag_register      (const gchar     * name,
193                                     GstTagFlag        flag,
194                                     GType             type,
195                                     const gchar     * nick,
196                                     const gchar     * blurb,
197                                     GstTagMergeFunc   func);
198 GST_API
199 void         gst_tag_register_static (const gchar   * name,
200                                       GstTagFlag      flag,
201                                       GType           type,
202                                       const gchar   * nick,
203                                       const gchar   * blurb,
204                                       GstTagMergeFunc func);
205
206 /* some default merging functions */
207
208 GST_API
209 void      gst_tag_merge_use_first          (GValue * dest, const GValue * src);
210
211 GST_API
212 void      gst_tag_merge_strings_with_comma (GValue * dest, const GValue * src);
213
214 /* basic tag support */
215
216 GST_API
217 gboolean               gst_tag_exists          (const gchar * tag);
218
219 GST_API
220 GType                  gst_tag_get_type        (const gchar * tag);
221
222 GST_API
223 const gchar *          gst_tag_get_nick        (const gchar * tag);
224
225 GST_API
226 const gchar *          gst_tag_get_description (const gchar * tag);
227
228 GST_API
229 GstTagFlag             gst_tag_get_flag        (const gchar * tag);
230
231 GST_API
232 gboolean               gst_tag_is_fixed        (const gchar * tag);
233
234 /* tag lists */
235
236 /**
237  * GstTagScope:
238  * @GST_TAG_SCOPE_STREAM: tags specific to this single stream
239  * @GST_TAG_SCOPE_GLOBAL: global tags for the complete medium
240  *
241  * GstTagScope specifies if a taglist applies to the complete
242  * medium or only to one single stream.
243  */
244 typedef enum {
245   GST_TAG_SCOPE_STREAM,
246   GST_TAG_SCOPE_GLOBAL
247 } GstTagScope;
248
249 GST_API
250 GstTagList * gst_tag_list_new_empty         (void) G_GNUC_MALLOC;
251
252 GST_API
253 GstTagList * gst_tag_list_new               (const gchar * tag, ...) G_GNUC_MALLOC;
254
255 GST_API
256 GstTagList * gst_tag_list_new_valist        (va_list var_args) G_GNUC_MALLOC;
257
258 GST_API
259 void         gst_tag_list_set_scope         (GstTagList * list, GstTagScope scope);
260
261 GST_API
262 GstTagScope  gst_tag_list_get_scope         (const GstTagList * list);
263
264 GST_API
265 gchar      * gst_tag_list_to_string         (const GstTagList * list) G_GNUC_MALLOC;
266
267 GST_API
268 GstTagList * gst_tag_list_new_from_string   (const gchar      * str) G_GNUC_MALLOC;
269
270 GST_API
271 gint         gst_tag_list_n_tags            (const GstTagList * list);
272
273 GST_API
274 const gchar* gst_tag_list_nth_tag_name      (const GstTagList * list, guint index);
275
276 GST_API
277 gboolean     gst_tag_list_is_empty          (const GstTagList * list);
278
279 GST_API
280 gboolean     gst_tag_list_is_equal          (const GstTagList * list1,
281                                              const GstTagList * list2);
282 GST_API
283 void         gst_tag_list_insert            (GstTagList       * into,
284                                              const GstTagList * from,
285                                              GstTagMergeMode    mode);
286 GST_API
287 GstTagList * gst_tag_list_merge             (const GstTagList * list1,
288                                              const GstTagList * list2,
289                                              GstTagMergeMode    mode) G_GNUC_MALLOC;
290 GST_API
291 guint        gst_tag_list_get_tag_size      (const GstTagList * list,
292                                              const gchar      * tag);
293 GST_API
294 void         gst_tag_list_add               (GstTagList       * list,
295                                              GstTagMergeMode    mode,
296                                              const gchar      * tag,
297                                              ...) G_GNUC_NULL_TERMINATED;
298 GST_API
299 void         gst_tag_list_add_values        (GstTagList       * list,
300                                              GstTagMergeMode    mode,
301                                              const gchar      * tag,
302                                              ...) G_GNUC_NULL_TERMINATED;
303 GST_API
304 void         gst_tag_list_add_valist        (GstTagList       * list,
305                                              GstTagMergeMode    mode,
306                                              const gchar      * tag,
307                                              va_list        var_args);
308 GST_API
309 void         gst_tag_list_add_valist_values (GstTagList       * list,
310                                              GstTagMergeMode    mode,
311                                              const gchar      * tag,
312                                              va_list            var_args);
313 GST_API
314 void         gst_tag_list_add_value         (GstTagList       * list,
315                                              GstTagMergeMode    mode,
316                                              const gchar      * tag,
317                                              const GValue     * value);
318 GST_API
319 void         gst_tag_list_remove_tag        (GstTagList       * list,
320                                              const gchar      * tag);
321 GST_API
322 void         gst_tag_list_foreach           (const GstTagList * list,
323                                              GstTagForeachFunc  func,
324                                              gpointer           user_data);
325 GST_API
326 const GValue *
327              gst_tag_list_get_value_index   (const GstTagList * list,
328                                              const gchar      * tag,
329                                              guint              index);
330 GST_API
331 gboolean     gst_tag_list_copy_value        (GValue           * dest,
332                                              const GstTagList * list,
333                                              const gchar      * tag);
334
335 /* simplifications (FIXME: do we want them?) */
336
337 GST_API
338 gboolean     gst_tag_list_get_boolean       (const GstTagList * list,
339                                              const gchar      * tag,
340                                              gboolean         * value);
341 GST_API
342 gboolean     gst_tag_list_get_boolean_index (const GstTagList * list,
343                                              const gchar      * tag,
344                                              guint              index,
345                                              gboolean         * value);
346 GST_API
347 gboolean     gst_tag_list_get_int           (const GstTagList * list,
348                                              const gchar      * tag,
349                                              gint             * value);
350 GST_API
351 gboolean     gst_tag_list_get_int_index     (const GstTagList * list,
352                                              const gchar      * tag,
353                                              guint              index,
354                                              gint             * value);
355 GST_API
356 gboolean     gst_tag_list_get_uint          (const GstTagList * list,
357                                              const gchar      * tag,
358                                              guint            * value);
359 GST_API
360 gboolean     gst_tag_list_get_uint_index    (const GstTagList * list,
361                                              const gchar      * tag,
362                                              guint              index,
363                                              guint            * value);
364 GST_API
365 gboolean     gst_tag_list_get_int64         (const GstTagList * list,
366                                              const gchar      * tag,
367                                              gint64           * value);
368 GST_API
369 gboolean     gst_tag_list_get_int64_index   (const GstTagList * list,
370                                              const gchar      * tag,
371                                              guint              index,
372                                              gint64           * value);
373 GST_API
374 gboolean     gst_tag_list_get_uint64        (const GstTagList * list,
375                                              const gchar      * tag,
376                                              guint64          * value);
377 GST_API
378 gboolean     gst_tag_list_get_uint64_index  (const GstTagList * list,
379                                              const gchar      * tag,
380                                              guint              index,
381                                              guint64          * value);
382 GST_API
383 gboolean     gst_tag_list_get_float         (const GstTagList * list,
384                                              const gchar      * tag,
385                                              gfloat           * value);
386 GST_API
387 gboolean     gst_tag_list_get_float_index   (const GstTagList * list,
388                                              const gchar      * tag,
389                                              guint              index,
390                                              gfloat           * value);
391 GST_API
392 gboolean     gst_tag_list_get_double        (const GstTagList * list,
393                                              const gchar      * tag,
394                                              gdouble          * value);
395 GST_API
396 gboolean     gst_tag_list_get_double_index  (const GstTagList * list,
397                                              const gchar      * tag,
398                                              guint              index,
399                                              gdouble          * value);
400 GST_API
401 gboolean     gst_tag_list_get_string        (const GstTagList * list,
402                                              const gchar      * tag,
403                                              gchar           ** value);
404 GST_API
405 gboolean     gst_tag_list_get_string_index  (const GstTagList * list,
406                                              const gchar      * tag,
407                                              guint              index,
408                                              gchar           ** value);
409 GST_API
410 gboolean     gst_tag_list_peek_string_index (const GstTagList * list,
411                                              const gchar      * tag,
412                                              guint              index,
413                                              const gchar     ** value);
414 GST_API
415 gboolean     gst_tag_list_get_pointer       (const GstTagList * list,
416                                              const gchar      * tag,
417                                              gpointer         * value);
418 GST_API
419 gboolean     gst_tag_list_get_pointer_index (const GstTagList * list,
420                                              const gchar      * tag,
421                                              guint              index,
422                                              gpointer         * value);
423 GST_API
424 gboolean     gst_tag_list_get_date          (const GstTagList * list,
425                                              const gchar      * tag,
426                                              GDate           ** value);
427 GST_API
428 gboolean     gst_tag_list_get_date_index    (const GstTagList * list,
429                                              const gchar      * tag,
430                                              guint              index,
431                                              GDate           ** value);
432 GST_API
433 gboolean     gst_tag_list_get_date_time     (const GstTagList * list,
434                                              const gchar      * tag,
435                                              GstDateTime     ** value);
436 GST_API
437 gboolean     gst_tag_list_get_date_time_index (const GstTagList * list,
438                                              const gchar      * tag,
439                                              guint              index,
440                                              GstDateTime     ** value);
441 GST_API
442 gboolean     gst_tag_list_get_sample        (const GstTagList * list,
443                                              const gchar      * tag,
444                                              GstSample       ** sample);
445 GST_API
446 gboolean     gst_tag_list_get_sample_index  (const GstTagList * list,
447                                              const gchar      * tag,
448                                              guint              index,
449                                              GstSample       ** sample);
450
451 /* refcounting */
452 /**
453  * gst_tag_list_ref:
454  * @taglist: the #GstTagList to reference
455  *
456  * Add a reference to a #GstTagList mini object.
457  *
458  * From this point on, until the caller calls gst_tag_list_unref() or
459  * gst_tag_list_make_writable(), it is guaranteed that the taglist object will
460  * not change. To use a #GstTagList object, you must always have a refcount on
461  * it -- either the one made implicitly by e.g. gst_tag_list_new(), or via
462  * taking one explicitly with this function.
463  *
464  * Returns: the same #GstTagList mini object.
465  */
466 static inline GstTagList *
467 gst_tag_list_ref (GstTagList * taglist)
468 {
469   return (GstTagList *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (taglist));
470 }
471
472 /**
473  * gst_tag_list_unref:
474  * @taglist: a #GstTagList.
475  *
476  * Unref a #GstTagList, and and free all its memory when the refcount reaches 0.
477  */
478 static inline void
479 gst_tag_list_unref (GstTagList * taglist)
480 {
481   gst_mini_object_unref (GST_MINI_OBJECT_CAST (taglist));
482 }
483
484 /**
485  * gst_clear_tag_list: (skip)
486  * @taglist_ptr: a pointer to a #GstTagList reference
487  *
488  * Clears a reference to a #GstTagList.
489  *
490  * @taglist_ptr must not be %NULL.
491  *
492  * If the reference is %NULL then this function does nothing. Otherwise, the
493  * reference count of the taglist is decreased and the pointer is set to %NULL.
494  *
495  * Since: 1.16
496  */
497 static inline void
498 gst_clear_tag_list (GstTagList ** taglist_ptr)
499 {
500   gst_clear_mini_object (taglist_ptr);
501 }
502
503 /**
504  * gst_tag_list_copy:
505  * @taglist: a #GstTagList.
506  *
507  * Creates a new #GstTagList as a copy of the old @taglist. The new taglist
508  * will have a refcount of 1, owned by the caller, and will be writable as
509  * a result.
510  *
511  * Note that this function is the semantic equivalent of a gst_tag_list_ref()
512  * followed by a gst_tag_list_make_writable(). If you only want to hold on to a
513  * reference to the data, you should use gst_tag_list_ref().
514  *
515  * When you are finished with the taglist, call gst_tag_list_unref() on it.
516  *
517  * Returns: the new #GstTagList
518  */
519 static inline GstTagList *
520 gst_tag_list_copy (const GstTagList * taglist)
521 {
522   return GST_TAG_LIST (gst_mini_object_copy (GST_MINI_OBJECT_CAST (taglist)));
523 }
524
525 /**
526  * gst_tag_list_is_writable:
527  * @taglist: a #GstTagList
528  *
529  * Tests if you can safely modify @taglist. It is only safe to modify taglist
530  * when there is only one owner of the taglist - ie, the refcount is 1.
531  */
532 #define gst_tag_list_is_writable(taglist)    gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (taglist))
533
534 /**
535  * gst_tag_list_make_writable:
536  * @taglist: (transfer full): a #GstTagList
537  *
538  * Returns a writable copy of @taglist.
539  *
540  * If there is only one reference count on @taglist, the caller must be the
541  * owner, and so this function will return the taglist object unchanged. If on
542  * the other hand there is more than one reference on the object, a new taglist
543  * object will be returned (which will be a copy of @taglist). The caller's
544  * reference on @taglist will be removed, and instead the caller will own a
545  * reference to the returned object.
546  *
547  * In short, this function unrefs the taglist in the argument and refs the
548  * taglist that it returns. Don't access the argument after calling this
549  * function. See also: gst_tag_list_ref().
550  *
551  * Returns: (transfer full): a writable taglist which may or may not be the
552  *     same as @taglist
553  */
554 #define gst_tag_list_make_writable(taglist)   GST_TAG_LIST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (taglist)))
555
556 /* GStreamer core tags */
557 /**
558  * GST_TAG_TITLE:
559  *
560  * commonly used title (string)
561  *
562  * The title as it should be displayed, e.g. 'The Doll House'
563  */
564 #define GST_TAG_TITLE                  "title"
565 /**
566  * GST_TAG_TITLE_SORTNAME:
567  *
568  * commonly used title, as used for sorting (string)
569  *
570  * The title as it should be sorted, e.g. 'Doll House, The'
571  */
572 #define GST_TAG_TITLE_SORTNAME         "title-sortname"
573 /**
574  * GST_TAG_ARTIST:
575  *
576  * person(s) responsible for the recording (string)
577  *
578  * The artist name as it should be displayed, e.g. 'Jimi Hendrix' or
579  * 'The Guitar Heroes'
580  */
581 #define GST_TAG_ARTIST                 "artist"
582 /**
583  * GST_TAG_ARTIST_SORTNAME:
584  *
585  * person(s) responsible for the recording, as used for sorting (string)
586  *
587  * The artist name as it should be sorted, e.g. 'Hendrix, Jimi' or
588  * 'Guitar Heroes, The'
589  */
590 #define GST_TAG_ARTIST_SORTNAME        "artist-sortname"
591 /**
592  * GST_TAG_ALBUM:
593  *
594  * album containing this data (string)
595  *
596  * The album name as it should be displayed, e.g. 'The Jazz Guitar'
597  */
598 #define GST_TAG_ALBUM                  "album"
599 /**
600  * GST_TAG_ALBUM_SORTNAME:
601  *
602  * album containing this data, as used for sorting (string)
603  *
604  * The album name as it should be sorted, e.g. 'Jazz Guitar, The'
605  */
606 #define GST_TAG_ALBUM_SORTNAME         "album-sortname"
607 /**
608  * GST_TAG_ALBUM_ARTIST:
609  *
610  * The artist of the entire album, as it should be displayed.
611  */
612 #define GST_TAG_ALBUM_ARTIST           "album-artist"
613 /**
614  * GST_TAG_ALBUM_ARTIST_SORTNAME:
615  *
616  * The artist of the entire album, as it should be sorted.
617  */
618 #define GST_TAG_ALBUM_ARTIST_SORTNAME  "album-artist-sortname"
619 /**
620  * GST_TAG_COMPOSER:
621  *
622  * person(s) who composed the recording (string)
623  */
624 #define GST_TAG_COMPOSER               "composer"
625 /**
626  * GST_TAG_CONDUCTOR:
627  *
628  * conductor/performer refinement (string)
629  *
630  * Since: 1.8
631  */
632 #define GST_TAG_CONDUCTOR               "conductor"
633 /**
634  * GST_TAG_DATE:
635  *
636  * date the data was created (#GDate structure)
637  */
638 #define GST_TAG_DATE                   "date"
639 /**
640  * GST_TAG_DATE_TIME:
641  *
642  * date and time the data was created (#GstDateTime structure)
643  */
644 #define GST_TAG_DATE_TIME              "datetime"
645 /**
646  * GST_TAG_GENRE:
647  *
648  * genre this data belongs to (string)
649  */
650 #define GST_TAG_GENRE                  "genre"
651 /**
652  * GST_TAG_COMMENT:
653  *
654  * free text commenting the data (string)
655  */
656 #define GST_TAG_COMMENT                "comment"
657 /**
658  * GST_TAG_EXTENDED_COMMENT:
659  *
660  * key/value text commenting the data (string)
661  *
662  * Must be in the form of 'key=comment' or
663  * 'key[lc]=comment' where 'lc' is an ISO-639
664  * language code.
665  *
666  * This tag is used for unknown Vorbis comment tags,
667  * unknown APE tags and certain ID3v2 comment fields.
668  */
669 #define GST_TAG_EXTENDED_COMMENT       "extended-comment"
670 /**
671  * GST_TAG_TRACK_NUMBER:
672  *
673  * track number inside a collection (unsigned integer)
674  */
675 #define GST_TAG_TRACK_NUMBER           "track-number"
676 /**
677  * GST_TAG_TRACK_COUNT:
678  *
679  * count of tracks inside collection this track belongs to (unsigned integer)
680  */
681 #define GST_TAG_TRACK_COUNT            "track-count"
682 /**
683  * GST_TAG_ALBUM_VOLUME_NUMBER:
684  *
685  * disc number inside a collection (unsigned integer)
686  */
687 #define GST_TAG_ALBUM_VOLUME_NUMBER    "album-disc-number"
688 /**
689  * GST_TAG_ALBUM_VOLUME_COUNT:
690  *
691  * count of discs inside collection this disc belongs to (unsigned integer)
692  */
693 #define GST_TAG_ALBUM_VOLUME_COUNT    "album-disc-count"
694 /**
695  * GST_TAG_LOCATION:
696  *
697  * Origin of media as a URI (location, where the original of the file or stream
698  * is hosted) (string)
699  */
700 #define GST_TAG_LOCATION               "location"
701 /**
702  * GST_TAG_HOMEPAGE:
703  *
704  * Homepage for this media (i.e. artist or movie homepage) (string)
705  */
706 #define GST_TAG_HOMEPAGE               "homepage"
707 /**
708  * GST_TAG_DESCRIPTION:
709  *
710  * short text describing the content of the data (string)
711  */
712 #define GST_TAG_DESCRIPTION            "description"
713 /**
714  * GST_TAG_VERSION:
715  *
716  * version of this data (string)
717  */
718 #define GST_TAG_VERSION                "version"
719 /**
720  * GST_TAG_ISRC:
721  *
722  * International Standard Recording Code - see http://www.ifpi.org/isrc/ (string)
723  */
724 #define GST_TAG_ISRC                   "isrc"
725 /**
726  * GST_TAG_ORGANIZATION:
727  *
728  * organization (string)
729  */
730 #define GST_TAG_ORGANIZATION           "organization"
731 /**
732  * GST_TAG_COPYRIGHT:
733  *
734  * copyright notice of the data (string)
735  */
736 #define GST_TAG_COPYRIGHT              "copyright"
737 /**
738  * GST_TAG_COPYRIGHT_URI:
739  *
740  * URI to location where copyright details can be found (string)
741  */
742 #define GST_TAG_COPYRIGHT_URI          "copyright-uri"
743 /**
744  * GST_TAG_ENCODED_BY:
745  *
746  * name of the person or organisation that encoded the file. May contain a
747  * copyright message if the person or organisation also holds the copyright
748  * (string)
749  *
750  * Note: do not use this field to describe the encoding application. Use
751  * #GST_TAG_APPLICATION_NAME or #GST_TAG_COMMENT for that.
752  */
753 #define GST_TAG_ENCODED_BY             "encoded-by"
754 /**
755  * GST_TAG_CONTACT:
756  *
757  * contact information (string)
758  */
759 #define GST_TAG_CONTACT                "contact"
760 /**
761  * GST_TAG_LICENSE:
762  *
763  * license of data (string)
764  */
765 #define GST_TAG_LICENSE                "license"
766 /**
767  * GST_TAG_LICENSE_URI:
768  *
769  * URI to location where license details can be found (string)
770  */
771 #define GST_TAG_LICENSE_URI            "license-uri"
772 /**
773  * GST_TAG_PERFORMER:
774  *
775  * person(s) performing (string)
776  */
777 #define GST_TAG_PERFORMER              "performer"
778 /**
779  * GST_TAG_DURATION:
780  *
781  * length in GStreamer time units (nanoseconds) (unsigned 64-bit integer)
782  */
783 #define GST_TAG_DURATION               "duration"
784 /**
785  * GST_TAG_CODEC:
786  *
787  * codec the data is stored in (string)
788  */
789 #define GST_TAG_CODEC                  "codec"
790 /**
791  * GST_TAG_VIDEO_CODEC:
792  *
793  * codec the video data is stored in (string)
794  */
795 #define GST_TAG_VIDEO_CODEC            "video-codec"
796 /**
797  * GST_TAG_AUDIO_CODEC:
798  *
799  * codec the audio data is stored in (string)
800  */
801 #define GST_TAG_AUDIO_CODEC            "audio-codec"
802 /**
803  * GST_TAG_SUBTITLE_CODEC:
804  *
805  * codec/format the subtitle data is stored in (string)
806  */
807 #define GST_TAG_SUBTITLE_CODEC         "subtitle-codec"
808 /**
809  * GST_TAG_CONTAINER_FORMAT:
810  *
811  * container format the data is stored in (string)
812  */
813 #define GST_TAG_CONTAINER_FORMAT       "container-format"
814 /**
815  * GST_TAG_BITRATE:
816  *
817  * exact or average bitrate in bits/s (unsigned integer)
818  */
819 #define GST_TAG_BITRATE                "bitrate"
820 /**
821  * GST_TAG_NOMINAL_BITRATE:
822  *
823  * nominal bitrate in bits/s (unsigned integer). The actual bitrate might be
824  * different from this target bitrate.
825  */
826 #define GST_TAG_NOMINAL_BITRATE        "nominal-bitrate"
827 /**
828  * GST_TAG_MINIMUM_BITRATE:
829  *
830  * minimum bitrate in bits/s (unsigned integer)
831  */
832 #define GST_TAG_MINIMUM_BITRATE        "minimum-bitrate"
833 /**
834  * GST_TAG_MAXIMUM_BITRATE:
835  *
836  * maximum bitrate in bits/s (unsigned integer)
837  */
838 #define GST_TAG_MAXIMUM_BITRATE        "maximum-bitrate"
839 /**
840  * GST_TAG_SERIAL:
841  *
842  * serial number of track (unsigned integer)
843  */
844 #define GST_TAG_SERIAL                 "serial"
845 /**
846  * GST_TAG_ENCODER:
847  *
848  * encoder used to encode this stream (string)
849  */
850 #define GST_TAG_ENCODER                "encoder"
851 /**
852  * GST_TAG_ENCODER_VERSION:
853  *
854  * version of the encoder used to encode this stream (unsigned integer)
855  */
856 #define GST_TAG_ENCODER_VERSION        "encoder-version"
857 /**
858  * GST_TAG_TRACK_GAIN:
859  *
860  * track gain in db (double)
861  */
862 #define GST_TAG_TRACK_GAIN             "replaygain-track-gain"
863 /**
864  * GST_TAG_TRACK_PEAK:
865  *
866  * peak of the track (double)
867  */
868 #define GST_TAG_TRACK_PEAK             "replaygain-track-peak"
869 /**
870  * GST_TAG_ALBUM_GAIN:
871  *
872  * album gain in db (double)
873  */
874 #define GST_TAG_ALBUM_GAIN             "replaygain-album-gain"
875 /**
876  * GST_TAG_ALBUM_PEAK:
877  *
878  * peak of the album (double)
879  */
880 #define GST_TAG_ALBUM_PEAK             "replaygain-album-peak"
881 /**
882  * GST_TAG_REFERENCE_LEVEL:
883  *
884  * reference level of track and album gain values (double)
885  */
886 #define GST_TAG_REFERENCE_LEVEL        "replaygain-reference-level"
887 /**
888  * GST_TAG_LANGUAGE_CODE:
889  *
890  * ISO-639-2 or ISO-639-1 code for the language the content is in (string)
891  *
892  * There is utility API in libgsttag in gst-plugins-base to obtain a translated
893  * language name from the language code: gst_tag_get_language_name()
894  */
895 #define GST_TAG_LANGUAGE_CODE          "language-code"
896 /**
897  * GST_TAG_LANGUAGE_NAME:
898  *
899  * Name of the language the content is in (string)
900  *
901  * Free-form name of the language the content is in, if a language code
902  * is not available. This tag should not be set in addition to a language
903  * code. It is undefined what language or locale the language name is in.
904  */
905 #define GST_TAG_LANGUAGE_NAME          "language-name"
906 /**
907  * GST_TAG_IMAGE:
908  *
909  * image (sample) (sample taglist should specify the content type and preferably
910  * also set "image-type" field as #GstTagImageType)
911  */
912 #define GST_TAG_IMAGE                  "image"
913 /**
914  * GST_TAG_PREVIEW_IMAGE:
915  *
916  * image that is meant for preview purposes, e.g. small icon-sized version
917  * (sample) (sample taglist should specify the content type)
918  */
919 #define GST_TAG_PREVIEW_IMAGE          "preview-image"
920
921 /**
922  * GST_TAG_ATTACHMENT:
923  *
924  * generic file attachment (sample) (sample taglist should specify the content
925  * type and if possible set "filename" to the file name of the
926  * attachment)
927  */
928 #define GST_TAG_ATTACHMENT             "attachment"
929
930 /**
931  * GST_TAG_BEATS_PER_MINUTE:
932  *
933  * number of beats per minute in audio (double)
934  */
935 #define GST_TAG_BEATS_PER_MINUTE       "beats-per-minute"
936
937 /**
938  * GST_TAG_KEYWORDS:
939  *
940  * comma separated keywords describing the content (string).
941  */
942 #define GST_TAG_KEYWORDS               "keywords"
943
944 /**
945  * GST_TAG_GEO_LOCATION_NAME:
946  *
947  * human readable descriptive location of where the media has been recorded or
948  * produced. (string).
949  */
950 #define GST_TAG_GEO_LOCATION_NAME               "geo-location-name"
951
952 /**
953  * GST_TAG_GEO_LOCATION_LATITUDE:
954  *
955  * geo latitude location of where the media has been recorded or produced in
956  * degrees according to WGS84 (zero at the equator, negative values for southern
957  * latitudes) (double).
958  */
959 #define GST_TAG_GEO_LOCATION_LATITUDE               "geo-location-latitude"
960
961 /**
962  * GST_TAG_GEO_LOCATION_LONGITUDE:
963  *
964  * geo longitude location of where the media has been recorded or produced in
965  * degrees according to WGS84 (zero at the prime meridian in Greenwich/UK,
966  * negative values for western longitudes). (double).
967  */
968 #define GST_TAG_GEO_LOCATION_LONGITUDE               "geo-location-longitude"
969
970 /**
971  * GST_TAG_GEO_LOCATION_ELEVATION:
972  *
973  * geo elevation of where the media has been recorded or produced in meters
974  * according to WGS84 (zero is average sea level) (double).
975  */
976 #define GST_TAG_GEO_LOCATION_ELEVATION               "geo-location-elevation"
977 /**
978  * GST_TAG_GEO_LOCATION_COUNTRY:
979  *
980  * The country (english name) where the media has been produced (string).
981  */
982 #define GST_TAG_GEO_LOCATION_COUNTRY                 "geo-location-country"
983 /**
984  * GST_TAG_GEO_LOCATION_CITY:
985  *
986  * The city (english name) where the media has been produced (string).
987  */
988 #define GST_TAG_GEO_LOCATION_CITY                    "geo-location-city"
989 /**
990  * GST_TAG_GEO_LOCATION_SUBLOCATION:
991  *
992  * A location 'smaller' than GST_TAG_GEO_LOCATION_CITY that specifies better
993  * where the media has been produced. (e.g. the neighborhood) (string).
994  *
995  * This tag has been added as this is how it is handled/named in XMP's
996  * Iptc4xmpcore schema.
997  */
998 #define GST_TAG_GEO_LOCATION_SUBLOCATION             "geo-location-sublocation"
999 /**
1000  * GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR:
1001  *
1002  * Represents the expected error on the horizontal positioning in
1003  * meters (double).
1004  */
1005 #define GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR   "geo-location-horizontal-error"
1006 /**
1007  * GST_TAG_GEO_LOCATION_MOVEMENT_SPEED:
1008  *
1009  * Speed of the capturing device when performing the capture.
1010  * Represented in m/s. (double)
1011  *
1012  * See also #GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION
1013  */
1014 #define GST_TAG_GEO_LOCATION_MOVEMENT_SPEED       "geo-location-movement-speed"
1015 /**
1016  * GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION:
1017  *
1018  * Indicates the movement direction of the device performing the capture
1019  * of a media. It is represented as degrees in floating point representation,
1020  * 0 means the geographic north, and increases clockwise (double from 0 to 360)
1021  *
1022  * See also #GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION
1023  */
1024 #define GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION "geo-location-movement-direction"
1025 /**
1026  * GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION:
1027  *
1028  * Indicates the direction the device is pointing to when capturing
1029  * a media. It is represented as degrees in floating point representation,
1030  * 0 means the geographic north, and increases clockwise (double from 0 to 360)
1031  *
1032  * See also #GST_TAG_GEO_LOCATION_MOVEMENT_DIRECTION
1033  */
1034 #define GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION  "geo-location-capture-direction"
1035 /**
1036  * GST_TAG_SHOW_NAME:
1037  *
1038  * Name of the show, used for displaying (string)
1039  */
1040 #define GST_TAG_SHOW_NAME                         "show-name"
1041 /**
1042  * GST_TAG_SHOW_SORTNAME:
1043  *
1044  * Name of the show, used for sorting (string)
1045  */
1046 #define GST_TAG_SHOW_SORTNAME                     "show-sortname"
1047 /**
1048  * GST_TAG_SHOW_EPISODE_NUMBER:
1049  *
1050  * Number of the episode within a season/show (unsigned integer)
1051  */
1052 #define GST_TAG_SHOW_EPISODE_NUMBER               "show-episode-number"
1053 /**
1054  * GST_TAG_SHOW_SEASON_NUMBER:
1055  *
1056  * Number of the season of a show/series (unsigned integer)
1057  */
1058 #define GST_TAG_SHOW_SEASON_NUMBER                "show-season-number"
1059 /**
1060  * GST_TAG_LYRICS:
1061  *
1062  * The lyrics of the media (string)
1063  */
1064 #define GST_TAG_LYRICS                            "lyrics"
1065 /**
1066  * GST_TAG_COMPOSER_SORTNAME:
1067  *
1068  * The composer's name, used for sorting (string)
1069  */
1070 #define GST_TAG_COMPOSER_SORTNAME                 "composer-sortname"
1071 /**
1072  * GST_TAG_GROUPING:
1073  *
1074  * Groups together media that are related and spans multiple tracks. An
1075  * example are multiple pieces of a concerto. (string)
1076  */
1077 #define GST_TAG_GROUPING                          "grouping"
1078 /**
1079  * GST_TAG_USER_RATING:
1080  *
1081  * Rating attributed by a person (likely the application user).
1082  * The higher the value, the more the user likes this media
1083  * (unsigned int from 0 to 100)
1084  */
1085 #define GST_TAG_USER_RATING                       "user-rating"
1086 /**
1087  * GST_TAG_DEVICE_MANUFACTURER:
1088  *
1089  * Manufacturer of the device used to create the media (string)
1090  */
1091 #define GST_TAG_DEVICE_MANUFACTURER               "device-manufacturer"
1092 /**
1093  * GST_TAG_DEVICE_MODEL:
1094  *
1095  * Model of the device used to create the media (string)
1096  */
1097 #define GST_TAG_DEVICE_MODEL                      "device-model"
1098 /**
1099  * GST_TAG_APPLICATION_NAME:
1100  *
1101  * Name of the application used to create the media (string)
1102  */
1103 #define GST_TAG_APPLICATION_NAME                  "application-name"
1104 /**
1105  * GST_TAG_APPLICATION_DATA:
1106  *
1107  * Arbitrary application data (sample)
1108  *
1109  * Some formats allow applications to add their own arbitrary data
1110  * into files. This data is application dependent.
1111  */
1112 #define GST_TAG_APPLICATION_DATA          "application-data"
1113 /**
1114  * GST_TAG_IMAGE_ORIENTATION:
1115  *
1116  * Represents the 'Orientation' tag from EXIF. Defines how the image
1117  * should be rotated and mirrored for display. (string)
1118  *
1119  * This tag has a predefined set of allowed values:
1120  *   "rotate-0"
1121  *   "rotate-90"
1122  *   "rotate-180"
1123  *   "rotate-270"
1124  *   "flip-rotate-0"
1125  *   "flip-rotate-90"
1126  *   "flip-rotate-180"
1127  *   "flip-rotate-270"
1128  *
1129  * The naming is adopted according to a possible transformation to perform
1130  * on the image to fix its orientation, obviously equivalent operations will
1131  * yield the same result.
1132  *
1133  * Rotations indicated by the values are in clockwise direction and
1134  * 'flip' means an horizontal mirroring.
1135  */
1136 #define GST_TAG_IMAGE_ORIENTATION            "image-orientation"
1137 /**
1138  * GST_TAG_PUBLISHER:
1139  *
1140  * Name of the label or publisher (string)
1141  *
1142  * Since: 1.2
1143  */
1144 #define GST_TAG_PUBLISHER                         "publisher"
1145 /**
1146  * GST_TAG_INTERPRETED_BY:
1147  *
1148  * Information about the people behind a remix and similar
1149  * interpretations of another existing piece (string)
1150  *
1151  * Since: 1.2
1152  */
1153 #define GST_TAG_INTERPRETED_BY                    "interpreted-by"
1154 /**
1155  * GST_TAG_MIDI_BASE_NOTE:
1156  *
1157  * <ulink url="http://en.wikipedia.org/wiki/Note#Note_designation_in_accordance_with_octave_name">Midi note number</ulink>
1158  * of the audio track. This is useful for sample instruments and in particular
1159  * for multi-samples.
1160  *
1161  * Since: 1.4
1162  */
1163 #define GST_TAG_MIDI_BASE_NOTE                    "midi-base-note"
1164 /**
1165  * GST_TAG_PRIVATE_DATA:
1166  *
1167  * Any private data that may be contained in tags (sample).
1168  *
1169  * It is represented by #GstSample in which #GstBuffer contains the
1170  * binary data and the sample's info #GstStructure may contain any
1171  * extra information that identifies the origin or meaning of the data.
1172  *
1173  * Private frames in ID3v2 tags ('PRIV' frames) will be represented
1174  * using this tag, in which case the GstStructure will be named
1175  * "ID3PrivateFrame" and contain a field named "owner" of type string
1176  * which contains the owner-identification string from the tag.
1177  *
1178  * Since: 1.8
1179  */
1180 #define GST_TAG_PRIVATE_DATA                         "private-data"
1181
1182 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
1183 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTagList, gst_tag_list_unref)
1184 #endif
1185
1186 G_END_DECLS
1187
1188 #endif /* __GST_TAGLIST_H__ */