summaryrefslogtreecommitdiff
path: root/libavfilter/opencl.h
diff options
context:
space:
mode:
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);