Top | ![]() |
![]() |
![]() |
![]() |
GESTimelineElementGESTimelineElement — Base Class for all elements that will be in a way or another inside a GESTimeline. |
GObject ╰── GInitiallyUnowned ╰── GESTimelineElement ├── GESContainer ╰── GESTrackElement
The GESTimelineElement base class implements the notion of timing as well as priority. A GESTimelineElement can have a parent object which will be responsible for controlling its timing properties.
gboolean ges_timeline_element_set_parent (GESTimelineElement *self
,GESTimelineElement *parent
);
Sets the parent of self
to parent
. The object's reference count will
be incremented, and any floating reference will be removed (see gst_object_ref_sink()
).
GESTimelineElement *
ges_timeline_element_get_parent (GESTimelineElement *self
);
Returns the parent of self
. This function increases the refcount
of the parent object so you should gst_object_unref()
it after usage.
parent of self
, this can be NULL
if
self
has no parent. unref after usage.
[transfer full][nullable]
gboolean ges_timeline_element_set_timeline (GESTimelineElement *self
,GESTimeline *timeline
);
Sets the timeline of self
to timeline
.
GESTimeline *
ges_timeline_element_get_timeline (GESTimelineElement *self
);
Returns the timeline of self
. This function increases the refcount
of the timeline so you should gst_object_unref()
it after usage.
timeline of self
, this can be NULL
if
self
has no timeline. unref after usage.
[transfer full][nullable]
void ges_timeline_element_set_start (GESTimelineElement *self
,GstClockTime start
);
Set the position of the object in its containing layer.
Note that if the snapping-distance property of the timeline containing
self
is set, self
will properly snap to the edges around start
.
void ges_timeline_element_set_inpoint (GESTimelineElement *self
,GstClockTime inpoint
);
Set the in-point, that is the moment at which the self
will start
outputting data from its contents.
void ges_timeline_element_set_duration (GESTimelineElement *self
,GstClockTime duration
);
Set the duration of the object
Note that if the timeline snap-distance property of the timeline containing
self
is set, self
will properly snap to its neighboors.
void ges_timeline_element_set_max_duration (GESTimelineElement *self
,GstClockTime maxduration
);
Set the maximun duration of the object
void ges_timeline_element_set_priority (GESTimelineElement *self
,guint32 priority
);
ges_timeline_element_set_priority
is deprecated and should not be used in newly-written code.
All priority management is done by GES itself now. To set GESEffect priorities ges_clip_set_top_effect_index should be used.
Sets the priority of the object within the containing layer
GstClockTime
ges_timeline_element_get_start (GESTimelineElement *self
);
GstClockTime
ges_timeline_element_get_inpoint (GESTimelineElement *self
);
GstClockTime
ges_timeline_element_get_duration (GESTimelineElement *self
);
GstClockTime
ges_timeline_element_get_max_duration (GESTimelineElement *self
);
guint32
ges_timeline_element_get_priority (GESTimelineElement *self
);
gboolean ges_timeline_element_ripple (GESTimelineElement *self
,GstClockTime start
);
Edits self
in ripple mode. It allows you to modify the
start of self
and move the following neighbours accordingly.
This will change the overall timeline duration.
gboolean ges_timeline_element_ripple_end (GESTimelineElement *self
,GstClockTime end
);
Edits self
in ripple mode. It allows you to modify the
duration of a self
and move the following neighbours accordingly.
This will change the overall timeline duration.
self |
The GESTimelineElement to ripple. |
|
end |
The new end (start + duration) of |
gboolean ges_timeline_element_roll_start (GESTimelineElement *self
,GstClockTime start
);
Edits self
in roll mode. It allows you to modify the
start and inpoint of a self
and "resize" (basicly change the duration
in this case) of the previous neighbours accordingly.
This will not change the overall timeline duration.
self |
The GESTimelineElement to roll |
|
start |
The new start of |
gboolean ges_timeline_element_roll_end (GESTimelineElement *self
,GstClockTime end
);
Edits self
in roll mode. It allows you to modify the
duration of a self
and trim (basicly change the start + inpoint
in this case) the following neighbours accordingly.
This will not change the overall timeline duration.
self |
The GESTimelineElement to roll. |
|
end |
The new end (start + duration) of |
gboolean ges_timeline_element_trim (GESTimelineElement *self
,GstClockTime start
);
Edits self
in trim mode. It allows you to modify the
inpoint and start of self
.
This will not change the overall timeline duration.
Note that to trim the end of an self you can just set its duration. The same way
as this method, it will take into account the snapping-distance property of the
timeline in which self
is.
self |
The GESTimelineElement to trim. |
|
start |
The new start of |
GESTimelineElement *
ges_timeline_element_get_toplevel_parent
(GESTimelineElement *self
);
Gets the toplevel GESTimelineElement controlling self
GESTimelineElement * ges_timeline_element_copy (GESTimelineElement *self
,gboolean deep
);
Copies self
self |
The GESTimelineElement to copy |
|
deep |
whether we want to create the elements |
GESTimelineElement * ges_timeline_element_paste (GESTimelineElement *self
,GstClockTime paste_position
);
Paste self
inside the timeline. self
must have been created
using ges_timeline_element_copy with recurse=TRUE set,
otherwise it will fail.
self |
The GESTimelineElement to paste |
|
paste_position |
The position in the timeline the element should
be copied to, meaning it will become the start of |
Since: 1.6.0
gchar *
ges_timeline_element_get_name (GESTimelineElement *self
);
Returns a copy of the name of self
.
Caller should g_free()
the return value after usage.
gboolean ges_timeline_element_set_name (GESTimelineElement *self
,const gchar *name
);
Sets the name of object, or gives self
a guaranteed unique name (if name is NULL).
This function makes a copy of the provided name, so the caller retains ownership
of the name it sent.
GParamSpec ** ges_timeline_element_list_children_properties (GESTimelineElement *self
,guint *n_properties
);
Gets an array of GParamSpec* for all configurable properties of the
children of self
.
self |
The GESTimelineElement to get the list of children properties from |
|
n_properties |
return location for the length of the returned array. |
[out] |
an array of GParamSpec* which should be freed after use or
NULL
if something went wrong.
[transfer full][array length=n_properties]
gboolean ges_timeline_element_lookup_child (GESTimelineElement *self
,const gchar *prop_name
,GObject **child
,GParamSpec **pspec
);
Looks up which element
and pspec
would be effected by the given name
. If various
contained elements have this property name you will get the first one, unless you
specify the class name in name
.
self |
object to lookup the property in |
|
prop_name |
name of the property to look up. You can specify the name of the class as such: "ClassName::property-name", to guarantee that you get the proper GParamSpec in case various GstElement-s contain the same property name. If you don't do so, you will get the first element found, having this property and the and the corresponding GParamSpec. |
|
child |
pointer to a GstElement that takes the real object to set property on. |
[out][allow-none][transfer full] |
pspec |
pointer to take the GParamSpec describing the property. |
[out][allow-none][transfer full] |
void ges_timeline_element_get_child_property_by_pspec (GESTimelineElement *self
,GParamSpec *pspec
,GValue *value
);
Gets a property of a child of self
.
self |
||
pspec |
The GParamSpec that specifies the property you want to get |
|
value |
return location for the value. |
[out] |
void ges_timeline_element_get_child_property_valist (GESTimelineElement *self
,const gchar *first_property_name
,va_list var_args
);
Gets a property of a child of self
. If there are various child elements
that have the same property name, you can distinguish them using the following
syntax: 'ClasseName::property_name' as property name. If you don't, the
corresponding property of the first element found will be set.
self |
The GESTimelineElement parent object |
|
first_property_name |
The name of the first property to get |
|
var_args |
value for the first property, followed optionally by more name/return location pairs, followed by NULL |
void ges_timeline_element_get_child_properties (GESTimelineElement *self
,const gchar *first_property_name
,...
);
Gets properties of a child of self
.
self |
The origin GESTimelineElement |
|
first_property_name |
The name of the first property to get |
|
... |
return location for the first property, followed optionally by more name/return location pairs, followed by NULL |
void ges_timeline_element_set_child_property_valist (GESTimelineElement *self
,const gchar *first_property_name
,va_list var_args
);
Sets a property of a child of self
. If there are various child elements
that have the same property name, you can distinguish them using the following
syntax: 'ClasseName::property_name' as property name. If you don't, the
corresponding property of the first element found will be set.
self |
The GESTimelineElement parent object |
|
first_property_name |
The name of the first property to set |
|
var_args |
value for the first property, followed optionally by more name/return location pairs, followed by NULL |
void ges_timeline_element_set_child_property_by_pspec (GESTimelineElement *self
,GParamSpec *pspec
,GValue *value
);
Sets a property of a child of self
.
void ges_timeline_element_set_child_properties (GESTimelineElement *self
,const gchar *first_property_name
,...
);
Sets a property of a child of self
. If there are various child elements
that have the same property name, you can distinguish them using the following
syntax: 'ClasseName::property_name' as property name. If you don't, the
corresponding property of the first element found will be set.
self |
The GESTimelineElement parent object |
|
first_property_name |
The name of the first property to set |
|
... |
value for the first property, followed optionally by more name/return location pairs, followed by NULL |
gboolean ges_timeline_element_set_child_property (GESTimelineElement *self
,const gchar *property_name
,GValue *value
);
Sets a property of a child of self
Note that ges_timeline_element_set_child_property is really intended for language bindings, ges_timeline_element_set_child_properties is much more convenient for C programming.
self |
The origin GESTimelineElement |
|
property_name |
The name of the property |
|
value |
the value |
gboolean ges_timeline_element_get_child_property (GESTimelineElement *self
,const gchar *property_name
,GValue *value
);
In general, a copy is made of the property contents and
the caller is responsible for freeing the memory by calling
g_value_unset()
.
Gets a property of a GstElement contained in object
.
Note that ges_timeline_element_get_child_property is really intended for language bindings, ges_timeline_element_get_child_properties is much more convenient for C programming.
self |
The origin GESTimelineElement |
|
property_name |
The name of the property |
|
value |
return location for the property value, it will be initialized if it is initialized with 0. |
[out] |
gboolean ges_timeline_element_add_child_property (GESTimelineElement *self
,GParamSpec *pspec
,GObject *child
);
gboolean ges_timeline_element_remove_child_property (GESTimelineElement *self
,GParamSpec *pspec
);
GESTrackType
ges_timeline_element_get_track_types (GESTimelineElement *self
);
Gets all the TrackTypes self
will interact with
Since: 1.6.0
#define GES_TIMELINE_ELEMENT_PARENT(obj) (((GESTimelineElement*)obj)->parent)
The parent of the object.
#define GES_TIMELINE_ELEMENT_TIMELINE(obj) (((GESTimelineElement*)obj)->timeline)
The timeline in which the object is.
#define GES_TIMELINE_ELEMENT_START(obj) (((GESTimelineElement*)obj)->start)
The start position of the object (in nanoseconds).
#define GES_TIMELINE_ELEMENT_END(obj) ((((GESTimelineElement*)obj)->start) + (((GESTimelineElement*)obj)->duration))
The end position of the object (in nanoseconds).
#define GES_TIMELINE_ELEMENT_INPOINT(obj) (((GESTimelineElement*)obj)->inpoint)
The in-point of the object (in nanoseconds).
#define GES_TIMELINE_ELEMENT_DURATION(obj) (((GESTimelineElement*)obj)->duration)
The duration of the object (in nanoseconds).
#define GES_TIMELINE_ELEMENT_MAX_DURATION(obj) (((GESTimelineElement*)obj)->maxduration)
The maximun duration of the object (in nanoseconds).
#define GES_TIMELINE_ELEMENT_PRIORITY(obj) (((GESTimelineElement*)obj)->priority)
The priority of the object.
typedef struct { /*< read only >*/ GESTimelineElement *parent; GESAsset *asset; GstClockTime start; GstClockTime inpoint; GstClockTime duration; GstClockTime maxduration; guint32 priority; GESTimeline *timeline; gchar *name; } GESTimelineElement;
Those filed can be accessed from outside but in no case should be changed from there. Subclasses can write them but should make sure to properly call g_object_notify.
GESTimelineElement * |
The GESTimelineElement that controls the object |
|
GESAsset * |
The GESAsset from which the object has been extracted |
|
GstClockTime |
position (in time) of the object |
|
GstClockTime |
Position in the media from which the object should be used |
|
GstClockTime |
duration of the object to be used |
|
GstClockTime |
The maximum duration the object can have |
|
guint32 |
priority of the object in the layer (0:top priority) |
|
GESTimeline * |
||
gchar * |
typedef struct { GInitiallyUnownedClass parent_class; gboolean (*set_parent) (GESTimelineElement * self, GESTimelineElement *parent); gboolean (*set_start) (GESTimelineElement * self, GstClockTime start); gboolean (*set_inpoint) (GESTimelineElement * self, GstClockTime inpoint); gboolean (*set_duration) (GESTimelineElement * self, GstClockTime duration); gboolean (*set_max_duration) (GESTimelineElement * self, GstClockTime maxduration); gboolean (*set_priority) (GESTimelineElement * self, guint32 priority); /* set_priority is now protected */ gboolean (*ripple) (GESTimelineElement *self, guint64 start); gboolean (*ripple_end) (GESTimelineElement *self, guint64 end); gboolean (*roll_start) (GESTimelineElement *self, guint64 start); gboolean (*roll_end) (GESTimelineElement *self, guint64 end); gboolean (*trim) (GESTimelineElement *self, guint64 start); void (*deep_copy) (GESTimelineElement *self, GESTimelineElement *copy); GESTimelineElement * (*paste) (GESTimelineElement *self, GESTimelineElement *ref_element, GstClockTime paste_position); GParamSpec** (*list_children_properties) (GESTimelineElement * self, guint *n_properties); gboolean (*lookup_child) (GESTimelineElement *self, const gchar *prop_name, GObject **child, GParamSpec **pspec); GESTrackType (*get_track_types) (GESTimelineElement * self); } GESTimelineElementClass;
The GESTimelineElement base class. Subclasses should override at least
set_start
set_inpoint
set_duration
ripple
ripple_end
roll_start
roll_end
and trim
.
Vmethods in subclasses should apply all the operation they need to but the real method implementation is in charge of setting the proper field, and emit the notify signal.
method to set the parent of a GESTimelineElement. |
||
method to set the start of a GESTimelineElement |
||
method to set the inpoint of a GESTimelineElement |
||
method to set the duration of a GESTimelineElement |
||
method to set the maximun duration of a GESTimelineElement |
||
method to set the priority of a GESTimelineElement |
||
method to ripple an object |
||
method to ripple an object on its GES_EDGE_END edge |
||
method to roll an object on its GES_EDGE_START edge |
||
method to roll an object on its GES_EDGE_END edge |
||
method to trim an object |
||
Copy the children properties of |
||