Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
de198bc7
Commit
de198bc7
authored
Dec 12, 2004
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl.c, voutgl.m: restored smooth resizing on OS X
re-enabled OS X GL provider (QT output still default)
parent
a272d13a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
40 deletions
+63
-40
modules/gui/macosx/voutgl.m
modules/gui/macosx/voutgl.m
+23
-7
modules/video_output/opengl.c
modules/video_output/opengl.c
+40
-33
No files found.
modules/gui/macosx/voutgl.m
View file @
de198bc7
...
...
@@ -55,11 +55,12 @@
struct
vout_sys_t
{
NSAutoreleasePool
*
o_pool
;
NSAutoreleasePool
*
o_pool
;
VLCWindow
*
o_window
;
VLCGLView
*
o_glview
;
vlc_bool_t
b_saved_frame
;
NSRect
s_frame
;
vlc_bool_t
*
b_got_frame
;
};
/*****************************************************************************
...
...
@@ -82,7 +83,6 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
* - the green line is gone
* - other problems?????
*/
return
(
1
);
if
(
!
CGDisplayUsesOpenGLAcceleration
(
kCGDirectMainDisplay
)
)
{
...
...
@@ -176,6 +176,7 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
}
/* Spawn window */
p_vout
->
p_sys
->
b_got_frame
=
VLC_FALSE
;
p_vout
->
p_sys
->
o_window
=
[[
VLCWindow
alloc
]
initWithVout
:
p_vout
frame:
nil
];
...
...
@@ -279,6 +280,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
static
void
Swap
(
vout_thread_t
*
p_vout
)
{
p_vout
->
p_sys
->
b_got_frame
=
VLC_TRUE
;
[[
p_vout
->
p_sys
->
o_glview
openGLContext
]
makeCurrentContext
];
if
(
[
p_vout
->
p_sys
->
o_glview
lockFocusIfCanDraw
]
)
{
...
...
@@ -349,7 +351,21 @@ static void Swap( vout_thread_t * p_vout )
}
glViewport
(
(
bounds
.
size
.
width
-
x
)
/
2
,
(
bounds
.
size
.
height
-
y
)
/
2
,
x
,
y
);
if
(
p_vout
->
p_sys
->
b_got_frame
)
{
/* Ask the opengl module to redraw */
vout_thread_t
*
p_parent
;
p_parent
=
(
vout_thread_t
*
)
p_vout
->
p_parent
;
if
(
p_parent
&&
p_parent
->
pf_display
)
{
p_parent
->
pf_display
(
p_parent
,
NULL
);
}
}
else
{
glClear
(
GL_COLOR_BUFFER_BIT
);
}
}
-
(
void
)
drawRect
:
(
NSRect
)
rect
...
...
modules/video_output/opengl.c
View file @
de198bc7
...
...
@@ -451,19 +451,6 @@ static int Manage( vout_thread_t *p_vout )
static
void
Render
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
float
f_width
,
f_height
;
/* glTexCoord works differently with GL_TEXTURE_2D and
GL_TEXTURE_RECTANGLE_EXT */
#ifdef SYS_DARWIN
f_width
=
(
float
)
p_vout
->
output
.
i_width
;
f_height
=
(
float
)
p_vout
->
output
.
i_height
;
#else
f_width
=
(
float
)
p_vout
->
output
.
i_width
/
p_sys
->
i_tex_width
;
f_height
=
(
float
)
p_vout
->
output
.
i_height
/
p_sys
->
i_tex_height
;
#endif
glClear
(
GL_COLOR_BUFFER_BIT
);
/* On Win32/GLX, we do this the usual way:
+ Fill the buffer with new content,
...
...
@@ -483,14 +470,53 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
time. */
#ifdef SYS_DARWIN
int
i_new_index
;
i_new_index
=
(
p_sys
->
i_index
+
1
)
&
1
;
/* Update the texture */
glBindTexture
(
VLCGL_TARGET
,
p_sys
->
p_textures
[
i_new_index
]
);
glTexSubImage2D
(
VLCGL_TARGET
,
0
,
0
,
0
,
p_sys
->
i_tex_width
,
p_sys
->
i_tex_height
,
VLCGL_FORMAT
,
VLCGL_TYPE
,
p_sys
->
pp_buffer
[
i_new_index
]
);
/* Bind to the previous texture for drawing */
glBindTexture
(
VLCGL_TARGET
,
p_sys
->
p_textures
[
p_sys
->
i_index
]
);
#else
/* Switch buffers */
p_sys
->
i_index
=
i_new_index
;
p_pic
->
p
->
p_pixels
=
p_sys
->
pp_buffer
[
p_sys
->
i_index
];
#else
/* Update the texture */
glTexSubImage2D
(
GL_TEXTURE_2D
,
0
,
0
,
0
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
VLCGL_RGB_FORMAT
,
VLCGL_RGB_TYPE
,
p_sys
->
pp_buffer
[
0
]
);
#endif
}
/*****************************************************************************
* DisplayVideo: displays previously rendered output
*****************************************************************************/
static
void
DisplayVideo
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
float
f_width
,
f_height
;
/* glTexCoord works differently with GL_TEXTURE_2D and
GL_TEXTURE_RECTANGLE_EXT */
#ifdef SYS_DARWIN
f_width
=
(
float
)
p_vout
->
output
.
i_width
;
f_height
=
(
float
)
p_vout
->
output
.
i_height
;
#else
f_width
=
(
float
)
p_vout
->
output
.
i_width
/
p_sys
->
i_tex_width
;
f_height
=
(
float
)
p_vout
->
output
.
i_height
/
p_sys
->
i_tex_height
;
#endif
/* Why drawing here and not in Render()? Because this way, the
OpenGL providers can call pf_display to force redraw. Currently,
the OS X provider uses it to get a smooth window resizing */
glClear
(
GL_COLOR_BUFFER_BIT
);
if
(
p_sys
->
i_effect
==
OPENGL_EFFECT_NONE
)
{
...
...
@@ -549,25 +575,6 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
glDisable
(
VLCGL_TARGET
);
#ifdef SYS_DARWIN
/* Switch buffers */
p_sys
->
i_index
=
(
p_sys
->
i_index
+
1
)
&
1
;
p_pic
->
p
->
p_pixels
=
p_sys
->
pp_buffer
[
p_sys
->
i_index
];
/* Update the texture */
glBindTexture
(
VLCGL_TARGET
,
p_sys
->
p_textures
[
p_sys
->
i_index
]
);
glTexSubImage2D
(
VLCGL_TARGET
,
0
,
0
,
0
,
p_sys
->
i_tex_width
,
p_sys
->
i_tex_height
,
VLCGL_FORMAT
,
VLCGL_TYPE
,
p_sys
->
pp_buffer
[
p_sys
->
i_index
]
);
#endif
}
/*****************************************************************************
* DisplayVideo: displays previously rendered output
*****************************************************************************/
static
void
DisplayVideo
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vout_sys_t
*
p_sys
=
p_vout
->
p_sys
;
p_sys
->
p_vout
->
pf_swap
(
p_sys
->
p_vout
);
}
...
...
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