19 #ifndef AVFILTER_OPENCL_H 20 #define AVFILTER_OPENCL_H 26 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 56 #define CL_SET_KERNEL_ARG(kernel, arg_num, type, arg) \ 57 cle = clSetKernelArg(kernel, arg_num, sizeof(type), arg); \ 58 if (cle != CL_SUCCESS) { \ 59 av_log(avctx, AV_LOG_ERROR, "Failed to set kernel " \ 60 "argument %d: error %d.\n", arg_num, cle); \ 69 #define CL_FAIL_ON_ERROR(errcode, ...) do { \ 70 if (cle != CL_SUCCESS) { \ 71 av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \ 79 #define CL_RELEASE_KERNEL(k) \ 82 cle = clReleaseKernel(k); \ 83 if (cle != CL_SUCCESS) \ 84 av_log(avctx, AV_LOG_ERROR, "Failed to release " \ 85 "OpenCL kernel: %d.\n", cle); \ 92 #define CL_RELEASE_MEMORY(m) \ 95 cle = clReleaseMemObject(m); \ 96 if (cle != CL_SUCCESS) \ 97 av_log(avctx, AV_LOG_ERROR, "Failed to release " \ 98 "OpenCL memory: %d.\n", cle); \ 105 #define CL_RELEASE_QUEUE(q) \ 108 cle = clReleaseCommandQueue(q); \ 109 if (cle != CL_SUCCESS) \ 110 av_log(avctx, AV_LOG_ERROR, "Failed to release " \ 111 "OpenCL command queue: %d.\n", cle); \ 148 const char **program_source_array,
157 const char *filename);
165 int block_alignment);
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
API-specific header for AV_HWDEVICE_TYPE_OPENCL.
void ff_opencl_print_const_matrix_3x3(AVBPrint *buf, const char *name_str, double mat[3][3])
Print a 3x3 matrix into a buffer as __constant array, which could be included in an OpenCL program...
This structure describes decoded (raw) audio or video data.
Main libavfilter public API header.
int ff_opencl_filter_work_size_from_image(AVFilterContext *avctx, size_t *work_size, AVFrame *frame, int plane, int block_alignment)
Find the work size needed needed for a given plane of an image.
AVOpenCLDeviceContext * hwctx
AVHWDeviceContext * device
int ff_opencl_filter_load_program(AVFilterContext *avctx, const char **program_source_array, int nb_strings)
Load a new OpenCL program from strings in memory.
A link between two filters.
void ff_opencl_filter_uninit(AVFilterContext *avctx)
Uninitialise an OpenCL filter context.
int ff_opencl_filter_load_program_from_file(AVFilterContext *avctx, const char *filename)
Load a new OpenCL program from a file.
int ff_opencl_filter_config_output(AVFilterLink *outlink)
Create a suitable hardware frames context for the output.
enum AVPixelFormat output_format
int ff_opencl_filter_init(AVFilterContext *avctx)
Initialise an OpenCL filter context.
Describe the class of an AVClass context structure.
refcounted data buffer API
A reference to a data buffer.
int ff_opencl_filter_query_formats(AVFilterContext *avctx)
Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
int ff_opencl_filter_config_input(AVFilterLink *inlink)
Check that the input link contains a suitable hardware frames context and extract the device from it...
AVPixelFormat
Pixel format.