Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
cb6083b1
Commit
cb6083b1
authored
Dec 20, 2012
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics (opengl).
parent
538865a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
modules/video_output/opengl.c
modules/video_output/opengl.c
+16
-16
No files found.
modules/video_output/opengl.c
View file @
cb6083b1
...
@@ -212,12 +212,12 @@ static void BuildVertexShader(vout_display_opengl_t *vgl,
...
@@ -212,12 +212,12 @@ static void BuildVertexShader(vout_display_opengl_t *vgl,
"#version 120
\n
"
"#version 120
\n
"
"varying vec4 TexCoord0,TexCoord1, TexCoord2;"
"varying vec4 TexCoord0,TexCoord1, TexCoord2;"
"attribute vec4 MultiTexCoord0,MultiTexCoord1,MultiTexCoord2;"
"attribute vec4 MultiTexCoord0,MultiTexCoord1,MultiTexCoord2;"
"attribute vec4
vertex_p
osition;"
"attribute vec4
VertexP
osition;"
"void main() {"
"void main() {"
" TexCoord0 = MultiTexCoord0;"
" TexCoord0 = MultiTexCoord0;"
" TexCoord1 = MultiTexCoord1;"
" TexCoord1 = MultiTexCoord1;"
" TexCoord2 = MultiTexCoord2;"
" TexCoord2 = MultiTexCoord2;"
" gl_Position =
vertex_p
osition;"
" gl_Position =
VertexP
osition;"
"}"
;
"}"
;
*
shader
=
vgl
->
CreateShader
(
GL_VERTEX_SHADER
);
*
shader
=
vgl
->
CreateShader
(
GL_VERTEX_SHADER
);
...
@@ -254,7 +254,7 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
...
@@ -254,7 +254,7 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
const
char
*
template_glsl_yuv
=
const
char
*
template_glsl_yuv
=
"#version 120
\n
"
"#version 120
\n
"
"uniform sampler2D Texture[3];"
"uniform sampler2D Texture[3];"
"uniform vec4
c
oefficient[4];"
"uniform vec4
C
oefficient[4];"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"void main(void) {"
"void main(void) {"
...
@@ -263,9 +263,9 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
...
@@ -263,9 +263,9 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
" %c = texture2D(Texture[1], TexCoord1.st);"
" %c = texture2D(Texture[1], TexCoord1.st);"
" %c = texture2D(Texture[2], TexCoord2.st);"
" %c = texture2D(Texture[2], TexCoord2.st);"
" result = x *
coefficient[0] + c
oefficient[3];"
" result = x *
Coefficient[0] + C
oefficient[3];"
" result = (y *
c
oefficient[1]) + result;"
" result = (y *
C
oefficient[1]) + result;"
" result = (z *
c
oefficient[2]) + result;"
" result = (z *
C
oefficient[2]) + result;"
" gl_FragColor = result;"
" gl_FragColor = result;"
"}"
;
"}"
;
bool
swap_uv
=
fmt
->
i_chroma
==
VLC_CODEC_YV12
||
bool
swap_uv
=
fmt
->
i_chroma
==
VLC_CODEC_YV12
||
...
@@ -302,11 +302,11 @@ static void BuildRGBFragmentShader(vout_display_opengl_t *vgl,
...
@@ -302,11 +302,11 @@ static void BuildRGBFragmentShader(vout_display_opengl_t *vgl,
const
char
*
code
=
const
char
*
code
=
"#version 120
\n
"
"#version 120
\n
"
"uniform sampler2D Texture[3];"
"uniform sampler2D Texture[3];"
"uniform vec4
f
illColor;"
"uniform vec4
F
illColor;"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"void main()"
"void main()"
"{ "
"{ "
" gl_FragColor = texture2D(Texture[0], TexCoord0.st)*
f
illColor;"
" gl_FragColor = texture2D(Texture[0], TexCoord0.st)*
F
illColor;"
"}"
;
"}"
;
*
shader
=
vgl
->
CreateShader
(
GL_FRAGMENT_SHADER
);
*
shader
=
vgl
->
CreateShader
(
GL_FRAGMENT_SHADER
);
vgl
->
ShaderSource
(
*
shader
,
1
,
&
code
,
NULL
);
vgl
->
ShaderSource
(
*
shader
,
1
,
&
code
,
NULL
);
...
@@ -320,11 +320,11 @@ static void BuildRGBAFragmentShader(vout_display_opengl_t *vgl,
...
@@ -320,11 +320,11 @@ static void BuildRGBAFragmentShader(vout_display_opengl_t *vgl,
const
char
*
code
=
const
char
*
code
=
"#version 120
\n
"
"#version 120
\n
"
"uniform sampler2D Texture[3];"
"uniform sampler2D Texture[3];"
"uniform vec4
f
illColor;"
"uniform vec4
F
illColor;"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"varying vec4 TexCoord0,TexCoord1,TexCoord2;"
"void main()"
"void main()"
"{ "
"{ "
" gl_FragColor = texture2D(Texture[0], TexCoord0.st)*
f
illColor;"
" gl_FragColor = texture2D(Texture[0], TexCoord0.st)*
F
illColor;"
"}"
;
"}"
;
*
shader
=
vgl
->
CreateShader
(
GL_FRAGMENT_SHADER
);
*
shader
=
vgl
->
CreateShader
(
GL_FRAGMENT_SHADER
);
vgl
->
ShaderSource
(
*
shader
,
1
,
&
code
,
NULL
);
vgl
->
ShaderSource
(
*
shader
,
1
,
&
code
,
NULL
);
...
@@ -848,8 +848,8 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
...
@@ -848,8 +848,8 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
}
}
glActiveTexture
(
GL_TEXTURE0
+
0
);
glActiveTexture
(
GL_TEXTURE0
+
0
);
glClientActiveTexture
(
GL_TEXTURE0
+
0
);
glClientActiveTexture
(
GL_TEXTURE0
+
0
);
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
"
vertex_p
osition"
));
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
"
VertexP
osition"
));
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
"
vertex_p
osition"
),
2
,
GL_FLOAT
,
0
,
0
,
vertexCoord
);
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
"
VertexP
osition"
),
2
,
GL_FLOAT
,
0
,
0
,
vertexCoord
);
glDrawArrays
(
GL_TRIANGLE_STRIP
,
0
,
4
);
glDrawArrays
(
GL_TRIANGLE_STRIP
,
0
,
4
);
}
}
...
@@ -890,7 +890,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
...
@@ -890,7 +890,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
if
(
vgl
->
program
[
0
])
{
if
(
vgl
->
program
[
0
])
{
vgl
->
UseProgram
(
vgl
->
program
[
0
]);
vgl
->
UseProgram
(
vgl
->
program
[
0
]);
vgl
->
Uniform4fv
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"
c
oefficient"
),
4
,
vgl
->
local_value
);
vgl
->
Uniform4fv
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"
C
oefficient"
),
4
,
vgl
->
local_value
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture[0]"
),
0
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture[0]"
),
0
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture[1]"
),
1
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture[1]"
),
1
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture[2]"
),
2
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture[2]"
),
2
);
...
@@ -925,11 +925,11 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
...
@@ -925,11 +925,11 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
glBindTexture
(
GL_TEXTURE_2D
,
glr
->
texture
);
glBindTexture
(
GL_TEXTURE_2D
,
glr
->
texture
);
if
(
vgl
->
program
[
0
])
{
if
(
vgl
->
program
[
0
])
{
vgl
->
Uniform4f
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
1
],
"
f
illColor"
),
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
glr
->
alpha
);
vgl
->
Uniform4f
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
1
],
"
F
illColor"
),
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
glr
->
alpha
);
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"MultiTexCoord0"
));
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"MultiTexCoord0"
));
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"MultiTexCoord0"
),
2
,
GL_FLOAT
,
0
,
0
,
textureCoord
);
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"MultiTexCoord0"
),
2
,
GL_FLOAT
,
0
,
0
,
textureCoord
);
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"
vertex_p
osition"
));
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"
VertexP
osition"
));
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"
vertex_p
osition"
),
2
,
GL_FLOAT
,
0
,
0
,
vertexCoord
);
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
1
],
"
VertexP
osition"
),
2
,
GL_FLOAT
,
0
,
0
,
vertexCoord
);
}
else
{
}
else
{
glEnableClientState
(
GL_VERTEX_ARRAY
);
glEnableClientState
(
GL_VERTEX_ARRAY
);
glEnableClientState
(
GL_TEXTURE_COORD_ARRAY
);
glEnableClientState
(
GL_TEXTURE_COORD_ARRAY
);
...
...
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