[FFmpeg-devel] [PATCH] lavfi: add nlmeans_opencl filter

Song, Ruiling ruiling.song at intel.com
Fri Apr 12 10:38:36 EEST 2019


> > > +#define RELEASE_KERNEL(k)                                    \
> > > +do {                                                         \
> > > +    if (k) {                                                 \
> > > +        cle = clReleaseKernel(k);                            \
> > > +        if (cle != CL_SUCCESS)                               \
> > > +            av_log(avctx, AV_LOG_ERROR, "Failed to release " \
> > > +                   "kernel: %d.\n", cle);                    \
> > > +    }                                                        \
> > > +} while(0)
> >
> > This appears multiple times here and also in other filters.  Maybe it should be a
> > macro in opencl.h like CL_SET_KERNEL_ARG?
Hi Mark,

I am rethinking about this problem, can we just simply call clReleaseKernel() and not checking the input and the error_code.
OpenCL spec has require implementation to check the input argument. So I think we can just ignore the if-null check.
As we are destroying the objects, is it still useful to care the error code returned?

Thanks!
Ruiling


More information about the ffmpeg-devel mailing list