Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
8d7e530f
Commit
8d7e530f
authored
Aug 30, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal_macosx: Fix the minimal window.
parent
d4db9fc9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
16 deletions
+57
-16
modules/gui/minimal_macosx/VLCMinimalVoutWindow.h
modules/gui/minimal_macosx/VLCMinimalVoutWindow.h
+4
-1
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
+12
-3
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
+17
-4
modules/gui/minimal_macosx/intf.h
modules/gui/minimal_macosx/intf.h
+1
-1
modules/gui/minimal_macosx/intf.m
modules/gui/minimal_macosx/intf.m
+20
-5
modules/gui/minimal_macosx/macosx.c
modules/gui/minimal_macosx/macosx.c
+3
-2
No files found.
modules/gui/minimal_macosx/VLCMinimalVoutWindow.h
View file @
8d7e530f
...
...
@@ -27,7 +27,10 @@
@interface
VLCMinimalVoutWindow
:
NSWindow
{
NSRect
rect
;
NSRect
initialFrame
;
NSPoint
initialLocation
,
initialLocationOnScreen
;
BOOL
fullscreen
;
BOOL
mouseDraggedShouldResize
;
}
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
;
...
...
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
View file @
8d7e530f
...
...
@@ -39,14 +39,20 @@
{
if
(
self
=
[
super
initWithContentRect
:
contentRect
styleMask
:
NSBorderlessWindowMask
backing
:
NSBackingStoreBuffered
defer
:
NO
])
{
rect
=
contentRect
;
initialFrame
=
contentRect
;
fullscreen
=
NO
;
[
self
setBackgroundColor
:[
NSColor
blackColor
]];
[
self
setHasShadow
:
YES
];
[
self
setMovableByWindowBackground
:
YES
];
[
self
center
];
}
return
self
;
}
/* @protocol VLCOpenGLVoutEmbedding */
-
(
void
)
addVoutSubview
:(
NSView
*
)
view
{
[
view
setAutoresizingMask
:
NSViewHeightSizable
|
NSViewWidthSizable
];
[[
self
contentView
]
addSubview
:
view
];
[
view
setFrame
:[[
self
contentView
]
bounds
]];
}
...
...
@@ -59,14 +65,17 @@
-
(
void
)
enterFullscreen
{
fullscreen
=
YES
;
initialFrame
=
[
self
frame
];
SetSystemUIMode
(
kUIModeAllHidden
,
kUIOptionAutoShowMenuBar
);
[
self
setFrame
:[[
self
screen
]
frame
]
display
:
YES
];
[
self
setFrame
:[[
self
screen
]
frame
]
display
:
YES
animate
:
YES
];
}
-
(
void
)
leaveFullscreen
{
fullscreen
=
NO
;
SetSystemUIMode
(
kUIModeNormal
,
kUIOptionAutoShowMenuBar
);
[
self
setFrame
:
rect
display
:
YES
];
[
self
setFrame
:
initialFrame
display
:
YES
animate
:
YES
];
}
-
(
BOOL
)
stretchesVideo
...
...
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
View file @
8d7e530f
...
...
@@ -52,16 +52,16 @@ int cocoaglvoutviewInit( vout_thread_t * p_vout )
var_Create
(
p_vout
,
"drawable"
,
VLC_VAR_DOINHERIT
);
var_Get
(
p_vout
,
"drawable"
,
&
value_drawable
);
p_vout
->
p_sys
->
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
o_cocoaglview_container
=
(
id
)
value_drawable
.
i_int
;
if
(
!
o_cocoaglview_container
)
{
msg_Warn
(
p_vout
,
"No drawable!, spawing a window"
);
o_cocoaglview_container
=
[[
VLCMinimalVoutWindow
alloc
]
initWithContentRect
:
NSMakeRect
(
0
,
0
,
200
,
200
)];
}
p_vout
->
p_sys
->
b_embedded
=
VLC_FALSE
;
p_vout
->
p_sys
->
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
/* Create the GL view */
struct
args
{
vout_thread_t
*
p_vout
;
id
<
VLCOpenGLVoutEmbedding
>
container
;
}
args
=
{
p_vout
,
o_cocoaglview_container
};
...
...
@@ -95,6 +95,8 @@ void cocoaglvoutviewEnd( vout_thread_t * p_vout )
if
(
[(
id
)
o_cocoaglview_container
respondsToSelector
:
@selector
(
removeVoutSubview
:)]
)
[
o_cocoaglview_container
removeVoutSubview
:
p_vout
->
p_sys
->
o_glview
];
[
p_vout
->
p_sys
->
o_glview
release
];
[
p_vout
->
p_sys
->
o_pool
release
];
}
...
...
@@ -195,15 +197,22 @@ void cocoaglvoutviewUnlock( vout_thread_t * p_vout )
* vout_thread_t. Must be called from main thread. */
+
(
void
)
autoinitOpenGLVoutViewIntVoutWithContainer
:
(
NSData
*
)
argsAsData
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
struct
args
{
vout_thread_t
*
p_vout
;
id
<
VLCOpenGLVoutEmbedding
>
container
;
}
*
args
=
(
struct
args
*
)[
argsAsData
bytes
];
VLCOpenGLVoutView
*
oglview
;
if
(
!
args
->
container
)
{
args
->
container
=
[[
VLCMinimalVoutWindow
alloc
]
initWithContentRect
:
NSMakeRect
(
0
,
0
,
args
->
p_vout
->
i_window_width
,
args
->
p_vout
->
i_window_height
)];
[(
VLCMinimalVoutWindow
*
)
args
->
container
makeKeyAndOrderFront
:
nil
];
}
oglview
=
[[
VLCOpenGLVoutView
alloc
]
initWithVout
:
args
->
p_vout
container
:
args
->
container
];
args
->
p_vout
->
p_sys
->
o_glview
=
[
oglview
autorelease
];
args
->
p_vout
->
p_sys
->
o_glview
=
oglview
;
[
args
->
container
addVoutSubview
:
oglview
];
[
pool
release
];
}
-
(
void
)
dealloc
...
...
@@ -365,5 +374,9 @@ void cocoaglvoutviewUnlock( vout_thread_t * p_vout )
CGLUnlockContext
([[
p_vout
->
p_sys
->
o_glview
openGLContext
]
CGLContextObj
]);
}
-
(
BOOL
)
mouseDownCanMoveWindow
{
return
YES
;
}
@end
modules/gui/minimal_macosx/intf.h
View file @
8d7e530f
...
...
@@ -45,6 +45,6 @@
*****************************************************************************/
struct
intf_sys_t
{
NSAutoreleasePool
*
o_pool
;
int
nothing_for_now
;
};
modules/gui/minimal_macosx/intf.m
View file @
8d7e530f
...
...
@@ -58,12 +58,9 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
memset( p_intf->p_sys, 0, sizeof( *p_intf->p_sys ) );
p_intf->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
p_intf->b_play = VLC_TRUE;
p_intf->pf_run = Run;
return
( 0 )
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -76,6 +73,17 @@ void E_(CloseIntf) ( vlc_object_t *p_this )
free( p_intf->p_sys );
}
/* Dock Connection */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
/*****************************************************************************
* Run: main loop
*****************************************************************************/
...
...
@@ -95,7 +103,14 @@ static void Run( intf_thread_t *p_intf )
sigemptyset(
&
set );
sigaddset(
&
set, SIGTERM );
pthread_sigmask( SIG_UNBLOCK,
&
set, NULL );
CPSProcessSerNum PSN;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
if (!CPSGetCurrentProcess(
&
PSN))
if (!CPSEnableForegroundOperation(
&
PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(
&
PSN))
[NSApplication sharedApplication];
[NSApp run];
[pool release];
}
modules/gui/minimal_macosx/macosx.c
View file @
8d7e530f
...
...
@@ -47,8 +47,9 @@ void E_(CloseVideoGL) ( vlc_object_t * );
vlc_module_begin
();
/* Minimal interface. see intf.m */
set_shortname
(
_
(
"minimal_macosx"
));
set_description
(
_
(
"Mac OS X minimal interface"
)
);
set_capability
(
"interface"
,
5
0
);
set_capability
(
"interface"
,
11
0
);
set_callbacks
(
E_
(
OpenIntf
),
E_
(
CloseIntf
)
);
set_category
(
CAT_INTERFACE
);
set_subcategory
(
SUBCAT_INTERFACE_MAIN
);
...
...
@@ -56,7 +57,7 @@ vlc_module_begin();
add_submodule
();
/* Will be loaded even without interface module. see voutgl.m */
set_description
(
"Mac OS X minimal OpenGL video output (opens a borderless window)"
);
set_capability
(
"opengl provider"
,
5
0
);
set_capability
(
"opengl provider"
,
11
0
);
set_category
(
CAT_VIDEO
);
set_subcategory
(
SUBCAT_VIDEO_VOUT
);
set_callbacks
(
E_
(
OpenVideoGL
),
E_
(
CloseVideoGL
)
);
...
...
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