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
ff4917e7
Commit
ff4917e7
authored
Apr 20, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout_macosx: sync remnants with 2.1 branch
parent
31ef2342
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
57 deletions
+21
-57
modules/video_output/macosx.m
modules/video_output/macosx.m
+21
-57
No files found.
modules/video_output/macosx.m
View file @
ff4917e7
/*****************************************************************************
*
voutgl
.m: MacOS X OpenGL provider
*
macosx
.m: MacOS X OpenGL provider
*****************************************************************************
* Copyright (C) 2001-2012 the VideoLAN team
* $Id$
...
...
@@ -317,28 +317,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
if
(
vout_window_SetFullScreen
(
sys
->
embed
,
cfg
->
is_fullscreen
))
return
VLC_EGENERIC
;
NSRect
frame
;
/* when entering fullscreen, set the OSD / display size to the visible screen size.
* this way, the text rendering will be as sharp as possible.
* when returning from fullscreen, pick the dimensions from cfg, which can be different
* from the native video size because of crop and zoom */
if
(
cfg
->
is_fullscreen
)
frame
=
[[[
sys
->
glView
window
]
screen
]
visibleFrame
];
else
frame
=
NSMakeRect
(
0
.,
0
.,
cfg
->
display
.
width
,
cfg
->
display
.
height
);
vout_display_SendEventDisplaySize
(
vd
,
frame
.
size
.
width
,
frame
.
size
.
height
,
cfg
->
is_fullscreen
);
const
video_format_t
*
source
;
source
=
&
vd
->
source
;
vout_display_cfg_t
place_cfg
=
*
cfg
;
place_cfg
.
display
.
width
=
frame
.
size
.
width
;
place_cfg
.
display
.
height
=
frame
.
size
.
height
;
vout_display_place_t
place
;
vout_display_PlacePicture
(
&
place
,
source
,
&
place_cfg
,
false
);
return
VLC_SUCCESS
;
}
case
VOUT_DISPLAY_CHANGE_WINDOW_STATE
:
...
...
@@ -376,17 +354,23 @@ static int Control (vout_display_t *vd, int query, va_list ap)
if
(
query
==
VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
||
query
==
VOUT_DISPLAY_CHANGE_SOURCE_CROP
)
{
const
video_format_t
*
source
;
source
=
(
const
video_format_t
*
)
va_arg
(
ap
,
const
video_format_t
*
);
cfg
=
vd
->
cfg
;
}
else
{
source
=
&
vd
->
source
;
cfg
=
(
const
vout_display_cfg_t
*
)
va_arg
(
ap
,
const
vout_display_cfg_t
*
);
if
(
query
==
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
)
is_forced
=
(
bool
)
va_arg
(
ap
,
int
);
}
if
(
query
==
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
&&
is_forced
&&
(
cfg
->
display
.
width
!=
vd
->
cfg
->
display
.
width
||
cfg
->
display
.
height
!=
vd
->
cfg
->
display
.
height
)
&&
vout_window_SetSize
(
sys
->
embed
,
cfg
->
display
.
width
,
cfg
->
display
.
height
))
return
VLC_EGENERIC
;
/* for the case that the core wants to resize below minimum window size we correct the size here
to ensure a centered picture */
vout_display_cfg_t
cfg_tmp
=
*
cfg
;
...
...
@@ -408,7 +392,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
This has the positive side effect that we avoid erratic sizing as we animate every resize. */
if
(
query
!=
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
)
{
glViewport
(
place
.
x
,
place
.
y
,
place
.
width
,
place
.
height
);
// x / y are top left corner, but we need the lower left one
glViewport
(
place
.
x
,
cfg_tmp
.
display
.
height
-
(
place
.
y
+
place
.
height
),
place
.
width
,
place
.
height
);
}
[
o_pool
release
];
...
...
@@ -471,6 +456,7 @@ static void OpenglSwap(vlc_gl_t *gl)
#define VLCAssertMainThread() assert([[NSThread currentThread] isMainThread])
+
(
void
)
getNewView
:(
NSValue
*
)
value
{
id
*
ret
=
[
value
pointerValue
];
...
...
@@ -626,44 +612,22 @@ static void OpenglSwap(vlc_gl_t *gl)
VLCAssertMainThread
();
NSRect
bounds
=
[
self
bounds
];
CGFloat
height
,
width
;
if
(
!
vd
||
(
vd
&&
vd
->
cfg
->
is_display_filled
))
{
height
=
bounds
.
size
.
height
;
width
=
bounds
.
size
.
width
;
}
else
{
height
=
vd
->
source
.
i_visible_height
;
width
=
vd
->
source
.
i_visible_width
;
}
GLint
x
=
width
,
y
=
height
;
vout_display_place_t
place
;
@synchronized
(
self
)
{
if
(
vd
)
{
CGFloat
videoHeight
=
vd
->
source
.
i_visible_height
;
CGFloat
videoWidth
=
vd
->
source
.
i_visible_width
;
vout_display_cfg_t
cfg_tmp
=
*
(
vd
->
cfg
);
cfg_tmp
.
display
.
width
=
bounds
.
size
.
width
;
cfg_tmp
.
display
.
height
=
bounds
.
size
.
height
;
GLint
sarNum
=
vd
->
source
.
i_sar_num
;
GLint
sarDen
=
vd
->
source
.
i_sar_den
;
if
(
height
*
videoWidth
*
sarNum
<
width
*
videoHeight
*
sarDen
)
{
x
=
(
height
*
videoWidth
*
sarNum
)
/
(
videoHeight
*
sarDen
);
y
=
height
;
}
else
{
x
=
width
;
y
=
(
width
*
videoHeight
*
sarDen
)
/
(
videoWidth
*
sarNum
);
}
vout_display_PlacePicture
(
&
place
,
&
vd
->
source
,
&
cfg_tmp
,
false
);
vout_display_SendEventDisplaySize
(
vd
,
bounds
.
size
.
width
,
bounds
.
size
.
height
,
vd
->
cfg
->
is_fullscreen
);
}
}
if
([
self
lockgl
])
{
glViewport
((
bounds
.
size
.
width
-
x
)
/
2
,
(
bounds
.
size
.
height
-
y
)
/
2
,
x
,
y
);
// x / y are top left corner, but we need the lower left one
glViewport
(
place
.
x
,
bounds
.
size
.
height
-
(
place
.
y
+
place
.
height
),
place
.
width
,
place
.
height
);
@synchronized
(
self
)
{
// This may be cleared before -drawRect is being called,
...
...
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