diff options
Diffstat (limited to 'libavfilter/opencl.h')
-rw-r--r-- | libavfilter/opencl.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavfilter/opencl.h b/libavfilter/opencl.h index c0a4519785..7441b11614 100644 --- a/libavfilter/opencl.h +++ b/libavfilter/opencl.h @@ -46,6 +46,21 @@ typedef struct OpenCLFilterContext { int output_height; } OpenCLFilterContext; + +/** + * set argument to specific Kernel. + * This macro relies on usage of local label "fail" and variables: + * avctx, cle and err. + */ +#define CL_SET_KERNEL_ARG(kernel, arg_num, type, arg) \ + cle = clSetKernelArg(kernel, arg_num, sizeof(type), arg); \ + if (cle != CL_SUCCESS) { \ + av_log(avctx, AV_LOG_ERROR, "Failed to set kernel " \ + "argument %d: error %d.\n", arg_num, cle); \ + err = AVERROR(EIO); \ + goto fail; \ + } + /** * Return that all inputs and outputs support only AV_PIX_FMT_OPENCL. */ |