Commit 695c381b authored by Thibault Saunier's avatar Thibault Saunier
Browse files

Rename GESTimelineFileSource to GESUriClip

Conflicts:
	ges/ges-pitivi-formatter.c
	ges/ges-uri-clip.c
	tests/check/ges/project.c
	tests/check/ges/uriclip.c
parent 04a3c49e
......@@ -17,7 +17,7 @@ LOCAL_SRC_FILES := \
ges-clip.c \
ges-timeline-pipeline.c \
ges-timeline-source.c \
ges-timeline-file-source.c \
ges-uri-clip.c \
ges-timeline-operation.c \
ges-timeline-transition.c \
ges-timeline-standard-transition.c \
......
......@@ -14,7 +14,7 @@ class Simple:
timeline.add_track(trackv)
timeline.add_layer(self.layer)
GES.Asset.new_async(GES.TimelineFileSource, uri, None, self.discoveredCb, None)
GES.Asset.new_async(GES.UriClip, uri, None, self.discoveredCb, None)
self.loop = GLib.MainLoop()
self.loop.run()
......
......@@ -11,7 +11,7 @@ class Simple:
timeline.add_track(trackv)
timeline.add_layer(layer)
src = GES.TimelineFileSource.new(uri=uri)
src = GES.UriClip.new(uri=uri)
src.set_start(long(0))
src.set_duration(long(10 * Gst.SECOND))
print src
......
......@@ -104,7 +104,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<title>Assets</title>
<xi:include href="xml/ges-asset-clip.xml"/>
<xi:include href="xml/ges-asset-track-object.xml"/>
<xi:include href="xml/ges-asset-file-source.xml"/>
<xi:include href="xml/ges-uri-clip-asset.xml"/>
<xi:include href="xml/ges-asset-track-file-source.xml"/>
<xi:include href="xml/ges-project.xml"/>
</chapter>
......
......@@ -440,26 +440,26 @@ GES_TYPE_TIMELINE_SOURCE
<SECTION>
<FILE>ges-timeline-filesource</FILE>
<TITLE>GESTimelineFileSource</TITLE>
GESTimelineFileSource
ges_timeline_filesource_new
ges_timeline_filesource_get_max_duration
ges_timeline_filesource_get_uri
ges_timeline_filesource_is_image
ges_timeline_filesource_is_muted
ges_timeline_filesource_set_is_image
ges_timeline_filesource_set_max_duration
ges_timeline_filesource_set_mute
<TITLE>GESUriClip</TITLE>
GESUriClip
ges_uri_clip_new
ges_uri_clip_get_max_duration
ges_uri_clip_get_uri
ges_uri_clip_is_image
ges_uri_clip_is_muted
ges_uri_clip_set_is_image
ges_uri_clip_set_max_duration
ges_uri_clip_set_mute
<SUBSECTION Standard>
GESTimelineFileSourceClass
GESTimelineFileSourcePrivate
ges_timeline_filesource_get_type
GES_IS_TIMELINE_FILE_SOURCE
GES_IS_TIMELINE_FILE_SOURCE_CLASS
GES_TIMELINE_FILE_SOURCE
GES_TIMELINE_FILE_SOURCE_CLASS
GES_TIMELINE_FILE_SOURCE_GET_CLASS
GES_TYPE_TIMELINE_FILE_SOURCE
GESUriClipClass
GESUriClipPrivate
ges_uri_clip_get_type
GES_IS_URI_CLIP
GES_IS_URI_CLIP_CLASS
GES_URI_CLIP
GES_URI_CLIP_CLASS
GES_URI_CLIP_GET_CLASS
GES_TYPE_URI_CLIP
</SECTION>
<SECTION>
......@@ -1017,24 +1017,24 @@ GES_ASSET_TRACK_OBJECT_GET_CLASS
</SECTION>
<SECTION>
<FILE>ges-asset-file-source</FILE>
<TITLE>GESAssetFileSource</TITLE>
GESAssetFileSource
ges_asset_filesource_get_type
ges_asset_filesource_get_duration
ges_asset_filesource_is_image
ges_asset_filesource_get_info
ges_asset_filesource_new
ges_asset_filesource_set_timeout
ges_asset_filesource_get_stream_assets
<FILE>ges-uri-clip-asset</FILE>
<TITLE>GESUriClipAsset</TITLE>
GESUriClipAsset
ges_uri_clip_asset_get_type
ges_uri_clip_asset_get_duration
ges_uri_clip_asset_is_image
ges_uri_clip_asset_get_info
ges_uri_clip_asset_new
ges_uri_clip_asset_set_timeout
ges_uri_clip_asset_get_stream_assets
<SUBSECTION Standard>
GESAssetFileSourcePrivate
GES_ASSET_FILESOURCE
GES_TYPE_ASSET_FILESOURCE
GES_ASSET_FILESOURCE_CLASS
GES_IS_ASSET_FILESOURCE
GES_IS_ASSET_FILESOURCE_CLASS
GES_ASSET_FILESOURCE_GET_CLASS
GESUriClipAssetPrivate
GES_URI_CLIP_ASSET
GES_TYPE_URI_CLIP_ASSET
GES_URI_CLIP_ASSET_CLASS
GES_IS_URI_CLIP_ASSET
GES_IS_URI_CLIP_ASSET_CLASS
GES_URI_CLIP_ASSET_GET_CLASS
</SECTION>
<SECTION>
......
......@@ -18,7 +18,7 @@ ges_timeline_transition_get_type
ges_timeline_standard_transition_get_type
ges_timeline_effect_get_type
ges_timeline_parse_launch_effect_get_type
ges_timeline_filesource_get_type
ges_uri_clip_get_type
ges_timeline_text_overlay_get_type
ges_timeline_title_source_get_type
ges_track_audio_test_source_get_type
......
......@@ -21,7 +21,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-timeline-source.c \
ges-timeline-effect.c \
ges-timeline-parse-launch-effect.c \
ges-timeline-file-source.c \
ges-uri-clip.c \
ges-timeline-operation.c \
ges-timeline-transition.c \
ges-timeline-standard-transition.c \
......@@ -48,7 +48,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-formatter.c \
ges-pitivi-formatter.c \
ges-asset.c \
ges-asset-file-source.c \
ges-uri-asset.c \
ges-asset-clip.c \
ges-asset-track-object.c \
ges-extractable.c \
......@@ -73,7 +73,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-clip.h \
ges-timeline-pipeline.h \
ges-timeline-source.h \
ges-timeline-file-source.h \
ges-uri-clip.h \
ges-timeline-effect.h \
ges-timeline-parse-launch-effect.h \
ges-timeline-operation.h \
......@@ -102,7 +102,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-formatter.h \
ges-pitivi-formatter.h \
ges-asset.h \
ges-asset-file-source.h \
ges-uri-asset.h \
ges-asset-clip.h \
ges-asset-track-object.h \
ges-extractable.h \
......
......@@ -21,7 +21,7 @@
* SECTION: ges-asset-clip
* @short_description: A GESAsset subclass specialized in GESClip extraction
*
* The #GESAssetFileSource is a special #GESAsset specilized in #GESClip.
* The #GESUriClipAsset is a special #GESAsset specilized in #GESClip.
* it is mostly used to get information about the #GESTrackType-s the objects extracted
* from it can potentialy create #GESTrackObject for.
*/
......
......@@ -25,7 +25,7 @@
* The Assets in the GStreamer Editing Services represent the ressources
* that can be used. You can create assets for any type that implements the #GESExtractable
* interface, for example #GESClips, #GESFormatter, and #GESTrackObject do implement it.
* This means that asssets will represent for example a #GESTimelineFileSources, #GESTrackEffect etc,
* This means that asssets will represent for example a #GESUriClips, #GESTrackEffect etc,
* and then you can extract objects of those types with the appropriate parameters from the asset
* using the #ges_asset_extract method:
*
......@@ -47,7 +47,7 @@
* custom effects. Note that #GESAsset management is making easier thanks to the #GESProject class.
*
* Each asset are represented by a pair of @extractable_type and @id (string). Actually the @extractable_type
* is the type that implements the #GESExtractable interface, that means that for example for a #GESTimelineFileSource,
* is the type that implements the #GESExtractable interface, that means that for example for a #GESUriClip,
* the type that implements the #GESExtractable interface is #GESClip.
* The identifier represents different things depending on the @extractable_type and you should check
* the documentation of each type to know what the ID of #GESAsset actually represents for that type. By default,
......@@ -698,7 +698,7 @@ ges_asset_get_extractable_type (GESAsset * self)
*
* Note that it won't be possible to instantiate the first %GESAsset with
* @id depending on the @extractable_type. For example instantiate a
* #GESAsset that extract #GESTimelineFileSource needs to be done async
* #GESAsset that extract #GESUriClip needs to be done async
* the first time for a specific ID.
*
* Returns: (transfer full) (allow-none): A reference to the wanted #GESAsset or %NULL
......@@ -789,7 +789,7 @@ done:
* new asset. The class must implement the #GESExtractable interface.
* @id: The Identifier of the asset we want to create. This identifier depends of the extractable,
* type you want. By default it is the name of the class itself (or %NULL), but for example for a
* GESTrackParseLaunchEffect, it will be the pipeline description, for a GESTimelineFileSource it
* GESTrackParseLaunchEffect, it will be the pipeline description, for a GESUriClip it
* will be the name of the file, etc... You should refer to the documentation of the #GESExtractable
* type you want to create a #GESAsset for.
* @cancellable: (allow-none): optional %GCancellable object, %NULL to ignore.
......@@ -824,7 +824,7 @@ done:
* }
*
* // The request:
* ges_asset_request_async (GES_TYPE_TIMELINE_FILE_SOURCE, some_uri, NULL,
* ges_asset_request_async (GES_TYPE_URI_CLIP, some_uri, NULL,
* (GAsyncReadyCallback) asset_loaded_cb, user_data);
* ]|
*/
......
......@@ -27,7 +27,7 @@
#include "ges-asset.h"
#include "ges-internal.h"
#include "ges-extractable.h"
#include "ges-timeline-file-source.h"
#include "ges-uri-clip.h"
static GQuark ges_asset_key;
......
......@@ -14,7 +14,8 @@ static GQuark ges_meta_key;
G_DEFINE_INTERFACE_WITH_CODE (GESMetaContainer, ges_meta_container,
G_TYPE_OBJECT, ges_meta_key =
g_quark_from_static_string ("ges-meta-container-data"););
g_quark_from_static_string ("ges-meta-container-data");
);
enum
{
......
......@@ -347,7 +347,7 @@ static GList *
save_sources (GESPitiviFormatter * formatter, GList * layers,
xmlTextWriterPtr writer)
{
GList *clipects, *tmp, *tmplayer;
GList *clips, *tmp, *tmplayer;
GESTimelineLayer *layer;
GESPitiviFormatterPrivate *priv = formatter->priv;
......@@ -361,17 +361,16 @@ save_sources (GESPitiviFormatter * formatter, GList * layers,
for (tmplayer = layers; tmplayer; tmplayer = tmplayer->next) {
layer = GES_TIMELINE_LAYER (tmplayer->data);
clipects = ges_timeline_layer_get_objects (layer);
for (tmp = clipects; tmp; tmp = tmp->next) {
clips = ges_timeline_layer_get_objects (layer);
for (tmp = clips; tmp; tmp = tmp->next) {
SrcMapping *srcmap = g_slice_new0 (SrcMapping);
GESClip *clip;
gchar *uriclip_uri;
clip = tmp->data;
if (GES_IS_TIMELINE_FILE_SOURCE (clip)) {
if (GES_IS_URI_CLIP (clip)) {
uriclip_uri = (gchar *) ges_timeline_filesource_get_uri
(GES_TIMELINE_FILE_SOURCE (clip));
uriclip_uri = (gchar *) ges_uri_clip_get_uri (GES_URI_CLIP (clip));
if (!g_hash_table_lookup (priv->saving_source_table, uriclip_uri)) {
gchar *strid = g_strdup_printf ("%i", priv->nb_sources);
......@@ -391,8 +390,8 @@ save_sources (GESPitiviFormatter * formatter, GList * layers,
source_list = g_list_append (source_list, srcmap);
}
}
g_list_foreach (clipects, (GFunc) g_object_unref, NULL);
g_list_free (clipects);
g_list_foreach (clips, (GFunc) g_object_unref, NULL);
g_list_free (clips);
g_object_unref (G_OBJECT (layer));
}
......@@ -579,8 +578,7 @@ list_sources (GESFormatter * self)
g_hash_table_insert (priv->source_uris, g_strdup (filename),
g_strdup (filename));
if (self->project)
ges_project_create_asset (self->project, filename,
GES_TYPE_TIMELINE_FILE_SOURCE);
ges_project_create_asset (self->project, filename, GES_TYPE_URI_CLIP);
}
xmlXPathFreeObject (xpathObj);
......@@ -852,7 +850,7 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
gchar *fac_ref = NULL, *media_type = NULL, *filename = NULL, *prio_str;
GList *tmp = NULL, *keys, *tmp_key;
GESTimelineFileSource *src = NULL;
GESUriClip *src = NULL;
gint prio;
gboolean a_avail = FALSE, v_avail = FALSE, video;
GHashTable *tckobj_table = priv->track_objects_table;
......@@ -906,7 +904,7 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
filename = (gchar *) g_hash_table_lookup (source_table, "filename");
src = ges_timeline_filesource_new (filename);
src = ges_uri_clip_new (filename);
if (!video) {
v_avail = TRUE;
......
......@@ -374,8 +374,8 @@ ges_timeline_pipeline_change_state (GstElement * element,
ret = GST_STATE_CHANGE_FAILURE;
goto done;
}
if (self->
priv->mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
if (self->priv->
mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
GST_DEBUG ("rendering => Updating pipeline caps");
if (!ges_timeline_pipeline_update_caps (self)) {
GST_ERROR_OBJECT (element, "Error setting the caps for rendering");
......
......@@ -29,7 +29,7 @@
#include "ges-internal.h"
#include "ges-track-object.h"
#include "ges-track-filesource.h"
#include "ges-asset-file-source.h"
#include "ges-uri-asset.h"
#include "ges-extractable.h"
static gchar *
......
......@@ -59,8 +59,8 @@ typedef struct _GESTimelineSourceClass GESTimelineSourceClass;
typedef struct _GESTimelineEffect GESTimelineEffect;
typedef struct _GESTimelineEffectClass GESTimelineEffectClass;
typedef struct _GESTimelineFileSource GESTimelineFileSource;
typedef struct _GESTimelineFileSourceClass GESTimelineFileSourceClass;
typedef struct _GESUriClip GESUriClip;
typedef struct _GESUriClipClass GESUriClipClass;
typedef struct _GESTimelineTransition GESTimelineTransition;
typedef struct _GESTimelineTransitionClass GESTimelineTransitionClass;
......@@ -146,8 +146,8 @@ typedef struct _GESAssetClass GESAssetClass;
typedef struct _GESAssetClip GESAssetClip;
typedef struct _GESAssetClipClass GESAssetClipClass;
typedef struct _GESAssetFileSource GESAssetFileSource;
typedef struct _GESAssetFileSourceClass GESAssetFileSourceClass;
typedef struct _GESUriClipAsset GESUriClipAsset;
typedef struct _GESUriClipAssetClass GESUriClipAssetClass;
typedef struct _GESAssetTrackObject GESAssetTrackObject;
typedef struct _GESAssetTrackObjectClass GESAssetTrackObjectClass;
......
......@@ -19,10 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION: ges-asset-file-source
* @short_description: A GESAsset subclass specialized in GESTimelineFileSource extraction
* SECTION: ges-uri-clip-asset
* @short_description: A GESAsset subclass specialized in GESUriClip extraction
*
* The #GESAssetFileSource is a special #GESAsset that lets you handle
* 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.
......@@ -40,7 +40,7 @@ initable_iface_init (GInitableIface * initable_iface)
initable_iface->init = NULL;
}
G_DEFINE_TYPE_WITH_CODE (GESAssetFileSource, ges_asset_filesource,
G_DEFINE_TYPE_WITH_CODE (GESUriClipAsset, ges_uri_clip_asset,
GES_TYPE_ASSET_CLIP,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init));
......@@ -58,7 +58,7 @@ static GParamSpec *properties[PROP_LAST];
static void discoverer_discovered_cb (GstDiscoverer * discoverer,
GstDiscovererInfo * info, GError * err, gpointer user_data);
struct _GESAssetFileSourcePrivate
struct _GESUriClipAssetPrivate
{
GstDiscovererInfo *info;
GstClockTime duration;
......@@ -70,7 +70,7 @@ struct _GESAssetFileSourcePrivate
struct _GESAssetTrackFileSourcePrivate
{
GstDiscovererStreamInfo *sinfo;
GESAssetFileSource *parent_asset;
GESUriClipAsset *parent_asset;
const gchar *uri;
GESTrackType type;
......@@ -78,10 +78,10 @@ struct _GESAssetTrackFileSourcePrivate
static void
ges_asset_filesource_get_property (GObject * object, guint property_id,
ges_uri_clip_asset_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GESAssetFileSourcePrivate *priv = GES_ASSET_FILESOURCE (object)->priv;
GESUriClipAssetPrivate *priv = GES_URI_CLIP_ASSET (object)->priv;
switch (property_id) {
case PROP_DURATION:
......@@ -93,10 +93,10 @@ ges_asset_filesource_get_property (GObject * object, guint property_id,
}
static void
ges_asset_filesource_set_property (GObject * object, guint property_id,
ges_uri_clip_asset_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESAssetFileSourcePrivate *priv = GES_ASSET_FILESOURCE (object)->priv;
GESUriClipAssetPrivate *priv = GES_URI_CLIP_ASSET (object)->priv;
switch (property_id) {
case PROP_DURATION:
......@@ -112,7 +112,7 @@ _start_loading (GESAsset * asset, GError ** error)
{
gboolean ret;
const gchar *uri;
GESAssetFileSourceClass *class = GES_ASSET_FILESOURCE_GET_CLASS (asset);
GESUriClipAssetClass *class = GES_URI_CLIP_ASSET_GET_CLASS (asset);
GST_DEBUG ("Started loading %p", asset);
......@@ -173,13 +173,13 @@ _asset_proxied (GESAsset * self, const gchar * new_uri)
}
static void
ges_asset_filesource_class_init (GESAssetFileSourceClass * klass)
ges_uri_clip_asset_class_init (GESUriClipAssetClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESAssetFileSourcePrivate));
g_type_class_add_private (klass, sizeof (GESUriClipAssetPrivate));
object_class->get_property = ges_asset_filesource_get_property;
object_class->set_property = ges_asset_filesource_set_property;
object_class->get_property = ges_uri_clip_asset_get_property;
object_class->set_property = ges_uri_clip_asset_set_property;
GES_ASSET_CLASS (klass)->start_loading = _start_loading;
GES_ASSET_CLASS (klass)->request_id_update = _request_id_update;
......@@ -187,7 +187,7 @@ ges_asset_filesource_class_init (GESAssetFileSourceClass * klass)
/**
* GESAssetFileSource:duration:
* GESUriClipAsset:duration:
*
* The duration (in nanoseconds) of the media file
*/
......@@ -211,12 +211,12 @@ ges_asset_filesource_class_init (GESAssetFileSourceClass * klass)
}
static void
ges_asset_filesource_init (GESAssetFileSource * self)
ges_uri_clip_asset_init (GESUriClipAsset * self)
{
GESAssetFileSourcePrivate *priv;
GESUriClipAssetPrivate *priv;
priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_ASSET_FILESOURCE, GESAssetFileSourcePrivate);
GES_TYPE_URI_CLIP_ASSET, GESUriClipAssetPrivate);
priv->info = NULL;
priv->duration = GST_CLOCK_TIME_NONE;
......@@ -224,12 +224,12 @@ ges_asset_filesource_init (GESAssetFileSource * self)
}
static void
_create_track_file_source_asset (GESAssetFileSource * asset,
_create_track_file_source_asset (GESUriClipAsset * asset,
GstDiscovererStreamInfo * sinfo, GESTrackType type)
{
GESAsset *tck_filesource_asset;
GESAssetTrackFileSourcePrivate *priv_tckasset;
GESAssetFileSourcePrivate *priv = asset->priv;
GESUriClipAssetPrivate *priv = asset->priv;
gchar *stream_id =
g_strdup (gst_discoverer_stream_info_get_stream_id (sinfo));
......@@ -255,13 +255,12 @@ _create_track_file_source_asset (GESAssetFileSource * asset,
}
static void
ges_asset_filesource_set_info (GESAssetFileSource * self,
GstDiscovererInfo * info)
ges_uri_clip_asset_set_info (GESUriClipAsset * self, GstDiscovererInfo * info)
{
GList *tmp, *stream_list;
GESTrackType supportedformats = GES_TRACK_TYPE_UNKNOWN;
GESAssetFileSourcePrivate *priv = GES_ASSET_FILESOURCE (self)->priv;
GESUriClipAssetPrivate *priv = GES_URI_CLIP_ASSET (self)->priv;
/* Extract infos from the GstDiscovererInfo */
stream_list = gst_discoverer_info_get_stream_list (info);
......@@ -322,22 +321,21 @@ discoverer_discovered_cb (GstDiscoverer * discoverer,
const GstTagList *tags;
const gchar *uri = gst_discoverer_info_get_uri (info);
GESAssetFileSource *mfs =
GES_ASSET_FILESOURCE (ges_asset_cache_lookup
(GES_TYPE_TIMELINE_FILE_SOURCE, uri));
GESUriClipAsset *mfs =
GES_URI_CLIP_ASSET (ges_asset_cache_lookup (GES_TYPE_URI_CLIP, uri));
tags = gst_discoverer_info_get_tags (info);
if (tags)
gst_tag_list_foreach (tags, (GstTagForeachFunc) _set_meta_foreach, mfs);
if (err == NULL)
ges_asset_filesource_set_info (mfs, info);
ges_asset_cache_set_loaded (GES_TYPE_TIMELINE_FILE_SOURCE, uri, err);
ges_uri_clip_asset_set_info (mfs, info);
ges_asset_cache_set_loaded (GES_TYPE_URI_CLIP, uri, err);
}
/* API implementation */
/**
* ges_asset_filesource_get_info:
* ges_uri_clip_asset_get_info:
* @self: Target asset
*
* Gets #GstDiscovererInfo about the file
......@@ -345,68 +343,68 @@ discoverer_discovered_cb (GstDiscoverer * discoverer,
* Returns: (transfer none): #GstDiscovererInfo of specified asset
*/
GstDiscovererInfo *
ges_asset_filesource_get_info (const GESAssetFileSource * self)
ges_uri_clip_asset_get_info (const GESUriClipAsset * self)
{
return self->priv->info;
}
/**
* ges_asset_filesource_get_duration:
* @self: a #GESAssetFileSource
* ges_uri_clip_asset_get_duration:
* @self: a #GESUriClipAsset
*
* Gets duration of the file represented by @self
*
* Returns: The duration of @self
*/
GstClockTime
ges_asset_filesource_get_duration (GESAssetFileSource * self)
ges_uri_clip_asset_get_duration (GESUriClipAsset * self)
{
g_return_val_if_fail (GES_IS_ASSET_FILESOURCE (self), GST_CLOCK_TIME_NONE);
g_return_val_if_fail (GES_IS_URI_CLIP_ASSET (self), GST_CLOCK_TIME_NONE);
return self->priv->duration;
}
/**
* ges_asset_filesource_is_image:
* ges_uri_clip_asset_is_image:
* @self: a #indent: Standard input:311: Error:Unexpected end of file
GESAssetFileSource
GESUriClipAsset
*
* Gets Whether the file represented by @self is an image or not
*
* Returns: Whether the file represented by @self is an image or not
*/
gboolean
ges_asset_filesource_is_image (GESAssetFileSource * self)
ges_uri_clip_asset_is_image (GESUriClipAsset * self)
{
g_return_val_if_fail (GES_IS_ASSET_FILESOURCE (self), FALSE);
g_return_val_if_fail (GES_IS_URI_CLIP_ASSET (self), FALSE);
return self->priv->is_image;
}
/**
* ges_asset_filesource_new:
* @uri: The URI of the file for which to create a #GESAssetFileSource
* ges_uri_clip_asset_new:
* @uri: The URI of the file for which to create a #GESUriClipAsset
* @cancellable: optional %GCancellable object, %NULL to ignore.
* @callback: (scope async): a #GAsyncReadyCallback to call when the initialization is finished
* @user_data: The user data to pass when @callback is called
*
* Creates a #GESAssetFileSource for @uri
* Creates a #GESUriClipAsset for @uri
*
* Example of request of a GESAssetFileSource:
* Example of request of a GESUriClipAsset:
* |[
* // The request callback
* static void
* filesource_asset_loaded_cb (GESAsset * source, GAsyncResult * res, gpointer user_data)
* {
* GError *error = NULL;
* GESAssetFileSource *filesource_asset;
* GESUriClipAsset *filesource_asset;
*
* filesource_asset = GES_ASSET_FILESOURCE (ges_asset_request_finish (res, &error));
* 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_asset_filesource_is_image (filesource_asset) ? "" : " not",
* GST_TIME_ARGS (ges_asset_filesource_get_duration (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);
......@@ -416,36 +414,36 @@ ges_asset_filesource_is_image (GESAssetFileSource * self)
* }
*
* // The request:
* ges_asset_filesource_new (uri, (GAsyncReadyCallback) filesource_asset_loaded_cb, user_data);
* ges_uri_clip_asset_new (uri, (GAsyncReadyCallback) filesource_asset_loaded_cb, user_data);
* ]|
*/
void
ges_asset_filesource_new (const gchar * uri, GCancellable * cancellable,
ges_uri_clip_asset_new (const gchar * uri, GCancellable * cancellable,
GAsyncReadyCallback callback, gpointer user_data)
{
ges_asset_request_async (GES_TYPE_TIMELINE_FILE_SOURCE, uri, cancellable,