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
77c14051
Commit
77c14051
authored
May 30, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl: add missing callback to release the (current) context
parent
a06b129a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
7 deletions
+33
-7
include/vlc_opengl.h
include/vlc_opengl.h
+6
-0
modules/video_output/egl.c
modules/video_output/egl.c
+10
-0
modules/video_output/glx.c
modules/video_output/glx.c
+17
-7
No files found.
include/vlc_opengl.h
View file @
77c14051
...
...
@@ -45,6 +45,7 @@ struct vlc_gl_t
void
*
sys
;
int
(
*
makeCurrent
)(
vlc_gl_t
*
);
void
(
*
releaseCurrent
)(
vlc_gl_t
*
);
void
(
*
swap
)(
vlc_gl_t
*
);
int
(
*
lock
)(
vlc_gl_t
*
);
void
(
*
unlock
)(
vlc_gl_t
*
);
...
...
@@ -65,6 +66,11 @@ static inline int vlc_gl_MakeCurrent(vlc_gl_t *gl)
return
gl
->
makeCurrent
(
gl
);
}
static
inline
void
vlc_gl_ReleaseCurrent
(
vlc_gl_t
*
gl
)
{
gl
->
releaseCurrent
(
gl
);
}
static
inline
int
vlc_gl_Lock
(
vlc_gl_t
*
gl
)
{
return
(
gl
->
lock
!=
NULL
)
?
gl
->
lock
(
gl
)
:
VLC_SUCCESS
;
...
...
modules/video_output/egl.c
View file @
77c14051
...
...
@@ -69,6 +69,7 @@ typedef struct vlc_gl_sys_t
/* OpenGL callbacks */
static
int
MakeCurrent
(
vlc_gl_t
*
);
static
void
ReleaseCurrent
(
vlc_gl_t
*
);
static
void
SwapBuffers
(
vlc_gl_t
*
);
static
void
*
GetSymbol
(
vlc_gl_t
*
,
const
char
*
);
...
...
@@ -214,6 +215,7 @@ static int Open (vlc_object_t *obj, const struct gl_api *api)
/* Initialize OpenGL callbacks */
gl
->
sys
=
sys
;
gl
->
makeCurrent
=
MakeCurrent
;
gl
->
releaseCurrent
=
ReleaseCurrent
;
gl
->
swap
=
SwapBuffers
;
gl
->
getProcAddress
=
GetSymbol
;
gl
->
lock
=
NULL
;
...
...
@@ -271,6 +273,14 @@ static int MakeCurrent (vlc_gl_t *gl)
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
;
...
...
modules/video_output/glx.c
View file @
77c14051
...
...
@@ -55,6 +55,7 @@ typedef struct vlc_gl_sys_t
}
vlc_gl_sys_t
;
static
int
MakeCurrent
(
vlc_gl_t
*
);
static
void
ReleaseCurrent
(
vlc_gl_t
*
);
static
void
SwapBuffers
(
vlc_gl_t
*
);
static
void
*
GetSymbol
(
vlc_gl_t
*
,
const
char
*
);
...
...
@@ -184,6 +185,15 @@ static int Open (vlc_object_t *obj)
goto
error
;
}
/* Initialize OpenGL callbacks */
gl
->
sys
=
sys
;
gl
->
makeCurrent
=
MakeCurrent
;
gl
->
releaseCurrent
=
ReleaseCurrent
;
gl
->
swap
=
SwapBuffers
;
gl
->
getProcAddress
=
GetSymbol
;
gl
->
lock
=
NULL
;
gl
->
unlock
=
NULL
;
#ifdef GLX_ARB_get_proc_address
bool
is_swap_interval_set
=
false
;
# ifdef GLX_SGI_swap_control
...
...
@@ -209,13 +219,6 @@ static int Open (vlc_object_t *obj)
# endif
#endif
/* Initialize OpenGL callbacks */
gl
->
sys
=
sys
;
gl
->
makeCurrent
=
MakeCurrent
;
gl
->
swap
=
SwapBuffers
;
gl
->
getProcAddress
=
GetSymbol
;
gl
->
lock
=
NULL
;
gl
->
unlock
=
NULL
;
return
VLC_SUCCESS
;
error:
...
...
@@ -245,6 +248,13 @@ static int MakeCurrent (vlc_gl_t *gl)
return
VLC_SUCCESS
;
}
static
void
ReleaseCurrent
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
glXMakeContextCurrent
(
sys
->
display
,
None
,
None
,
NULL
);
}
static
void
SwapBuffers
(
vlc_gl_t
*
gl
)
{
vlc_gl_sys_t
*
sys
=
gl
->
sys
;
...
...
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