Skip to content

Instantly share code, notes, and snippets.

@tuxcanfly
Created June 22, 2010 08:00
Show Gist options
  • Save tuxcanfly/448156 to your computer and use it in GitHub Desktop.
Save tuxcanfly/448156 to your computer and use it in GitHub Desktop.
ffmpegthumbnailer (rev214) Adds gnome vfs support to handle URIs passed by nautlius
Index: configure.ac
===================================================================
--- configure.ac (revision 214)
+++ configure.ac (working copy)
@@ -42,7 +42,24 @@
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
+########################################################################
+# Check gnome vfs support
+########################################################################
+AM_CONDITIONAL(GNOME_VFS, test "$HAVE_GNOME_VFS" = "yes")
+AC_ARG_ENABLE(gnome_vfs,
+ [ --enable-gnome-vfs Support gnome vfs],
+ [ enable_gnome_vfs=$enableval ] )
+if test "$enable_gnome_vfs" != "no"; then
+ PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS=yes, HAVE_GNOME_VFS=no)
+ if test $HAVE_GNOME_VFS = yes; then
+ AC_DEFINE(HAVE_GNOME_VFS, [], "Gnome VFS support enabled")
+ AC_SUBST(GNOME_VFS_CFLAGS)
+ AC_SUBST(GNOME_VFS_LIBS)
+ fi
+fi
+AM_CONDITIONAL(GNOME_VFS, test "$HAVE_GNOME_VFS" = "yes")
+
########################################################################
# Check png support
########################################################################
@@ -135,6 +152,12 @@
echo "jpeg support : disabled"
fi
+if test "x$HAVE_GNOME_VFS" = xyes; then
+ echo "gnome-vfs support : enabled"
+else
+ echo "gnome-vfs support : disabled"
+fi
+
if test "x$ENABLE_UNITTEST" = xyes; then
echo "unittests : enabled"
else
Index: main.cpp
===================================================================
--- main.cpp (revision 214)
+++ main.cpp (working copy)
@@ -23,6 +23,10 @@
#include <stdexcept>
#include <stdlib.h>
+#ifdef HAVE_GNOME_VFS
+#include <libgnomevfs/gnome-vfs.h>
+#endif
+
#include "libffmpegthumbnailer/videothumbnailer.h"
#include "libffmpegthumbnailer/stringoperations.h"
#include "libffmpegthumbnailer/filmstripfilter.h"
@@ -58,7 +62,10 @@
maintainAspectRatio = false;
break;
case 'i':
- inputFile = optarg;
+ inputFile = optarg;
+ #ifdef HAVE_GNOME_VFS
+ inputFile = gnome_vfs_get_local_path_from_uri(optarg);
+ #endif
break;
case 'o':
outputFile = optarg;
Index: Makefile.am
===================================================================
--- Makefile.am (revision 214)
+++ Makefile.am (working copy)
@@ -46,6 +46,10 @@
ffmpegthumbnailer_SOURCES = main.cpp
ffmpegthumbnailer_LDADD = libffmpegthumbnailer.la
+if GNOME_VFS
+ffmpegthumbnailer_CPPFLAGS= $(GNOME_VFS_CFLAGS)
+ffmpegthumbnailer_LDFLAGS= $(GNOME_VFS_LIBS)
+endif
if ENABLE_UNITTEST
check_PROGRAMS = testrunner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment