summaryrefslogtreecommitdiff
path: root/libavcodec/libjxl.h
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2023-02-04 16:29:15 -0500
committerLeo Izen <leo.izen@gmail.com>2023-02-06 13:05:39 -0500
commit000934830620c03be55644e054f9ffaaadac2a0a (patch)
tree9a2f3cc09aaf3a8b83a5e6718ee7fbb208e27d7f /libavcodec/libjxl.h
parentc5aeb8f4db5529cdb5248bbb7154adf6f0c8faf3 (diff)
avcodec/libjxl: add #ifdef guards for libjxl >= 0.8.0 features
Since many distributions ship libjxl 0.7.0 still, we'd still prefer to compile against that, but don't want to lose the features that require libjxl 0.8.0 or greater. For this reason I've added preprocessor #ifdef guards around the features that aren't necessarily in libjxl 0.7.0. Signed-off-by: Leo Izen <leo.izen@gmail.com>
Diffstat (limited to 'libavcodec/libjxl.h')
-rw-r--r--libavcodec/libjxl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/libjxl.h b/libavcodec/libjxl.h
index 5387c438fd..e305b6e758 100644
--- a/libavcodec/libjxl.h
+++ b/libavcodec/libjxl.h
@@ -27,8 +27,20 @@
#ifndef AVCODEC_LIBJXL_H
#define AVCODEC_LIBJXL_H
+#include <jxl/decode.h>
#include <jxl/memory_manager.h>
+/*
+ * libjxl version 0.7.0 and earlier doesn't contain these macros at all
+ * so to detect version 0.7.0 versus 0.8.0 we need to define them ourselves
+ */
+#ifndef JPEGXL_COMPUTE_NUMERIC_VERSION
+ #define JPEGXL_COMPUTE_NUMERIC_VERSION(major,minor,patch) ((major<<24) | (minor<<16) | (patch<<8) | 0)
+#endif
+#ifndef JPEGXL_NUMERIC_VERSION
+ #define JPEGXL_NUMERIC_VERSION JPEGXL_COMPUTE_NUMERIC_VERSION(0, 7, 0)
+#endif
+
/**
* Transform threadcount in ffmpeg to one used by libjxl.
*