GESTrack

## GESTrack GESTrack — Composition of objects |

## Synopsis

    #include <ges/ges.h>

                        GESTrack;
    GstElement *        (*GESCreateElementForGapFunc)       (GESTrack *track);
    GESTrack *          ges_track_new                       (GESTrackType type,
                                                             GstCaps *caps);
    gboolean            ges_track_add_element               (GESTrack *track,
                                                             GESTrackElement *object);
    gboolean            ges_track_remove_element            (GESTrack *track,
                                                             GESTrackElement *object);
    const GstCaps *     ges_track_get_caps                  (GESTrack *track);
    GList *             ges_track_get_elements              (GESTrack *track);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GstObject
                   +----GstElement
                         +----GstBin
                               +----GESTrack

## Implemented Interfaces

GESTrack implements GstChildProxy and GESMetaContainer.

## Properties

      "caps"                     GstCaps*              : Read / Write / Construct Only
      "duration"                 guint64               : Read
      "restriction-caps"         GstCaps*              : Read / Write
      "track-type"               GESTrackType          : Read / Write / Construct Only

## Signals

      "track-element-added"                            : Run First
      "track-element-removed"                          : Run First

## Description

Corresponds to one output format (i.e. audio OR video).

Contains the compatible TrackElement(s).

Wraps GNonLin's 'gnlcomposition' element.

## Details

### GESTrack

    typedef struct {
      /* READ-ONLY */
      GESTrackType     type;
    } GESTrack;

GESTrackType `type`; | a GESTrackType indicting the basic type of the track.

### GESCreateElementForGapFunc ()

    GstElement *        (*GESCreateElementForGapFunc)       (GESTrack *track);

A function that will be called to create the GstElement that will be used as a source to fill the gaps in `track`.

`track` : | the GESTrack
Returns : | A GstElement (must be a source) that will be used to fill the gaps (periods of time in `track` that containes no source).

### ges_track_new ()

    GESTrack *          ges_track_new                       (GESTrackType type,
                                                             GstCaps *caps);

Creates a new GESTrack with the given `type` and `caps`.

The newly created track will steal a reference to the caps. If you wish to use those caps elsewhere, you will have to take an extra reference.

`type` : | The type of track
`caps` : | The caps to restrict the output of the track to. [transfer full]
Returns : | A new GESTrack.

### ges_track_add_element ()

    gboolean            ges_track_add_element               (GESTrack *track,
                                                             GESTrackElement *object);

Adds the given object to the track. Sets the object's controlling track, and thus takes ownership of the `object`.

An object can only be added to one track.

`track` : | a GESTrack
`object` : | the GESTrackElement to add. [transfer full]
Returns : | TRUE if the object was properly added. FALSE if the track does not want to accept the object.

### ges_track_remove_element ()

    gboolean            ges_track_remove_element            (GESTrack *track,
                                                             GESTrackElement *object);

Removes the object from the track and unparents it. Unparenting it means the reference owned by `track` on the `object` will be removed. If you wish to use the `object` after this function, make sure you call `gst_object_ref()` before removing it from the `track`.

`track` : | a GESTrack
`object` : | the GESTrackElement to remove
Returns : | TRUE if the object was removed, else FALSE if the track could not remove the object (like if it didn't belong to the track).

### ges_track_get_caps ()

    const GstCaps *     ges_track_get_caps                  (GESTrack *track);

Get the GstCaps this track is configured to output.

`track` : | a GESTrack
Returns : | The GstCaps this track is configured to output.

### ges_track_get_elements ()

    GList *             ges_track_get_elements              (GESTrack *track);

Gets the GESTrackElement contained in `track`

`track` : | a GESTrack
Returns : | the list of GESTrackElement present in the Track sorted by priority and start. [transfer full][element-type GESTrackElement]

## Property Details

### The `"caps"` property

      "caps"                     GstCaps*              : Read / Write / Construct Only

Caps used to filter/choose the output stream. This is generally set to a generic set of caps like 'video/x-raw' for raw video.

Default value: GST_CAPS_ANY.

### The `"duration"` property

      "duration"                 guint64               : Read

Current duration of the track

Default value: O

Default value: 1000000000

### The `"restriction-caps"` property

      "restriction-caps"         GstCaps*              : Read / Write

Caps used to filter/choose the output stream.

Default value: GST_CAPS_ANY.

### The `"track-type"` property

      "track-type"               GESTrackType          : Read / Write / Construct Only

Type of stream the track outputs. This is used when creating the GESTrack to specify in generic terms what type of content will be outputted.

It also serves as a 'fast' way to check what type of data will be outputted from the GESTrack without having to actually check the GESTrack's caps property.

Default value: GES_TRACK_TYPE_CUSTOM

## Signal Details

### The `"track-element-added"` signal

    void                user_function                      (GESTrack        *object,
                                                            GESTrackElement *effect,
                                                            gpointer         user_data)      : Run First

Will be emitted after a track element was added to the track.

`object` : | the GESTrack
`effect` : | the GESTrackElement that was added.
`user_data` : | user data set when the signal handler was connected.

### The `"track-element-removed"` signal

    void                user_function                      (GESTrack        *object,
                                                            GESTrackElement *effect,
                                                            gpointer         user_data)      : Run First

Will be emitted after a track element was removed from the track.

`object` : | the GESTrack
`effect` : | the GESTrackElement that was removed.
`user_data` : | user data set when the signal handler was connected.