[FFmpeg-devel] [PATCH 1/3] Add clew.c & clew.h to libavutil

wm4 nfxjfg at googlemail.com
Fri Feb 6 12:01:29 CET 2015


On Fri, 6 Feb 2015 11:14:21 +0100
Hendrik Leppkes <h.leppkes at gmail.com> wrote:

> On Fri, Feb 6, 2015 at 11:09 AM, Gupta, Maneesh <Maneesh.Gupta at amd.com> wrote:
> > Hi All,
> >
> > There are several issues with the way ffmpeg compilation works when OpenCL is enabled using --enable-opencl. Chief among them are:
> > 1. One needs to also use --extra-cflags, --extra-ldflags & -extra-libs to specify the path to the OpenCL header and library files. Otherwise configure fails.
> > 2. ffmpeg currently requires OpenCL 1.2, but the build system may have another version installed (such as the newer OpenCL 2.0 which has deprecated some 1.2 APIs).
> >
> > There are a couple of ways to address this.
> >
> > * One way is the x264 approach which is to bundle cl.h, cl_platform.h and a wrapper c file which relies on dynamically loading OpenCL rather than using static linking. This requires modifications to the entire OpenCL based code since we cannot use the OpenCL APIs directly.
> > * Another approach taken by LibreOffice and Blender for example is to use clew (i.e. The OpenCL Extension Wrangler Library). This has the advantage of letting us use the OpenCL APIs directly yet at the same time relying on dynamically loading OpenCL. The clew project is hosted at https://github.com/OpenCLWrangler/clew. This is maintained by two people (Sergey and Martijn).
> > Usage of clew in Libreoffice can be seen @ http://cgit.freedesktop.org/libreoffice/core/tree/clew/source and in Blender @ https://git.blender.org/gitweb/gitweb.cgi/blender.git/tree/HEAD:/extern/clew.
> >
> > This patch is for adding clew to the ffmpeg tree. The subsequent patches switch the OpenCL code in ffmpeg from using cl.h to using clew.
> >
> 
> 
> Using such a library is fine, if its deemed the best solution
> available, but flat-out importing its code into avutil is not.

+1

Also look at all these awful "portability" hacks in the added code.
It's not a good idea to agree to maintaining this terrible mess.


More information about the ffmpeg-devel mailing list