## GESTrack

GESTrack — Composition of objects

## Synopsis

    #include <ges/ges.h>

                        GESTrack;
    GESTrack *          ges_track_audio_raw_new             (void);
    GESTrack *          ges_track_video_raw_new             (void);
    GESTrack *          ges_track_new                       (GESTrackType type,
                                                             GstCaps *caps);
    gboolean            ges_track_add_object                (GESTrack *track,
                                                             GESTrackObject *object);
    gboolean            ges_track_remove_object             (GESTrack *track,
                                                             GESTrackObject *object);
    void                ges_track_set_caps                  (GESTrack *track,
                                                             const GstCaps *caps);
    const GstCaps *     ges_track_get_caps                  (GESTrack *track);

## Object Hierarchy

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

## Implemented Interfaces

GESTrack implements GstChildProxy.

## Properties

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

## Description

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

Contains the compatible TrackObject(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.

### ges_track_audio_raw_new ()

    GESTrack *          ges_track_audio_raw_new             (void);

Creates a new GESTrack of type GES_TRACK_TYPE_AUDIO and with generic raw audio caps ("audio/x-raw-int;audio/x-raw-float");

Returns : | A new GESTrack.

### ges_track_video_raw_new ()

    GESTrack *          ges_track_video_raw_new             (void);

Creates a new GESTrack of type GES_TRACK_TYPE_VIDEO and with generic raw video caps ("video/x-raw-yuv;video/x-raw-rgb");

Returns : | A new GESTrack.

### 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.
Returns : | A new GESTrack.

### ges_track_add_object ()

    gboolean            ges_track_add_object                (GESTrack *track,
                                                             GESTrackObject *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 GESTrackObject 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_object ()

    gboolean            ges_track_remove_object             (GESTrack *track,
                                                             GESTrackObject *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 `g_object_ref()` before removing it from the `track`.

`track` : | a GESTrack
`object` : | the GESTrackObject 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_set_caps ()

    void                ges_track_set_caps                  (GESTrack *track,
                                                             const GstCaps *caps);

Sets the given `caps` on the track.

`track` : | a GESTrack
`caps` : | the GstCaps to set

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

## Property Details

### The `"caps"` property

      "caps"                     GstCaps*              : Read / Write / Construct

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

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