build: Add an option to disable examples
authorThibault Saunier <tsaunier@igalia.com>
Wed, 8 Jul 2020 11:42:38 +0000 (07:42 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 30 Jul 2020 22:44:13 +0000 (18:44 -0400)
And make it yield as in other modules

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

meson_options.txt
tools/ges-launcher.c

index fe25f55..5f15a78 100644 (file)
@@ -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
index 983ddc2..18ef9f3 100644 (file)
@@ -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;