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
9ef4ff38
Commit
9ef4ff38
authored
Aug 27, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
egl: add Wayland extended platform support
This enables OpenGL/OpenGL ES through Wayland.
parent
c4ee2fc8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
2 deletions
+69
-2
configure.ac
configure.ac
+11
-0
modules/video_output/Makefile.am
modules/video_output/Makefile.am
+8
-0
modules/video_output/egl.c
modules/video_output/egl.c
+50
-2
No files found.
configure.ac
View file @
9ef4ff38
...
...
@@ -3205,8 +3205,19 @@ AS_IF([test "${enable_wayland}" != "no"], [
AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
])
])
AS_IF([test "${have_egl}" = "yes"], [
PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
have_wayland_egl="yes"
], [
AS_IF([test -n "${enable_wayland}"], [
AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
])
])
])
])
AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
dnl
...
...
modules/video_output/Makefile.am
View file @
9ef4ff38
...
...
@@ -145,6 +145,14 @@ if HAVE_WAYLAND
vout_LTLIBRARIES
+=
libwl_shell_surface_plugin.la
endif
libegl_wl_plugin_la_SOURCES
=
video_output/egl.c
libegl_wl_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
-DUSE_PLATFORM_WAYLAND
=
1
libegl_wl_plugin_la_CFLAGS
=
$(AM_CFLAGS)
$(EGL_CFLAGS)
$(WAYLAND_EGL_CFLAGS)
libegl_wl_plugin_la_LIBADD
=
$(EGL_LIBS)
$(WAYLAND_EGL_LIBS)
if
HAVE_EGL
vout_LTLIBRARIES
+=
libegl_wl_plugin.la
endif
### Win32 ###
libdirect2d_plugin_la_SOURCES
=
video_output/msw/direct2d.c
\
...
...
modules/video_output/egl.c
View file @
9ef4ff38
...
...
@@ -3,7 +3,7 @@
* @brief EGL OpenGL extension module
*/
/*****************************************************************************
* Copyright © 2010-201
1
Rémi Denis-Courmont
* Copyright © 2010-201
4
Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -36,6 +36,9 @@
#ifdef USE_PLATFORM_X11
# include <vlc_xlib.h>
#endif
#ifdef USE_PLATFORM_WAYLAND
# include <wayland-egl.h>
#endif
typedef
struct
vlc_gl_sys_t
{
...
...
@@ -45,6 +48,10 @@ typedef struct vlc_gl_sys_t
#if defined (USE_PLATFORM_X11)
Display
*
x11
;
#endif
#if defined (USE_PLATFORM_WAYLAND)
struct
wl_egl_window
*
window
;
unsigned
width
,
height
;
#endif
}
vlc_gl_sys_t
;
static
int
MakeCurrent
(
vlc_gl_t
*
gl
)
...
...
@@ -65,6 +72,21 @@ static void ReleaseCurrent (vlc_gl_t *gl)
EGL_NO_CONTEXT
);
}
#ifdef USE_PLATFORM_WAYLAND
static
void
Resize
(
vlc_gl_t
*
gl
,
unsigned
width
,
unsigned
height
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
wl_egl_window_resize
(
sys
->
window
,
width
,
height
,
(
sys
->
width
-
width
)
/
2
,
(
sys
->
height
-
height
)
/
2
);
sys
->
width
=
width
;
sys
->
height
=
height
;
}
#else
# define Resize (NULL)
#endif
static
void
SwapBuffers
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
...
...
@@ -161,6 +183,10 @@ static void Close (vlc_object_t *obj)
#ifdef USE_PLATFORM_X11
if
(
sys
->
x11
!=
NULL
)
XCloseDisplay
(
sys
->
x11
);
#endif
#ifdef USE_PLATFORM_WAYLAND
if
(
sys
->
window
!=
NULL
)
wl_egl_window_destroy
(
sys
->
window
);
#endif
free
(
sys
);
}
...
...
@@ -222,6 +248,28 @@ static int Open (vlc_object_t *obj, const struct gl_api *api)
}
# endif
#elif defined (USE_PLATFORM_WAYLAND)
sys
->
window
=
NULL
;
if
(
wnd
->
type
!=
VOUT_WINDOW_TYPE_WAYLAND
)
goto
error
;
# ifdef EGL_EXT_platform_wayland
if
(
!
CheckClientExt
(
"EGL_EXT_platform_wayland"
))
goto
error
;
/* Resize() should be called with the proper size before Swap() */
window
=
wl_egl_window_create
(
wnd
->
handle
.
wl
,
1
,
1
);
if
(
window
==
NULL
)
goto
error
;
sys
->
window
=
window
;
sys
->
display
=
GetDisplayEXT
(
EGL_PLATFORM_WAYLAND_EXT
,
wnd
->
display
.
wl
,
NULL
);
createSurface
=
CreateWindowSurfaceEXT
;
# endif
#elif defined (USE_PLATFORM_WIN32)
if
(
wnd
->
type
!=
VOUT_WINDOW_TYPE_HWND
)
goto
error
;
...
...
@@ -308,7 +356,7 @@ static int Open (vlc_object_t *obj, const struct gl_api *api)
/* Initialize OpenGL callbacks */
gl
->
makeCurrent
=
MakeCurrent
;
gl
->
releaseCurrent
=
ReleaseCurrent
;
gl
->
resize
=
NULL
;
gl
->
resize
=
Resize
;
gl
->
swap
=
SwapBuffers
;
gl
->
getProcAddress
=
GetSymbol
;
gl
->
lock
=
NULL
;
...
...
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