Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype Track = Track (ManagedPtr Track)
- class (GObject o, IsDescendantOf Track o) => IsTrack o
- toTrack :: (MonadIO m, IsTrack o) => o -> m Track
- trackAddElement :: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) => a -> b -> m Bool
- trackAddElementFull :: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) => a -> b -> m ()
- trackCommit :: (HasCallStack, MonadIO m, IsTrack a) => a -> m Bool
- trackGetCaps :: (HasCallStack, MonadIO m, IsTrack a) => a -> m (Maybe Caps)
- trackGetElements :: (HasCallStack, MonadIO m, IsTrack a) => a -> m [TrackElement]
- trackGetMixing :: (HasCallStack, MonadIO m, IsTrack a) => a -> m Bool
- trackGetRestrictionCaps :: (HasCallStack, MonadIO m, IsTrack a) => a -> m (Maybe Caps)
- trackGetTimeline :: (HasCallStack, MonadIO m, IsTrack a) => a -> m (Maybe Timeline)
- trackNew :: (HasCallStack, MonadIO m) => [TrackType] -> Caps -> m Track
- trackRemoveElement :: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) => a -> b -> m Bool
- trackRemoveElementFull :: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) => a -> b -> m ()
- trackSetMixing :: (HasCallStack, MonadIO m, IsTrack a) => a -> Bool -> m ()
- trackSetRestrictionCaps :: (HasCallStack, MonadIO m, IsTrack a) => a -> Caps -> m ()
- trackSetTimeline :: (HasCallStack, MonadIO m, IsTrack a, IsTimeline b) => a -> b -> m ()
- trackUpdateRestrictionCaps :: (HasCallStack, MonadIO m, IsTrack a) => a -> Caps -> m ()
- constructTrackCaps :: (IsTrack o, MonadIO m) => Caps -> m (GValueConstruct o)
- getTrackCaps :: (MonadIO m, IsTrack o) => o -> m (Maybe Caps)
- getTrackDuration :: (MonadIO m, IsTrack o) => o -> m Word64
- clearTrackId :: (MonadIO m, IsTrack o) => o -> m ()
- constructTrackId :: (IsTrack o, MonadIO m) => Text -> m (GValueConstruct o)
- getTrackId :: (MonadIO m, IsTrack o) => o -> m (Maybe Text)
- setTrackId :: (MonadIO m, IsTrack o) => o -> Text -> m ()
- constructTrackMixing :: (IsTrack o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTrackMixing :: (MonadIO m, IsTrack o) => o -> m Bool
- setTrackMixing :: (MonadIO m, IsTrack o) => o -> Bool -> m ()
- constructTrackRestrictionCaps :: (IsTrack o, MonadIO m) => Caps -> m (GValueConstruct o)
- getTrackRestrictionCaps :: (MonadIO m, IsTrack o) => o -> m (Maybe Caps)
- setTrackRestrictionCaps :: (MonadIO m, IsTrack o) => o -> Caps -> m ()
- constructTrackTrackType :: (IsTrack o, MonadIO m) => [TrackType] -> m (GValueConstruct o)
- getTrackTrackType :: (MonadIO m, IsTrack o) => o -> m [TrackType]
- type TrackCommitedCallback = IO ()
- afterTrackCommited :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackCommitedCallback) -> m SignalHandlerId
- onTrackCommited :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackCommitedCallback) -> m SignalHandlerId
- type TrackTrackElementAddedCallback = TrackElement -> IO ()
- afterTrackTrackElementAdded :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementAddedCallback) -> m SignalHandlerId
- onTrackTrackElementAdded :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementAddedCallback) -> m SignalHandlerId
- type TrackTrackElementRemovedCallback = TrackElement -> IO ()
- afterTrackTrackElementRemoved :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementRemovedCallback) -> m SignalHandlerId
- onTrackTrackElementRemoved :: (IsTrack a, MonadIO m) => a -> ((?self :: a) => TrackTrackElementRemovedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Track Source # | |
GObject Track Source # | |
Defined in GI.GES.Objects.Track | |
ManagedPtrNewtype Track Source # | |
Defined in GI.GES.Objects.Track Methods toManagedPtr :: Track -> ManagedPtr Track | |
TypedObject Track Source # | |
Defined in GI.GES.Objects.Track | |
HasParentTypes Track Source # | |
Defined in GI.GES.Objects.Track | |
IsGValue (Maybe Track) Source # | Convert |
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 # | |
Defined in GI.GES.Objects.Track |
class (GObject o, IsDescendantOf Track o) => IsTrack o Source #
Instances
(GObject o, IsDescendantOf Track o) => IsTrack o Source # | |
Defined in GI.GES.Objects.Track |
Methods
Click to display all available methods, including inherited ones
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
Arguments
:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
See trackAddElement
, which also gives an error.
addElementFull
Arguments
:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
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
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> m Bool | Returns: |
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
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> m (Maybe Caps) | Returns: The caps of |
Get the Track:caps of the track.
getElements
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> m [TrackElement] | Returns: A list of
all the |
Gets the track elements contained in the track. The returned list is sorted by the element's TimelineElement:priority and TimelineElement:start.
getMixing
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> m Bool | Returns: Whether |
Gets the Track:mixing of the track.
getRestrictionCaps
trackGetRestrictionCaps Source #
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> m (Maybe Caps) | Returns: The restriction-caps of |
Gets the Track:restrictionCaps of the track.
Since: 1.18
getTimeline
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> m (Maybe Timeline) | Returns: The timeline that |
Get the timeline this track belongs to.
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> [TrackType] |
|
-> Caps |
|
-> 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
Arguments
:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
See trackRemoveElementFull
, which also returns an error.
removeElementFull
trackRemoveElementFull Source #
Arguments
:: (HasCallStack, MonadIO m, IsTrack a, IsTrackElement b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Removes the given track element from the track, which revokes ownership of the element.
Since: 1.18
setMixing
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the Track:mixing for the track.
setRestrictionCaps
trackSetRestrictionCaps Source #
Arguments
:: (HasCallStack, MonadIO m, IsTrack a) | |
=> a |
|
-> Caps |
|
-> 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
Arguments
:: (HasCallStack, MonadIO m, IsTrack a, IsTimeline b) | |
=> a | |
-> 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 |
|
-> Caps |
|
-> 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 |
|
-> 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 |
|
-> 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