## GstInterpolationControlSource

GstInterpolationControlSource — interpolation control source

## Synopsis

    #include <libs/controller/gstinterpolationcontrolsource.h>

    struct              GstInterpolationControlSource;
    enum                GstInterpolateMode;
    GstInterpolationControlSource * gst_interpolation_control_source_new
                                                            (void);
    gboolean            gst_interpolation_control_source_set
                                                            (GstInterpolationControlSource *self,
                                                             GstClockTime timestamp,
                                                             const GValue *value);
    gboolean            gst_interpolation_control_source_set_from_list
                                                            (GstInterpolationControlSource *self,
                                                             const GSList *timedvalues);
    gboolean            gst_interpolation_control_source_set_interpolation_mode
                                                            (GstInterpolationControlSource *self,
                                                             GstInterpolateMode mode);
    GList *             gst_interpolation_control_source_get_all
                                                            (GstInterpolationControlSource *self);
    gboolean            gst_interpolation_control_source_unset
                                                            (GstInterpolationControlSource *self,
                                                             GstClockTime timestamp);
    void                gst_interpolation_control_source_unset_all
                                                            (GstInterpolationControlSource *self);
    gint                gst_interpolation_control_source_get_count
                                                            (GstInterpolationControlSource *self);

## Object Hierarchy

      GObject
       +----GstControlSource
             +----GstInterpolationControlSource

## Description

GstInterpolationControlSource is a GstControlSource, that interpolates values between user-given control points. It supports several interpolation modes and property types.

To use GstInterpolationControlSource get a new instance by calling `gst_interpolation_control_source_new()`, bind it to a GParamSpec, select a interpolation mode with `gst_interpolation_control_source_set_interpolation_mode()` and set some control points by calling `gst_interpolation_control_source_set()`.

All functions are MT-safe.

## Details

### struct GstInterpolationControlSource

    struct GstInterpolationControlSource;

The instance structure of GstControlSource.

### enum GstInterpolateMode

    typedef enum {
      GST_INTERPOLATE_NONE,
      GST_INTERPOLATE_TRIGGER,
      GST_INTERPOLATE_LINEAR,
      GST_INTERPOLATE_QUADRATIC,
      GST_INTERPOLATE_CUBIC,
      GST_INTERPOLATE_USER
    } GstInterpolateMode;

The various interpolation modes available.

`GST_INTERPOLATE_NONE` | steps-like interpolation, default
`GST_INTERPOLATE_TRIGGER` | returns the default value of the property, except for times with specific values
`GST_INTERPOLATE_LINEAR` | linear interpolation
`GST_INTERPOLATE_QUADRATIC` | square interpolation (deprecated, maps to cubic)
`GST_INTERPOLATE_CUBIC` | cubic interpolation
`GST_INTERPOLATE_USER` | user-provided interpolation (not yet available)

### gst_interpolation_control_source_new ()

    GstInterpolationControlSource * gst_interpolation_control_source_new
                                                            (void);

This returns a new, unbound GstInterpolationControlSource.

Returns : | a new, unbound GstInterpolationControlSource.

### gst_interpolation_control_source_set ()

    gboolean            gst_interpolation_control_source_set
                                                            (GstInterpolationControlSource *self,
                                                             GstClockTime timestamp,
                                                             const GValue *value);

Set the value of given controller-handled property at a certain time.

`self` : | the GstInterpolationControlSource object
`timestamp` : | the time the control-change is scheduled for
`value` : | the control-value
Returns : | FALSE if the values couldn't be set, TRUE otherwise.

### gst_interpolation_control_source_set_from_list ()

    gboolean            gst_interpolation_control_source_set_from_list
                                                            (GstInterpolationControlSource *self,
                                                             const GSList *timedvalues);

Sets multiple timed values at once.

`self` : | the GstInterpolationControlSource object
`timedvalues` : | a list with GstTimedValue items
Returns : | FALSE if the values couldn't be set, TRUE otherwise.

### gst_interpolation_control_source_set_interpolation_mode ()

    gboolean            gst_interpolation_control_source_set_interpolation_mode
                                                            (GstInterpolationControlSource *self,
                                                             GstInterpolateMode mode);

Sets the given interpolation mode.

### Note

User interpolation is not yet available and quadratic interpolation is deprecated and maps to cubic interpolation.

`self` : | the GstInterpolationControlSource object
`mode` : | interpolation mode
Returns : | `TRUE` if the interpolation mode could be set, `FALSE` otherwise

### gst_interpolation_control_source_get_all ()

    GList *             gst_interpolation_control_source_get_all
                                                            (GstInterpolationControlSource *self);

Returns a read-only copy of the list of GstTimedValue for the given property. Free the list after done with it.

`self` : | the GstInterpolationControlSource to get the list from
Returns : | a copy of the list, or `NULL` if the property isn't handled by the controller

### gst_interpolation_control_source_unset ()

    gboolean            gst_interpolation_control_source_unset
                                                            (GstInterpolationControlSource *self,
                                                             GstClockTime timestamp);

Used to remove the value of given controller-handled property at a certain time.

`self` : | the GstInterpolationControlSource object
`timestamp` : | the time the control-change should be removed from
Returns : | FALSE if the value couldn't be unset (i.e. not found, TRUE otherwise.

### gst_interpolation_control_source_unset_all ()

    void                gst_interpolation_control_source_unset_all
                                                            (GstInterpolationControlSource *self);

Used to remove all time-stamped values of given controller-handled property

`self` : | the GstInterpolationControlSource object

### gst_interpolation_control_source_get_count ()

    gint                gst_interpolation_control_source_get_count
                                                            (GstInterpolationControlSource *self);

Returns the number of control points that are set.

`self` : | the GstInterpolationControlSource to get the number of values from
Returns : | the number of control points that are set.