gi-ges-1.0.4: libges bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GES.Objects.Track

Description

A Track acts an output source for a Timeline. Each one essentially provides an additional Pad for the timeline, with Track:restrictionCaps capabilities. Internally, a track wraps an nlecomposition filtered by a capsfilter.

A track will contain a number of TrackElement-s, and its role is to select and activate these elements according to their timings when the timeline in played. For example, a track would activate a Source when its TimelineElement:start is reached by outputting its data for its TimelineElement:duration. Similarly, a Operation would be activated by applying its effect to the source data, starting from its TimelineElement:start time and lasting for its TimelineElement:duration.

For most users, it will usually be sufficient to add newly created tracks to a timeline, but never directly add an element to a track. Whenever a Clip is added to a timeline, the clip adds its elements to the timeline's tracks and assumes responsibility for updating them.

Synopsis

Exported types

newtype Track Source #

Memory-managed wrapper type.

Constructors

Track (ManagedPtr Track) 

Instances

Instances details
Eq Track Source # 
Instance details

Defined in GI.GES.Objects.Track

Methods

(==) :: Track -> Track -> Bool #

(/=) :: Track -> Track -> Bool #

GObject Track Source # 
Instance details

Defined in GI.GES.Objects.Track

ManagedPtrNewtype Track Source # 
Instance details

Defined in GI.GES.Objects.Track

Methods

toManagedPtr :: Track -> ManagedPtr Track

TypedObject Track Source # 
Instance details

Defined in GI.GES.Objects.Track

Methods

glibType :: IO GType

HasParentTypes Track Source # 
Instance details

Defined in GI.GES.Objects.Track

IsGValue (Maybe Track) Source #

Convert Track to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GES.Objects.Track

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Track -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Track)

type ParentTypes Track Source # 
Instance details

Defined in GI.GES.Objects.Track

type ParentTypes Track = '[Bin, Element, Object, Object, MetaContainer, ChildProxy]

class (GObject o, IsDescendantOf Track o) => IsTrack o Source #

Type class for types which can be safely cast to Track, for instance with toTrack.

Instances

Instances details
(GObject o, IsDescendantOf Track o) => IsTrack o Source # 
Instance details

Defined in GI.GES.Objects.Track

toTrack :: (MonadIO m, IsTrack o) => o -> m Track Source #

Cast to Track, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

abortState, add, addControlBinding, addElement, addElementFull, addMetasFromString, addPad, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, bindProperty, bindPropertyFull, callAsync, changeState, checkMetaRegistered, childAdded, childRemoved, commit, continueState, createAllPads, defaultError, findUnlinkedPad, forceFloating, foreach, foreachPad, foreachSinkPad, foreachSrcPad, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, isFloating, isLockedState, iterateAllByElementFactoryName, iterateAllByInterface, iterateElements, iteratePads, iterateRecurse, iterateSinkPads, iterateSinks, iterateSorted, iterateSources, iterateSrcPads, link, linkFiltered, linkPads, linkPadsFiltered, linkPadsFull, lookup, lostState, messageFull, messageFullWithDetails, metasToString, noMorePads, notify, notifyByPspec, postMessage, provideClock, query, queryConvert, queryDuration, queryPosition, recalculateLatency, ref, refSink, registerMeta, registerMetaBoolean, registerMetaDate, registerMetaDateTime, registerMetaDouble, registerMetaFloat, registerMetaInt, registerMetaInt64, registerMetaString, registerMetaUint, registerMetaUint64, registerStaticMeta, releaseRequestPad, remove, removeControlBinding, removeElement, removeElementFull, removePad, removePropertyNotifyWatch, requestPad, requestPadSimple, runDispose, seek, seekSimple, sendEvent, stealData, stealQdata, suggestNextSync, syncChildrenStates, syncStateWithParent, syncValues, thawNotify, unlink, unlinkPads, unparent, unref, updateRestrictionCaps, watchClosure.

Getters

getBaseTime, getBoolean, getBus, getByInterface, getByName, getByNameRecurseUp, getCaps, getChildByIndex, getChildByName, getChildByNameRecurse, getChildrenCount, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContextUnlocked, getContexts, getControlBinding, getControlRate, getCurrentClockTime, getCurrentRunningTime, getData, getDate, getDateTime, getDouble, getElements, getFactory, getFloat, getGValueArray, getInt, getInt64, getMarkerList, getMeta, getMetadata, getMixing, getName, getPadTemplate, getPadTemplateList, getParent, getPathString, getProperty, getQdata, getRequestPad, getRestrictionCaps, getStartTime, getState, getStaticPad, getString, getSuppressedFlags, getTimeline, getUint, getUint64, getValue.

Setters

setBaseTime, setBoolean, setBus, setClock, setContext, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setDate, setDateTime, setDouble, setFloat, setInt, setInt64, setLockedState, setMarkerList, setMeta, setMixing, setName, setParent, setProperty, setRestrictionCaps, setStartTime, setState, setString, setSuppressedFlags, setTimeline, setUint, setUint64.

addElement

trackAddElement Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) 
=> a

track: A Track

-> b

object: The element to add

-> m Bool

Returns: True if object was successfully added to track.

See trackAddElement, which also gives an error.

addElementFull

trackAddElementFull Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) 
=> a

track: A Track

-> b

object: The element to add

-> m ()

(Can throw GError)

Adds the given track element to the track, which takes ownership of the element.

Note that this can fail if it would break a configuration rule of the track's Timeline.

Note that a TrackElement can only be added to one track.

Since: 1.18

commit

trackCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> m Bool

Returns: True if pending changes were committed, or False if nothing needed to be committed.

Commits all the pending changes for the elements contained in the track.

When changes are made to the timing or priority of elements within a track, they are not directly executed for the underlying nlecomposition and its children. This method will finally execute these changes so they are reflected in the data output of the track.

Any pending changes will be executed in the backend. The Timeline::commited signal will be emitted once this has completed.

Note that timelineCommit will call this method on all of its tracks, so you are unlikely to need to use this directly.

getCaps

trackGetCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> m (Maybe Caps)

Returns: The caps of track.

Get the Track:caps of the track.

getElements

trackGetElements Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> m [TrackElement]

Returns: A list of all the TrackElement-s in track.

Gets the track elements contained in the track. The returned list is sorted by the element's TimelineElement:priority and TimelineElement:start.

getMixing

trackGetMixing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> m Bool

Returns: Whether track is mixing.

Gets the Track:mixing of the track.

getRestrictionCaps

trackGetRestrictionCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> m (Maybe Caps)

Returns: The restriction-caps of track.

Gets the Track:restrictionCaps of the track.

Since: 1.18

getTimeline

trackGetTimeline Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> m (Maybe Timeline)

Returns: The timeline that track belongs to, or Nothing if it does not belong to a timeline.

Get the timeline this track belongs to.

new

trackNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [TrackType]

type: The Track:trackType for the track

-> Caps

caps: The Track:caps for the track

-> m Track

Returns: A new track.

Creates a new track with the given track-type and caps.

If type is GES_TRACK_TYPE_VIDEO, and caps is a subset of "video/x-raw(ANY)", then a VideoTrack is created. This will automatically choose a gap creation method suitable for video data. You will likely want to set Track:restrictionCaps separately. You may prefer to use the videoTrackNew method instead.

If type is GES_TRACK_TYPE_AUDIO, and caps is a subset of "audio/x-raw(ANY)", then a AudioTrack is created. This will automatically choose a gap creation method suitable for audio data, and will set the Track:restrictionCaps to the default for AudioTrack. You may prefer to use the audioTrackNew method instead.

Otherwise, a plain Track is returned. You will likely want to set the Track:restrictionCaps and call ges_track_set_create_element_for_gap_func() on the returned track.

removeElement

trackRemoveElement Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) 
=> a

track: A Track

-> b

object: The element to remove

-> m Bool

Returns: True if object was successfully removed from track.

See trackRemoveElementFull, which also returns an error.

removeElementFull

trackRemoveElementFull Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) 
=> a

track: A Track

-> b

object: The element to remove

-> m ()

(Can throw GError)

Removes the given track element from the track, which revokes ownership of the element.

Since: 1.18

setMixing

trackSetMixing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> Bool

mixing: Whether track should be mixing

-> m () 

Sets the Track:mixing for the track.

setRestrictionCaps

trackSetRestrictionCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> Caps

caps: The new restriction-caps for track

-> m () 

Sets the Track:restrictionCaps for the track.

**NOTE**: Restriction caps are **not** taken into account when
using [Pipeline:mode]("GI.GES.Objects.Pipeline#g:attr:mode")=@/GES_PIPELINE_MODE_SMART_RENDER/@.

setTimeline

trackSetTimeline Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a, IsTimeline b) 
=> a

track: A Track timeline (nullable): A Timeline

-> b 
-> m () 

Informs the track that it belongs to the given timeline. Calling this does not actually add the track to the timeline. For that, you should use timelineAddTrack, which will also take care of informing the track that it belongs to the timeline. As such, there is no need for you to call this method.

updateRestrictionCaps

trackUpdateRestrictionCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsTrack a) 
=> a

track: A Track

-> Caps

caps: The caps to update the restriction-caps with

-> m () 

Updates the Track:restrictionCaps of the track using the fields found in the given caps. Each of the Structure-s in caps is compared against the existing structure with the same index in the current Track:restrictionCaps. If there is no corresponding existing structure at that index, then the new structure is simply copied to that index. Otherwise, any fields in the new structure are copied into the existing structure. This will replace existing values, and may introduce new ones, but any fields 'missing' in the new structure are left unchanged in the existing structure.

For example, if the existing Track:restrictionCaps are "video/x-raw, width=480, height=360", and the updating caps is "video/x-raw, format=I420, width=500; video/x-bayer, width=400", then the new Track:restrictionCaps after calling this will be "video/x-raw, width=500, height=360, format=I420; video/x-bayer, width=400".

Properties

caps

The capabilities used to choose the output of the Track's elements. Internally, this is used to select output streams when several may be available, by determining whether its Pad is compatible (see NleObject:caps for nlecomposition). As such, this is used as a weaker indication of the desired output type of the track, **before** the Track:restrictionCaps is applied. Therefore, this should be set to a *generic* superset of the Track:restrictionCaps, such as "video/x-raw(ANY)". In addition, it should match with the track's Track:trackType.

Note that when you set this property, the CapsFeatures of all its Structure-s will be automatically set to GST_CAPS_FEATURES_ANY.

Once a track has been added to a Timeline, you should not change this.

Default value: GST_CAPS_ANY.

constructTrackCaps :: (IsTrack o, MonadIO m) => Caps -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “caps” property. This is rarely needed directly, but it is used by new.

getTrackCaps :: (MonadIO m, IsTrack o) => o -> m (Maybe Caps) Source #

Get the value of the “caps” property. When overloading is enabled, this is equivalent to

get track #caps

duration

Current duration of the track

Default value: O

getTrackDuration :: (MonadIO m, IsTrack o) => o -> m Word64 Source #

Get the value of the “duration” property. When overloading is enabled, this is equivalent to

get track #duration

id

The nlecomposition:id of the underlying nlecomposition.

Since: 1.18

clearTrackId :: (MonadIO m, IsTrack o) => o -> m () Source #

Set the value of the “id” property to Nothing. When overloading is enabled, this is equivalent to

clear #id

constructTrackId :: (IsTrack o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “id” property. This is rarely needed directly, but it is used by new.

getTrackId :: (MonadIO m, IsTrack o) => o -> m (Maybe Text) Source #

Get the value of the “id” property. When overloading is enabled, this is equivalent to

get track #id

setTrackId :: (MonadIO m, IsTrack o) => o -> Text -> m () Source #

Set the value of the “id” property. When overloading is enabled, this is equivalent to

set track [ #id := value ]

mixing

Whether the track should support the mixing of Layer data, such as composing the video data of each layer (when part of the video data is transparent, the next layer will become visible) or adding together the audio data. As such, for audio and video tracks, you'll likely want to keep this set to True.

constructTrackMixing :: (IsTrack o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “mixing” property. This is rarely needed directly, but it is used by new.

getTrackMixing :: (MonadIO m, IsTrack o) => o -> m Bool Source #

Get the value of the “mixing” property. When overloading is enabled, this is equivalent to

get track #mixing

setTrackMixing :: (MonadIO m, IsTrack o) => o -> Bool -> m () Source #

Set the value of the “mixing” property. When overloading is enabled, this is equivalent to

set track [ #mixing := value ]

restrictionCaps

The capabilities that specifies the final output format of the Track. For example, for a video track, it would specify the height, width, framerate and other properties of the stream.

You may change this property after the track has been added to a Timeline, but it must remain compatible with the track's Track:caps.

Default value: GST_CAPS_ANY.

constructTrackRestrictionCaps :: (IsTrack o, MonadIO m) => Caps -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “restriction-caps” property. This is rarely needed directly, but it is used by new.

getTrackRestrictionCaps :: (MonadIO m, IsTrack o) => o -> m (Maybe Caps) Source #

Get the value of the “restriction-caps” property. When overloading is enabled, this is equivalent to

get track #restrictionCaps

setTrackRestrictionCaps :: (MonadIO m, IsTrack o) => o -> Caps -> m () Source #

Set the value of the “restriction-caps” property. When overloading is enabled, this is equivalent to

set track [ #restrictionCaps := value ]

trackType

The track type of the track. This controls the type of TrackElement-s that can be added to the track. This should match with the track's Track:caps.

Once a track has been added to a Timeline, you should not change this.

constructTrackTrackType :: (IsTrack o, MonadIO m) => [TrackType] -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “track-type” property. This is rarely needed directly, but it is used by new.

getTrackTrackType :: (MonadIO m, IsTrack o) => o -> m [TrackType] Source #

Get the value of the “track-type” property. When overloading is enabled, this is equivalent to

get track #trackType

Signals

commited

type TrackCommitedCallback = IO () Source #

This signal will be emitted once the changes initiated by trackCommit have been executed in the backend. In particular, this will be emitted whenever the underlying nlecomposition has been committed (see nlecomposition::commited).

afterTrackCommited :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackCommitedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the commited signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after track #commited callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onTrackCommited :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackCommitedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the commited signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on track #commited callback

trackElementAdded

type TrackTrackElementAddedCallback Source #

Arguments

 = TrackElement

effect: The element that was added

-> IO () 

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

afterTrackTrackElementAdded :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the trackElementAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after track #trackElementAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onTrackTrackElementAdded :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the trackElementAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on track #trackElementAdded callback

trackElementRemoved

type TrackTrackElementRemovedCallback Source #

Arguments

 = TrackElement

effect: The element that was removed

-> IO () 

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

afterTrackTrackElementRemoved :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the trackElementRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after track #trackElementRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onTrackTrackElementRemoved :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the trackElementRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on track #trackElementRemoved callback