* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config_components.h"
+
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
cl_int cle;
int err;
- err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_convolution, 1);
+ err = ff_opencl_filter_load_program(avctx, &ff_source_convolution_cl, 1);
if (err < 0)
goto fail;
.filter_frame = &convolution_opencl_filter_frame,
.config_props = &ff_opencl_filter_config_input,
},
- { NULL }
};
static const AVFilterPad convolution_opencl_outputs[] = {
.type = AVMEDIA_TYPE_VIDEO,
.config_props = &ff_opencl_filter_config_output,
},
- { NULL }
};
#define OFFSET(x) offsetof(ConvolutionOpenCLContext, x)
AVFILTER_DEFINE_CLASS(convolution_opencl);
-AVFilter ff_vf_convolution_opencl = {
+const AVFilter ff_vf_convolution_opencl = {
.name = "convolution_opencl",
.description = NULL_IF_CONFIG_SMALL("Apply convolution mask to input video"),
.priv_size = sizeof(ConvolutionOpenCLContext),
.priv_class = &convolution_opencl_class,
.init = &ff_opencl_filter_init,
.uninit = &convolution_opencl_uninit,
- .query_formats = &ff_opencl_filter_query_formats,
- .inputs = convolution_opencl_inputs,
- .outputs = convolution_opencl_outputs,
+ FILTER_INPUTS(convolution_opencl_inputs),
+ FILTER_OUTPUTS(convolution_opencl_outputs),
+ FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
#endif /* CONFIG_CONVOLUTION_OPENCL_FILTER */
AVFILTER_DEFINE_CLASS(sobel_opencl);
-AVFilter ff_vf_sobel_opencl = {
+const AVFilter ff_vf_sobel_opencl = {
.name = "sobel_opencl",
.description = NULL_IF_CONFIG_SMALL("Apply sobel operator"),
.priv_size = sizeof(ConvolutionOpenCLContext),
.priv_class = &sobel_opencl_class,
.init = &ff_opencl_filter_init,
.uninit = &convolution_opencl_uninit,
- .query_formats = &ff_opencl_filter_query_formats,
- .inputs = convolution_opencl_inputs,
- .outputs = convolution_opencl_outputs,
+ FILTER_INPUTS(convolution_opencl_inputs),
+ FILTER_OUTPUTS(convolution_opencl_outputs),
+ FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
#endif /* CONFIG_SOBEL_OPENCL_FILTER */
AVFILTER_DEFINE_CLASS(prewitt_opencl);
-AVFilter ff_vf_prewitt_opencl = {
+const AVFilter ff_vf_prewitt_opencl = {
.name = "prewitt_opencl",
.description = NULL_IF_CONFIG_SMALL("Apply prewitt operator"),
.priv_size = sizeof(ConvolutionOpenCLContext),
.priv_class = &prewitt_opencl_class,
.init = &ff_opencl_filter_init,
.uninit = &convolution_opencl_uninit,
- .query_formats = &ff_opencl_filter_query_formats,
- .inputs = convolution_opencl_inputs,
- .outputs = convolution_opencl_outputs,
+ FILTER_INPUTS(convolution_opencl_inputs),
+ FILTER_OUTPUTS(convolution_opencl_outputs),
+ FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
#endif /* CONFIG_PREWITT_OPENCL_FILTER */
AVFILTER_DEFINE_CLASS(roberts_opencl);
-AVFilter ff_vf_roberts_opencl = {
+const AVFilter ff_vf_roberts_opencl = {
.name = "roberts_opencl",
.description = NULL_IF_CONFIG_SMALL("Apply roberts operator"),
.priv_size = sizeof(ConvolutionOpenCLContext),
.priv_class = &roberts_opencl_class,
.init = &ff_opencl_filter_init,
.uninit = &convolution_opencl_uninit,
- .query_formats = &ff_opencl_filter_query_formats,
- .inputs = convolution_opencl_inputs,
- .outputs = convolution_opencl_outputs,
+ FILTER_INPUTS(convolution_opencl_inputs),
+ FILTER_OUTPUTS(convolution_opencl_outputs),
+ FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ .flags = AVFILTER_FLAG_HWDEVICE,
};
#endif /* CONFIG_ROBERTS_OPENCL_FILTER */