[FFmpeg-devel] [PATCH v2 1/2] lavfi/opencl: add macro for opencl error handling.

Song, Ruiling ruiling.song at intel.com
Thu Jul 12 20:06:46 EEST 2018



> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Mark Thompson
> Sent: Wednesday, July 11, 2018 3:10 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v2 1/2] lavfi/opencl: add macro for opencl
> error handling.
> 
> On 03/07/18 19:16, Ruiling Song wrote:
> > Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> > ---
> >  libavfilter/opencl.h            | 11 +++++++++
> >  libavfilter/vf_avgblur_opencl.c | 45 +++++++++--------------------------
> >  libavfilter/vf_overlay_opencl.c | 29 +++++------------------
> >  libavfilter/vf_program_opencl.c | 14 ++---------
> >  libavfilter/vf_tonemap_opencl.c | 33 +++++---------------------
> >  libavfilter/vf_unsharp_opencl.c | 52 +++++++++--------------------------------
> >  6 files changed, 47 insertions(+), 137 deletions(-)
> >
> > diff --git a/libavfilter/opencl.h b/libavfilter/opencl.h
> > index 7441b11..0ed360b 100644
> > --- a/libavfilter/opencl.h
> > +++ b/libavfilter/opencl.h
> > @@ -112,5 +112,16 @@ int
> ff_opencl_filter_work_size_from_image(AVFilterContext *avctx,
> >                                            size_t *work_size,
> >                                            AVFrame *frame, int plane,
> >                                            int block_alignment);
> > +/**
> > + * A helper macro to handle OpenCL error. 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)
> 
> I moved this up in the file to be next to the similar macro and match the
> formatting.
Yeah, that make sense. Thanks!

Ruiling
> 
> All looks good, so applied with that change.
> 
> Thanks,
> 
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list