From e29138323797c6f5f08273aa05dd4fd7225c9a96 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 8 Jul 2020 07:42:38 -0400 Subject: [PATCH] build: Add an option to disable examples And make it yield as in other modules Part-of: --- meson_options.txt | 1 + tools/ges-launcher.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index fe25f55..5f15a78 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,3 +23,4 @@ option('libpython-dir', type : 'string', value : '', description: 'Path to find libpythonXX.so') option('validate', type : 'feature', value : 'auto', yield: true, description: 'Enable GstValidate integration.') +option('examples', type : 'feature', value : 'auto', yield : true) \ No newline at end of file diff --git a/tools/ges-launcher.c b/tools/ges-launcher.c index 983ddc2..18ef9f3 100644 --- a/tools/ges-launcher.c +++ b/tools/ges-launcher.c @@ -141,14 +141,21 @@ static GstEncodingProfile * get_smart_profile (GESLauncher * self) { gint n_audio, n_video; - GList *tmp, *assets, *possible_profiles = NULL; + GList *tmp, *assets = NULL, *possible_profiles = NULL; GstEncodingProfile *res = NULL; - GESProject *proj = - GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (self-> - priv->timeline))); _check_has_audio_video (self, &n_audio, &n_video); - assets = ges_project_list_assets (proj, GES_TYPE_URI_CLIP); + for (tmp = self->priv->timeline->layers; tmp; tmp = tmp->next) { + GList *tclip, *clips = ges_layer_get_clips (tmp->data); + + for (tclip = clips; tclip; tclip = tclip->next) { + if (GES_IS_URI_CLIP (tclip->data)) + assets = + g_list_append (assets, ges_extractable_get_asset (tclip->data)); + } + g_list_free_full (clips, gst_object_unref); + } + for (tmp = assets; tmp; tmp = tmp->next) { GESAsset *asset = tmp->data; GList *audio_streams, *video_streams; -- 2.7.4