lavfi/opencl: Avoid deprecation warnings when built with post-1.2 headers
authorMark Thompson <sw@jkqxz.net>
Mon, 19 Mar 2018 22:52:51 +0000 (22:52 +0000)
committerMark Thompson <sw@jkqxz.net>
Thu, 22 Mar 2018 23:14:14 +0000 (23:14 +0000)
The intended target is OpenCL 1.2, so disable warnings for APIs deprecated
after that.  This primarily applies to clCreateCommandQueue(), we can't use
the replacement clCreateCommandQueueWithProperties() because it was
introduced in OpenCL 2.0.

Also remove some unnecessary includes from overlay and program filters so
that the define is available at the right moment.

libavfilter/opencl.h
libavfilter/vf_overlay_opencl.c
libavfilter/vf_program_opencl.c

index 45fe2a2..c0a4519 100644 (file)
 #ifndef AVFILTER_OPENCL_H
 #define AVFILTER_OPENCL_H
 
+// The intended target is OpenCL 1.2, so disable warnings for APIs
+// deprecated after that.  This primarily applies to clCreateCommandQueue(),
+// we can't use the replacement clCreateCommandQueueWithProperties() because
+// it was introduced in OpenCL 2.0.
+#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
+
 #include "libavutil/buffer.h"
 #include "libavutil/hwcontext.h"
 #include "libavutil/hwcontext_opencl.h"
index 16e10f4..b43050d 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavutil/avassert.h"
-#include "libavutil/buffer.h"
-#include "libavutil/common.h"
-#include "libavutil/hwcontext.h"
-#include "libavutil/hwcontext_opencl.h"
 #include "libavutil/log.h"
-#include "libavutil/mathematics.h"
 #include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
 
 #include "avfilter.h"
 #include "framesync.h"
index 0bcf188..a002792 100644 (file)
  */
 
 #include "libavutil/avstring.h"
-#include "libavutil/buffer.h"
-#include "libavutil/common.h"
-#include "libavutil/hwcontext.h"
-#include "libavutil/hwcontext_opencl.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
-#include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
 
 #include "avfilter.h"
 #include "framesync.h"