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
6550c5d7
Commit
6550c5d7
authored
Jul 23, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/video_output/opengl.c, modules/video_output/x11/glx.c: proper scaling + fixes.
parent
634e231f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
10 deletions
+37
-10
modules/video_output/opengl.c
modules/video_output/opengl.c
+30
-10
modules/video_output/x11/glx.c
modules/video_output/x11/glx.c
+7
-0
No files found.
modules/video_output/opengl.c
View file @
6550c5d7
...
...
@@ -66,11 +66,18 @@ static inline int GetAlignedSize( int );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define EFFECT_TEXT N_("Select effect")
#define EFFECT_LONGTEXT N_( \
"Allows you to select different visual effects.")
vlc_module_begin
();
set_description
(
_
(
"OpenGL video output"
)
);
set_capability
(
"video output"
,
20
);
add_shortcut
(
"opengl"
);
set_callbacks
(
CreateVout
,
DestroyVout
);
add_integer
(
"opengl-effect"
,
0
,
NULL
,
EFFECT_TEXT
,
EFFECT_LONGTEXT
,
VLC_TRUE
);
vlc_module_end
();
/*****************************************************************************
...
...
@@ -89,7 +96,7 @@ struct vout_sys_t
int
i_tex_height
;
GLuint
texture
;
int
i_effect
;
//XXX
int
i_effect
;
};
/*****************************************************************************
...
...
@@ -99,6 +106,7 @@ static int CreateVout( vlc_object_t *p_this )
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
vout_sys_t
*
p_sys
;
vlc_value_t
val
;
/* Allocate structure */
p_vout
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
...
...
@@ -108,8 +116,9 @@ static int CreateVout( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
//XXX set to 0 to disable the cube effect
p_sys
->
i_effect
=
1
;
var_Create
(
p_vout
,
"opengl-effect"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_vout
,
"opengl-effect"
,
&
val
);
p_sys
->
i_effect
=
val
.
i_int
;
/* A texture must have a size aligned on a power of 2 */
p_sys
->
i_tex_width
=
GetAlignedSize
(
p_vout
->
render
.
i_width
);
...
...
@@ -134,6 +143,8 @@ static int CreateVout( vlc_object_t *p_this )
p_sys
->
p_vout
->
render
.
i_width
=
p_vout
->
render
.
i_width
;
p_sys
->
p_vout
->
render
.
i_height
=
p_vout
->
render
.
i_height
;
p_sys
->
p_vout
->
render
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
p_sys
->
p_vout
->
b_scale
=
p_vout
->
b_scale
;
p_sys
->
p_vout
->
i_alignment
=
p_vout
->
i_alignment
;
p_sys
->
p_vout
->
p_module
=
module_Need
(
p_sys
->
p_vout
,
"opengl provider"
,
NULL
,
0
);
...
...
@@ -221,15 +232,25 @@ static int Init( vout_thread_t *p_vout )
I_OUTPUTPICTURES
=
1
;
/* Set the texture parameters */
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_PRIORITY
,
1
.
0
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
if
(
p_sys
->
i_effect
)
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_MODULATE
);
glDisable
(
GL_BLEND
);
glDisable
(
GL_DEPTH_TEST
);
glDepthMask
(
GL_FALSE
);
glDisable
(
GL_CULL_FACE
);
glClear
(
GL_COLOR_BUFFER_BIT
);
if
(
p_sys
->
i_effect
==
1
)
{
glEnable
(
GL_CULL_FACE
);
/* glDisable( GL_DEPTH_TEST );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE );*/
/* Set the perpective */
glMatrixMode
(
GL_PROJECTION
);
...
...
@@ -281,6 +302,7 @@ static void DestroyVout( vlc_object_t *p_this )
static
int
Manage
(
vout_thread_t
*
p_vout
)
{
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
return
p_sys
->
p_vout
->
pf_manage
(
p_sys
->
p_vout
);
}
...
...
@@ -293,13 +315,11 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
float
f_width
=
(
float
)
p_vout
->
output
.
i_width
/
p_sys
->
i_tex_width
;
float
f_height
=
(
float
)
p_vout
->
output
.
i_height
/
p_sys
->
i_tex_height
;
glClear
(
GL_COLOR_BUFFER_BIT
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
3
,
p_sys
->
i_tex_width
,
p_sys
->
i_tex_height
,
0
,
VLCGL_RGB_FORMAT
,
VLCGL_RGB_TYPE
,
p_sys
->
p_buffer
);
if
(
!
p_sys
->
i_effect
)
if
(
p_sys
->
i_effect
!=
1
)
{
glEnable
(
GL_TEXTURE_2D
);
glBegin
(
GL_POLYGON
);
...
...
modules/video_output/x11/glx.c
View file @
6550c5d7
...
...
@@ -306,6 +306,13 @@ int InitGLX13( vout_thread_t *p_vout )
static
void
SwapBuffers
(
vout_thread_t
*
p_vout
)
{
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
int
i_width
,
i_height
,
i_x
,
i_y
;
vout_PlacePicture
(
p_vout
,
p_vout
->
p_sys
->
p_win
->
i_width
,
p_vout
->
p_sys
->
p_win
->
i_height
,
&
i_x
,
&
i_y
,
&
i_width
,
&
i_height
);
glViewport
(
0
,
0
,
(
GLint
)
i_width
,
(
GLint
)
i_height
);
if
(
p_sys
->
b_glx13
)
{
...
...
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