GESTimelineElement

GESTimelineElement — Base Class for all elements that will be in a way or another inside a GESTimeline.

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GESTimelineElement
            ├── GESContainer
            ╰── GESTrackElement

Implemented Interfaces

GESTimelineElement implements GESExtractable and GESMetaContainer.

Includes

#include <ges/ges.h>

Description

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.

Functions

ges_timeline_element_set_parent ()

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()).

Parameters

self

a GESTimelineElement

 

parent

new parent of self

 

Returns

TRUE if parent could be set or FALSE when self already had a parent or self and parent are the same.


ges_timeline_element_get_parent ()

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.

Parameters

self

a GESTimelineElement

 

Returns

parent of self , this can be NULL if self has no parent. unref after usage.

[transfer full]


ges_timeline_element_set_timeline ()

gboolean
ges_timeline_element_set_timeline (GESTimelineElement *self,
                                   GESTimeline *timeline);

Sets the timeline of self to timeline .

Parameters

self

a GESTimelineElement

 

timeline

The GESTimeline self is in

 

Returns

TRUE if timeline could be set or FALSE when timeline already had a timeline.


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

Parameters

self

a GESTimelineElement

 

Returns

timeline of self , this can be NULL if self has no timeline. unref after usage.

[transfer full]


ges_timeline_element_set_start ()

void
ges_timeline_element_set_start (GESTimelineElement *self,
                                GstClockTime start);

Set the position of the object in its containing layer

Note that if the timeline snap-distance property of the timeline containing self is set, self will properly snap to its neighboors.

Parameters

self

a GESTimelineElement

 

start

the position in GstClockTime

 

ges_timeline_element_set_inpoint ()

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.

Parameters

self

a GESTimelineElement

 

inpoint

the in-point in GstClockTime

 

ges_timeline_element_set_duration ()

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.

Parameters

self

a GESTimelineElement

 

duration

the duration in GstClockTime

 

ges_timeline_element_set_max_duration ()

void
ges_timeline_element_set_max_duration (GESTimelineElement *self,
                                       GstClockTime maxduration);

Set the maximun duration of the object

Parameters

self

a GESTimelineElement

 

maxduration

the maximum duration in GstClockTime

 

ges_timeline_element_set_priority ()

void
ges_timeline_element_set_priority (GESTimelineElement *self,
                                   guint32 priority);

Sets the priority of the object within the containing layer

Parameters

self

a GESTimelineElement

 

priority

the priority

 

ges_timeline_element_get_start ()

GstClockTime
ges_timeline_element_get_start (GESTimelineElement *self);

Parameters

self

a GESTimelineElement

 

Returns

The start of self


ges_timeline_element_get_inpoint ()

GstClockTime
ges_timeline_element_get_inpoint (GESTimelineElement *self);

Parameters

self

a GESTimelineElement

 

Returns

The inpoint of self


ges_timeline_element_get_duration ()

GstClockTime
ges_timeline_element_get_duration (GESTimelineElement *self);

Parameters

self

a GESTimelineElement

 

Returns

The duration of self


ges_timeline_element_get_max_duration ()

GstClockTime
ges_timeline_element_get_max_duration (GESTimelineElement *self);

Parameters

self

a GESTimelineElement

 

Returns

The maxduration of self


ges_timeline_element_get_priority ()

guint32
ges_timeline_element_get_priority (GESTimelineElement *self);

Parameters

self

a GESTimelineElement

 

Returns

The priority of self


ges_timeline_element_ripple ()

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.

Parameters

self

The GESTimelineElement to ripple.

 

start

The new start of self in ripple mode.

 

Returns

TRUE if the self as been rippled properly, FALSE if an error occured


ges_timeline_element_ripple_end ()

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.

Parameters

self

The GESTimelineElement to ripple.

 

end

The new end (start + duration) of self in ripple mode. It will basically only change the duration of self .

 

Returns

TRUE if the self as been rippled properly, FALSE if an error occured


ges_timeline_element_roll_start ()

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.

Parameters

self

The GESTimelineElement to roll

 

start

The new start of self in roll mode, it will also adapat the in-point of self according

 

Returns

TRUE if the self as been roll properly, FALSE if an error occured


ges_timeline_element_roll_end ()

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.

Parameters

self

The GESTimelineElement to roll.

 

end

The new end (start + duration) of self in roll mode

 

Returns

TRUE if the self as been rolled properly, FALSE if an error occured


ges_timeline_element_trim ()

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.

Parameters

self

The GESTimelineElement to trim.

 

start

The new start of self in trim mode, will adapt the inpoint of self accordingly

 

Returns

TRUE if the self as been trimmed properly, FALSE if an error occured


ges_timeline_element_get_toplevel_parent ()

GESTimelineElement *
ges_timeline_element_get_toplevel_parent
                               (GESTimelineElement *self);

Gets the toplevel GESTimelineElement controlling self

Parameters

self

The GESTimelineElement to get the toplevel parent from

 

Returns

The toplevel controlling parent of self .

[transfer full]


ges_timeline_element_copy ()

GESTimelineElement *
ges_timeline_element_copy (GESTimelineElement *self,
                           gboolean deep);

Copies self

Parameters

self

The GESTimelineElement to copy

 

deep

whether we want to create the elements self contains or not

 

Returns

The newly create GESTimelineElement, copied from self .

[transfer floating]


ges_timeline_element_get_name ()

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.

Parameters

self

a GESTimelineElement

 

Returns

The name of self .

[transfer full]


ges_timeline_element_set_name ()

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.

Parameters

self

a GESTimelineElement

 

GES_TIMELINE_ELEMENT_PARENT()

#define GES_TIMELINE_ELEMENT_PARENT(obj) (((GESTimelineElement*)obj)->parent)

The parent of the object.

Parameters


GES_TIMELINE_ELEMENT_TIMELINE()

#define GES_TIMELINE_ELEMENT_TIMELINE(obj) (((GESTimelineElement*)obj)->timeline)

The timeline in which the object is.

Parameters


GES_TIMELINE_ELEMENT_START()

#define GES_TIMELINE_ELEMENT_START(obj) (((GESTimelineElement*)obj)->start)

The start position of the object (in nanoseconds).

Parameters


GES_TIMELINE_ELEMENT_END()

#define GES_TIMELINE_ELEMENT_END(obj) ((((GESTimelineElement*)obj)->start) + (((GESTimelineElement*)obj)->duration))

The end position of the object (in nanoseconds).

Parameters


GES_TIMELINE_ELEMENT_INPOINT()

#define GES_TIMELINE_ELEMENT_INPOINT(obj) (((GESTimelineElement*)obj)->inpoint)

The in-point of the object (in nanoseconds).

Parameters


GES_TIMELINE_ELEMENT_DURATION()

#define GES_TIMELINE_ELEMENT_DURATION(obj) (((GESTimelineElement*)obj)->duration)

The duration of the object (in nanoseconds).

Parameters


GES_TIMELINE_ELEMENT_MAX_DURATION()

#define GES_TIMELINE_ELEMENT_MAX_DURATION(obj) (((GESTimelineElement*)obj)->maxduration)

The maximun duration of the object (in nanoseconds).

Parameters


GES_TIMELINE_ELEMENT_PRIORITY()

#define GES_TIMELINE_ELEMENT_PRIORITY(obj) (((GESTimelineElement*)obj)->priority)

The priority of the object.

Parameters


GES_TIMELINE_ELEMENT_NAME()

#define GES_TIMELINE_ELEMENT_NAME(obj) (((GESTimelineElement*)obj)->name)

The name of the object.

Parameters

Types and Values

GESTimelineElement

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.

Members

GESTimelineElement *parent;

The GESTimelineElement that controls the object

 

GESAsset *asset;

The GESAsset from which the object has been extracted

 

GstClockTime start;

position (in time) of the object

 

GstClockTime inpoint;

Position in the media from which the object should be used

 

GstClockTime duration;

duration of the object to be used

 

GstClockTime maxduration;

The maximum duration the object can have

 

guint32 priority;

priority of the object in the layer (0:top priority)

 

GESTimeline *timeline;

   

gchar *name;

   

GESTimelineElementClass

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);

  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);
} 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.

Members

GInitiallyUnownedClass parent_class;

   

set_parent ()

method to set the parent of a GESTimelineElement.

 

set_start ()

method to set the start of a GESTimelineElement

 

set_inpoint ()

method to set the inpoint of a GESTimelineElement

 

set_duration ()

method to set the duration of a GESTimelineElement

 

set_max_duration ()

method to set the maximun duration of a GESTimelineElement

 

set_priority ()

method to set the priority of a GESTimelineElement

 

ripple ()

method to ripple an object

 

ripple_end ()

method to ripple an object on its GES_EDGE_END edge

 

roll_start ()

method to roll an object on its GES_EDGE_START edge

 

roll_end ()

method to roll an object on its GES_EDGE_END edge

 

trim ()

method to trim an object

 

deep_copy ()

Copy the children properties of self into copy