[FFmpeg-cvslog] lavu/opencl: add check version and platform

highgod0401 git at videolan.org
Sun Apr 28 23:51:33 CEST 2013


ffmpeg | branch: master | highgod0401 <highgod0401 at gmail.com> | Sun Apr 28 11:03:24 2013 +0800| [df9117921ac3fea7552a20c66b1cfd5967a9f345] | committer: Michael Niedermayer

lavu/opencl: add check version and platform

Reviewed-by: Hanspeter Niederstrasser <niederstrasser at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df9117921ac3fea7552a20c66b1cfd5967a9f345
---

 configure          |    9 ++++++++-
 libavutil/opencl.h |    6 +++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 648db2f..ee95d89 100755
--- a/configure
+++ b/configure
@@ -1408,6 +1408,7 @@ HAVE_LIST="
     attribute_packed
     cdio_paranoia_h
     cdio_paranoia_paranoia_h
+    cl_cl_h
     clock_gettime
     closesocket
     cmov
@@ -3894,6 +3895,7 @@ check_func_headers windows.h Sleep
 check_func_headers windows.h VirtualAlloc
 check_func_headers glob.h glob
 
+check_header cl/cl.h
 check_header direct.h
 check_header dlfcn.h
 check_header dxva.h
@@ -4041,7 +4043,12 @@ enabled openal     && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32
                         die "ERROR: openal not found"; } &&
                       { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
                         die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
-enabled opencl     && require2 opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL
+enabled opencl     && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
+                        check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
+                        die "ERROR: opencl not found"; } &&
+                      { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
+                        check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
+                        die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
 enabled openssl    && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
                         check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
                         check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
diff --git a/libavutil/opencl.h b/libavutil/opencl.h
index acafe36..96a3086 100644
--- a/libavutil/opencl.h
+++ b/libavutil/opencl.h
@@ -31,8 +31,12 @@
 #ifndef LIBAVUTIL_OPENCL_H
 #define LIBAVUTIL_OPENCL_H
 
-#include <CL/cl.h>
 #include "config.h"
+#if HAVE_CL_CL_H
+#include <CL/cl.h>
+#else
+#include <OpenCL/cl.h>
+#endif
 #include "dict.h"
 
 #define AV_OPENCL_KERNEL( ... )# __VA_ARGS__



More information about the ffmpeg-cvslog mailing list