36
36
* Using TOC is very easy. Firstly, create #GstToc structure which represents root
37
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).
38
* it with #GstTocEntry entries by appending them to the #GstToc using
39
* gst_toc_append_entry(), and appending subentries to a #GstTocEntry using
40
* gst_toc_entry_append_sub_entry().
43
42
* Note that root level of the TOC can contain only either editions or chapters. You
44
43
* should not mix them together at the same level. Otherwise you will get serialization
45
44
* /deserialization errors. Make sure that no one of the entries has negative start and
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.
53
47
* Use gst_event_new_toc() to create a new TOC #GstEvent, and gst_event_parse_toc() to
54
48
* parse received TOC event. Use gst_event_new_toc_select() to create a new TOC select #GstEvent,
55
49
* and gst_event_parse_toc_select() to parse received TOC select event. The same rule for
56
50
* 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().
51
* gst_message_parse_toc() to parse received TOC message.
53
* TOCs can have global scope or current scope. Global scope TOCs contain
54
* all entries that can possibly be selected using a toc select event, and
55
* are what an application is usually interested in. TOCs with current scope
56
* only contain the parts of the TOC relevant to the currently selected/playing
57
* stream; the current scope TOC is used by downstream elements such as muxers
58
* to write correct TOC entries when transcoding files, for example. When
59
* playing a DVD, the global TOC would contain a hierarchy of all titles,
60
* chapters and angles, for example, while the current TOC would only contain
61
* the chapters for the currently playing title if playback of a specific
62
* title was requested.
62
65
#ifdef HAVE_CONFIG_H
421
424
* Copy #GstToc with all subentries (deep copy).
423
426
* Returns: newly allocated #GstToc in case of success, NULL otherwise;
424
* free it when done with gst_toc_free().
427
* free it when done with gst_toc_unref().
427
430
gst_toc_copy (const GstToc * toc)