[gegl/video-rejuvenation: 16/60] ui: include video files in thumbnails/overview listings



commit 1da1d189c1d3fc2f36bac5d25e24316bbc3b7811
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Oct 13 21:16:28 2015 +0200

    ui: include video files in thumbnails/overview listings

 bin/mrg-ui.c          |   19 ++++++++++++++++++-
 examples/gegl-video.c |    2 +-
 2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/bin/mrg-ui.c b/bin/mrg-ui.c
index ad23a7f..8f77e73 100644
--- a/bin/mrg-ui.c
+++ b/bin/mrg-ui.c
@@ -207,6 +207,23 @@ static int str_has_image_suffix (char *path)
          g_str_has_suffix (path, ".exr");
 }
 
+static int str_has_video_suffix (char *path)
+{
+  return g_str_has_suffix (path, ".avi") ||
+         g_str_has_suffix (path, ".AVI") ||
+         g_str_has_suffix (path, ".mp4") ||
+         g_str_has_suffix (path, ".MP4") ||
+         g_str_has_suffix (path, ".mkv") ||
+         g_str_has_suffix (path, ".MKV") ||
+         g_str_has_suffix (path, ".mov") ||
+         g_str_has_suffix (path, ".ogg");
+}
+
+static int str_has_visual_suffix (char *path)
+{
+  return str_has_image_suffix (path) || str_has_video_suffix (path);
+}
+
 static void populate_paths (State *o)
 {
   struct dirent **namelist;
@@ -238,7 +255,7 @@ static void populate_paths (State *o)
   for (i = 0; i < n; i++)
   {
     if (namelist[i]->d_name[0] != '.' &&
-        str_has_image_suffix (namelist[i]->d_name))
+        str_has_visual_suffix (namelist[i]->d_name))
     {
       gchar *fpath = g_strdup_printf ("%s/%s", path, namelist[i]->d_name);
 
diff --git a/examples/gegl-video.c b/examples/gegl-video.c
index 44d861f..7e5ee5d 100644
--- a/examples/gegl-video.c
+++ b/examples/gegl-video.c
@@ -254,7 +254,7 @@ main (gint    argc,
       readbuf = gegl_node_new_child (gegl_display,
                                      "operation", "gegl:buffer-source",
                                      NULL);
-      display = gegl_node_create_child (gegl_display, "gegl:display");
+      display = gegl_node_create_child (gegl_display, "gegl:sdl-display");
       gegl_node_link_many (readbuf, display, NULL);
       break;
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]