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
00246f15
Commit
00246f15
authored
Dec 19, 2012
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small clean up (opengl)
parent
05a86500
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
+21
-24
modules/video_output/opengl.c
modules/video_output/opengl.c
+21
-24
No files found.
modules/video_output/opengl.c
View file @
00246f15
...
@@ -461,30 +461,30 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
...
@@ -461,30 +461,30 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
free
(
code
);
free
(
code
);
for
(
GLuint
i
=
0
;
i
<
2
;
i
++
)
{
for
(
GLuint
i
=
0
;
i
<
2
;
i
++
)
{
int
infoLength
=
0
;
int
infoLength
=
0
;
int
charsWritten
=
0
;
char
*
infolog
;
vgl
->
GetProgramiv
(
vgl
->
program
[
i
],
GL_INFO_LOG_LENGTH
,
&
infoLength
);
vgl
->
GetProgramiv
(
vgl
->
program
[
i
],
GL_INFO_LOG_LENGTH
,
&
infoLength
);
if
(
infoLength
>
1
)
{
if
(
infoLength
>
1
)
{
/* If there is some message, better to check linking is ok */
int
charsWritten
;
GLint
link_status
=
GL_TRUE
;
char
*
infolog
;
vgl
->
GetProgramiv
(
vgl
->
program
[
i
],
GL_LINK_STATUS
,
&
link_status
);
infolog
=
(
char
*
)
malloc
(
infoLength
);
infolog
=
malloc
(
infoLength
);
vgl
->
GetProgramInfoLog
(
vgl
->
program
[
i
],
infoLength
,
&
charsWritten
,
infolog
);
vgl
->
GetProgramInfoLog
(
vgl
->
program
[
i
],
infoLength
,
&
charsWritten
,
infolog
);
fprintf
(
stderr
,
"shader program %d:
%s %d
\n
"
,
i
,
infolog
,
infoLength
);
fprintf
(
stderr
,
"shader program %d:
%s
\n
"
,
i
,
infolog
);
free
(
infolog
);
free
(
infolog
);
/* Check shaders messages too */
/* Check shaders messages too */
for
(
GLuint
j
=
0
;
j
<
2
;
j
++
)
{
for
(
GLuint
j
=
0
;
j
<
2
;
j
++
)
{
vgl
->
GetShaderiv
(
vgl
->
shader
[
j
],
GL_INFO_LOG_LENGTH
,
&
infoLength
);
vgl
->
GetShaderiv
(
vgl
->
shader
[
j
],
GL_INFO_LOG_LENGTH
,
&
infoLength
);
if
(
infoLength
>
1
)
{
if
(
infoLength
>
1
)
{
infolog
=
(
char
*
)
malloc
(
infoLength
);
infolog
=
malloc
(
infoLength
);
vgl
->
GetShaderInfoLog
(
vgl
->
shader
[
j
],
infoLength
,
&
charsWritten
,
infolog
);
vgl
->
GetShaderInfoLog
(
vgl
->
shader
[
j
],
infoLength
,
&
charsWritten
,
infolog
);
fprintf
(
stderr
,
"shader %d: %s
\n
"
,
j
,
infolog
);
fprintf
(
stderr
,
"shader %d: %s
\n
"
,
j
,
infolog
);
free
(
infolog
);
free
(
infolog
);
}
}
}
}
/* If there is some message, better to check linking is ok */
GLint
link_status
=
GL_TRUE
;
vgl
->
GetProgramiv
(
vgl
->
program
[
i
],
GL_LINK_STATUS
,
&
link_status
);
if
(
link_status
==
GL_FALSE
)
{
if
(
link_status
==
GL_FALSE
)
{
fprintf
(
stderr
,
"Unable to use program %d
\n
"
,
i
);
fprintf
(
stderr
,
"Unable to use program %d
\n
"
,
i
);
free
(
vgl
);
free
(
vgl
);
...
@@ -555,7 +555,7 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned
...
@@ -555,7 +555,7 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned
/* Allocate our pictures */
/* Allocate our pictures */
picture_t
*
picture
[
VLCGL_PICTURE_MAX
]
=
{
NULL
,
};
picture_t
*
picture
[
VLCGL_PICTURE_MAX
]
=
{
NULL
,
};
unsigned
count
=
0
;
unsigned
count
;
for
(
count
=
0
;
count
<
__MIN
(
VLCGL_PICTURE_MAX
,
requested_count
);
count
++
)
{
for
(
count
=
0
;
count
<
__MIN
(
VLCGL_PICTURE_MAX
,
requested_count
);
count
++
)
{
picture
[
count
]
=
picture_NewFromFormat
(
&
vgl
->
fmt
);
picture
[
count
]
=
picture_NewFromFormat
(
&
vgl
->
fmt
);
...
@@ -751,7 +751,7 @@ static void DrawWithoutShaders(vout_display_opengl_t *vgl,
...
@@ -751,7 +751,7 @@ static void DrawWithoutShaders(vout_display_opengl_t *vgl,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
};
};
const
GLfloat
textureCoord
[
8
]
=
{
const
GLfloat
textureCoord
[]
=
{
left
[
0
],
bottom
[
0
],
left
[
0
],
bottom
[
0
],
right
[
0
],
bottom
[
0
],
right
[
0
],
bottom
[
0
],
left
[
0
],
top
[
0
],
left
[
0
],
top
[
0
],
...
@@ -791,7 +791,7 @@ static void DrawWithoutShaders(vout_display_opengl_t *vgl,
...
@@ -791,7 +791,7 @@ static void DrawWithoutShaders(vout_display_opengl_t *vgl,
static
void
DrawWithShaders
(
vout_display_opengl_t
*
vgl
,
static
void
DrawWithShaders
(
vout_display_opengl_t
*
vgl
,
float
*
left
,
float
*
top
,
float
*
right
,
float
*
bottom
)
float
*
left
,
float
*
top
,
float
*
right
,
float
*
bottom
)
{
{
const
GLfloat
vertexCoord
[]
=
{
static
const
GLfloat
vertexCoord
[]
=
{
-
1
.
0
,
1
.
0
,
-
1
.
0
,
1
.
0
,
-
1
.
0
,
-
1
.
0
,
-
1
.
0
,
-
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
,
...
@@ -799,8 +799,7 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
...
@@ -799,8 +799,7 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
};
};
for
(
unsigned
j
=
0
;
j
<
vgl
->
chroma
->
plane_count
;
j
++
)
{
for
(
unsigned
j
=
0
;
j
<
vgl
->
chroma
->
plane_count
;
j
++
)
{
char
*
attribute
=
NULL
;
const
GLfloat
textureCoord
[]
=
{
const
GLfloat
texCoord
[]
=
{
left
[
j
],
top
[
j
],
left
[
j
],
top
[
j
],
left
[
j
],
bottom
[
j
],
left
[
j
],
bottom
[
j
],
right
[
j
],
top
[
j
],
right
[
j
],
top
[
j
],
...
@@ -810,13 +809,11 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
...
@@ -810,13 +809,11 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
glClientActiveTexture
(
GL_TEXTURE0
+
j
);
glClientActiveTexture
(
GL_TEXTURE0
+
j
);
glEnable
(
vgl
->
tex_target
);
glEnable
(
vgl
->
tex_target
);
glBindTexture
(
vgl
->
tex_target
,
vgl
->
texture
[
0
][
j
]);
glBindTexture
(
vgl
->
tex_target
,
vgl
->
texture
[
0
][
j
]);
if
(
asprintf
(
&
attribute
,
"MultiTexCoord%1d"
,
j
)
==
-
1
)
return
;
char
attribute
[
20
];
snprintf
(
attribute
,
sizeof
(
attribute
),
"MultiTexCoord%1d"
,
j
);
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
attribute
));
vgl
->
EnableVertexAttribArray
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
attribute
));
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
attribute
),
2
,
GL_FLOAT
,
0
,
0
,
texCoord
);
vgl
->
VertexAttribPointer
(
vgl
->
GetAttribLocation
(
vgl
->
program
[
0
],
attribute
),
2
,
GL_FLOAT
,
0
,
0
,
textureCoord
);
free
(
attribute
);
attribute
=
NULL
;
}
}
glActiveTexture
(
GL_TEXTURE0
+
0
);
glActiveTexture
(
GL_TEXTURE0
+
0
);
glClientActiveTexture
(
GL_TEXTURE0
+
0
);
glClientActiveTexture
(
GL_TEXTURE0
+
0
);
...
@@ -886,7 +883,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
...
@@ -886,7 +883,7 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
glr
->
left
,
glr
->
top
,
glr
->
left
,
glr
->
top
,
glr
->
left
,
glr
->
bottom
,
glr
->
left
,
glr
->
bottom
,
glr
->
right
,
glr
->
top
,
glr
->
right
,
glr
->
top
,
glr
->
right
,
glr
->
bottom
,
glr
->
right
,
glr
->
bottom
,
};
};
static
const
GLfloat
textureCoord
[]
=
{
static
const
GLfloat
textureCoord
[]
=
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
...
...
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