summaryrefslogtreecommitdiff
path: root/thumbnailer
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 14:35:32 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 14:35:32 +0200
commite230b6f78546827521107be23797048482c8b193 (patch)
tree948c1e77382c484819ea399bba4edcdc19cc6bf0 /thumbnailer
parent211da5fc3048ca2b6ccee2166b0aaaade55cb84f (diff)
parent49120f48474fc8fdc2448c75d961bc238213cfac (diff)
Update upstream source from tag 'upstream/0.28.2'
Update to upstream version '0.28.2' with Debian dir 811236a8e9a1308bf427065dcb6270419ff4f965
Diffstat (limited to 'thumbnailer')
-rw-r--r--thumbnailer/meson.build5
-rw-r--r--thumbnailer/shotwell-video-thumbnailer.c295
-rw-r--r--thumbnailer/shotwell-video-thumbnailer.vala22
3 files changed, 201 insertions, 121 deletions
diff --git a/thumbnailer/meson.build b/thumbnailer/meson.build
new file mode 100644
index 0000000..29acb1f
--- /dev/null
+++ b/thumbnailer/meson.build
@@ -0,0 +1,5 @@
+executable('shotwell-video-thumbnailer',
+ 'shotwell-video-thumbnailer.vala',
+ dependencies : [posix, gstreamer, gee, gdk_pixbuf],
+ install : true,
+ install_dir : join_paths(get_option('libexecdir'), 'shotwell'))
diff --git a/thumbnailer/shotwell-video-thumbnailer.c b/thumbnailer/shotwell-video-thumbnailer.c
index c40d6c7..7446b90 100644
--- a/thumbnailer/shotwell-video-thumbnailer.c
+++ b/thumbnailer/shotwell-video-thumbnailer.c
@@ -18,6 +18,7 @@
#include <string.h>
#include <gst/gst.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <unistd.h>
#include <stdio.h>
#include <gobject/gvaluecollector.h>
@@ -32,8 +33,9 @@
typedef struct _ShotwellThumbnailer ShotwellThumbnailer;
typedef struct _ShotwellThumbnailerClass ShotwellThumbnailerClass;
typedef struct _ShotwellThumbnailerPrivate ShotwellThumbnailerPrivate;
-#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ParamSpecShotwellThumbnailer ParamSpecShotwellThumbnailer;
@@ -67,15 +69,73 @@ enum {
};
#define SHOTWELL_THUMBNAILER_caps_string "video/x-raw,format=RGB,pixel-aspect-ratio=1/1"
gint shotwell_thumbnailer_main (gchar** args, int args_length1);
+static gboolean __lambda4_ (GstPluginFeature* f);
+static gboolean ___lambda4__gst_plugin_feature_filter (GstPluginFeature* feature, gpointer self);
+static void _g_object_unref0_ (gpointer var);
+static void _g_list_free__g_object_unref0_ (GList* self);
ShotwellThumbnailer* shotwell_thumbnailer_new (void);
ShotwellThumbnailer* shotwell_thumbnailer_construct (GType object_type);
static void shotwell_thumbnailer_finalize (ShotwellThumbnailer * obj);
static gpointer _g_object_ref0 (gpointer self) {
-#line 25 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+#line 29 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return self ? g_object_ref (self) : NULL;
-#line 79 "shotwell-video-thumbnailer.c"
+#line 85 "shotwell-video-thumbnailer.c"
+}
+
+
+static gboolean __lambda4_ (GstPluginFeature* f) {
+ gboolean result = FALSE;
+ GstPluginFeature* _tmp0_;
+ gchar* _tmp1_;
+ gchar* _tmp2_;
+ gboolean _tmp3_;
+ gboolean _tmp4_;
+#line 30 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ g_return_val_if_fail (GST_IS_PLUGIN_FEATURE (f), FALSE);
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp0_ = f;
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp1_ = gst_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gst_object_get_type (), GstObject));
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp2_ = _tmp1_;
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp3_ = g_str_has_prefix (_tmp2_, "vaapi");
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp4_ = _tmp3_;
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _g_free0 (_tmp2_);
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ result = _tmp4_;
+#line 31 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ return result;
+#line 114 "shotwell-video-thumbnailer.c"
+}
+
+
+static gboolean ___lambda4__gst_plugin_feature_filter (GstPluginFeature* feature, gpointer self) {
+ gboolean result;
+ result = __lambda4_ (feature);
+#line 30 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ return result;
+#line 123 "shotwell-video-thumbnailer.c"
+}
+
+
+static void _g_object_unref0_ (gpointer var) {
+#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
+#line 130 "shotwell-video-thumbnailer.c"
+}
+
+
+static void _g_list_free__g_object_unref0_ (GList* self) {
+#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
+#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ g_list_free (self);
+#line 139 "shotwell-video-thumbnailer.c"
}
@@ -91,16 +151,14 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
gint64 duration = 0LL;
gint64 position = 0LL;
GstStateChangeReturn ret = 0;
+ gint _tmp0_;
GstRegistry* registry = NULL;
- GstRegistry* _tmp0_;
GstRegistry* _tmp1_;
- GstPluginFeature* feature = NULL;
GstRegistry* _tmp2_;
- GstPluginFeature* _tmp3_;
- GstPluginFeature* _tmp4_;
- GstRegistry* _tmp7_;
- GstPluginFeature* _tmp8_;
- GstPluginFeature* _tmp9_;
+ GList* features = NULL;
+ GstRegistry* _tmp3_;
+ GList* _tmp4_;
+ GList* _tmp5_;
gchar** _tmp12_;
gint _tmp12__length1;
gchar** _tmp16_;
@@ -113,56 +171,73 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
gchar* _tmp22_;
GError * _inner_error_ = NULL;
#line 23 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- gst_init (&args_length1, &args);
-#line 25 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp0_ = gst_registry_get ();
-#line 25 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp1_ = _g_object_ref0 (_tmp0_);
-#line 25 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- registry = _tmp1_;
-#line 27 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp2_ = registry;
-#line 27 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp3_ = gst_registry_find_feature (_tmp2_, "vaapidecodebin", gst_element_factory_get_type ());
+ _tmp0_ = nice (19);
+#line 23 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ if (_tmp0_ < 0) {
+#line 24 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ g_debug ("shotwell-video-thumbnailer.vala:24: Failed to reduce thumbnailer nice " \
+"level. Continuing anyway");
+#line 180 "shotwell-video-thumbnailer.c"
+ }
#line 27 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- feature = _tmp3_;
+ gst_init (&args_length1, &args);
#line 29 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp4_ = feature;
+ _tmp1_ = gst_registry_get ();
#line 29 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- if (_tmp4_ != NULL) {
-#line 134 "shotwell-video-thumbnailer.c"
- GstRegistry* _tmp5_;
- GstPluginFeature* _tmp6_;
+ _tmp2_ = _g_object_ref0 (_tmp1_);
+#line 29 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ registry = _tmp2_;
#line 30 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp5_ = registry;
+ _tmp3_ = registry;
#line 30 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp6_ = feature;
+ _tmp4_ = gst_registry_feature_filter (_tmp3_, ___lambda4__gst_plugin_feature_filter, FALSE, NULL);
#line 30 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- gst_registry_remove_feature (_tmp5_, _tmp6_);
-#line 143 "shotwell-video-thumbnailer.c"
- }
-#line 33 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp7_ = registry;
-#line 33 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp8_ = gst_registry_find_feature (_tmp7_, "vaapidecode", gst_element_factory_get_type ());
-#line 33 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
-#line 33 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- feature = _tmp8_;
+ features = _tmp4_;
+#line 34 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp5_ = features;
+#line 198 "shotwell-video-thumbnailer.c"
+ {
+ GList* feature_collection = NULL;
+ GList* feature_it = NULL;
+#line 34 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ feature_collection = _tmp5_;
+#line 34 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ for (feature_it = feature_collection; feature_it != NULL; feature_it = feature_it->next) {
+#line 206 "shotwell-video-thumbnailer.c"
+ GstPluginFeature* _tmp6_;
+ GstPluginFeature* feature = NULL;
+#line 34 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp6_ = _g_object_ref0 ((GstPluginFeature*) feature_it->data);
+#line 34 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ feature = _tmp6_;
+#line 213 "shotwell-video-thumbnailer.c"
+ {
+ GstPluginFeature* _tmp7_;
+ gchar* _tmp8_;
+ gchar* _tmp9_;
+ GstRegistry* _tmp10_;
+ GstPluginFeature* _tmp11_;
+#line 35 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp7_ = feature;
+#line 35 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _tmp8_ = gst_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gst_object_get_type (), GstObject));
#line 35 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp9_ = feature;
+ _tmp9_ = _tmp8_;
#line 35 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- if (_tmp9_ != NULL) {
-#line 157 "shotwell-video-thumbnailer.c"
- GstRegistry* _tmp10_;
- GstPluginFeature* _tmp11_;
+ g_debug ("shotwell-video-thumbnailer.vala:35: Removing registry feature %s", _tmp9_);
+#line 35 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _g_free0 (_tmp9_);
#line 36 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp10_ = registry;
+ _tmp10_ = registry;
#line 36 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _tmp11_ = feature;
+ _tmp11_ = feature;
#line 36 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- gst_registry_remove_feature (_tmp10_, _tmp11_);
-#line 166 "shotwell-video-thumbnailer.c"
+ gst_registry_remove_feature (_tmp10_, _tmp11_);
+#line 34 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
+ _g_object_unref0 (feature);
+#line 238 "shotwell-video-thumbnailer.c"
+ }
+ }
}
#line 39 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp12_ = args;
@@ -170,7 +245,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_tmp12__length1 = args_length1;
#line 39 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (_tmp12__length1 != 2) {
-#line 174 "shotwell-video-thumbnailer.c"
+#line 248 "shotwell-video-thumbnailer.c"
FILE* _tmp13_;
gchar** _tmp14_;
gint _tmp14__length1;
@@ -188,7 +263,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
result = 1;
#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -203,7 +278,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 41 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 207 "shotwell-video-thumbnailer.c"
+#line 281 "shotwell-video-thumbnailer.c"
}
#line 44 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp16_ = args;
@@ -229,7 +304,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_free0 (_tmp21_);
#line 44 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_free0 (_tmp19_);
-#line 233 "shotwell-video-thumbnailer.c"
+#line 307 "shotwell-video-thumbnailer.c"
{
GstElement* _tmp23_ = NULL;
const gchar* _tmp24_;
@@ -269,7 +344,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_tmp23_ = _tmp25_;
#line 49 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 273 "shotwell-video-thumbnailer.c"
+#line 347 "shotwell-video-thumbnailer.c"
goto __catch0_g_error;
}
#line 49 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -300,7 +375,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_tmp31_ = ret;
#line 56 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (_tmp31_ == GST_STATE_CHANGE_FAILURE) {
-#line 304 "shotwell-video-thumbnailer.c"
+#line 378 "shotwell-video-thumbnailer.c"
FILE* _tmp32_;
#line 57 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp32_ = stderr;
@@ -311,7 +386,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 58 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
#line 58 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 58 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 58 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -326,14 +401,14 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 58 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 330 "shotwell-video-thumbnailer.c"
+#line 404 "shotwell-video-thumbnailer.c"
} else {
GstStateChangeReturn _tmp33_;
#line 59 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp33_ = ret;
#line 59 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (_tmp33_ == GST_STATE_CHANGE_NO_PREROLL) {
-#line 337 "shotwell-video-thumbnailer.c"
+#line 411 "shotwell-video-thumbnailer.c"
FILE* _tmp34_;
#line 60 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp34_ = stderr;
@@ -344,7 +419,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 61 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
#line 61 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 61 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 61 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -359,7 +434,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 61 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 363 "shotwell-video-thumbnailer.c"
+#line 437 "shotwell-video-thumbnailer.c"
}
}
#line 67 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -372,7 +447,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_tmp37_ = ret;
#line 68 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (_tmp37_ == GST_STATE_CHANGE_FAILURE) {
-#line 376 "shotwell-video-thumbnailer.c"
+#line 450 "shotwell-video-thumbnailer.c"
FILE* _tmp38_;
#line 69 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp38_ = stderr;
@@ -383,7 +458,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 70 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
#line 70 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 70 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 70 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -398,7 +473,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 70 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 402 "shotwell-video-thumbnailer.c"
+#line 476 "shotwell-video-thumbnailer.c"
}
#line 74 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp39_ = pipeline;
@@ -408,7 +483,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
duration = _tmp40_;
#line 74 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (!_tmp41_) {
-#line 412 "shotwell-video-thumbnailer.c"
+#line 486 "shotwell-video-thumbnailer.c"
FILE* _tmp42_;
#line 75 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp42_ = stderr;
@@ -419,7 +494,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 76 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
#line 76 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 76 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 76 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -434,7 +509,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 76 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 438 "shotwell-video-thumbnailer.c"
+#line 512 "shotwell-video-thumbnailer.c"
}
#line 79 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
position = (gint64) (1 * GST_SECOND);
@@ -454,7 +529,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_tmp47_ = ret;
#line 88 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (_tmp47_ == GST_STATE_CHANGE_FAILURE) {
-#line 458 "shotwell-video-thumbnailer.c"
+#line 532 "shotwell-video-thumbnailer.c"
FILE* _tmp48_;
#line 89 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp48_ = stderr;
@@ -465,7 +540,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 90 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
#line 90 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 90 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 90 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -480,7 +555,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 90 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 484 "shotwell-video-thumbnailer.c"
+#line 558 "shotwell-video-thumbnailer.c"
}
#line 93 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_tmp49_ = sink;
@@ -502,7 +577,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 96 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
-#line 506 "shotwell-video-thumbnailer.c"
+#line 580 "shotwell-video-thumbnailer.c"
goto __catch0_g_error;
}
#line 97 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -519,7 +594,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
gst_element_set_state (_tmp55_, GST_STATE_NULL);
#line 47 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (_tmp23_);
-#line 523 "shotwell-video-thumbnailer.c"
+#line 597 "shotwell-video-thumbnailer.c"
}
goto __finally0;
__catch0_g_error:
@@ -545,7 +620,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
#line 104 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_error_free0 (e);
#line 104 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 104 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 104 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -560,15 +635,15 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 104 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 564 "shotwell-video-thumbnailer.c"
+#line 638 "shotwell-video-thumbnailer.c"
}
__finally0:
#line 47 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
-#line 569 "shotwell-video-thumbnailer.c"
+#line 643 "shotwell-video-thumbnailer.c"
gint _tmp59_ = 0;
#line 47 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 47 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 47 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -587,12 +662,12 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
g_clear_error (&_inner_error_);
#line 47 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return _tmp59_;
-#line 591 "shotwell-video-thumbnailer.c"
+#line 665 "shotwell-video-thumbnailer.c"
}
#line 107 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
result = 0;
#line 107 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
- _g_object_unref0 (feature);
+ __g_list_free__g_object_unref0_0 (features);
#line 107 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
_g_object_unref0 (registry);
#line 107 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
@@ -607,7 +682,7 @@ gint shotwell_thumbnailer_main (gchar** args, int args_length1) {
_g_object_unref0 (pipeline);
#line 107 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return result;
-#line 611 "shotwell-video-thumbnailer.c"
+#line 685 "shotwell-video-thumbnailer.c"
}
@@ -617,7 +692,7 @@ int main (int argc, char ** argv) {
#endif
#line 15 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return shotwell_thumbnailer_main (argv, argc);
-#line 621 "shotwell-video-thumbnailer.c"
+#line 695 "shotwell-video-thumbnailer.c"
}
@@ -627,21 +702,21 @@ ShotwellThumbnailer* shotwell_thumbnailer_construct (GType object_type) {
self = (ShotwellThumbnailer*) g_type_create_instance (object_type);
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return self;
-#line 631 "shotwell-video-thumbnailer.c"
+#line 705 "shotwell-video-thumbnailer.c"
}
ShotwellThumbnailer* shotwell_thumbnailer_new (void) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return shotwell_thumbnailer_construct (TYPE_SHOTWELL_THUMBNAILER);
-#line 638 "shotwell-video-thumbnailer.c"
+#line 712 "shotwell-video-thumbnailer.c"
}
static void value_shotwell_thumbnailer_init (GValue* value) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
value->data[0].v_pointer = NULL;
-#line 645 "shotwell-video-thumbnailer.c"
+#line 719 "shotwell-video-thumbnailer.c"
}
@@ -650,7 +725,7 @@ static void value_shotwell_thumbnailer_free_value (GValue* value) {
if (value->data[0].v_pointer) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
shotwell_thumbnailer_unref (value->data[0].v_pointer);
-#line 654 "shotwell-video-thumbnailer.c"
+#line 728 "shotwell-video-thumbnailer.c"
}
}
@@ -660,11 +735,11 @@ static void value_shotwell_thumbnailer_copy_value (const GValue* src_value, GVal
if (src_value->data[0].v_pointer) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
dest_value->data[0].v_pointer = shotwell_thumbnailer_ref (src_value->data[0].v_pointer);
-#line 664 "shotwell-video-thumbnailer.c"
+#line 738 "shotwell-video-thumbnailer.c"
} else {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
dest_value->data[0].v_pointer = NULL;
-#line 668 "shotwell-video-thumbnailer.c"
+#line 742 "shotwell-video-thumbnailer.c"
}
}
@@ -672,37 +747,37 @@ static void value_shotwell_thumbnailer_copy_value (const GValue* src_value, GVal
static gpointer value_shotwell_thumbnailer_peek_pointer (const GValue* value) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return value->data[0].v_pointer;
-#line 676 "shotwell-video-thumbnailer.c"
+#line 750 "shotwell-video-thumbnailer.c"
}
static gchar* value_shotwell_thumbnailer_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (collect_values[0].v_pointer) {
-#line 683 "shotwell-video-thumbnailer.c"
+#line 757 "shotwell-video-thumbnailer.c"
ShotwellThumbnailer * object;
object = collect_values[0].v_pointer;
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (object->parent_instance.g_class == NULL) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-#line 690 "shotwell-video-thumbnailer.c"
+#line 764 "shotwell-video-thumbnailer.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-#line 694 "shotwell-video-thumbnailer.c"
+#line 768 "shotwell-video-thumbnailer.c"
}
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
value->data[0].v_pointer = shotwell_thumbnailer_ref (object);
-#line 698 "shotwell-video-thumbnailer.c"
+#line 772 "shotwell-video-thumbnailer.c"
} else {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
value->data[0].v_pointer = NULL;
-#line 702 "shotwell-video-thumbnailer.c"
+#line 776 "shotwell-video-thumbnailer.c"
}
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return NULL;
-#line 706 "shotwell-video-thumbnailer.c"
+#line 780 "shotwell-video-thumbnailer.c"
}
@@ -713,25 +788,25 @@ static gchar* value_shotwell_thumbnailer_lcopy_value (const GValue* value, guint
if (!object_p) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
-#line 717 "shotwell-video-thumbnailer.c"
+#line 791 "shotwell-video-thumbnailer.c"
}
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (!value->data[0].v_pointer) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
*object_p = NULL;
-#line 723 "shotwell-video-thumbnailer.c"
+#line 797 "shotwell-video-thumbnailer.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
*object_p = value->data[0].v_pointer;
-#line 727 "shotwell-video-thumbnailer.c"
+#line 801 "shotwell-video-thumbnailer.c"
} else {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
*object_p = shotwell_thumbnailer_ref (value->data[0].v_pointer);
-#line 731 "shotwell-video-thumbnailer.c"
+#line 805 "shotwell-video-thumbnailer.c"
}
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return NULL;
-#line 735 "shotwell-video-thumbnailer.c"
+#line 809 "shotwell-video-thumbnailer.c"
}
@@ -745,7 +820,7 @@ GParamSpec* param_spec_shotwell_thumbnailer (const gchar* name, const gchar* nic
G_PARAM_SPEC (spec)->value_type = object_type;
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return G_PARAM_SPEC (spec);
-#line 749 "shotwell-video-thumbnailer.c"
+#line 823 "shotwell-video-thumbnailer.c"
}
@@ -754,7 +829,7 @@ gpointer value_get_shotwell_thumbnailer (const GValue* value) {
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SHOTWELL_THUMBNAILER), NULL);
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return value->data[0].v_pointer;
-#line 758 "shotwell-video-thumbnailer.c"
+#line 832 "shotwell-video-thumbnailer.c"
}
@@ -774,17 +849,17 @@ void value_set_shotwell_thumbnailer (GValue* value, gpointer v_object) {
value->data[0].v_pointer = v_object;
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
shotwell_thumbnailer_ref (value->data[0].v_pointer);
-#line 778 "shotwell-video-thumbnailer.c"
+#line 852 "shotwell-video-thumbnailer.c"
} else {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
value->data[0].v_pointer = NULL;
-#line 782 "shotwell-video-thumbnailer.c"
+#line 856 "shotwell-video-thumbnailer.c"
}
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (old) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
shotwell_thumbnailer_unref (old);
-#line 788 "shotwell-video-thumbnailer.c"
+#line 862 "shotwell-video-thumbnailer.c"
}
}
@@ -803,17 +878,17 @@ void value_take_shotwell_thumbnailer (GValue* value, gpointer v_object) {
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
value->data[0].v_pointer = v_object;
-#line 807 "shotwell-video-thumbnailer.c"
+#line 881 "shotwell-video-thumbnailer.c"
} else {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
value->data[0].v_pointer = NULL;
-#line 811 "shotwell-video-thumbnailer.c"
+#line 885 "shotwell-video-thumbnailer.c"
}
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
if (old) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
shotwell_thumbnailer_unref (old);
-#line 817 "shotwell-video-thumbnailer.c"
+#line 891 "shotwell-video-thumbnailer.c"
}
}
@@ -823,14 +898,14 @@ static void shotwell_thumbnailer_class_init (ShotwellThumbnailerClass * klass) {
shotwell_thumbnailer_parent_class = g_type_class_peek_parent (klass);
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
((ShotwellThumbnailerClass *) klass)->finalize = shotwell_thumbnailer_finalize;
-#line 827 "shotwell-video-thumbnailer.c"
+#line 901 "shotwell-video-thumbnailer.c"
}
static void shotwell_thumbnailer_instance_init (ShotwellThumbnailer * self) {
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
self->ref_count = 1;
-#line 834 "shotwell-video-thumbnailer.c"
+#line 908 "shotwell-video-thumbnailer.c"
}
@@ -840,7 +915,7 @@ static void shotwell_thumbnailer_finalize (ShotwellThumbnailer * obj) {
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SHOTWELL_THUMBNAILER, ShotwellThumbnailer);
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
g_signal_handlers_destroy (self);
-#line 844 "shotwell-video-thumbnailer.c"
+#line 918 "shotwell-video-thumbnailer.c"
}
@@ -865,7 +940,7 @@ gpointer shotwell_thumbnailer_ref (gpointer instance) {
g_atomic_int_inc (&self->ref_count);
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
return instance;
-#line 869 "shotwell-video-thumbnailer.c"
+#line 943 "shotwell-video-thumbnailer.c"
}
@@ -878,7 +953,7 @@ void shotwell_thumbnailer_unref (gpointer instance) {
SHOTWELL_THUMBNAILER_GET_CLASS (self)->finalize (self);
#line 12 "/home/jens/Source/shotwell/thumbnailer/shotwell-video-thumbnailer.vala"
g_type_free_instance ((GTypeInstance *) self);
-#line 882 "shotwell-video-thumbnailer.c"
+#line 956 "shotwell-video-thumbnailer.c"
}
}
diff --git a/thumbnailer/shotwell-video-thumbnailer.vala b/thumbnailer/shotwell-video-thumbnailer.vala
index 234868a..2b381a6 100644
--- a/thumbnailer/shotwell-video-thumbnailer.vala
+++ b/thumbnailer/shotwell-video-thumbnailer.vala
@@ -11,7 +11,7 @@
// a replacement for totem-video-thumbnailer
class ShotwellThumbnailer {
const string caps_string = """video/x-raw,format=RGB,pixel-aspect-ratio=1/1""";
-
+
public static int main(string[] args) {
Gst.Element pipeline, sink;
string descr;
@@ -19,20 +19,20 @@ class ShotwellThumbnailer {
uint8[]? pngdata;
int64 duration, position;
Gst.StateChangeReturn ret;
-
+
+ if (Posix.nice (19) < 0) {
+ debug ("Failed to reduce thumbnailer nice level. Continuing anyway");
+ }
+
Gst.init(ref args);
var registry = Gst.Registry.@get ();
+ var features = registry.feature_filter ((f) => {
+ return f.get_name ().has_prefix ("vaapi");
+ }, false);
- var feature = registry.find_feature ("vaapidecodebin",
- typeof (Gst.ElementFactory));
- if (feature != null) {
- registry.remove_feature (feature);
- }
-
- feature = registry.find_feature ("vaapidecode",
- typeof (Gst.ElementFactory));
- if (feature != null) {
+ foreach (var feature in features) {
+ debug ("Removing registry feature %s", feature.get_name ());
registry.remove_feature (feature);
}