diff mbox series

[FFmpeg-devel] avcodec/libjxl.h: include version.h

Message ID 20240123222914.235662-1-leo.izen@gmail.com
State Accepted
Commit ac06190a5a11f2b170e7719d769d7c0d65bff3e0
Headers show
Series [FFmpeg-devel] avcodec/libjxl.h: include version.h | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Leo Izen Jan. 23, 2024, 10:29 p.m. UTC
This file has been exported since our minimum required version (0.7.0),
but it wasn't documented. Instead it was transitively included by
<jxl/decode.h> (but not jxl/encode.h), which ffmpeg relied on.

libjxl broke its API in libjxl/libjxl@66b959239355aef5255 by removing
the transitive include of version.h, and they do not plan on adding
it back. Instead they are choosing to leave the API backwards-
incompatible with downstream callers written for some fairly recent
versions of their API.

As a result, we include <jxl/version.h> to continue to build against
more recent versions of libjxl. The version macros removed are also
present in that file, so we no longer need to redefine them.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
---
 libavcodec/libjxl.h | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/libjxl.h b/libavcodec/libjxl.h
index e305b6e758..0b983a122f 100644
--- a/libavcodec/libjxl.h
+++ b/libavcodec/libjxl.h
@@ -27,19 +27,8 @@ 
 #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
+#include <jxl/version.h>
 
 /**
  * Transform threadcount in ffmpeg to one used by libjxl.