GESTrack: GStreamer Editing Services 1.10.4 Reference Manual

## GESTrack GESTrack — Composition of objects |

## Functions

GstElement * | (*GESCreateElementForGapFunc) ()
GESTrack * | ges_track_new ()
gboolean | ges_track_add_element ()
void | ges_track_set_restriction_caps ()
void | ges_track_update_restriction_caps ()
gboolean | ges_track_remove_element ()
const GstCaps * | ges_track_get_caps ()
GList * | ges_track_get_elements ()
gboolean | ges_track_commit ()
gboolean | ges_track_get_mixing ()
void | ges_track_set_mixing ()

## Properties

GstCaps * | caps | Read / Write / Construct Only
guint64 | duration | Read
gboolean | mixing | Read / Write / Construct
GstCaps * | restriction-caps | Read / Write
GESTrackType | track-type | Read / Write / Construct Only

## Signals

void | commited | Run Last
void | track-element-added | Run First
void | track-element-removed | Run First

## Types and Values

| GESTrack

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBin
                        ╰── GESTrack

## Implemented Interfaces

GESTrack implements GstChildProxy and GESMetaContainer.

## Includes

    #include <ges/ges.h>

## Description

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

Contains the compatible TrackElement(s).

## Functions

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

#### Parameters

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.

#### Parameters

type | The type of track |
caps | The caps to restrict the output of the track to. | [transfer full]

#### Returns

A new GESTrack.

[transfer floating]

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

#### Parameters

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

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

Sets the given `caps` as the caps the track has to output.

#### Parameters

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

### ges_track_update_restriction_caps ()

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

Updates the restriction caps by modifying all the fields present in `caps` in the original restriction caps. If for example the current restriction caps are video/x-raw, format=I420, width=360 and `caps` is video/x-raw, format=RGB, the restriction caps will be updated to video/x-raw, format=RGB, width=360.

Modification happens for each structure in the new caps, and one can add new fields or structures through that function.

#### Parameters

track | a GESTrack |
caps | the GstCaps to update with |

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

#### Parameters

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.

#### Parameters

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`

#### Parameters

track | a GESTrack |

#### Returns

the list of GESTrackElement present in the Track sorted by priority and start.

[transfer full][element-type GESTrackElement]

### ges_track_commit ()

    gboolean
    ges_track_commit (GESTrack *track);

Commits all the pending changes of the TrackElement contained in the track.

When timing changes happen in a timeline, the changes are not directly done inside NLE. This method needs to be called so any changes on a clip contained in the timeline actually happen at the media processing level.

#### Parameters

track | a GESTrack |

#### Returns

`TRUE` if something as been commited `FALSE` if nothing needed to be commited

### ges_track_get_mixing ()

    gboolean
    ges_track_get_mixing (GESTrack *track);

Gets if the underlying NleComposition contains an expandable mixer.

#### Parameters

track | a GESTrack |

#### Returns

True if there is a mixer, False otherwise.

### ges_track_set_mixing ()

    void
    ges_track_set_mixing (GESTrack *track,
                          gboolean mixing);

Sets if the GESTrack should be mixing.

#### Parameters

track | a GESTrack |
mixing | TRUE if the track should be mixing, FALSE otherwise. |

## Types and Values

### GESTrack

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

#### Members

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

## Property Details

### The `“caps”` property

      “caps”                     GstCaps *

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.

Flags: Read / Write / Construct Only

### The `“duration”` property

      “duration”                 guint64

Current duration of the track

Default value: O

Flags: Read

Default value: 1000000000

### The `“mixing”` property

      “mixing”                   gboolean

Whether layer mixing is activated or not on the track.

Flags: Read / Write / Construct

Default value: TRUE

### The `“restriction-caps”` property

      “restriction-caps”         GstCaps *

Caps used to filter/choose the output stream.

Default value: GST_CAPS_ANY.

Flags: Read / Write

### The `“track-type”` property

      “track-type”               GESTrackType

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.

Flags: Read / Write / Construct Only

Default value: GES_TRACK_TYPE_CUSTOM

## Signal Details

### The `“commited”` signal

    void
    user_function (GESTrack *track,
                   gpointer  user_data)

#### Parameters

track | the GESTrack |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“track-element-added”` signal

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

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

#### Parameters

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

Flags: Run First

### The `“track-element-removed”` signal

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

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

#### Parameters

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

Flags: Run First