[FFmpeg-devel] [PATCH] avutil/opencl: don't include config.h

James Almer jamrial at gmail.com
Thu Jan 8 03:10:40 CET 2015


On 07/01/15 10:55 PM, Wei Gao wrote:
> 2015-01-08 8:42 GMT+08:00 Michael Niedermayer <michaelni at gmx.at>:
> 
>> On Wed, Jan 07, 2015 at 05:44:41PM -0300, James Almer wrote:
>>> On 06/01/15 11:27 PM, Michael Niedermayer wrote:
>>>> On Tue, Jan 06, 2015 at 01:56:01AM -0300, James Almer wrote:
>>>>> It's not an installed header. Use libavutil/avconfig.h instead.
>>>>
>>>> assuming noone objects to this "hack" ... ugly but it should fix the
>>>> build so ok
>>>
>>> Yes, i agree it's kinda ugly. What about this instead?
>>
>> LGTM but i dont have opencl setup so havnt tested it
>>
> Hi
> 
> diff --git a/libavutil/opencl.h b/libavutil/opencl.h
> index 4655cba..0b7b8d4 100644
> --- a/libavutil/opencl.h
> +++ b/libavutil/opencl.h
> @@ -32,11 +32,10 @@
>  #ifndef LIBAVUTIL_OPENCL_H
>  #define LIBAVUTIL_OPENCL_H
> 
> -#include "config.h"
> -#if HAVE_CL_CL_H
> -#include <CL/cl.h>
> -#else
> +#ifdef __APPLE__
>  #include <OpenCL/cl.h>
> +#else
> +#include <CL/cl.h>
>  #endif
>  #include <stdint.h>
>  #include "dict.h"
> just this patch right? I can test it, but I don't have apple platform.

Yes.
The CL_cl_h check in configure could also be removed alongside this since it wouldn't 
be necessary anymore.

https://www.khronos.org/registry/cl/ mentions that the OpenCL/cl.h path is exclusive 
to MacOSX, so i think the patch should be good to finally get the libavutil/opencl.h 
header work for api users.


More information about the ffmpeg-devel mailing list