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 |
A BaseEffect
is some operation that applies an effect to the data
it receives.
Time Effects
Some operations will change the timing of the stream data they receive
in some way. In particular, the Element
that they wrap could alter
the times of the segment they receive in a GST_EVENT_SEGMENT
event,
or the times of a seek they receive in a GST_EVENT_SEEK
event. Such
operations would be considered time effects since they translate the
times they receive on their source to different times at their sink,
and vis versa. This introduces two sets of time coordinates for the
event: (internal) sink coordinates and (internal) source coordinates,
where segment times are translated from the sink coordinates to the
source coordinates, and seek times are translated from the source
coordinates to the sink coordinates.
If you use such an effect in GES, you will need to inform GES of the
properties that control the timing with
baseEffectRegisterTimeProperty
, and the effect's timing
behaviour using baseEffectSetTimeTranslationFuncs
.
Note that a time effect should not have its
TrackElement:hasInternalSource set to True
.
In addition, note that GES only *fully* supports time effects whose mapping from the source to sink coordinates (those applied to seeks) obeys:
+ Maps the time 0
to 0
. So initial time-shifting effects are
excluded.
+ Is monotonically increasing. So reversing effects, and effects that
jump backwards in the stream are excluded.
+ Can handle a reasonable GstClockTime
, relative to the project. So
this would exclude a time effect with an extremely large speed-up
that would cause the converted GstClockTime
seeks to overflow.
+ Is 'continuously reversible'. This essentially means that for every
time in the sink coordinates, we can, to 'good enough' accuracy,
calculate the corresponding time in the source coordinates. Moreover,
this should correspond to how segment times are translated from
sink to source.
+ Only depends on the registered time properties, rather than the
state of the Element
or the data it receives. This would exclude,
say, an effect that would speedup if there is more red in the image
it receives.
Note that a constant-rate-change effect that is not extremely fast or
slow would satisfy these conditions. For such effects, you may wish to
use effectClassRegisterRateProperty
.
Synopsis
- newtype BaseEffect = BaseEffect (ManagedPtr BaseEffect)
- class (GObject o, IsDescendantOf BaseEffect o) => IsBaseEffect o
- toBaseEffect :: (MonadIO m, IsBaseEffect o) => o -> m BaseEffect
- baseEffectIsTimeEffect :: (HasCallStack, MonadIO m, IsBaseEffect a) => a -> m Bool
- baseEffectRegisterTimeProperty :: (HasCallStack, MonadIO m, IsBaseEffect a) => a -> Text -> m Bool
- baseEffectSetTimeTranslationFuncs :: (HasCallStack, MonadIO m, IsBaseEffect a) => a -> Maybe BaseEffectTimeTranslationFunc -> Maybe BaseEffectTimeTranslationFunc -> m Bool
Exported types
newtype BaseEffect Source #
Memory-managed wrapper type.
BaseEffect (ManagedPtr BaseEffect) |
Instances
Eq BaseEffect Source # | |
Defined in GI.GES.Objects.BaseEffect (==) :: BaseEffect -> BaseEffect -> Bool # (/=) :: BaseEffect -> BaseEffect -> Bool # | |
GObject BaseEffect Source # | |
Defined in GI.GES.Objects.BaseEffect | |
ManagedPtrNewtype BaseEffect Source # | |
Defined in GI.GES.Objects.BaseEffect toManagedPtr :: BaseEffect -> ManagedPtr BaseEffect | |
TypedObject BaseEffect Source # | |
Defined in GI.GES.Objects.BaseEffect | |
HasParentTypes BaseEffect Source # | |
Defined in GI.GES.Objects.BaseEffect | |
IsGValue (Maybe BaseEffect) Source # | Convert |
Defined in GI.GES.Objects.BaseEffect gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe BaseEffect -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe BaseEffect) | |
type ParentTypes BaseEffect Source # | |
Defined in GI.GES.Objects.BaseEffect type ParentTypes BaseEffect = '[Operation, TrackElement, TimelineElement, Object, Extractable, MetaContainer] |
class (GObject o, IsDescendantOf BaseEffect o) => IsBaseEffect o Source #
Type class for types which can be safely cast to BaseEffect
, for instance with toBaseEffect
.
Instances
(GObject o, IsDescendantOf BaseEffect o) => IsBaseEffect o Source # | |
Defined in GI.GES.Objects.BaseEffect |
toBaseEffect :: (MonadIO m, IsBaseEffect o) => o -> m BaseEffect Source #
Cast to BaseEffect
, 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
Methods
addChildProperty, addChildrenProps, addMetasFromString, bindProperty, bindPropertyFull, checkMetaRegistered, clampControlSource, copy, edit, editFull, forceFloating, foreach, freezeNotify, getv, hasInternalSource, isActive, isCore, isFloating, isTimeEffect, listChildrenProperties, lookupChild, metasToString, notify, notifyByPspec, paste, ref, refSink, registerMeta, registerMetaBoolean, registerMetaDate, registerMetaDateTime, registerMetaDouble, registerMetaFloat, registerMetaInt, registerMetaInt64, registerMetaString, registerMetaUint, registerMetaUint64, registerStaticMeta, registerTimeProperty, removeChildProperty, removeControlBinding, ripple, rippleEnd, rollEnd, rollStart, runDispose, stealData, stealQdata, thawNotify, trim, unref, watchClosure.
Getters
getAllControlBindings, getAsset, getAutoClampControlSources, getBoolean, getChildProperty, getChildPropertyByPspec, getControlBinding, getData, getDate, getDateTime, getDouble, getDuration, getElement, getFloat, getGnlobject, getId, getInpoint, getInt, getInt64, getLayerPriority, getMarkerList, getMaxDuration, getMeta, getName, getNaturalFramerate, getNleobject, getParent, getPriority, getProperty, getQdata, getStart, getString, getTimeline, getToplevelParent, getTrack, getTrackType, getTrackTypes, getUint, getUint64.
Setters
setActive, setAsset, setAutoClampControlSources, setBoolean, setChildProperty, setChildPropertyByPspec, setChildPropertyFull, setControlSource, setData, setDataFull, setDate, setDateTime, setDouble, setDuration, setFloat, setHasInternalSource, setInpoint, setInt, setInt64, setMarkerList, setMaxDuration, setMeta, setName, setParent, setPriority, setProperty, setStart, setString, setTimeTranslationFuncs, setTimeline, setTrackType, setUint, setUint64.
isTimeEffect
baseEffectIsTimeEffect Source #
:: (HasCallStack, MonadIO m, IsBaseEffect a) | |
=> a |
|
-> m Bool | Returns: |
Get whether the effect is considered a time effect or not. An effect with registered time properties or set translation functions is considered a time effect.
Since: 1.18
registerTimeProperty
baseEffectRegisterTimeProperty Source #
:: (HasCallStack, MonadIO m, IsBaseEffect a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Register a child property of the effect as a property that, when set,
can change the timing of its input data. The child property should be
specified as in timelineElementLookupChild
.
You should also set the corresponding time translation using
baseEffectSetTimeTranslationFuncs
.
Note that effect
must not be part of a clip, nor can it have
TrackElement:hasInternalSource set to True
.
Since: 1.18
setTimeTranslationFuncs
baseEffectSetTimeTranslationFuncs Source #
:: (HasCallStack, MonadIO m, IsBaseEffect a) | |
=> a |
|
-> Maybe BaseEffectTimeTranslationFunc |
|
-> Maybe BaseEffectTimeTranslationFunc |
|
-> m Bool | Returns: |
Set the time translation query functions for the time effect. If an
effect is a time effect, it will have two sets of coordinates: one
at its sink and one at its source. The given functions should be able
to translate between these two sets of coordinates. More specifically,
sourceToSinkFunc
should *emulate* how the corresponding Element
would translate the Segment
time
field, and sinkToSourceFunc
should emulate how the corresponding Element
would translate the
seek query start
and stop
values, as used in elementSeek
. As
such, sinkToSourceFunc
should act as an approximate reverse of
sourceToSinkFunc
.
Note, these functions will be passed a table of time properties, as
registered in baseEffectRegisterTimeProperty
, and their
values. The functions should emulate what the translation *would* be
*if* the time properties were set to the given values. They should not
use the currently set values.
Note that effect
must not be part of a clip, nor can it have
TrackElement:hasInternalSource set to True
.
Since: 1.18