[FFmpeg-devel] [PATCH 1/3] Add clew.c & clew.h to libavutil
Maneesh.Gupta at amd.com
Fri Feb 6 12:06:28 CET 2015
> -----Original Message-----
> From: ffmpeg-devel-bounces at ffmpeg.org [mailto:ffmpeg-devel-
> bounces at ffmpeg.org] On Behalf Of wm4
> Sent: Friday, February 06, 2015 4:31 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 1/3] Add clew.c & clew.h to libavutil
> 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
> > > 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 @
> > >
> > > 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.
> 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.
Alright. Can you suggest an alternate way of building ffmpeg using clew? Clew has lot of advantages and essentially consists of a single source and header file. I will modify and resubmit the patch accordingly.
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
More information about the ffmpeg-devel