[FFmpeg-trac] #5979(avdevice:new): Fix for OpenCl & OpenGL on OSX
FFmpeg
trac at avcodec.org
Thu Nov 24 22:12:01 EET 2016
#5979: Fix for OpenCl & OpenGL on OSX
-------------------------------------+-------------------------------------
Reporter: f77hacker | Type: defect
Status: new | Priority: normal
Component: avdevice | Version: git-
Keywords: | master
opencl,opengl,osx | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
How to reproduce:
{{{
git clone blah blah blah
configure lots of options --enable-opencl --enable-opengl
/opt/local/include/GL/glext.h:111:54: error: unknown type name 'GLenum';
did you mean 'enum'?
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint
start, GLuint end, GLsizei co...
^~~~~~
enum
/opt/local/include/GL/glext.h:111:61: warning: declaration of 'enum mode'
will not be visible outside of this
function [-Wvisibility]
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint
start, GLuint end, GLsizei co...
^
/opt/local/include/GL/glext.h:111:67: error: unknown type name 'GLuint'
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint
start, GLuint end, GLsizei co...
^
/opt/local/include/GL/glext.h:111:81: error: unknown type name 'GLuint'
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint
start, GLuint end, GLsizei co...
^
/opt/local/include/GL/glext.h:111:93: error: unknown type name 'GLsizei'
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint
start, GLuint end, GLsizei count, GLe...
^
/opt/local/include/GL/glext.h:111:108: error: unknown type name 'GLenum';
did you mean 'enum'?
...PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end,
GLsizei count, GLenum type, const ...
^~~~~~
enum
/opt/local/include/GL/glext.h:111:115: warning: declaration of 'enum type'
will not be visible outside of this
function [-Wvisibility]
...PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end,
GLsizei count, GLenum type, const ...
^
/opt/local/include/GL/glext.h:112:47: error: unknown type name 'GLenum';
did you mean 'enum'?
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level,
GLint internalformat, GLsize...
^~~~~~
enum
/opt/local/include/GL/glext.h:112:54: warning: declaration of 'enum
target' will not be visible outside of
this function [-Wvisibility]
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level,
GLint internalformat, GLsize...
/opt/local/include/GL/glext.h:112:164: warning: declaration of 'enum
format' will not be visible outside of
this function [-Wvisibility]
...GLint internalformat, GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLenum format, GLenu...
^
/opt/local/include/GL/glext.h:112:172: error: unknown type name 'GLenum';
did you mean 'enum'?
...GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum
format, GLenum type, const void *pi...
^~~~~~
enum
/opt/local/include/GL/glext.h:112:179: warning: declaration of 'enum type'
will not be visible outside of this
function [-Wvisibility]
...GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum
format, GLenum type, const void *pi...
^
/opt/local/include/GL/glext.h:113:108: error: unknown type name 'GLint'
...PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsi...
^
'''+ a shitload of more errors'''
fatal error: too many errors emitted, stopping now [-ferror-limit=]
}}}
modify opengl_enc.c
was
{{{
#if HAVE_WINDOWS_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if HAVE_OPENGL_GL3_H
#include <OpenGL/gl3.h>
#elif HAVE_ES2_GL_H
#include <ES2/gl.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
#endif
#if HAVE_GLXGETPROCADDRESS
#include <GL/glx.h>
#endif
#if HAVE_SDL2
#include <SDL.h>
#include <SDL/SDL_video.h>
#endif
}}}
my fix to make this compile on OSX 10.11.6, using
{{{
--cc=clang-mp-3.9 --cxx=clang++-mp-3.9
--optflags='-O3 -pipe -arch x86_64 -m64 -mtune=haswell -march=haswell
-mmacosx-version-min=10.11 -fopenmp -fomit-frame-pointer -fno-common
-funroll-loops -mavx2 -mfma -mfpmath=sse -msse2 -msse3 -msse4.1 -msse4.2'
}}}
is
{{{
#include <SDL.h>
#include <SDL/SDL_video.h>
#include <GLES3/gl32.h>
#include <OpenGL/glu.h>
#include <OpenCL/opencl.h>}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5979>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list