Fix #541: Showing existing, or maybe generating thumbnails for MP4 and WEBM
[geeqie.git] / configure.in
index a80cb87..0b6bc1b 100644 (file)
@@ -366,6 +366,32 @@ AM_CONDITIONAL(HAVE_TIFF, [test "x$HAVE_TIFF" = xyes])
 AC_SUBST(TIFF_CFLAGS)
 AC_SUBST(TIFF_LIBS)
 
+#  libffmpegthumbnailer support
+# ----------------------------------------------------------------------
+
+AC_ARG_ENABLE([ffmpegthumbnailer],
+  AC_HELP_STRING([--disable-ffmpegthumbnailer], [disable ffmpegthumbnailer support for generating thumbnails of video files]),
+    [ffmpegthumbnailer=$enableval], [ffmpegthumbnailer=auto])
+
+if test "x${ffmpegthumbnailer}" != "xno"; then
+  PKG_CHECK_MODULES(FFMPEGTHUMBNAILER, [libffmpegthumbnailer >= 2.0.0],
+    [
+      HAVE_FFMPEGTHUMBNAILER=yes
+      AC_DEFINE(HAVE_FFMPEGTHUMBNAILER, 1, [define to enable ffmpegthumbnailer support])
+      AC_CHECK_MEMBER([video_thumbnailer.prefer_embedded_metadata], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_METADATA, 1, [define if ffmpegthumbnailer supports embedded metadata])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
+      AC_CHECK_MEMBER([image_data.image_data_width], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_RGB, 1, [define if ffmpegthumbnailer supports raw RGB output])], [], [[#include <libffmpegthumbnailer/videothumbnailerc.h>]])
+      AC_CHECK_LIB([ffmpegthumbnailer], [video_thumbnailer_set_size], [AC_DEFINE(HAVE_FFMPEGTHUMBNAILER_WH, 1, [define if ffmpegthumbnailer supports specifying size by width/height])])
+    ],
+    [
+      HAVE_FFMPEGTHUMBNAILER=no
+    ])
+else
+  HAVE_FFMPEGTHUMBNAILER=disabled
+fi
+
+AM_CONDITIONAL(HAVE_FFMPEGTHUMBNAILER, [test "x$HAVE_FFMPEGTHUMBNAILER" = xyes])
+AC_SUBST(FFMPEGTHUMBNAILER_CFLAGS)
+AC_SUBST(FFMPEGTHUMBNAILER_LIBS)
 
 #  Exiv2 support
 # ----------------------------------------------------------------------
@@ -613,6 +639,7 @@ Support:
   Libchamplain:                $HAVE_LIBCHAMPLAIN
   Libchamplain-gtk:    $HAVE_LIBCHAMPLAIN_GTK
   Lua:          $HAVE_LUA
+  FFmpegthumbnailer:   $HAVE_FFMPEGTHUMBNAILER
 
 Documentation:
   Doxygen:       $DX_DOXYGEN