toc: Add functions to retrieve the parent GstToc/GstTocEntry of a GstTocEntry
[platform/upstream/gstreamer.git] / gst / gsttoc.c
1 /* GStreamer
2  * (c) 2010, 2012 Alexander Saprykin <xelfium@gmail.com>
3  *
4  * gsttoc.c: GstToc initialization and parsing/creation
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., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 /**
23  * SECTION:gsttoc
24  * @short_description: Generic table of contents support
25  * @see_also: #GstStructure, #GstEvent, #GstMessage, #GstQuery
26  *
27  * #GstToc functions are used to create/free #GstToc and #GstTocEntry structures.
28  * Also they are used to convert #GstToc into #GstStructure and vice versa.
29  *
30  * #GstToc lets you to inform other elements in pipeline or application that playing
31  * source has some kind of table of contents (TOC). These may be chapters, editions,
32  * angles or other types. For example: DVD chapters, Matroska chapters or cue sheet
33  * TOC. Such TOC will be useful for applications to display instead of just a
34  * playlist.
35  *
36  * Using TOC is very easy. Firstly, create #GstToc structure which represents root
37  * contents of the source. You can also attach TOC-specific tags to it. Then fill
38  * it with #GstTocEntry entries by appending them to #GstToc.entries #GstTocEntry.subentries
39  * lists. You should use GST_TOC_ENTRY_TYPE_CHAPTER for generic TOC entry and
40  * GST_TOC_ENTRY_TYPE_EDITION for the entries which are considered to be alternatives
41  * (like DVD angles, Matroska editions and so on).
42  *
43  * Note that root level of the TOC can contain only either editions or chapters. You
44  * should not mix them together at the same level. Otherwise you will get serialization
45  * /deserialization errors. Make sure that no one of the entries has negative start and
46  *  stop values.
47  *
48  * Please, use #GstToc.info and #GstTocEntry.info fields in that way: create a #GstStructure,
49  * put all info related to your element there and put this structure into the info field under
50  * the name of your element. Some fields in the info structure can be used for internal purposes,
51  * so you should use it in the way described above to not to overwrite already existent fields.
52  *
53  * Use gst_event_new_toc() to create a new TOC #GstEvent, and gst_event_parse_toc() to
54  * parse received TOC event. Use gst_event_new_toc_select() to create a new TOC select #GstEvent,
55  * and gst_event_parse_toc_select() to parse received TOC select event. The same rule for
56  * the #GstMessage: gst_message_new_toc() to create new TOC #GstMessage, and
57  * gst_message_parse_toc() to parse received TOC message. Also you can create a new TOC query
58  * with gst_query_new_toc(), set it with gst_query_set_toc() and parse it with
59  * gst_query_parse_toc().
60  */
61
62 #ifdef HAVE_CONFIG_H
63 #  include "config.h"
64 #endif
65
66 #include "gst_private.h"
67 #include "gstenumtypes.h"
68 #include "gsttaglist.h"
69 #include "gststructure.h"
70 #include "gstvalue.h"
71 #include "gsttoc.h"
72 #include "gstpad.h"
73 #include "gstquark.h"
74
75 struct _GstTocEntry
76 {
77   GstMiniObject mini_object;
78
79   GstToc *toc;
80   GstTocEntry *parent;
81
82   gchar *uid;
83   GstTocEntryType type;
84   GstClockTime start, stop;
85   GList *subentries;
86   GstTagList *tags;
87 };
88
89 struct _GstToc
90 {
91   GstMiniObject mini_object;
92
93   GList *entries;
94   GstTagList *tags;
95 };
96
97 #undef gst_toc_copy
98 static GstToc *gst_toc_copy (const GstToc * toc);
99 static void gst_toc_free (GstToc * toc);
100 #undef gst_toc_entry_copy
101 static GstTocEntry *gst_toc_entry_copy (const GstTocEntry * toc);
102 static void gst_toc_entry_free (GstTocEntry * toc);
103
104 GST_DEFINE_MINI_OBJECT_TYPE (GstToc, gst_toc);
105 GST_DEFINE_MINI_OBJECT_TYPE (GstTocEntry, gst_toc_entry);
106
107 /**
108  * gst_toc_new:
109  *
110  * Create a new #GstToc structure.
111  *
112  * Returns: (transfer full): newly allocated #GstToc structure, free it
113  *     with gst_toc_unref().
114  */
115 GstToc *
116 gst_toc_new (void)
117 {
118   GstToc *toc;
119
120   toc = g_slice_new0 (GstToc);
121
122   gst_mini_object_init (GST_MINI_OBJECT_CAST (toc), 0, GST_TYPE_TOC,
123       (GstMiniObjectCopyFunction) gst_toc_copy, NULL,
124       (GstMiniObjectFreeFunction) gst_toc_free);
125
126   toc->tags = gst_tag_list_new_empty ();
127
128   return toc;
129 }
130
131 /**
132  * gst_toc_set_tags:
133  * @toc: A #GstToc instance
134  * @tags: (allow-none) (transfer full): A #GstTagList or %NULL
135  *
136  * Set a #GstTagList with tags for the complete @toc.
137  */
138 void
139 gst_toc_set_tags (GstToc * toc, GstTagList * tags)
140 {
141   g_return_if_fail (toc != NULL);
142   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (toc)));
143
144   if (toc->tags)
145     gst_tag_list_unref (toc->tags);
146   toc->tags = tags;
147 }
148
149 /**
150  * gst_toc_merge_tags:
151  * @toc: A #GstToc instance
152  * @tags: (allow-none): A #GstTagList or %NULL
153  * @mode: A #GstTagMergeMode
154  *
155  * Merge @tags into the existing tags of @toc using @mode.
156  */
157 void
158 gst_toc_merge_tags (GstToc * toc, GstTagList * tags, GstTagMergeMode mode)
159 {
160   g_return_if_fail (toc != NULL);
161   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (toc)));
162
163   if (!toc->tags) {
164     toc->tags = gst_tag_list_ref (tags);
165   } else {
166     GstTagList *tmp = gst_tag_list_merge (toc->tags, tags, mode);
167     gst_tag_list_unref (toc->tags);
168     toc->tags = tmp;
169   }
170 }
171
172 /**
173  * gst_toc_get_tags:
174  * @toc: A #GstToc instance
175  *
176  * Gets the tags for @toc.
177  *
178  * Returns: (transfer none): A #GstTagList for @entry
179  */
180 GstTagList *
181 gst_toc_get_tags (const GstToc * toc)
182 {
183   g_return_val_if_fail (toc != NULL, NULL);
184
185   return toc->tags;
186 }
187
188 /**
189  * gst_toc_append_entry:
190  * @toc: A #GstToc instance
191  * @entry: (transfer full): A #GstTocEntry
192  *
193  * Appends the #GstTocEntry @entry to @toc.
194  */
195 void
196 gst_toc_append_entry (GstToc * toc, GstTocEntry * entry)
197 {
198   g_return_if_fail (toc != NULL);
199   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (toc)));
200   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (entry)));
201   g_return_if_fail (entry->toc == NULL);
202   g_return_if_fail (entry->parent == NULL);
203
204   toc->entries = g_list_append (toc->entries, entry);
205   entry->toc = toc;
206
207   GST_LOG ("appended %s entry with uid %s to toc %p",
208       gst_toc_entry_type_get_nick (entry->type), entry->uid, toc);
209
210   gst_toc_dump (toc);
211 }
212
213 /**
214  * gst_toc_get_entries:
215  * @toc: A #GstToc instance
216  *
217  * Gets the list of #GstTocEntry of @toc.
218  *
219  * Returns: (transfer none) (element-type Gst.TocEntry): A #GList of #GstTocEntry for @entry
220  */
221 GList *
222 gst_toc_get_entries (const GstToc * toc)
223 {
224   g_return_val_if_fail (toc != NULL, NULL);
225
226   return toc->entries;
227 }
228
229 static GstTocEntry *
230 gst_toc_entry_new_internal (GstTocEntryType type, const gchar * uid)
231 {
232   GstTocEntry *entry;
233
234   entry = g_slice_new0 (GstTocEntry);
235
236   gst_mini_object_init (GST_MINI_OBJECT_CAST (entry), 0, GST_TYPE_TOC_ENTRY,
237       (GstMiniObjectCopyFunction) gst_toc_entry_copy, NULL,
238       (GstMiniObjectFreeFunction) gst_toc_entry_free);
239
240   entry->uid = g_strdup (uid);
241   entry->type = type;
242   entry->tags = NULL;
243   entry->start = entry->stop = GST_CLOCK_TIME_NONE;
244
245   return entry;
246 }
247
248 /**
249  * gst_toc_entry_new:
250  * @type: entry type.
251  * @uid: unique ID (UID) in the whole TOC.
252  *
253  * Create new #GstTocEntry structure.
254  *
255  * Returns: newly allocated #GstTocEntry structure, free it with gst_toc_entry_unref().
256  */
257 GstTocEntry *
258 gst_toc_entry_new (GstTocEntryType type, const gchar * uid)
259 {
260   g_return_val_if_fail (uid != NULL, NULL);
261
262   return gst_toc_entry_new_internal (type, uid);
263 }
264
265 static void
266 gst_toc_free (GstToc * toc)
267 {
268   g_list_foreach (toc->entries, (GFunc) gst_mini_object_unref, NULL);
269   g_list_free (toc->entries);
270
271   if (toc->tags != NULL)
272     gst_tag_list_unref (toc->tags);
273
274   g_slice_free (GstToc, toc);
275 }
276
277 static void
278 gst_toc_entry_free (GstTocEntry * entry)
279 {
280   g_return_if_fail (entry != NULL);
281
282   g_list_foreach (entry->subentries, (GFunc) gst_mini_object_unref, NULL);
283   g_list_free (entry->subentries);
284
285   g_free (entry->uid);
286
287   if (entry->tags != NULL)
288     gst_tag_list_unref (entry->tags);
289
290   g_slice_free (GstTocEntry, entry);
291 }
292
293 static GstTocEntry *
294 gst_toc_entry_find_sub_entry (const GstTocEntry * entry, const gchar * uid)
295 {
296   GList *cur;
297   GstTocEntry *subentry, *subsubentry;
298
299   g_return_val_if_fail (entry != NULL, NULL);
300   g_return_val_if_fail (uid != NULL, NULL);
301
302   cur = entry->subentries;
303   while (cur != NULL) {
304     subentry = cur->data;
305
306     if (g_strcmp0 (subentry->uid, uid) == 0)
307       return subentry;
308
309     subsubentry = gst_toc_entry_find_sub_entry (subentry, uid);
310     if (subsubentry != NULL)
311       return subsubentry;
312
313     cur = cur->next;
314   }
315
316   return NULL;
317 }
318
319 /**
320  * gst_toc_find_entry:
321  * @toc: #GstToc to search in.
322  * @uid: UID to find #GstTocEntry with.
323  *
324  * Find #GstTocEntry with given @uid in the @toc.
325  *
326  * Returns: (transfer none): #GstTocEntry with specified @uid from the @toc, or NULL if not found.
327  */
328 GstTocEntry *
329 gst_toc_find_entry (const GstToc * toc, const gchar * uid)
330 {
331   GList *cur;
332   GstTocEntry *entry, *subentry;
333
334   g_return_val_if_fail (toc != NULL, NULL);
335   g_return_val_if_fail (uid != NULL, NULL);
336
337   cur = toc->entries;
338   while (cur != NULL) {
339     entry = cur->data;
340
341     if (g_strcmp0 (entry->uid, uid) == 0)
342       return entry;
343
344     subentry = gst_toc_entry_find_sub_entry (entry, uid);
345     if (subentry != NULL)
346       return subentry;
347     cur = cur->next;
348   }
349
350   return NULL;
351 }
352
353 /**
354  * gst_toc_entry_copy:
355  * @entry: #GstTocEntry to copy.
356  *
357  * Copy #GstTocEntry with all subentries (deep copy).
358  *
359  * Returns: newly allocated #GstTocEntry in case of success, NULL otherwise;
360  * free it when done with gst_toc_entry_unref().
361  */
362 static GstTocEntry *
363 gst_toc_entry_copy (const GstTocEntry * entry)
364 {
365   GstTocEntry *ret, *sub;
366   GstTagList *list;
367   GList *cur;
368
369   g_return_val_if_fail (entry != NULL, NULL);
370
371   ret = gst_toc_entry_new (entry->type, entry->uid);
372
373   ret->start = entry->start;
374   ret->stop = entry->stop;
375
376   if (GST_IS_TAG_LIST (entry->tags)) {
377     list = gst_tag_list_copy (entry->tags);
378     if (ret->tags)
379       gst_tag_list_unref (ret->tags);
380     ret->tags = list;
381   }
382
383   cur = entry->subentries;
384   while (cur != NULL) {
385     sub = gst_toc_entry_copy (cur->data);
386
387     if (sub != NULL)
388       ret->subentries = g_list_prepend (ret->subentries, sub);
389
390     cur = cur->next;
391   }
392   ret->subentries = g_list_reverse (ret->subentries);
393
394   return ret;
395 }
396
397 /**
398  * gst_toc_copy:
399  * @toc: #GstToc to copy.
400  *
401  * Copy #GstToc with all subentries (deep copy).
402  *
403  * Returns: newly allocated #GstToc in case of success, NULL otherwise;
404  * free it when done with gst_toc_free().
405  */
406 static GstToc *
407 gst_toc_copy (const GstToc * toc)
408 {
409   GstToc *ret;
410   GstTocEntry *entry;
411   GList *cur;
412   GstTagList *list;
413
414   g_return_val_if_fail (toc != NULL, NULL);
415
416   ret = gst_toc_new ();
417
418   if (GST_IS_TAG_LIST (toc->tags)) {
419     list = gst_tag_list_copy (toc->tags);
420     gst_tag_list_unref (ret->tags);
421     ret->tags = list;
422   }
423
424   cur = toc->entries;
425   while (cur != NULL) {
426     entry = gst_toc_entry_copy (cur->data);
427
428     if (entry != NULL)
429       ret->entries = g_list_prepend (ret->entries, entry);
430
431     cur = cur->next;
432   }
433   ret->entries = g_list_reverse (ret->entries);
434
435   return ret;
436 }
437
438 /**
439  * gst_toc_entry_set_start_stop_times:
440  * @entry: #GstTocEntry to set values.
441  * @start: start value to set.
442  * @stop: stop value to set.
443  *
444  * Set @start and @stop values for the @entry.
445  */
446 void
447 gst_toc_entry_set_start_stop_times (GstTocEntry * entry, gint64 start,
448     gint64 stop)
449 {
450   g_return_if_fail (entry != NULL);
451
452   entry->start = start;
453   entry->stop = stop;
454 }
455
456 /**
457  * gst_toc_entry_get_start_stop_times:
458  * @entry: #GstTocEntry to get values from.
459  * @start: (out): the storage for the start value, leave #NULL if not need.
460  * @stop: (out): the storage for the stop value, leave #NULL if not need.
461  *
462  * Get start and stop values from the @entry and write them into appropriate storages.
463  *
464  * Returns: TRUE if all non-NULL storage pointers were filled with appropriate values,
465  * FALSE otherwise.
466  */
467 gboolean
468 gst_toc_entry_get_start_stop_times (const GstTocEntry * entry, gint64 * start,
469     gint64 * stop)
470 {
471   gboolean ret = TRUE;
472
473   g_return_val_if_fail (entry != NULL, FALSE);
474
475   if (start != NULL)
476     *start = entry->start;
477   if (stop != NULL)
478     *stop = entry->stop;
479
480   return ret;
481 }
482
483 /**
484  * gst_toc_entry_type_get_nick:
485  * @type: a #GstTocEntryType.
486  *
487  * Converts @type to a string representation.
488  *
489  * Returns: Returns a human-readable string for @type. This string is
490  *    only for debugging purpose and should not be displayed in a user
491  *    interface.
492  */
493 const gchar *
494 gst_toc_entry_type_get_nick (GstTocEntryType type)
495 {
496   switch (type) {
497     case GST_TOC_ENTRY_TYPE_ANGLE:
498       return "angle";
499     case GST_TOC_ENTRY_TYPE_VERSION:
500       return "version";
501     case GST_TOC_ENTRY_TYPE_EDITION:
502       return "edition";
503     case GST_TOC_ENTRY_TYPE_TITLE:
504       return "title";
505     case GST_TOC_ENTRY_TYPE_TRACK:
506       return "track";
507     case GST_TOC_ENTRY_TYPE_CHAPTER:
508       return "chapter";
509     default:
510       break;
511   }
512   return "invalid";
513 }
514
515 /**
516  * gst_toc_entry_get_entry_type:
517  * @entry: a #GstTocEntry
518  *
519  * Returns: @entry's entry type
520  */
521 GstTocEntryType
522 gst_toc_entry_get_entry_type (const GstTocEntry * entry)
523 {
524   g_return_val_if_fail (entry != NULL, GST_TOC_ENTRY_TYPE_INVALID);
525
526   return entry->type;
527 }
528
529 /**
530  * gst_toc_entry_is_alternative:
531  * @entry: a #GstTocEntry
532  *
533  * Returns: %TRUE if @entry's type is an alternative type, otherwise %FALSE
534  */
535 gboolean
536 gst_toc_entry_is_alternative (const GstTocEntry * entry)
537 {
538   g_return_val_if_fail (entry != NULL, FALSE);
539
540   return GST_TOC_ENTRY_TYPE_IS_ALTERNATIVE (entry->type);
541 }
542
543 /**
544  * gst_toc_entry_is_sequence:
545  * @entry: a #GstTocEntry
546  *
547  * Returns: %TRUE if @entry's type is a sequence type, otherwise %FALSE
548  */
549 gboolean
550 gst_toc_entry_is_sequence (const GstTocEntry * entry)
551 {
552   g_return_val_if_fail (entry != NULL, FALSE);
553
554   return GST_TOC_ENTRY_TYPE_IS_SEQUENCE (entry->type);
555 }
556
557 /**
558  * gst_toc_entry_get_uid:
559  * @entry: A #GstTocEntry instance
560  *
561  * Gets the UID of @entry.
562  *
563  * Returns: (transfer none): The UID of @entry
564  */
565 const gchar *
566 gst_toc_entry_get_uid (const GstTocEntry * entry)
567 {
568   g_return_val_if_fail (entry != NULL, NULL);
569
570   return entry->uid;
571 }
572
573 /**
574  * gst_toc_entry_append_sub_entry:
575  * @entry: A #GstTocEntry instance
576  * @subentry: (transfer full): A #GstTocEntry
577  *
578  * Appends the #GstTocEntry @subentry to @entry.
579  */
580 void
581 gst_toc_entry_append_sub_entry (GstTocEntry * entry, GstTocEntry * subentry)
582 {
583   g_return_if_fail (entry != NULL);
584   g_return_if_fail (subentry != NULL);
585   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (entry)));
586   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST
587           (subentry)));
588   g_return_if_fail (subentry->toc == NULL);
589   g_return_if_fail (subentry->parent == NULL);
590
591   entry->subentries = g_list_append (entry->subentries, subentry);
592   subentry->toc = entry->toc;
593   subentry->parent = entry;
594
595   GST_LOG ("appended %s subentry with uid %s to entry %s",
596       gst_toc_entry_type_get_nick (subentry->type), subentry->uid, entry->uid);
597 }
598
599 /**
600  * gst_toc_entry_get_uid:
601  * @entry: A #GstTocEntry instance
602  *
603  * Gets the sub-entries of @entry.
604  *
605  * Returns: (transfer none) (element-type Gst.TocEntry): A #GList of #GstTocEntry of @entry
606  */
607 GList *
608 gst_toc_entry_get_sub_entries (const GstTocEntry * entry)
609 {
610   g_return_val_if_fail (entry != NULL, NULL);
611
612   return entry->subentries;
613 }
614
615 /**
616  * gst_toc_entry_set_tags:
617  * @entry: A #GstTocEntry instance
618  * @tags: (allow-none) (transfer full): A #GstTagList or %NULL
619  *
620  * Set a #GstTagList with tags for the complete @entry.
621  */
622 void
623 gst_toc_entry_set_tags (GstTocEntry * entry, GstTagList * tags)
624 {
625   g_return_if_fail (entry != NULL);
626   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (entry)));
627
628   if (entry->tags)
629     gst_tag_list_unref (entry->tags);
630   entry->tags = tags;
631 }
632
633 /**
634  * gst_toc_entry_merge_tags:
635  * @entry: A #GstTocEntry instance
636  * @tags: (allow-none): A #GstTagList or %NULL
637  * @mode: A #GstTagMergeMode
638  *
639  * Merge @tags into the existing tags of @entry using @mode.
640  */
641 void
642 gst_toc_entry_merge_tags (GstTocEntry * entry, GstTagList * tags,
643     GstTagMergeMode mode)
644 {
645   g_return_if_fail (entry != NULL);
646   g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (entry)));
647
648   if (!entry->tags) {
649     entry->tags = gst_tag_list_ref (tags);
650   } else {
651     GstTagList *tmp = gst_tag_list_merge (entry->tags, tags, mode);
652     gst_tag_list_unref (entry->tags);
653     entry->tags = tmp;
654   }
655 }
656
657 /**
658  * gst_toc_entry_get_tags:
659  * @entry: A #GstTocEntry instance
660  *
661  * Gets the tags for @entry.
662  *
663  * Returns: (transfer none): A #GstTagList for @entry
664  */
665 GstTagList *
666 gst_toc_entry_get_tags (const GstTocEntry * entry)
667 {
668   g_return_val_if_fail (entry != NULL, NULL);
669
670   return entry->tags;
671 }
672
673 /**
674  * gst_toc_entry_get_toc:
675  * @entry: A #GstTocEntry instance
676  *
677  * Gets the parent #GstToc of @entry.
678  *
679  * Returns: (transfer none): The parent #GstToc of @entry
680  */
681 GstToc *
682 gst_toc_entry_get_toc (GstTocEntry * entry)
683 {
684   g_return_val_if_fail (entry != NULL, NULL);
685
686   return entry->toc;
687 }
688
689 /**
690  * gst_toc_entry_get_parent:
691  * @entry: A #GstTocEntry instance
692  *
693  * Gets the parent #GstTocEntry of @entry.
694  *
695  * Returns: (transfer none): The parent #GstTocEntry of @entry
696  */
697 GstTocEntry *
698 gst_toc_entry_get_parent (GstTocEntry * entry)
699 {
700   g_return_val_if_fail (entry != NULL, NULL);
701
702   return entry->parent;
703 }
704
705 #ifndef GST_DISABLE_GST_DEBUG
706 static void
707 gst_toc_dump_entries (GList * entries, guint depth)
708 {
709   GList *e;
710   gchar *indent;
711
712   indent = g_malloc0 (depth + 1);
713   memset (indent, ' ', depth);
714   for (e = entries; e != NULL; e = e->next) {
715     GstTocEntry *entry = e->data;
716
717     GST_TRACE ("%s+ %s (%s), %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT ", "
718         "tags: %" GST_PTR_FORMAT, indent, entry->uid,
719         gst_toc_entry_type_get_nick (entry->type),
720         GST_TIME_ARGS (entry->start), GST_TIME_ARGS (entry->stop), entry->tags);
721
722     if (entry->subentries != NULL)
723       gst_toc_dump_entries (entry->subentries, depth + 2);
724   }
725   g_free (indent);
726 }
727 #endif
728
729 void
730 gst_toc_dump (GstToc * toc)
731 {
732 #ifndef GST_DISABLE_GST_DEBUG
733   GST_TRACE ("        Toc %p, tags: %" GST_PTR_FORMAT, toc, toc->tags);
734   gst_toc_dump_entries (toc->entries, 2);
735 #endif
736 }