GESUriClipAsset

## GESUriClipAsset GESUriClipAsset — A GESAsset subclass specialized in GESUriClip extraction |

## Synopsis

    #include <ges/ges.h>

                        GESUriClipAsset;
    GType               ges_uri_clip_asset_get_type         (void);
    GstClockTime        ges_uri_clip_asset_get_duration     (GESUriClipAsset *self);
    gboolean            ges_uri_clip_asset_is_image         (GESUriClipAsset *self);
    GstDiscovererInfo * ges_uri_clip_asset_get_info         (const GESUriClipAsset *self);
    void                ges_uri_clip_asset_new              (const gchar *uri,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GESUriClipAsset *   ges_uri_clip_asset_request_sync     (const gchar *uri,
                                                             GError **error);
    const GList *       ges_uri_clip_asset_get_stream_assets
                                                            (GESUriClipAsset *self);
    void                ges_uri_clip_asset_class_set_timeout
                                                            (GESUriClipAssetClass *klass,
                                                             GstClockTime timeout);

## Object Hierarchy

      GObject
       +----GESAsset
             +----GESClipAsset
                   +----GESUriClipAsset

## Implemented Interfaces

GESUriClipAsset implements GAsyncInitable, GInitable and GESMetaContainer.

## Description

The GESUriClipAsset is a special GESAsset that lets you handle the media file to use inside the GStreamer Editing Services. It has APIs that let you get information about the medias. Also, the tags found in the media file are set as Metadatas of the Asser.

## Details

### GESUriClipAsset

    typedef struct _GESUriClipAsset GESUriClipAsset;

### ges_uri_clip_asset_get_type ()

    GType               ges_uri_clip_asset_get_type         (void);

### ges_uri_clip_asset_get_duration ()

    GstClockTime        ges_uri_clip_asset_get_duration     (GESUriClipAsset *self);

Gets duration of the file represented by `self`

`self` : | a GESUriClipAsset
Returns : | The duration of `self`

### ges_uri_clip_asset_is_image ()

    gboolean            ges_uri_clip_asset_is_image         (GESUriClipAsset *self);

Gets Whether the file represented by `self` is an image or not

`self` : | a indent: Standard input:311: Error:Unexpected end of file GESUriClipAsset
Returns : | Whether the file represented by `self` is an image or not

### ges_uri_clip_asset_get_info ()

    GstDiscovererInfo * ges_uri_clip_asset_get_info         (const GESUriClipAsset *self);

Gets GstDiscovererInfo about the file

`self` : | Target asset
Returns : | GstDiscovererInfo of specified asset. [transfer none]

### ges_uri_clip_asset_new ()

    void                ges_uri_clip_asset_new              (const gchar *uri,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Creates a GESUriClipAsset for `uri`

Example of request of a GESUriClipAsset:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    // The request callback
    static void
    filesource_asset_loaded_cb (GESAsset * source, GAsyncResult * res, gpointer user_data)
    {
      GError *error = NULL;
      GESUriClipAsset *filesource_asset;

      filesource_asset = GES_URI_CLIP_ASSET (ges_asset_request_finish (res, &error));
      if (filesource_asset) {
       g_print ("The file: %s is usable as a FileSource, it is%s an image and lasts %" GST_TIME_FORMAT,
           ges_asset_get_id (GES_ASSET (filesource_asset))
           ges_uri_clip_asset_is_image (filesource_asset) ? "" : " not",
           GST_TIME_ARGS (ges_uri_clip_asset_get_duration (filesource_asset));
      } else {
       g_print ("The file: %s is *not* usable as a FileSource because: %s",
           ges_asset_get_id (source), error->message);
      }

      gst_object_unref (mfs);
    }

    // The request:
    ges_uri_clip_asset_new (uri, (GAsyncReadyCallback) filesource_asset_loaded_cb, user_data);

`uri` : | The URI of the file for which to create a GESUriClipAsset
`cancellable` : | optional `GCancellable` object, `NULL` to ignore.
`callback` : | a GAsyncReadyCallback to call when the initialization is finished. [scope async]
`user_data` : | The user data to pass when `callback` is called

### ges_uri_clip_asset_request_sync ()

    GESUriClipAsset *   ges_uri_clip_asset_request_sync     (const gchar *uri,
                                                             GError **error);

Creates a GESUriClipAsset for `uri` syncronously. You should avoid to use it in application, and rather create GESUriClipAsset asynchronously

`uri` : | The URI of the file for which to create a GESUriClipAsset
`error` : | An error to be set in case something wrong happens or `NULL`. [allow-none]
Returns : | A reference to the requested asset or `NULL` if an error happend. [transfer none]

### ges_uri_clip_asset_get_stream_assets ()

    const GList *       ges_uri_clip_asset_get_stream_assets
                                                            (GESUriClipAsset *self);

Get the GESUriSourceAsset `self` containes

`self` : | A GESUriClipAsset
Returns : | a GList of GESUriSourceAsset. [transfer none][element-type GESUriSourceAsset]

### ges_uri_clip_asset_class_set_timeout ()

    void                ges_uri_clip_asset_class_set_timeout
                                                            (GESUriClipAssetClass *klass,
                                                             GstClockTime timeout);

Sets the timeout of GESUriClipAsset loading

`klass` : | The GESUriClipAssetClass on which to set the discoverer timeout
`timeout` : | The timeout to set