summaryrefslogtreecommitdiff
path: root/libavfilter/opencl.h
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2018-07-04 02:16:24 +0800
committerMark Thompson <sw@jkqxz.net>2018-07-11 23:03:46 +0100
commit48a1abed133d005aa4d7f49e4fdd5bef9aa263f5 (patch)
treec6d770a615ddfacc46aaa15a1a225939e982402b /libavfilter/opencl.h
parent09628cb1b4cc1fba5d2eb2882562a939444a57e4 (diff)
lavfi/opencl: add macro for opencl error handling.
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Diffstat (limited to 'libavfilter/opencl.h')
-rw-r--r--libavfilter/opencl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavfilter/opencl.h b/libavfilter/opencl.h
index 7441b11614..1b7f117865 100644
--- a/libavfilter/opencl.h
+++ b/libavfilter/opencl.h
@@ -62,6 +62,18 @@ typedef struct OpenCLFilterContext {
}
/**
+ * A helper macro to handle OpenCL errors. It will assign errcode to
+ * variable err, log error msg, and jump to fail label on error.
+ */
+#define CL_FAIL_ON_ERROR(errcode, ...) do { \
+ if (cle != CL_SUCCESS) { \
+ av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
+ err = errcode; \
+ goto fail; \
+ } \
+ } while(0)
+
+/**
* Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
*/
int ff_opencl_filter_query_formats(AVFilterContext *avctx);