mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
add assets to layer and adjust position and duration (closes #45)
This commit is contained in:
parent
3b182342e0
commit
dc463e2550
1 changed files with 10 additions and 2 deletions
|
@ -27,7 +27,9 @@ bus_message_cb (GstBus * bus, GstMessage * message, GMainLoop * mainloop);
|
|||
|
||||
static GstEncodingProfile *make_profile_from_info (GstDiscovererInfo * info);
|
||||
|
||||
GESLayer *layer = NULL;
|
||||
GESPipeline *pipeline = NULL;
|
||||
GESTimeline *timeline = NULL;
|
||||
gchar *output_uri = NULL;
|
||||
guint assetsCount = 0;
|
||||
guint assetsLoaded = 0;
|
||||
|
@ -37,16 +39,23 @@ asset_loaded_cb (GObject * source_object, GAsyncResult * res,
|
|||
GMainLoop * mainloop)
|
||||
{
|
||||
GError *error = NULL;
|
||||
guint64 duration = 0;
|
||||
|
||||
GESUriClipAsset *mfs =
|
||||
GES_URI_CLIP_ASSET (ges_asset_request_finish (res, &error));
|
||||
|
||||
if (error) {
|
||||
GST_WARNING ("error creating asseti %s", error->message);
|
||||
GST_WARNING ("error creating asset %s", error->message);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
duration = ges_uri_clip_asset_get_duration (mfs);
|
||||
ges_layer_add_asset (layer,
|
||||
GES_ASSET (source_object),
|
||||
ges_timeline_get_duration (timeline),
|
||||
0, duration, ges_clip_asset_get_supported_formats (GES_CLIP_ASSET (mfs)));
|
||||
|
||||
assetsLoaded++;
|
||||
/*
|
||||
* Check if we have loaded last asset and trigger concatenating
|
||||
|
@ -71,7 +80,6 @@ main (int argc, char **argv)
|
|||
{
|
||||
GMainLoop *mainloop = NULL;
|
||||
GESTimeline *timeline;
|
||||
GESLayer *layer = NULL;
|
||||
GstBus *bus = NULL;
|
||||
guint i;
|
||||
|
||||
|
|
Loading…
Reference in a new issue