## GESFormatter GESFormatter — Timeline saving and loading. |

## Functions

gboolean | (*GESFormatterLoadFromURIMethod) ()
gboolean | (*GESFormatterSaveToURIMethod) ()
gboolean | (*GESFormatterCanLoadURIMethod) ()
void | ges_formatter_class_register_metas ()
gboolean | ges_formatter_load_from_uri ()
gboolean | ges_formatter_save_to_uri ()
gboolean | ges_formatter_can_load_uri ()
gboolean | ges_formatter_can_save_uri ()
GESAsset * | ges_formatter_get_default ()

## Types and Values

| GESFormatter
| GESFormatterClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GESFormatter

## Implemented Interfaces

GESFormatter implements GESExtractable.

## Includes

    #include <ges/ges.h>

## Description

## Functions

### GESFormatterLoadFromURIMethod ()

    gboolean
    (*GESFormatterLoadFromURIMethod) (GESFormatter *formatter,
                                      GESTimeline *timeline,
                                      const gchar *uri,
                                      GError **error);

`GESFormatterLoadFromURIMethod` has been deprecated since version 1.16 and should not be used in newly-written code.

Use `ges_timeline_load_from_uri`

Virtual method for loading a timeline from a given URI.

Every GESFormatter subclass needs to implement this method.

#### Parameters

formatter | a GESFormatter |
timeline | a GESTimeline |
uri | the URI to load from |
error | An error to be set in case something wrong happens or `NULL`. | [out][allow-none]

#### Returns

TRUE if the `timeline` was properly loaded from the given `uri` , else FALSE.

### GESFormatterSaveToURIMethod ()

    gboolean
    (*GESFormatterSaveToURIMethod) (GESFormatter *formatter,
                                    GESTimeline *timeline,
                                    const gchar *uri,
                                    gboolean overwrite,
                                    GError **error);

`GESFormatterSaveToURIMethod` has been deprecated since version 1.16 and should not be used in newly-written code.

Use `ges_timeline_save_to_uri`

Virtual method for saving a timeline to a uri.

Every GESFormatter subclass needs to implement this method.

#### Parameters

formatter | a GESFormatter |
timeline | a GESTimeline |
uri | the URI to save to |
overwrite | Whether the file should be overwritten in case it exists |
error | An error to be set in case something wrong happens or `NULL`. | [out][allow-none]

#### Returns

TRUE if the `timeline` was properly stored to the given `uri` , else FALSE.

### GESFormatterCanLoadURIMethod ()

    gboolean
    (*GESFormatterCanLoadURIMethod) (GESFormatter *dummy_instance,
                                     const gchar *uri,
                                     GError **error);

### ges_formatter_class_register_metas ()

    void
    ges_formatter_class_register_metas (GESFormatterClass *klass,
                                        const gchar *name,
                                        const gchar *description,
                                        const gchar *extension,
                                        const gchar *mimetype,
                                        gdouble version,
                                        GstRank rank);

### ges_formatter_load_from_uri ()

    gboolean
    ges_formatter_load_from_uri (GESFormatter *formatter,
                                 GESTimeline *timeline,
                                 const gchar *uri,
                                 GError **error);

Load data from the given URI into timeline.

#### Parameters

formatter | a GESFormatter |
timeline | a GESTimeline |
uri | a gchar * pointing to a URI |
error | A GError that will be set in case of error |

#### Returns

TRUE if the timeline data was successfully loaded from the URI, else FALSE.

### ges_formatter_save_to_uri ()

    gboolean
    ges_formatter_save_to_uri (GESFormatter *formatter,
                               GESTimeline *timeline,
                               const gchar *uri,
                               gboolean overwrite,
                               GError **error);

Save data from timeline to the given URI.

#### Parameters

formatter | a GESFormatter |
timeline | a GESTimeline |
uri | a gchar * pointing to a URI |
overwrite | `TRUE` to overwrite file if it exists |
error | A GError that will be set in case of error |

#### Returns

TRUE if the timeline data was successfully saved to the URI else FALSE.

### ges_formatter_can_load_uri ()

    gboolean
    ges_formatter_can_load_uri (const gchar *uri,
                                GError **error);

Checks if there is a GESFormatter available which can load a GESTimeline from the given URI.

#### Parameters

uri | a gchar * pointing to the URI |
error | A GError that will be set in case of error |

#### Returns

TRUE if there is a GESFormatter that can support the given uri or FALSE if not.

### ges_formatter_can_save_uri ()

    gboolean
    ges_formatter_can_save_uri (const gchar *uri,
                                GError **error);

Returns TRUE if there is a GESFormatter available which can save a GESTimeline to the given URI.

#### Parameters

uri | a gchar * pointing to a URI |
error | A GError that will be set in case of error |

#### Returns

TRUE if the given `uri` is supported, else FALSE.

### ges_formatter_get_default ()

    GESAsset *
    ges_formatter_get_default (void);

Get the default GESAsset to use as formatter. It will return the asset for the GESFormatter that has the highest `rank`

#### Returns

The GESAsset for the formatter with highest `rank` .

[transfer none]

## Types and Values

### GESFormatter

    typedef struct _GESFormatter GESFormatter;

Base class for timeline data serialization and deserialization.

### GESFormatterClass

    typedef struct {
      GInitiallyUnownedClass parent_class;

      /* TODO 2.0: Rename the loading method to can_load and load.
       * Technically we just pass data to load, it should not necessarily
       * be a URI */
      GESFormatterCanLoadURIMethod can_load_uri;
      GESFormatterLoadFromURIMethod load_from_uri;
      GESFormatterSaveToURIMethod save_to_uri;
    } GESFormatterClass;

GES Formatter class. Override the vmethods to implement the formatter functionnality.

#### Members

GESFormatterCanLoadURIMethod `can_load_uri`; | Whether the URI can be loaded |
GESFormatterLoadFromURIMethod `load_from_uri`; | class method to deserialize data from a URI |
GESFormatterSaveToURIMethod `save_to_uri`; | class method to serialize data to a URI |