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.BaseEffect

Description

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

Exported types

newtype BaseEffect Source #

Memory-managed wrapper type.

Constructors

BaseEffect (ManagedPtr BaseEffect) 

Instances

Instances details
Eq BaseEffect Source # 
Instance details

Defined in GI.GES.Objects.BaseEffect

GObject BaseEffect Source # 
Instance details

Defined in GI.GES.Objects.BaseEffect

ManagedPtrNewtype BaseEffect Source # 
Instance details

Defined in GI.GES.Objects.BaseEffect

Methods

toManagedPtr :: BaseEffect -> ManagedPtr BaseEffect

TypedObject BaseEffect Source # 
Instance details

Defined in GI.GES.Objects.BaseEffect

Methods

glibType :: IO GType

HasParentTypes BaseEffect Source # 
Instance details

Defined in GI.GES.Objects.BaseEffect

IsGValue (Maybe BaseEffect) Source #

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

Instance details

Defined in GI.GES.Objects.BaseEffect

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes BaseEffect Source # 
Instance details

Defined in GI.GES.Objects.BaseEffect

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

Instances details
(GObject o, IsDescendantOf BaseEffect o) => IsBaseEffect o Source # 
Instance details

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

Expand

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 #

Arguments

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

effect: A BaseEffect

-> m Bool

Returns: True if effect is considered a time effect.

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 #

Arguments

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

effect: A BaseEffect

-> Text

childPropertyName: The name of the child property to register as a time property

-> m Bool

Returns: True if the child property was found and newly registered.

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 #

Arguments

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

effect: A BaseEffect

-> Maybe BaseEffectTimeTranslationFunc

sourceToSinkFunc: The function to use for querying how a time is translated from the source coordinates to the sink coordinates of effect

-> Maybe BaseEffectTimeTranslationFunc

sinkToSourceFunc: The function to use for querying how a time is translated from the sink coordinates to the source coordinates of effect

-> m Bool

Returns: True if the translation functions were set.

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