Gst.Toc¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gst.Toc¶
Gst.Toc
functions are used to create/freeGst.Toc
andGst.TocEntry
structures. Also they are used to convertGst.Toc
intoGst.Structure
and vice versa.Gst.Toc
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
Gst.Toc
structure which represents root contents of the source. You can also attach TOC-specific tags to it. Then fill it withGst.TocEntry
entries by appending them to theGst.Toc
usingGst.Toc.append_entry
(), and appending subentries to aGst.TocEntry
usingGst.TocEntry.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 TOCGst.Event
, andGst.Event.parse_toc
() to parse received TOC event. UseGst.Event.new_toc_select
() to create a new TOC selectGst.Event
, andGst.Event.parse_toc_select
() to parse received TOC select event. The same rule for theGst.Message
:Gst.Message.new_toc
() to create new TOCGst.Message
, andGst.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).
- classmethod new(scope)[source]¶
- Parameters:
scope (
Gst.TocScope
) – scope of this TOC- Returns:
newly allocated
Gst.Toc
structure, free it with gst_toc_unref().- Return type:
Create a new
Gst.Toc
structure.
- append_entry(entry)[source]¶
- Parameters:
entry (
Gst.TocEntry
) – AGst.TocEntry
Appends the
Gst.TocEntry
entry to self.
- find_entry(uid)[source]¶
- Parameters:
uid (
str
) – UID to findGst.TocEntry
with.- Returns:
Gst.TocEntry
with specified uid from the self, orNone
if not found.- Return type:
Gst.TocEntry
orNone
Find
Gst.TocEntry
with given uid in the self.
- get_entries()[source]¶
- Returns:
A
GLib.List
ofGst.TocEntry
for entry- Return type:
Gets the list of
Gst.TocEntry
of self.
- get_tags()[source]¶
- Returns:
A
Gst.TagList
for entry- Return type:
Gst.TagList
orNone
Gets the tags for self.
- merge_tags(tags, mode)[source]¶
- Parameters:
tags (
Gst.TagList
orNone
) – AGst.TagList
orNone
mode (
Gst.TagMergeMode
) – AGst.TagMergeMode
Merge tags into the existing tags of self using mode.
- set_tags(tags)[source]¶
- Parameters:
tags (
Gst.TagList
orNone
) – AGst.TagList
orNone
Set a
Gst.TagList
with tags for the complete self.