Rename TrackFileSource to UriSource

This commit is contained in:
Thibault Saunier 2013-01-26 14:07:01 -03:00
parent 6363d0fdad
commit bfef8d77ba
11 changed files with 82 additions and 84 deletions

View file

@ -29,7 +29,7 @@ LOCAL_SRC_FILES := \
ges-track-element.c \
ges-source.c \
ges-track-operation.c \
ges-track-filesource.c \
ges-uri-source.c \
ges-track-image-source.c \
ges-track-transition.c \
ges-track-audio-transition.c \

View file

@ -63,7 +63,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<chapter>
<title>Track objects</title>
<xi:include href="xml/ges-track-filesource.xml"/>
<xi:include href="xml/ges-uri-source.xml"/>
<xi:include href="xml/ges-track-title-source.xml"/>
<xi:include href="xml/ges-audio-test-source.xml"/>
<xi:include href="xml/ges-video-test-source.xml"/>

View file

@ -161,13 +161,13 @@ GES_TYPE_TRACK_OPERATION
</SECTION>
<SECTION>
<FILE>ges-track-filesource</FILE>
<TITLE>GESTrackFileSource</TITLE>
GESTrackFileSource
<FILE>ges-uri-source</FILE>
<TITLE>GESUriSource</TITLE>
GESUriSource
ges_track_filesource_new
<SUBSECTION Standard>
GESTrackFileSourceClass
GESTrackFileSourcePrivate
GESUriSourceClass
GESUriSourcePrivate
GES_TRACK_FILESOURCE
GES_TRACK_FILESOURCE_CLASS
GES_TRACK_FILESOURCE_GET_CLASS
@ -1042,14 +1042,14 @@ GES_URI_CLIP_ASSET_GET_CLASS
<SECTION>
<FILE>ges-asset-track-file-source</FILE>
<TITLE>GESAssetTrackFileSource</TITLE>
GESAssetTrackFileSource
ges_asset_track_filesource_get_type
ges_asset_track_filesource_get_filesource_asset
ges_asset_track_filesource_get_stream_info
ges_asset_track_filesource_get_stream_uri
<TITLE>GESUriSourceAsset</TITLE>
GESUriSourceAsset
ges_uri_source_asset_get_type
ges_uri_source_asset_get_filesource_asset
ges_uri_source_asset_get_stream_info
ges_uri_source_asset_get_stream_uri
<SUBSECTION Standard>
GESAssetTrackFileSourcePrivate
GESUriSourceAssetPrivate
GES_ASSET_TRACK_FILESOURCE
GES_TYPE_ASSET_TRACK_FILESOURCE
GES_ASSET_TRACK_FILESOURCE_CLASS

View file

@ -33,7 +33,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-track-element.c \
ges-source.c \
ges-track-operation.c \
ges-track-filesource.c \
ges-uri-source.c \
ges-track-image-source.c \
ges-track-transition.c \
ges-track-audio-transition.c \
@ -89,7 +89,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-track-element.h \
ges-source.h \
ges-track-operation.h \
ges-track-filesource.h \
ges-uri-source.h \
ges-track-image-source.h \
ges-track-transition.h \
ges-track-audio-transition.h \

View file

@ -101,8 +101,8 @@ typedef struct _GESBaseEffectClass GESBaseEffectClass;
typedef struct _GESEffect GESEffect;
typedef struct _GESEffectClass GESEffectClass;
typedef struct _GESTrackFileSource GESTrackFileSource;
typedef struct _GESTrackFileSourceClass GESTrackFileSourceClass;
typedef struct _GESUriSource GESUriSource;
typedef struct _GESUriSourceClass GESUriSourceClass;
typedef struct _GESTrackImageSource GESTrackImageSource;
typedef struct _GESTrackImageSourceClass GESTrackImageSourceClass;
@ -152,8 +152,8 @@ typedef struct _GESUriClipAssetClass GESUriClipAssetClass;
typedef struct _GESAssetTrackElement GESAssetTrackElement;
typedef struct _GESAssetTrackElementClass GESAssetTrackElementClass;
typedef struct _GESAssetTrackFileSource GESAssetTrackFileSource;
typedef struct _GESAssetTrackFileSourceClass GESAssetTrackFileSourceClass;
typedef struct _GESUriSourceAsset GESUriSourceAsset;
typedef struct _GESUriSourceAssetClass GESUriSourceAssetClass;
typedef struct _GESProject GESProject;
typedef struct _GESProjectClass GESProjectClass;

View file

@ -67,7 +67,7 @@ struct _GESUriClipAssetPrivate
GList *asset_trackfilesources;
};
struct _GESAssetTrackFileSourcePrivate
struct _GESUriSourceAssetPrivate
{
GstDiscovererStreamInfo *sinfo;
GESUriClipAsset *parent_asset;
@ -224,11 +224,11 @@ ges_uri_clip_asset_init (GESUriClipAsset * self)
}
static void
_create_track_file_source_asset (GESUriClipAsset * asset,
_create_uri_source_asset (GESUriClipAsset * asset,
GstDiscovererStreamInfo * sinfo, GESTrackType type)
{
GESAsset *tck_filesource_asset;
GESAssetTrackFileSourcePrivate *priv_tckasset;
GESUriSourceAssetPrivate *priv_tckasset;
GESUriClipAssetPrivate *priv = asset->priv;
gchar *stream_id =
g_strdup (gst_discoverer_stream_info_get_stream_id (sinfo));
@ -286,9 +286,9 @@ ges_uri_clip_asset_set_info (GESUriClipAsset * self, GstDiscovererInfo * info)
type = GES_TRACK_TYPE_VIDEO;
}
GST_DEBUG_OBJECT (self, "Creating GESAssetTrackFileSource for stream: %s",
GST_DEBUG_OBJECT (self, "Creating GESUriSourceAsset for stream: %s",
gst_discoverer_stream_info_get_stream_id (sinf));
_create_track_file_source_asset (self, sinf, type);
_create_uri_source_asset (self, sinf, type);
}
ges_asset_clip_set_supported_formats (GES_ASSET_CLIP
(self), supportedformats);
@ -445,10 +445,10 @@ ges_uri_clip_asset_set_timeout (GESUriClipAssetClass * class,
* ges_uri_clip_asset_get_stream_assets:
* @self: A #GESUriClipAsset
*
* Get the GESAssetTrackFileSource @self containes
* Get the GESUriSourceAsset @self containes
*
* Returns: (transfer none) (element-type GESAssetTrackFileSource): a
* #GList of #GESAssetTrackFileSource
* Returns: (transfer none) (element-type GESUriSourceAsset): a
* #GList of #GESUriSourceAsset
*/
const GList *
ges_uri_clip_asset_get_stream_assets (GESUriClipAsset * self)
@ -459,25 +459,24 @@ ges_uri_clip_asset_get_stream_assets (GESUriClipAsset * self)
}
/*****************************************************************
* GESAssetTrackFileSource implementation *
* GESUriSourceAsset implementation *
*****************************************************************/
/**
* SECTION: ges-asset-track-file-source
* @short_description: A GESAsset subclass specialized in GESTrackFileSource extraction
* @short_description: A GESAsset subclass specialized in GESUriSource extraction
*
* NOTE: You should never request such a #GESAsset as they will be created automatically
* by #GESUriClipAsset-s.
*/
G_DEFINE_TYPE (GESAssetTrackFileSource, ges_asset_track_filesource,
G_DEFINE_TYPE (GESUriSourceAsset, ges_uri_source_asset,
GES_TYPE_ASSET_TRACK_ELEMENT);
static GESExtractable *
_extract (GESAsset * asset, GError ** error)
{
GESTrackElement *trackelement;
GESAssetTrackFileSourcePrivate *priv =
GES_ASSET_TRACK_FILESOURCE (asset)->priv;
GESUriSourceAssetPrivate *priv = GES_ASSET_TRACK_FILESOURCE (asset)->priv;
if (GST_IS_DISCOVERER_STREAM_INFO (priv->sinfo) == FALSE) {
GST_WARNING_OBJECT (asset, "Can not extract as no strean info set");
@ -499,20 +498,20 @@ _extract (GESAsset * asset, GError ** error)
}
static void
ges_asset_track_filesource_class_init (GESAssetTrackFileSourceClass * klass)
ges_uri_source_asset_class_init (GESUriSourceAssetClass * klass)
{
g_type_class_add_private (klass, sizeof (GESAssetTrackFileSourcePrivate));
g_type_class_add_private (klass, sizeof (GESUriSourceAssetPrivate));
GES_ASSET_CLASS (klass)->extract = _extract;
}
static void
ges_asset_track_filesource_init (GESAssetTrackFileSource * self)
ges_uri_source_asset_init (GESUriSourceAsset * self)
{
GESAssetTrackFileSourcePrivate *priv;
GESUriSourceAssetPrivate *priv;
priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_ASSET_TRACK_FILESOURCE, GESAssetTrackFileSourcePrivate);
GES_TYPE_ASSET_TRACK_FILESOURCE, GESUriSourceAssetPrivate);
priv->sinfo = NULL;
priv->parent_asset = NULL;
@ -522,7 +521,7 @@ ges_asset_track_filesource_init (GESAssetTrackFileSource * self)
}
/**
* ges_asset_track_filesource_get_stream_info:
* ges_uri_source_asset_get_stream_info:
* @asset: A #GESUriClipAsset
*
* Get the #GstDiscovererStreamInfo user by @asset
@ -530,7 +529,7 @@ ges_asset_track_filesource_init (GESAssetTrackFileSource * self)
* Returns: (transfer none): a #GESUriClipAsset
*/
GstDiscovererStreamInfo *
ges_asset_track_filesource_get_stream_info (GESAssetTrackFileSource * asset)
ges_uri_source_asset_get_stream_info (GESUriSourceAsset * asset)
{
g_return_val_if_fail (GES_IS_ASSET_TRACK_FILESOURCE (asset), NULL);
@ -538,7 +537,7 @@ ges_asset_track_filesource_get_stream_info (GESAssetTrackFileSource * asset)
}
const gchar *
ges_asset_track_filesource_get_stream_uri (GESAssetTrackFileSource * asset)
ges_uri_source_asset_get_stream_uri (GESUriSourceAsset * asset)
{
g_return_val_if_fail (GES_IS_ASSET_TRACK_FILESOURCE (asset), NULL);
@ -546,7 +545,7 @@ ges_asset_track_filesource_get_stream_uri (GESAssetTrackFileSource * asset)
}
/**
* ges_asset_track_filesource_get_filesource_asset:
* ges_uri_source_asset_get_filesource_asset:
* @asset: A #GESUriClipAsset
*
* Get the #GESUriClipAsset @self is contained in
@ -554,8 +553,7 @@ ges_asset_track_filesource_get_stream_uri (GESAssetTrackFileSource * asset)
* Returns: a #GESUriClipAsset
*/
const GESUriClipAsset *
ges_asset_track_filesource_get_filesource_asset (GESAssetTrackFileSource *
asset)
ges_uri_source_asset_get_filesource_asset (GESUriSourceAsset * asset)
{
g_return_val_if_fail (GES_IS_ASSET_TRACK_FILESOURCE (asset), NULL);

View file

@ -77,42 +77,42 @@ void ges_uri_clip_asset_set_timeout (GESUriClipAssetClass *class
GstClockTime timeout);
const GList * ges_uri_clip_asset_get_stream_assets (GESUriClipAsset *self);
#define GES_TYPE_ASSET_TRACK_FILESOURCE ges_asset_track_filesource_get_type()
#define GES_TYPE_ASSET_TRACK_FILESOURCE ges_uri_source_asset_get_type()
#define GES_ASSET_TRACK_FILESOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_ASSET_TRACK_FILESOURCE, GESAssetTrackFileSource))
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_ASSET_TRACK_FILESOURCE, GESUriSourceAsset))
#define GES_ASSET_TRACK_FILESOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_ASSET_TRACK_FILESOURCE, GESAssetTrackFileSourceClass))
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_ASSET_TRACK_FILESOURCE, GESUriSourceAssetClass))
#define GES_IS_ASSET_TRACK_FILESOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_ASSET_TRACK_FILESOURCE))
#define GES_IS_ASSET_TRACK_FILESOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_ASSET_TRACK_FILESOURCE))
#define GES_ASSET_TRACK_FILESOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_ASSET_TRACK_FILESOURCE, GESAssetTrackFileSourceClass))
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_ASSET_TRACK_FILESOURCE, GESUriSourceAssetClass))
typedef struct _GESAssetTrackFileSourcePrivate GESAssetTrackFileSourcePrivate;
typedef struct _GESUriSourceAssetPrivate GESUriSourceAssetPrivate;
GType ges_asset_track_filesource_get_type (void);
GType ges_uri_source_asset_get_type (void);
struct _GESAssetTrackFileSource
struct _GESUriSourceAsset
{
GESAssetTrackElement parent;
/* <private> */
GESAssetTrackFileSourcePrivate *priv;
GESUriSourceAssetPrivate *priv;
/* Padding for API extension */
gpointer __ges_reserved[GES_PADDING];
};
struct _GESAssetTrackFileSourceClass
struct _GESUriSourceAssetClass
{
GESAssetTrackElementClass parent_class;
gpointer _ges_reserved[GES_PADDING];
};
GstDiscovererStreamInfo * ges_asset_track_filesource_get_stream_info (GESAssetTrackFileSource *asset);
const gchar * ges_asset_track_filesource_get_stream_uri (GESAssetTrackFileSource *asset);
const GESUriClipAsset *ges_asset_track_filesource_get_filesource_asset (GESAssetTrackFileSource *asset);
GstDiscovererStreamInfo * ges_uri_source_asset_get_stream_info (GESUriSourceAsset *asset);
const gchar * ges_uri_source_asset_get_stream_uri (GESUriSourceAsset *asset);
const GESUriClipAsset *ges_uri_source_asset_get_filesource_asset (GESUriSourceAsset *asset);
G_END_DECLS
#endif /* _GES_URI_CLIP_ASSET */

View file

@ -29,7 +29,7 @@
#include "ges-internal.h"
#include "ges-uri-clip.h"
#include "ges-source-clip.h"
#include "ges-track-filesource.h"
#include "ges-uri-source.h"
#include "ges-uri-asset.h"
#include "ges-asset-track-object.h"
#include "ges-extractable.h"
@ -406,7 +406,7 @@ ges_uri_clip_create_track_element (GESClip * obj, GESTrackType type)
}
} else {
GST_DEBUG ("Creating a GESTrackFileSource");
GST_DEBUG ("Creating a GESUriSource");
/* FIXME : Implement properly ! */
res = (GESTrackElement *) ges_track_filesource_new (priv->uri);

View file

@ -19,7 +19,7 @@
*/
/**
* SECTION:ges-track-filesource
* SECTION:ges-uri-source
* @short_description: outputs a single media stream from a given file
*
* Outputs a single media stream from a given file. The stream chosen depends on
@ -28,7 +28,7 @@
#include "ges-internal.h"
#include "ges-track-element.h"
#include "ges-track-filesource.h"
#include "ges-uri-source.h"
#include "ges-uri-asset.h"
#include "ges-extractable.h"
@ -60,12 +60,12 @@ ges_extractable_interface_init (GESExtractableInterface * iface)
iface->set_asset = extractable_set_asset;
}
G_DEFINE_TYPE_WITH_CODE (GESTrackFileSource, ges_track_filesource,
G_DEFINE_TYPE_WITH_CODE (GESUriSource, ges_track_filesource,
GES_TYPE_SOURCE,
G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE,
ges_extractable_interface_init));
struct _GESTrackFileSourcePrivate
struct _GESUriSourcePrivate
{
void *dummy;
};
@ -80,7 +80,7 @@ static void
ges_track_filesource_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GESTrackFileSource *uriclip = GES_TRACK_FILESOURCE (object);
GESUriSource *uriclip = GES_TRACK_FILESOURCE (object);
switch (property_id) {
case PROP_URI:
@ -95,7 +95,7 @@ static void
ges_track_filesource_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTrackFileSource *uriclip = GES_TRACK_FILESOURCE (object);
GESUriSource *uriclip = GES_TRACK_FILESOURCE (object);
switch (property_id) {
case PROP_URI:
@ -109,7 +109,7 @@ ges_track_filesource_set_property (GObject * object, guint property_id,
static void
ges_track_filesource_dispose (GObject * object)
{
GESTrackFileSource *uriclip = GES_TRACK_FILESOURCE (object);
GESUriSource *uriclip = GES_TRACK_FILESOURCE (object);
if (uriclip->uri)
g_free (uriclip->uri);
@ -123,25 +123,25 @@ ges_track_filesource_create_gnl_object (GESTrackElement * object)
GstElement *gnlobject;
gnlobject = gst_element_factory_make ("gnlurisource", NULL);
g_object_set (gnlobject, "uri", ((GESTrackFileSource *) object)->uri, NULL);
g_object_set (gnlobject, "uri", ((GESUriSource *) object)->uri, NULL);
return gnlobject;
}
static void
ges_track_filesource_class_init (GESTrackFileSourceClass * klass)
ges_track_filesource_class_init (GESUriSourceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTrackElementClass *track_class = GES_TRACK_ELEMENT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTrackFileSourcePrivate));
g_type_class_add_private (klass, sizeof (GESUriSourcePrivate));
object_class->get_property = ges_track_filesource_get_property;
object_class->set_property = ges_track_filesource_set_property;
object_class->dispose = ges_track_filesource_dispose;
/**
* GESTrackFileSource:uri:
* GESUriSource:uri:
*
* The location of the file/resource to use.
*/
@ -152,22 +152,22 @@ ges_track_filesource_class_init (GESTrackFileSourceClass * klass)
}
static void
ges_track_filesource_init (GESTrackFileSource * self)
ges_track_filesource_init (GESUriSource * self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_TRACK_FILESOURCE, GESTrackFileSourcePrivate);
GES_TYPE_TRACK_FILESOURCE, GESUriSourcePrivate);
}
/**
* ges_track_filesource_new:
* @uri: the URI the source should control
*
* Creates a new #GESTrackFileSource for the provided @uri.
* Creates a new #GESUriSource for the provided @uri.
*
* Returns: The newly created #GESTrackFileSource, or %NULL if there was an
* Returns: The newly created #GESUriSource, or %NULL if there was an
* error.
*/
GESTrackFileSource *
GESUriSource *
ges_track_filesource_new (gchar * uri)
{
return g_object_new (GES_TYPE_TRACK_FILESOURCE, "uri", uri, NULL);

View file

@ -30,10 +30,10 @@ G_BEGIN_DECLS
#define GES_TYPE_TRACK_FILESOURCE ges_track_filesource_get_type()
#define GES_TRACK_FILESOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TRACK_FILESOURCE, GESTrackFileSource))
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TRACK_FILESOURCE, GESUriSource))
#define GES_TRACK_FILESOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TRACK_FILESOURCE, GESTrackFileSourceClass))
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TRACK_FILESOURCE, GESUriSourceClass))
#define GES_IS_TRACK_FILESOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TRACK_FILESOURCE))
@ -42,26 +42,26 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TRACK_FILESOURCE))
#define GES_TRACK_FILESOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_FILESOURCE, GESTrackFileSourceClass))
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_FILESOURCE, GESUriSourceClass))
typedef struct _GESTrackFileSourcePrivate GESTrackFileSourcePrivate;
typedef struct _GESUriSourcePrivate GESUriSourcePrivate;
/**
* GESTrackFileSource:
* GESUriSource:
*/
struct _GESTrackFileSource {
struct _GESUriSource {
/*< private >*/
GESSource parent;
gchar *uri;
GESTrackFileSourcePrivate *priv;
GESUriSourcePrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
struct _GESTrackFileSourceClass {
struct _GESUriSourceClass {
/*< private >*/
GESSourceClass parent_class;
@ -71,7 +71,7 @@ struct _GESTrackFileSourceClass {
GType ges_track_filesource_get_type (void);
GESTrackFileSource* ges_track_filesource_new (gchar *uri);
GESUriSource* ges_track_filesource_new (gchar *uri);
G_END_DECLS

View file

@ -60,7 +60,7 @@
#include <ges/ges-source.h>
#include <ges/ges-track-operation.h>
#include <ges/ges-track-filesource.h>
#include <ges/ges-uri-source.h>
#include <ges/ges-track-image-source.h>
#include <ges/ges-video-test-source.h>
#include <ges/ges-audio-test-source.h>