GstTag.TagDemux¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
|
|
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
element |
r |
parent element |
|
reserved |
[ |
r |
Class Details¶
- class GstTag.TagDemux(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Provides a base class for demuxing tags at the beginning or end of a stream and handles things like typefinding, querying, seeking, and different modes of operation (chain-based, pull_range-based, and providing downstream elements with random access if upstream supports that). The tag is stripped from the output, and all offsets are adjusted for the tag sizes, so that to the downstream element the stream will appear as if there was no tag at all. Also, once the tag has been parsed,
GstTag.TagDemux
will try to determine the media type of the resulting stream and add a source pad with the appropriate caps in order to facilitate auto-plugging.- Deriving from
GstTag.TagDemux
Subclasses have to do four things:
In their base init function, they must add a pad template for the sink pad to the element class, describing the media type they can parse in the caps of the pad template.
In their class init function, they must override GST_TAG_DEMUX_CLASS(demux_klass)->identify_tag with their own identify function.
In their class init function, they must override GST_TAG_DEMUX_CLASS(demux_klass)->parse_tag with their own parse function.
In their class init function, they must also set GST_TAG_DEMUX_CLASS(demux_klass)->min_start_size and/or GST_TAG_DEMUX_CLASS(demux_klass)->min_end_size to the minimum size required for the identify function to decide whether the stream has a supported tag or not. A class parsing ID3v1 tags, for example, would set min_end_size to 128 bytes.
- do_identify_tag(buffer, start_tag, tag_size) virtual¶
- Parameters:
buffer (
Gst.Buffer
) –start_tag (
bool
) –tag_size (
int
) –
- Return type:
identify tag and determine the size required to parse the tag. Buffer may be larger than the specified minimum size. Subclassed MUST override this vfunc in their class_init function.
- do_merge_tags(start_tags, end_tags) virtual¶
- Parameters:
start_tags (
Gst.TagList
) –end_tags (
Gst.TagList
) –
- Return type:
merge start and end tags. Subclasses may want to override this vfunc to allow prioritising of start or end tag according to user preference. Note that both start_tags and end_tags may be
None
. By default start tags are preferred over end tags.
- do_parse_tag(buffer, start_tag, tag_size, tags) virtual¶
- Parameters:
buffer (
Gst.Buffer
) –start_tag (
bool
) –tag_size (
int
) –tags (
Gst.TagList
) –
- Return type:
parse the tag. Buffer will be exactly of the size determined by the identify_tag vfunc before. The parse_tag vfunc may change the size stored in *tag_size and return
GstTag.TagDemuxResult.AGAIN
to request a larger or smaller buffer. It is also permitted to adjust the tag_size to a smaller value and then returnGstTag.TagDemuxResult.OK
in one go. Subclassed MUST override the parse_tag vfunc in their class_init function.