Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8baa3933
Commit
8baa3933
authored
Sep 13, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
egl: reorder to avoid forward declarations
parent
b8af88fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
77 deletions
+65
-77
modules/video_output/egl.c
modules/video_output/egl.c
+65
-77
No files found.
modules/video_output/egl.c
View file @
8baa3933
...
@@ -37,33 +37,6 @@
...
@@ -37,33 +37,6 @@
# include <vlc_xlib.h>
# include <vlc_xlib.h>
#endif
#endif
/* Plugin callbacks */
static
int
OpenGLES2
(
vlc_object_t
*
);
static
int
OpenGLES
(
vlc_object_t
*
);
static
int
OpenGL
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
vlc_module_begin
()
set_shortname
(
N_
(
"EGL"
))
set_description
(
N_
(
"EGL extension for OpenGL"
))
set_category
(
CAT_VIDEO
)
set_subcategory
(
SUBCAT_VIDEO_VOUT
)
set_capability
(
"opengl"
,
50
)
set_callbacks
(
OpenGL
,
Close
)
add_shortcut
(
"egl"
)
add_submodule
()
set_capability
(
"opengl es2"
,
50
)
set_callbacks
(
OpenGLES2
,
Close
)
add_shortcut
(
"egl"
)
add_submodule
()
set_capability
(
"opengl es"
,
50
)
set_callbacks
(
OpenGLES
,
Close
)
add_shortcut
(
"egl"
)
vlc_module_end
()
typedef
struct
vlc_gl_sys_t
typedef
struct
vlc_gl_sys_t
{
{
EGLDisplay
display
;
EGLDisplay
display
;
...
@@ -74,11 +47,36 @@ typedef struct vlc_gl_sys_t
...
@@ -74,11 +47,36 @@ typedef struct vlc_gl_sys_t
#endif
#endif
}
vlc_gl_sys_t
;
}
vlc_gl_sys_t
;
/* OpenGL callbacks */
static
int
MakeCurrent
(
vlc_gl_t
*
gl
)
static
int
MakeCurrent
(
vlc_gl_t
*
);
{
static
void
ReleaseCurrent
(
vlc_gl_t
*
);
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
static
void
SwapBuffers
(
vlc_gl_t
*
);
static
void
*
GetSymbol
(
vlc_gl_t
*
,
const
char
*
);
if
(
eglMakeCurrent
(
sys
->
display
,
sys
->
surface
,
sys
->
surface
,
sys
->
context
)
!=
EGL_TRUE
)
return
VLC_EGENERIC
;
return
VLC_SUCCESS
;
}
static
void
ReleaseCurrent
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
eglMakeCurrent
(
sys
->
display
,
EGL_NO_SURFACE
,
EGL_NO_SURFACE
,
EGL_NO_CONTEXT
);
}
static
void
SwapBuffers
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
eglSwapBuffers
(
sys
->
display
,
sys
->
surface
);
}
static
void
*
GetSymbol
(
vlc_gl_t
*
gl
,
const
char
*
procname
)
{
(
void
)
gl
;
return
(
void
*
)
eglGetProcAddress
(
procname
);
}
static
bool
CheckToken
(
const
char
*
haystack
,
const
char
*
needle
)
static
bool
CheckToken
(
const
char
*
haystack
,
const
char
*
needle
)
{
{
...
@@ -149,6 +147,24 @@ static EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config,
...
@@ -149,6 +147,24 @@ static EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config,
return
eglCreateWindowSurface
(
dpy
,
config
,
*
native
,
attrs
);
return
eglCreateWindowSurface
(
dpy
,
config
,
*
native
,
attrs
);
}
}
static
void
Close
(
vlc_object_t
*
obj
)
{
vlc_gl_t
*
gl
=
(
vlc_gl_t
*
)
obj
;
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
if
(
sys
->
display
!=
EGL_NO_DISPLAY
)
{
if
(
sys
->
surface
!=
EGL_NO_SURFACE
)
eglDestroySurface
(
sys
->
display
,
sys
->
surface
);
eglTerminate
(
sys
->
display
);
}
#ifdef USE_PLATFORM_X11
if
(
sys
->
x11
!=
NULL
)
XCloseDisplay
(
sys
->
x11
);
#endif
free
(
sys
);
}
/**
/**
* Probe EGL display availability
* Probe EGL display availability
*/
*/
...
@@ -330,51 +346,23 @@ static int OpenGL (vlc_object_t *obj)
...
@@ -330,51 +346,23 @@ static int OpenGL (vlc_object_t *obj)
return
Open
(
obj
,
&
api
);
return
Open
(
obj
,
&
api
);
}
}
static
void
Close
(
vlc_object_t
*
obj
)
vlc_module_begin
()
{
set_shortname
(
N_
(
"EGL"
))
vlc_gl_t
*
gl
=
(
vlc_gl_t
*
)
obj
;
set_description
(
N_
(
"EGL extension for OpenGL"
))
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
set_category
(
CAT_VIDEO
)
set_subcategory
(
SUBCAT_VIDEO_VOUT
)
if
(
sys
->
display
!=
EGL_NO_DISPLAY
)
set_capability
(
"opengl"
,
50
)
{
set_callbacks
(
OpenGL
,
Close
)
if
(
sys
->
surface
!=
EGL_NO_SURFACE
)
add_shortcut
(
"egl"
)
eglDestroySurface
(
sys
->
display
,
sys
->
surface
);
eglTerminate
(
sys
->
display
);
}
#ifdef USE_PLATFORM_X11
if
(
sys
->
x11
!=
NULL
)
XCloseDisplay
(
sys
->
x11
);
#endif
free
(
sys
);
}
static
int
MakeCurrent
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
if
(
eglMakeCurrent
(
sys
->
display
,
sys
->
surface
,
sys
->
surface
,
sys
->
context
)
!=
EGL_TRUE
)
return
VLC_EGENERIC
;
return
VLC_SUCCESS
;
}
static
void
ReleaseCurrent
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
eglMakeCurrent
(
sys
->
display
,
EGL_NO_SURFACE
,
EGL_NO_SURFACE
,
EGL_NO_CONTEXT
);
}
static
void
SwapBuffers
(
vlc_gl_t
*
gl
)
add_submodule
()
{
set_capability
(
"opengl es2"
,
50
)
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
set_callbacks
(
OpenGLES2
,
Close
)
add_shortcut
(
"egl"
)
eglSwapBuffers
(
sys
->
display
,
sys
->
surface
);
add_submodule
()
}
set_capability
(
"opengl es"
,
50
)
set_callbacks
(
OpenGLES
,
Close
)
add_shortcut
(
"egl"
)
static
void
*
GetSymbol
(
vlc_gl_t
*
gl
,
const
char
*
procname
)
vlc_module_end
()
{
(
void
)
gl
;
return
(
void
*
)
eglGetProcAddress
(
procname
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment