# GstToc

GstToc functions are used to create/free GstToc and GstTocEntry structures. Also they are used to convert GstToc into GstStructure and vice versa.

GstToc lets you to inform other elements in pipeline or application that playing source has some kind of table of contents (TOC). These may be chapters, editions, angles or other types. For example: DVD chapters, Matroska chapters or cue sheet TOC. Such TOC will be useful for applications to display instead of just a playlist.

Using TOC is very easy. Firstly, create GstToc structure which represents root contents of the source. You can also attach TOC-specific tags to it. Then fill it with GstTocEntry entries by appending them to the GstToc using gst_toc_append_entry, and appending subentries to a GstTocEntry using gst_toc_entry_append_sub_entry.

Note that root level of the TOC can contain only either editions or chapters. You should not mix them together at the same level. Otherwise you will get serialization /deserialization errors. Make sure that no one of the entries has negative start and stop values.

Use gst_event_new_toc to create a new TOC GstEvent, and gst_event_parse_toc to parse received TOC event. Use gst_event_new_toc_select to create a new TOC select GstEvent, and gst_event_parse_toc_select to parse received TOC select event. The same rule for the GstMessage: gst_message_new_toc to create new TOC GstMessage, and gst_message_parse_toc to parse received TOC message.

TOCs can have global scope or current scope. Global scope TOCs contain all entries that can possibly be selected using a toc select event, and are what an application is usually interested in. TOCs with current scope only contain the parts of the TOC relevant to the currently selected/playing stream; the current scope TOC is used by downstream elements such as muxers to write correct TOC entries when transcoding files, for example. When playing a DVD, the global TOC would contain a hierarchy of all titles, chapters and angles, for example, while the current TOC would only contain the chapters for the currently playing title if playback of a specific title was requested.

Applications and plugins should not rely on TOCs having a certain kind of structure, but should allow for different alternatives. For example, a simple CUE sheet embedded in a file may be presented as a flat list of track entries, or could have a top-level edition node (or some other alternative type entry) with track entries underneath that node; or even multiple top-level edition nodes (or some other alternative type entries) each with track entries underneath, in case the source file has extracted a track listing from different sources).

## GstToc

## Gst.Toc

### Constructors

### Methods

## GstTocEntry

## Gst.TocEntry

### Constructors

### Methods

## Functions

## Function Macros

## Enumerations

### GstTocEntryType

The different types of TOC entries (see GstTocEntry).

There are two types of TOC entries: alternatives or parts in a sequence.

##### Members

`GST_TOC_ENTRY_TYPE_ANGLE` (-3) –

entry is an angle (i.e. an alternative)

`GST_TOC_ENTRY_TYPE_VERSION` (-2) –

entry is a version (i.e. alternative)

`GST_TOC_ENTRY_TYPE_EDITION` (-1) –

entry is an edition (i.e. alternative)

`GST_TOC_ENTRY_TYPE_INVALID` (0) –

invalid entry type value

`GST_TOC_ENTRY_TYPE_TITLE` (1) –

entry is a title (i.e. a part of a sequence)

`GST_TOC_ENTRY_TYPE_TRACK` (2) –

entry is a track (i.e. a part of a sequence)

`GST_TOC_ENTRY_TYPE_CHAPTER` (3) –

entry is a chapter (i.e. a part of a sequence)

### Gst.TocEntryType

The different types of TOC entries (see Gst.TocEntry).

There are two types of TOC entries: alternatives or parts in a sequence.

##### Members

`Gst.TocEntryType.ANGLE` (-3) –

entry is an angle (i.e. an alternative)

`Gst.TocEntryType.VERSION` (-2) –

entry is a version (i.e. alternative)

`Gst.TocEntryType.EDITION` (-1) –

entry is an edition (i.e. alternative)

`Gst.TocEntryType.INVALID` (0) –

invalid entry type value

`Gst.TocEntryType.TITLE` (1) –

entry is a title (i.e. a part of a sequence)

`Gst.TocEntryType.TRACK` (2) –

entry is a track (i.e. a part of a sequence)

`Gst.TocEntryType.CHAPTER` (3) –

entry is a chapter (i.e. a part of a sequence)

### Gst.TocEntryType

The different types of TOC entries (see Gst.TocEntry).

There are two types of TOC entries: alternatives or parts in a sequence.

##### Members

`Gst.TocEntryType.ANGLE` (-3) –

entry is an angle (i.e. an alternative)

`Gst.TocEntryType.VERSION` (-2) –

entry is a version (i.e. alternative)

`Gst.TocEntryType.EDITION` (-1) –

entry is an edition (i.e. alternative)

`Gst.TocEntryType.INVALID` (0) –

invalid entry type value

`Gst.TocEntryType.TITLE` (1) –

entry is a title (i.e. a part of a sequence)

`Gst.TocEntryType.TRACK` (2) –

entry is a track (i.e. a part of a sequence)

`Gst.TocEntryType.CHAPTER` (3) –

entry is a chapter (i.e. a part of a sequence)

### GstTocLoopType

How a GstTocEntry should be repeated. By default, entries are played a single time.

##### Members

`GST_TOC_LOOP_NONE` (0) –

single forward playback

`GST_TOC_LOOP_FORWARD` (1) –

repeat forward

`GST_TOC_LOOP_REVERSE` (2) –

repeat backward

`GST_TOC_LOOP_PING_PONG` (3) –

repeat forward and backward

Since : 1.4

### Gst.TocLoopType

How a Gst.TocEntry should be repeated. By default, entries are played a single time.

##### Members

`Gst.TocLoopType.NONE` (0) –

single forward playback

`Gst.TocLoopType.FORWARD` (1) –

repeat forward

`Gst.TocLoopType.REVERSE` (2) –

repeat backward

`Gst.TocLoopType.PING_PONG` (3) –

repeat forward and backward

Since : 1.4

### Gst.TocLoopType

How a Gst.TocEntry should be repeated. By default, entries are played a single time.

##### Members

`Gst.TocLoopType.NONE` (0) –

single forward playback

`Gst.TocLoopType.FORWARD` (1) –

repeat forward

`Gst.TocLoopType.REVERSE` (2) –

repeat backward

`Gst.TocLoopType.PING_PONG` (3) –

repeat forward and backward

Since : 1.4

### GstTocScope

The scope of a TOC.

##### Members

`GST_TOC_SCOPE_GLOBAL` (1) –

global TOC representing all selectable options (this is what applications are usually interested in)

`GST_TOC_SCOPE_CURRENT` (2) –

TOC for the currently active/selected stream (this is a TOC representing the current stream from start to EOS, and is what a TOC writer / muxer is usually interested in; it will usually be a subset of the global TOC, e.g. just the chapters of the current title, or the chapters selected for playback from the current title)

### Gst.TocScope

The scope of a TOC.

##### Members

`Gst.TocScope.GLOBAL` (1) –

global TOC representing all selectable options (this is what applications are usually interested in)

`Gst.TocScope.CURRENT` (2) –

TOC for the currently active/selected stream (this is a TOC representing the current stream from start to EOS, and is what a TOC writer / muxer is usually interested in; it will usually be a subset of the global TOC, e.g. just the chapters of the current title, or the chapters selected for playback from the current title)

### Gst.TocScope

The scope of a TOC.

##### Members

`Gst.TocScope.GLOBAL` (1) –

global TOC representing all selectable options (this is what applications are usually interested in)

`Gst.TocScope.CURRENT` (2) –

TOC for the currently active/selected stream (this is a TOC representing the current stream from start to EOS, and is what a TOC writer / muxer is usually interested in; it will usually be a subset of the global TOC, e.g. just the chapters of the current title, or the chapters selected for playback from the current title)

## Constants

The results of the search are