You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.4 KiB
71 lines
2.4 KiB
7 years ago
|
From affb84f98477bb490554f56bf82ebffcefa0ec42 Mon Sep 17 00:00:00 2001
|
||
|
From: Jimi Huotari <chiitoo@gentoo.org>
|
||
|
Date: Tue, 5 Sep 2017 23:30:24 +0300
|
||
|
Subject: [PATCH 1/3] libobs: Fix ImageMagick header path
|
||
|
|
||
|
Since ImageMagick 7, the header path has been changed. This commit
|
||
|
implements a check for the version being used, and includes the
|
||
|
header as is appropriate.
|
||
|
|
||
|
Special thanks to Hu.
|
||
|
|
||
|
Mantis-Bug: https://obsproject.com/mantis/view.php?id=966
|
||
|
|
||
|
Gentoo-Bug: https://bugs.gentoo.org/627520
|
||
|
---
|
||
|
libobs/CMakeLists.txt | 6 ++++++
|
||
|
libobs/graphics/graphics-magick.c | 6 ++++++
|
||
|
libobs/obsconfig.h.in | 3 +++
|
||
|
3 files changed, 15 insertions(+)
|
||
|
|
||
|
diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
|
||
|
index cd2b80e1..e91f366a 100644
|
||
|
--- a/libobs/CMakeLists.txt
|
||
|
+++ b/libobs/CMakeLists.txt
|
||
|
@@ -31,6 +31,12 @@ option(LIBOBS_PREFER_IMAGEMAGICK "Prefer ImageMagick over ffmpeg for image loadi
|
||
|
if(NOT FFMPEG_AVCODEC_FOUND OR (ImageMagick_MagickCore_FOUND AND LIBOBS_PREFER_IMAGEMAGICK))
|
||
|
message(STATUS "Using ImageMagick for image loading in libobs")
|
||
|
|
||
|
+ if(${ImageMagick_VERSION_STRING} LESS 7)
|
||
|
+ set(LIBOBS_IMAGEMAGICK_DIR_STYLE LIBOBS_IMAGEMAGICK_DIR_STYLE_6L)
|
||
|
+ elseif(${ImageMagick_VERSION_STRING} GREATER_EQUAL 7)
|
||
|
+ set(LIBOBS_IMAGEMAGICK_DIR_STYLE LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE)
|
||
|
+ endif()
|
||
|
+
|
||
|
set(libobs_image_loading_SOURCES
|
||
|
graphics/graphics-magick.c)
|
||
|
set(libobs_image_loading_LIBRARIES
|
||
|
diff --git a/libobs/graphics/graphics-magick.c b/libobs/graphics/graphics-magick.c
|
||
|
index c106bfa6..6e4e1e96 100644
|
||
|
--- a/libobs/graphics/graphics-magick.c
|
||
|
+++ b/libobs/graphics/graphics-magick.c
|
||
|
@@ -1,8 +1,14 @@
|
||
|
#include "graphics.h"
|
||
|
+#include "obsconfig.h"
|
||
|
|
||
|
#define MAGICKCORE_QUANTUM_DEPTH 16
|
||
|
#define MAGICKCORE_HDRI_ENABLE 0
|
||
|
+
|
||
|
+#if LIBOBS_IMAGEMAGICK_DIR_STYLE == LIBOBS_IMAGEMAGICK_DIR_STYLE_6L
|
||
|
#include <magick/MagickCore.h>
|
||
|
+#elif LIBOBS_IMAGEMAGICK_DIR_STYLE == LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE
|
||
|
+#include <MagickCore/MagickCore.h>
|
||
|
+#endif
|
||
|
|
||
|
void gs_init_image_deps()
|
||
|
{
|
||
|
diff --git a/libobs/obsconfig.h.in b/libobs/obsconfig.h.in
|
||
|
index f86962d5..cc1f4005 100644
|
||
|
--- a/libobs/obsconfig.h.in
|
||
|
+++ b/libobs/obsconfig.h.in
|
||
|
@@ -17,3 +17,6 @@
|
||
|
#define OBS_UNIX_STRUCTURE @OBS_UNIX_STRUCTURE@
|
||
|
#define BUILD_CAPTIONS @BUILD_CAPTIONS@
|
||
|
#define HAVE_DBUS @HAVE_DBUS@
|
||
|
+#define LIBOBS_IMAGEMAGICK_DIR_STYLE_6L 6
|
||
|
+#define LIBOBS_IMAGEMAGICK_DIR_STYLE_7GE 7
|
||
|
+#define LIBOBS_IMAGEMAGICK_DIR_STYLE @LIBOBS_IMAGEMAGICK_DIR_STYLE@
|
||
|
--
|
||
|
2.14.1
|
||
|
|