Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
602d4482
Commit
602d4482
authored
May 25, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged vout_display_opengl_ResetTextures() into vout_display_opengl_GetPool().
parent
5d527f36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
53 deletions
+47
-53
modules/video_output/opengl.c
modules/video_output/opengl.c
+47
-52
modules/video_output/opengl.h
modules/video_output/opengl.h
+0
-1
No files found.
modules/video_output/opengl.c
View file @
602d4482
...
...
@@ -238,57 +238,6 @@ void vout_display_opengl_Delete(vout_display_opengl_t *vgl)
free
(
vgl
);
}
int
vout_display_opengl_ResetTextures
(
vout_display_opengl_t
*
vgl
)
{
if
(
vlc_gl_Lock
(
vgl
->
gl
))
return
VLC_EGENERIC
;
glDeleteTextures
(
VLCGL_TEXTURE_COUNT
,
vgl
->
texture
);
glGenTextures
(
VLCGL_TEXTURE_COUNT
,
vgl
->
texture
);
for
(
int
i
=
0
;
i
<
VLCGL_TEXTURE_COUNT
;
i
++
)
{
glBindTexture
(
VLCGL_TARGET
,
vgl
->
texture
[
i
]);
#if !USE_OPENGL_ES
/* Set the texture parameters */
glTexParameterf
(
VLCGL_TARGET
,
GL_TEXTURE_PRIORITY
,
1
.
0
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_MODULATE
);
#endif
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
#ifdef MACOS_OPENGL
/* Tell the driver not to make a copy of the texture but to use
our buffer */
glEnable
(
GL_UNPACK_CLIENT_STORAGE_APPLE
);
glPixelStorei
(
GL_UNPACK_CLIENT_STORAGE_APPLE
,
GL_TRUE
);
#if 0
/* Use VRAM texturing */
glTexParameteri(VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE,
GL_STORAGE_CACHED_APPLE);
#else
/* Use AGP texturing */
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_STORAGE_HINT_APPLE
,
GL_STORAGE_SHARED_APPLE
);
#endif
#endif
/* Call glTexImage2D only once, and use glTexSubImage2D later */
if
(
vgl
->
buffer
[
i
])
{
glTexImage2D
(
VLCGL_TARGET
,
0
,
VLCGL_FORMAT
,
vgl
->
tex_width
,
vgl
->
tex_height
,
0
,
VLCGL_FORMAT
,
VLCGL_TYPE
,
vgl
->
buffer
[
i
]);
}
}
vlc_gl_Unlock
(
vgl
->
gl
);
return
VLC_SUCCESS
;
}
#ifdef MACOS_OPENGL
/* XXX See comment vout_display_opengl_Prepare */
struct
picture_sys_t
{
...
...
@@ -327,6 +276,9 @@ static void PictureUnlock(picture_t *picture)
picture_pool_t
*
vout_display_opengl_GetPool
(
vout_display_opengl_t
*
vgl
)
{
if
(
vgl
->
pool
)
return
vgl
->
pool
;
picture_t
*
picture
[
VLCGL_TEXTURE_COUNT
];
int
i
;
...
...
@@ -374,7 +326,50 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl)
if
(
!
vgl
->
pool
)
goto
error
;
vout_display_opengl_ResetTextures
(
vgl
);
if
(
vlc_gl_Lock
(
vgl
->
gl
))
return
vgl
->
pool
;
glGenTextures
(
VLCGL_TEXTURE_COUNT
,
vgl
->
texture
);
for
(
int
i
=
0
;
i
<
VLCGL_TEXTURE_COUNT
;
i
++
)
{
glBindTexture
(
VLCGL_TARGET
,
vgl
->
texture
[
i
]);
#if !USE_OPENGL_ES
/* Set the texture parameters */
glTexParameterf
(
VLCGL_TARGET
,
GL_TEXTURE_PRIORITY
,
1
.
0
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_MODULATE
);
#endif
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
#ifdef MACOS_OPENGL
/* Tell the driver not to make a copy of the texture but to use
our buffer */
glEnable
(
GL_UNPACK_CLIENT_STORAGE_APPLE
);
glPixelStorei
(
GL_UNPACK_CLIENT_STORAGE_APPLE
,
GL_TRUE
);
#if 0
/* Use VRAM texturing */
glTexParameteri(VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE,
GL_STORAGE_CACHED_APPLE);
#else
/* Use AGP texturing */
glTexParameteri
(
VLCGL_TARGET
,
GL_TEXTURE_STORAGE_HINT_APPLE
,
GL_STORAGE_SHARED_APPLE
);
#endif
#endif
/* Call glTexImage2D only once, and use glTexSubImage2D later */
if
(
vgl
->
buffer
[
i
])
{
glTexImage2D
(
VLCGL_TARGET
,
0
,
VLCGL_FORMAT
,
vgl
->
tex_width
,
vgl
->
tex_height
,
0
,
VLCGL_FORMAT
,
VLCGL_TYPE
,
vgl
->
buffer
[
i
]);
}
}
vlc_gl_Unlock
(
vgl
->
gl
);
return
vgl
->
pool
;
...
...
modules/video_output/opengl.h
View file @
602d4482
...
...
@@ -58,7 +58,6 @@ typedef struct vout_display_opengl_t vout_display_opengl_t;
vout_display_opengl_t
*
vout_display_opengl_New
(
video_format_t
*
fmt
,
vlc_gl_t
*
gl
);
void
vout_display_opengl_Delete
(
vout_display_opengl_t
*
vgl
);
int
vout_display_opengl_ResetTextures
(
vout_display_opengl_t
*
vgl
);
picture_pool_t
*
vout_display_opengl_GetPool
(
vout_display_opengl_t
*
vgl
);
int
vout_display_opengl_Prepare
(
vout_display_opengl_t
*
vgl
,
...
...
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