GES.Track

g GES.MetaContainer GES.MetaContainer GES.Track GES.Track GES.MetaContainer->GES.Track GObject.GInterface GObject.GInterface GObject.GInterface->GES.MetaContainer Gst.ChildProxy Gst.ChildProxy GObject.GInterface->Gst.ChildProxy GObject.Object GObject.Object GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.Object->GObject.InitiallyUnowned Gst.Bin Gst.Bin Gst.Bin->GES.Track Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object Gst.Element Gst.Element Gst.Element->Gst.Bin Gst.ChildProxy->Gst.Bin Gst.Object->Gst.Element

Subclasses:GES.AudioTrack, GES.VideoTrack

Properties

Inherited:Gst.Bin (2), Gst.Object (2)
Name Type Flags Short Description
caps Gst.Caps r/w/co Caps used to filter/choose the output stream
duration int r The current duration of the track
mixing bool r/w/c Whether layer mixing is activated on the track or not
restriction-caps Gst.Caps r/w Caps used to filter/choose the output stream
track-type GES.TrackType r/w/co Type of stream the track outputs

Signals

Inherited:Gst.Bin (5), Gst.Element (3), Gst.Object (1), GObject.Object (1), Gst.ChildProxy (2), GES.MetaContainer (1)
Name Short Description
commited  
track-element-added Will be emitted after a track element was added to the track.
track-element-removed Will be emitted after a track element was removed from the track.

Fields

Inherited:Gst.Bin (5), Gst.Element (3), Gst.Object (1), GObject.Object (1), Gst.ChildProxy (2), GES.MetaContainer (1)
Name Type Access Description
parent Gst.Bin r  
type GES.TrackType r a GES.TrackType indicting the basic type of the track.

Class Details

class GES.Track(**kwargs)
Bases:Gst.Bin, GES.MetaContainer
Abstract:No
Structure:GES.TrackClass

Corresponds to one output format (i.e. audio OR video).

Contains the compatible TrackElement(s).

classmethod new(type, caps)[source]
Parameters:
  • type (GES.TrackType) – The type of track
  • caps (Gst.Caps) – The caps to restrict the output of the track to.
Returns:

A new GES.Track.

Return type:

GES.Track

Creates a new GES.Track with the given type and caps.

The newly created track will steal a reference to the caps. If you wish to use those caps elsewhere, you will have to take an extra reference.

add_element(object)[source]
Parameters:object (GES.TrackElement) – the GES.TrackElement to add
Returns:True if the object was properly added. False if the track does not want to accept the object.
Return type:bool

Adds the given object to the track. Sets the object’s controlling track, and thus takes ownership of the object.

An object can only be added to one track.

commit()[source]
Returns:True if something as been commited False if nothing needed to be commited
Return type:bool

Commits all the pending changes of the TrackElement contained in the track.

When timing changes happen in a timeline, the changes are not directly done inside NLE. This method needs to be called so any changes on a clip contained in the timeline actually happen at the media processing level.

get_caps()[source]
Returns:The Gst.Caps this track is configured to output.
Return type:Gst.Caps

Get the Gst.Caps this track is configured to output.

get_elements()[source]
Returns:the list of GES.TrackElement present in the Track sorted by priority and start.
Return type:[GES.TrackElement]

Gets the GES.TrackElement contained in self

get_mixing()[source]
Returns:#True if there is a mixer, #False otherwise.
Return type:bool

Gets if the underlying #NleComposition contains an expandable mixer.

get_timeline()[source]
Returns:The GES.Timeline this track belongs to. Can be None.
Return type:GES.Timeline or None

Get the GES.Timeline this track belongs to. Can be None.

remove_element(object)[source]
Parameters:object (GES.TrackElement) – the GES.TrackElement to remove
Returns:True if the object was removed, else False if the track could not remove the object (like if it didn’t belong to the track).
Return type:bool

Removes the object from the track and unparents it. Unparenting it means the reference owned by self on the object will be removed. If you wish to use the object after this function, make sure you call Gst.Object.ref() before removing it from the self.

set_mixing(mixing)[source]
Parameters:mixing (bool) – True if the track should be mixing, False otherwise.

Sets if the GES.Track should be mixing.

set_restriction_caps(caps)[source]
Parameters:caps (Gst.Caps) – the Gst.Caps to set

Sets the given caps as the caps the track has to output.

set_timeline(timeline)[source]
Parameters:timeline (GES.Timeline) – a GES.Timeline

Sets timeline as the timeline controlling self.

update_restriction_caps(caps)[source]
Parameters:caps (Gst.Caps) – the Gst.Caps to update with

Updates the restriction caps by modifying all the fields present in caps in the original restriction caps. If for example the current restriction caps are video/x-raw, format=I420, width=360 and caps is video/x-raw, format=RGB, the restriction caps will be updated to video/x-raw, format=RGB, width=360.

Modification happens for each structure in the new caps, and one can add new fields or structures through that function.

Signal Details

GES.Track.signals.commited(track)
Signal Name:commited
Flags:RUN_LAST
Parameters:track (GES.Track) – The object which received the signal
GES.Track.signals.track_element_added(track, effect)
Signal Name:

track-element-added

Flags:

RUN_FIRST

Parameters:

Will be emitted after a track element was added to the track.

GES.Track.signals.track_element_removed(track, effect)
Signal Name:

track-element-removed

Flags:

RUN_FIRST

Parameters:

Will be emitted after a track element was removed from the track.

Property Details

GES.Track.props.caps
Name:caps
Type:Gst.Caps
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

Caps used to filter/choose the output stream. This is generally set to a generic set of caps like ‘video/x-raw’ for raw video.

Default value: #GST_CAPS_ANY.

GES.Track.props.duration
Name:duration
Type:int
Default Value:1000000000
Flags:READABLE

Current duration of the track

Default value: O

GES.Track.props.mixing
Name:mixing
Type:bool
Default Value:True
Flags:READABLE, WRITABLE, CONSTRUCT

Whether layer mixing is activated or not on the track.

GES.Track.props.restriction_caps
Name:restriction-caps
Type:Gst.Caps
Default Value:None
Flags:READABLE, WRITABLE

Caps used to filter/choose the output stream.

Default value: #GST_CAPS_ANY.

GES.Track.props.track_type
Name:track-type
Type:GES.TrackType
Default Value:GES.TrackType.CUSTOM
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

Type of stream the track outputs. This is used when creating the GES.Track to specify in generic terms what type of content will be outputted.

It also serves as a ‘fast’ way to check what type of data will be outputted from the GES.Track without having to actually check the GES.Track‘s caps property.