Top | ![]() |
![]() |
![]() |
![]() |
gboolean | ges_project_load () |
gboolean | ges_project_add_asset () |
gboolean | ges_project_remove_asset () |
GList * | ges_project_list_assets () |
GESAsset * | ges_project_get_asset () |
gboolean | ges_project_save () |
gboolean | ges_project_create_asset () |
GType | ges_project_get_type () |
gchar * | ges_project_get_uri () |
GESProject * | ges_project_new () |
gboolean | ges_project_add_encoding_profile () |
const GList * | ges_project_list_encoding_profiles () |
GList * | ges_project_get_loading_assets () |
void | asset-added | Run Last |
void | asset-removed | Run Last |
void | error-loading-asset | Run Last |
void | loaded | Run First |
gchar* | missing-uri | Run Last |
The GESProject is used to control a set of GESAsset and is a
GESAsset with GES_TYPE_TIMELINE as extractable_type
itself. That
means that you can extract GESTimeline from a project as followed:
1 2 3 4 5 6 7 8 9 10 |
GESProject *project; GESTimeline *timeline; project = ges_project_new ("file:///path/to/a/valid/project/uri"); // Here you can connect to the various signal to get more infos about // what is happening and recover from errors if possible ... timeline = ges_asset_extract (GES_ASSET (project)); |
The GESProject class offers a higher level API to handle GESAsset-s. It lets you request new asset, and it informs you about new assets through a set of signals. Also it handles problem such as missing files/missing GstElement and lets you try to recover from those.
gboolean ges_project_load (GESProject *project
,GESTimeline *timeline
,GError **error
);
Loads project
into timeline
project |
A GESProject that has an |
|
timeline |
A blank timeline to load |
|
error |
An error to be set in case something wrong happens or |
[out][allow-none] |
gboolean ges_project_add_asset (GESProject *project
,GESAsset *asset
);
Adds a Asset to project
, the project will keep a reference on
asset
.
gboolean ges_project_remove_asset (GESProject *project
,GESAsset *asset
);
remove a asset
to from project
.
GList * ges_project_list_assets (GESProject *project
,GType filter
);
List all asset
contained in project
filtering per extractable_type
as defined by filter
. It copies the asset and thus will not be updated
in time.
GESAsset * ges_project_get_asset (GESProject *project
,const gchar *id
,GType extractable_type
);
gboolean ges_project_save (GESProject *project
,GESTimeline *timeline
,const gchar *uri
,GESAsset *formatter_asset
,gboolean overwrite
,GError **error
);
Save the timeline of project
to uri
. You should make sure that timeline
is one of the timelines that have been extracted from project
(using ges_asset_extract (project
);)
project |
A GESProject to save |
|
timeline |
The GESTimeline to save, it must have been extracted from |
|
uri |
The uri where to save |
|
formatter_asset |
The formatter asset to use or |
[allow-none] |
overwrite |
|
|
error |
An error to be set in case something wrong happens or |
[out][allow-none] |
gboolean ges_project_create_asset (GESProject *project
,const gchar *id
,GType extractable_type
);
Create and add a GESAsset to project
. You should connect to the
"asset-added" signal to get the asset when it finally gets added to
project
gchar *
ges_project_get_uri (GESProject *project
);
Retrieve the uri that is currently set on project
GESProject *
ges_project_new (const gchar *id
);
Creates a new GESProject and sets its uri to uri
if provided. Note that
if uri
is not valid or NULL
, the uri of the project will then be set
the first time you save the project. If you then save the project to
other locations, it will never be updated again and the first valid URI is
the URI it will keep refering to.
gboolean ges_project_add_encoding_profile (GESProject *project
,GstEncodingProfile *profile
);
Adds profile
to the project. It lets you save in what format
the project has been renders and keep a reference to those formats.
Also, those formats will be saves to the project file when possible.
const GList *
ges_project_list_encoding_profiles (GESProject *project
);
Lists the encoding profile that have been set to project
. The first one
is the latest added.
GList *
ges_project_get_loading_assets (GESProject *project
);
Get the assets that are being loaded
“asset-added”
signalvoid user_function (GESProject *formatter, GESAsset *asset, gpointer user_data)
formatter |
the GESProject |
|
asset |
The GESAsset that has been added to |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“asset-removed”
signalvoid user_function (GESProject *formatter, GESAsset *asset, gpointer user_data)
formatter |
the GESProject |
|
asset |
The GESAsset that has been removed from |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“error-loading-asset”
signalvoid user_function (GESProject *project, GError *error, gchar *id, GType *extractable_type, gpointer user_data)
Informs you that a GESAsset could not be created. In case of missing GStreamer plugins, the error will be set to GST_CORE_ERROR GST_CORE_ERROR_MISSING_PLUGIN
project |
the GESProject on which a problem happend when creted a GESAsset |
|
error |
The GError defining the error that accured, might be |
|
id |
The |
|
extractable_type |
The |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“loaded”
signalvoid user_function (GESProject *project, GESTimeline *timeline, gpointer user_data)
project |
the GESProject that is done loading a project. |
|
timeline |
The GESTimeline that complete loading |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“missing-uri”
signalgchar* user_function (GESProject *project, GError *error, GESAsset *wrong_asset, gpointer user_data)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
static gchar source_moved_cb (GESProject *project, GError *error, GESAsset *asset_with_error) { return g_strdup ("file:///the/new/uri.ogg"); } static int main (int argc, gchar ** argv) { GESTimeline *timeline; GESProject *project = ges_project_new ("file:///some/uri.xges"); g_signal_connect (project, "missing-uri", source_moved_cb, NULL); timeline = ges_asset_extract (GES_ASSET (project)); } |
project |
the GESProject reporting that a file has moved |
|
error |
The error that happened |
|
wrong_asset |
The asset with the wrong ID, you should us it and its content only to find out what the new location is. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last