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
393761ab
Commit
393761ab
authored
Oct 27, 2012
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: move vout initialisation to vout controller
parent
40d4d0fd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
106 deletions
+109
-106
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.h
+1
-1
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+1
-98
modules/gui/macosx/VLCVoutWindowController.h
modules/gui/macosx/VLCVoutWindowController.h
+2
-1
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VLCVoutWindowController.m
+101
-4
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+1
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+3
-2
No files found.
modules/gui/macosx/MainWindow.h
View file @
393761ab
...
...
@@ -101,6 +101,7 @@
+
(
VLCMainWindow
*
)
sharedInstance
;
@property
(
readwrite
)
BOOL
fullscreen
;
@property
(
readonly
)
BOOL
nativeFullscreenMode
;
@property
(
readwrite
)
BOOL
nonembedded
;
@property
(
readonly
)
VLCFSPanel
*
fsPanel
;
...
...
@@ -130,7 +131,6 @@
-
(
void
)
showFullscreenController
;
-
(
VLCVoutView
*
)
setupVout
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
setVideoplayEnabled
;
-
(
void
)
hideMouseCursor
:(
NSTimer
*
)
timer
;
...
...
modules/gui/macosx/MainWindow.m
View file @
393761ab
...
...
@@ -59,6 +59,7 @@
@synthesize
fullscreen
=
b_fullscreen
;
@synthesize
nativeFullscreenMode
=
b_nativeFullscreenMode
;
@synthesize
nonembedded
=
b_nonembedded
;
@synthesize
fsPanel
=
o_fspanel
;
static
VLCMainWindow
*
_o_sharedInstance
=
nil
;
...
...
@@ -708,104 +709,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
#pragma mark -
#pragma mark Video Output handling
-
(
VLCVoutView
*
)
setupVout
:(
vout_window_t
*
)
p_wnd
{
BOOL
b_video_deco
=
var_InheritBool
(
VLCIntf
,
"video-deco"
);
BOOL
b_video_wallpaper
=
var_InheritBool
(
VLCIntf
,
"video-wallpaper"
);
VLCVoutView
*
o_vout_view
;
VLCVideoWindowCommon
*
o_new_video_window
;
// TODO: make lion fullscreen compatible with video-wallpaper and !embedded-video
if
((
b_video_wallpaper
||
!
b_video_deco
)
&&
!
b_nativeFullscreenMode
)
{
// b_video_wallpaper is priorized over !b_video_deco
msg_Dbg
(
VLCIntf
,
"Creating background / blank window"
);
NSScreen
*
screen
=
[
NSScreen
screenWithDisplayID
:(
CGDirectDisplayID
)
var_InheritInteger
(
VLCIntf
,
"macosx-vdev"
)];
if
(
!
screen
)
screen
=
[
self
screen
];
NSRect
window_rect
;
if
(
b_video_wallpaper
)
window_rect
=
[
screen
frame
];
else
window_rect
=
[
self
frame
];
NSUInteger
mask
=
NSBorderlessWindowMask
;
if
(
!
OSX_SNOW_LEOPARD
&&
!
b_video_deco
)
mask
|=
NSResizableWindowMask
;
BOOL
b_no_video_deco_only
=
!
b_video_wallpaper
;
o_new_video_window
=
[[
VLCVideoWindowCommon
alloc
]
initWithContentRect
:
window_rect
styleMask
:
mask
backing
:
NSBackingStoreBuffered
defer
:
YES
];
[
o_new_video_window
setDelegate
:
o_new_video_window
];
if
(
b_video_wallpaper
)
[
o_new_video_window
setLevel
:
CGWindowLevelForKey
(
kCGDesktopWindowLevelKey
)
+
1
];
[
o_new_video_window
setBackgroundColor
:
[
NSColor
blackColor
]];
[
o_new_video_window
setCanBecomeKeyWindow
:
!
b_video_wallpaper
];
[
o_new_video_window
setCanBecomeMainWindow
:
!
b_video_wallpaper
];
[
o_new_video_window
setAcceptsMouseMovedEvents
:
!
b_video_wallpaper
];
[
o_new_video_window
setMovableByWindowBackground
:
!
b_video_wallpaper
];
[
o_new_video_window
useOptimizedDrawing
:
YES
];
o_vout_view
=
[[
VLCVoutView
alloc
]
initWithFrame
:[[
o_new_video_window
contentView
]
bounds
]];
[
o_vout_view
setAutoresizingMask
:
NSViewWidthSizable
|
NSViewHeightSizable
];
[[
o_new_video_window
contentView
]
addSubview
:
o_vout_view
positioned
:
NSWindowAbove
relativeTo
:
nil
];
[
o_new_video_window
setVideoView
:
o_vout_view
];
if
(
b_video_wallpaper
)
[
o_new_video_window
orderBack
:
nil
];
else
{
[
o_new_video_window
center
];
[
o_new_video_window
setFrameAutosaveName
:
@"extra-videowindow"
];
[
o_new_video_window
setContentMinSize
:
NSMakeSize
(
f_min_video_height
,
f_min_video_height
)];
}
b_nonembedded
=
YES
;
}
else
{
if
(
var_InheritBool
(
VLCIntf
,
"embedded-video"
)
||
b_nativeFullscreenMode
)
{
o_vout_view
=
[
o_video_view
retain
];
o_new_video_window
=
[
self
retain
];
b_nonembedded
=
NO
;
}
else
{
NSWindowController
*
o_controller
=
[[
NSWindowController
alloc
]
initWithWindowNibName
:
@"DetachedVideoWindow"
];
[
o_controller
loadWindow
];
o_new_video_window
=
[(
VLCDetachedVideoWindow
*
)[
o_controller
window
]
retain
];
[
o_controller
release
];
[
o_new_video_window
setDelegate
:
o_new_video_window
];
[
o_new_video_window
setLevel
:
NSNormalWindowLevel
];
[
o_new_video_window
useOptimizedDrawing
:
YES
];
o_vout_view
=
[[
o_new_video_window
videoView
]
retain
];
b_nonembedded
=
YES
;
}
}
if
(
!
b_video_wallpaper
)
{
[
o_new_video_window
makeKeyAndOrderFront
:
self
];
vout_thread_t
*
p_vout
=
getVout
();
if
(
p_vout
)
{
if
(
var_GetBool
(
p_vout
,
"video-on-top"
))
[
o_new_video_window
setLevel
:
NSStatusWindowLevel
];
else
[
o_new_video_window
setLevel
:
NSNormalWindowLevel
];
vlc_object_release
(
p_vout
);
}
}
[
o_new_video_window
setAlphaValue
:
config_GetFloat
(
VLCIntf
,
"macosx-opaqueness"
)];
[[[
VLCMain
sharedInstance
]
voutController
]
addVout
:[
o_new_video_window
autorelease
]
forDisplay
:
p_wnd
];
if
(
b_nonembedded
)
{
// event occurs before window is created, so call again
[[
VLCMain
sharedInstance
]
playbackStatusUpdated
];
}
return
[
o_vout_view
autorelease
];
}
-
(
void
)
setVideoplayEnabled
{
BOOL
b_videoPlayback
=
[[
VLCMain
sharedInstance
]
activeVideoPlayback
];
...
...
modules/gui/macosx/VLCVoutWindowController.h
View file @
393761ab
...
...
@@ -28,13 +28,14 @@
#import <vlc_vout_window.h>
@class
VLCVideoWindowCommon
;
@class
VLCVoutView
;
@interface
VLCVoutWindowController
:
NSObject
{
NSMutableDictionary
*
o_vout_dict
;
}
-
(
void
)
addVout
:(
VLCVideoWindowCommon
*
)
o_window
forDisplay
:(
vout_window_t
*
)
p_wnd
;
-
(
VLCVoutView
*
)
setupVout
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
removeVoutforDisplay
:(
NSValue
*
)
o_key
;
-
(
void
)
updateWindowsControlsBarWithSelector
:(
SEL
)
aSel
;
...
...
modules/gui/macosx/VLCVoutWindowController.m
View file @
393761ab
...
...
@@ -24,7 +24,7 @@
#import "VLCVoutWindowController.h"
#import "intf.h"
#import "
Windows
.h"
#import "
MainWindow
.h"
#import "VideoView.h"
@implementation
VLCVoutWindowController
...
...
@@ -46,11 +46,108 @@
[
super
dealloc
];
}
-
(
void
)
addVout
:(
VLCVideoWindowCommon
*
)
o_window
forDisplay
:(
vout_window_t
*
)
p_wnd
-
(
VLCVoutView
*
)
setupVout
:(
vout_window_t
*
)
p_wnd
{
[[
o_window
videoView
]
setVoutThread
:(
vout_thread_t
*
)
p_wnd
->
p_parent
];
BOOL
b_nonembedded
=
NO
;
BOOL
b_nativeFullscreenMode
=
[[
VLCMain
sharedInstance
]
nativeFullscreenMode
];
BOOL
b_video_deco
=
var_InheritBool
(
VLCIntf
,
"video-deco"
);
BOOL
b_video_wallpaper
=
var_InheritBool
(
VLCIntf
,
"video-wallpaper"
);
VLCVoutView
*
o_vout_view
;
VLCVideoWindowCommon
*
o_new_video_window
;
// TODO: make lion fullscreen compatible with video-wallpaper and !embedded-video
if
((
b_video_wallpaper
||
!
b_video_deco
)
&&
!
b_nativeFullscreenMode
)
{
// b_video_wallpaper is priorized over !b_video_deco
msg_Dbg
(
VLCIntf
,
"Creating background / blank window"
);
NSScreen
*
screen
=
[
NSScreen
screenWithDisplayID
:(
CGDirectDisplayID
)
var_InheritInteger
(
VLCIntf
,
"macosx-vdev"
)];
if
(
!
screen
)
screen
=
[[
VLCMainWindow
sharedInstance
]
screen
];
NSRect
window_rect
;
if
(
b_video_wallpaper
)
window_rect
=
[
screen
frame
];
else
window_rect
=
[[
VLCMainWindow
sharedInstance
]
frame
];
NSUInteger
mask
=
NSBorderlessWindowMask
;
if
(
!
OSX_SNOW_LEOPARD
&&
!
b_video_deco
)
mask
|=
NSResizableWindowMask
;
BOOL
b_no_video_deco_only
=
!
b_video_wallpaper
;
o_new_video_window
=
[[
VLCVideoWindowCommon
alloc
]
initWithContentRect
:
window_rect
styleMask
:
mask
backing
:
NSBackingStoreBuffered
defer
:
YES
];
[
o_new_video_window
setDelegate
:
o_new_video_window
];
if
(
b_video_wallpaper
)
[
o_new_video_window
setLevel
:
CGWindowLevelForKey
(
kCGDesktopWindowLevelKey
)
+
1
];
[
o_new_video_window
setBackgroundColor
:
[
NSColor
blackColor
]];
[
o_new_video_window
setCanBecomeKeyWindow
:
!
b_video_wallpaper
];
[
o_new_video_window
setCanBecomeMainWindow
:
!
b_video_wallpaper
];
[
o_new_video_window
setAcceptsMouseMovedEvents
:
!
b_video_wallpaper
];
[
o_new_video_window
setMovableByWindowBackground
:
!
b_video_wallpaper
];
[
o_new_video_window
useOptimizedDrawing
:
YES
];
o_vout_view
=
[[
VLCVoutView
alloc
]
initWithFrame
:[[
o_new_video_window
contentView
]
bounds
]];
[
o_vout_view
setAutoresizingMask
:
NSViewWidthSizable
|
NSViewHeightSizable
];
[[
o_new_video_window
contentView
]
addSubview
:
o_vout_view
positioned
:
NSWindowAbove
relativeTo
:
nil
];
[
o_new_video_window
setVideoView
:
o_vout_view
];
if
(
b_video_wallpaper
)
[
o_new_video_window
orderBack
:
nil
];
else
{
[
o_new_video_window
center
];
[
o_new_video_window
setFrameAutosaveName
:
@"extra-videowindow"
];
[
o_new_video_window
setContentMinSize
:
NSMakeSize
(
f_min_video_height
,
f_min_video_height
)];
}
[[
VLCMainWindow
sharedInstance
]
setNonembedded
:
YES
];
b_nonembedded
=
YES
;
}
else
{
if
(
var_InheritBool
(
VLCIntf
,
"embedded-video"
)
||
b_nativeFullscreenMode
)
{
o_vout_view
=
[[[
VLCMainWindow
sharedInstance
]
videoView
]
retain
];
o_new_video_window
=
[[
VLCMainWindow
sharedInstance
]
retain
];
b_nonembedded
=
NO
;
}
else
{
NSWindowController
*
o_controller
=
[[
NSWindowController
alloc
]
initWithWindowNibName
:
@"DetachedVideoWindow"
];
[
o_controller
loadWindow
];
o_new_video_window
=
[(
VLCDetachedVideoWindow
*
)[
o_controller
window
]
retain
];
[
o_controller
release
];
[
o_new_video_window
setDelegate
:
o_new_video_window
];
[
o_new_video_window
setLevel
:
NSNormalWindowLevel
];
[
o_new_video_window
useOptimizedDrawing
:
YES
];
o_vout_view
=
[[
o_new_video_window
videoView
]
retain
];
b_nonembedded
=
YES
;
}
}
if
(
!
b_video_wallpaper
)
{
[
o_new_video_window
makeKeyAndOrderFront
:
self
];
vout_thread_t
*
p_vout
=
getVout
();
if
(
p_vout
)
{
if
(
var_GetBool
(
p_vout
,
"video-on-top"
))
[
o_new_video_window
setLevel
:
NSStatusWindowLevel
];
else
[
o_new_video_window
setLevel
:
NSNormalWindowLevel
];
vlc_object_release
(
p_vout
);
}
}
[
o_new_video_window
setAlphaValue
:
config_GetFloat
(
VLCIntf
,
"macosx-opaqueness"
)];
if
(
b_nonembedded
)
{
// event occurs before window is created, so call again
[[
VLCMain
sharedInstance
]
playbackStatusUpdated
];
}
[[
VLCMainWindow
sharedInstance
]
setNonembedded
:
b_nonembedded
];
[
o_vout_view
setVoutThread
:(
vout_thread_t
*
)
p_wnd
->
p_parent
];
[
o_vout_dict
setObject
:[
o_new_video_window
autorelease
]
forKey
:[
NSValue
valueWithPointer
:
p_wnd
]];
[
o_vout_dict
setObject
:
o_window
forKey
:[
NSValue
valueWithPointer
:
p_wnd
]
];
return
[
o_vout_view
autorelease
];
}
-
(
void
)
removeVoutforDisplay
:(
NSValue
*
)
o_key
...
...
modules/gui/macosx/intf.h
View file @
393761ab
...
...
@@ -149,6 +149,7 @@ struct intf_sys_t
}
@property
(
readonly
)
VLCVoutWindowController
*
voutController
;
@property
(
readonly
)
BOOL
nativeFullscreenMode
;
+
(
VLCMain
*
)
sharedInstance
;
...
...
modules/gui/macosx/intf.m
View file @
393761ab
...
...
@@ -553,6 +553,7 @@ audio_output_t *getAout(void)
@implementation
VLCMain
@synthesize
voutController
=
o_vout_controller
;
@synthesize
nativeFullscreenMode
=
b_nativeFullscreenMode
;
#pragma mark -
#pragma mark Initialization
...
...
@@ -1556,8 +1557,8 @@ static VLCMain *_o_sharedMainInstance = nil;
-
(
id
)
getVideoViewAtPositionX
:
(
int
*
)
pi_x
Y
:
(
int
*
)
pi_y
withWidth
:
(
unsigned
int
*
)
pi_width
andHeight
:
(
unsigned
int
*
)
pi_height
forWindow
:(
vout_window_t
*
)
p_wnd
{
SEL
sel
=
@selector
(
setupVout
:
);
NSInvocation
*
inv
=
[
NSInvocation
invocationWithMethodSignature
:[
o_
mainwindow
methodSignatureForSelector
:
sel
]];
[
inv
setTarget
:
o_
mainwindow
];
NSInvocation
*
inv
=
[
NSInvocation
invocationWithMethodSignature
:[
o_
vout_controller
methodSignatureForSelector
:
sel
]];
[
inv
setTarget
:
o_
vout_controller
];
[
inv
setSelector
:
sel
];
[
inv
setArgument
:
&
p_wnd
atIndex
:
2
];
// starting at 2!
...
...
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