GES.BaseEffect¶
- Subclasses:
Methods¶
- Inherited:
GES.TrackElement (22), GES.TimelineElement (38), GObject.Object (37), GES.Extractable (3), GES.MetaContainer (40)
- Structs:
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Signals¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class GES.BaseEffect(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
A
GES.BaseEffectis 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
Gst.Elementthat they wrap could alter the times of the segment they receive in aGst.EventType.SEGMENTevent, or the times of a seek they receive in aGst.EventType.SEEKevent. 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
GES.BaseEffect.register_time_property(), and the effect’s timing behaviour usingGES.BaseEffect.set_time_translation_funcs().Note that a time effect should not have its
GES.TrackElement:has-internal-sourceset toTrue.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
0to0. 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
Gst.Elementor 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
GES.EffectClass.register_rate_property().- is_time_effect()[source]¶
-
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.
New in version 1.18.
- register_time_property(child_property_name)[source]¶
- Parameters:
child_property_name (
str) – The name of the child property to register as a time property- Returns:
Trueif the child property was found and newly registered.- Return type:
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
GES.TimelineElement.lookup_child().You should also set the corresponding time translation using
GES.BaseEffect.set_time_translation_funcs().Note that self must not be part of a clip, nor can it have
GES.TrackElement:has-internal-sourceset toTrue.New in version 1.18.
- set_time_translation_funcs(source_to_sink_func, sink_to_source_func)[source]¶
- Parameters:
source_to_sink_func (
GES.BaseEffectTimeTranslationFuncorNone) – The function to use for querying how a time is translated from the source coordinates to the sink coordinates of selfsink_to_source_func (
GES.BaseEffectTimeTranslationFuncorNone) – The function to use for querying how a time is translated from the sink coordinates to the source coordinates of self
- Returns:
Trueif the translation functions were set.- Return type:
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, source_to_sink_func should *emulate* how the corresponding
Gst.Elementwould translate theGst.Segmenttime field, and sink_to_source_func should emulate how the correspondingGst.Elementwould translate the seek query start and stop values, as used inGst.Element.seek(). As such, sink_to_source_func should act as an approximate reverse of source_to_sink_func.Note, these functions will be passed a table of time properties, as registered in
GES.BaseEffect.register_time_property(), 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 self must not be part of a clip, nor can it have
GES.TrackElement:has-internal-sourceset toTrue.New in version 1.18.