Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d8532131
Commit
d8532131
authored
Dec 19, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal_macosx: re-implement in-separate-window video output based upon the 2.0 vout API
remnants to be removed in next commit
parent
5ff7862f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
17 deletions
+101
-17
modules/gui/minimal_macosx/VLCMinimalVoutWindow.h
modules/gui/minimal_macosx/VLCMinimalVoutWindow.h
+0
-3
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
+1
-14
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
+2
-0
modules/gui/minimal_macosx/intf.m
modules/gui/minimal_macosx/intf.m
+95
-0
modules/gui/minimal_macosx/voutgl.m
modules/gui/minimal_macosx/voutgl.m
+3
-0
No files found.
modules/gui/minimal_macosx/VLCMinimalVoutWindow.h
View file @
d8532131
...
@@ -35,9 +35,6 @@
...
@@ -35,9 +35,6 @@
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
;
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
;
/* @protocol VLCOpenGLVoutEmbedding */
-
(
void
)
addVoutSubview
:(
NSView
*
)
view
;
-
(
void
)
removeVoutSubview
:(
NSView
*
)
view
;
-
(
void
)
enterFullscreen
;
-
(
void
)
enterFullscreen
;
-
(
void
)
leaveFullscreen
;
-
(
void
)
leaveFullscreen
;
-
(
BOOL
)
stretchesVideo
;
-
(
BOOL
)
stretchesVideo
;
...
...
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m
View file @
d8532131
...
@@ -45,24 +45,11 @@
...
@@ -45,24 +45,11 @@
[
self
setHasShadow
:
YES
];
[
self
setHasShadow
:
YES
];
[
self
setMovableByWindowBackground
:
YES
];
[
self
setMovableByWindowBackground
:
YES
];
[
self
center
];
[
self
center
];
NSLog
(
@"window created"
);
}
}
return
self
;
return
self
;
}
}
/* @protocol VLCOpenGLVoutEmbedding */
-
(
void
)
addVoutSubview
:(
NSView
*
)
view
{
[
view
setAutoresizingMask
:
NSViewHeightSizable
|
NSViewWidthSizable
];
[[
self
contentView
]
addSubview
:
view
];
[
view
setFrame
:[[
self
contentView
]
bounds
]];
}
-
(
void
)
removeVoutSubview
:(
NSView
*
)
view
{
[
self
close
];
[
self
release
];
}
-
(
void
)
enterFullscreen
-
(
void
)
enterFullscreen
{
{
fullscreen
=
YES
;
fullscreen
=
YES
;
...
...
modules/gui/minimal_macosx/VLCOpenGLVoutView.m
View file @
d8532131
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#include <OpenGL/OpenGL.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/gl.h>
#if 0
/*****************************************************************************
/*****************************************************************************
* cocoaglvoutviewInit
* cocoaglvoutviewInit
...
@@ -187,3 +188,4 @@ void cocoaglvoutviewEnd( vout_window_t * p_wnd )
...
@@ -187,3 +188,4 @@ void cocoaglvoutviewEnd( vout_window_t * p_wnd )
}
}
@end
@end
#endif
modules/gui/minimal_macosx/intf.m
View file @
d8532131
...
@@ -41,7 +41,10 @@
...
@@ -41,7 +41,10 @@
#include
<vlc
_input
.
h
>
#include
<vlc
_input
.
h
>
#import
<vlc
_interface
.
h
>
#import
<vlc
_interface
.
h
>
#include
<vlc
_vout_window
.
h
>
#import
<intf
.
h
>
#import
<intf
.
h
>
#import "VLCMinimalVoutWindow.h"
/*****************************************************************************
/*****************************************************************************
* Local prototypes.
* Local prototypes.
...
@@ -148,3 +151,95 @@ static void Run( intf_thread_t *p_intf )
...
@@ -148,3 +151,95 @@ static void Run( intf_thread_t *p_intf )
[pool release];
[pool release];
}
}
/*****************************************************************************
* Vout window management
*****************************************************************************/
static int WindowControl(vout_window_t *, int i_query, va_list);
int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
NSRect proposedVideoViewPosition = NSMakeRect(cfg->x, cfg->y, cfg->width, cfg->height);
VLCMinimalVoutWindow *o_window = [[VLCMinimalVoutWindow alloc] initWithContentRect:proposedVideoViewPosition];
[o_window makeKeyAndOrderFront:nil];
if (!o_window) {
msg_Err(p_wnd, "window creation failed");
[o_pool release];
return VLC_EGENERIC;
}
msg_Dbg(p_wnd, "returning video window with proposed position x=%i, y=%i, width=%i, height=%i", cfg->x, cfg->y, cfg->width, cfg->height);
p_wnd->handle.nsobject = [o_window contentView];
// TODO: find a cleaner way for "start in fullscreen"
if (var_GetBool(pl_Get(p_wnd), "fullscreen"))
[o_window performSelectorOnMainThread:@selector(enterFullscreen) withObject:nil waitUntilDone:NO];
p_wnd->control = WindowControl;
[o_pool release];
return VLC_SUCCESS;
}
static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
{
NSWindow * o_window = [(id)p_wnd->handle.nsobject window];
if (!o_window) {
msg_Err(p_wnd, "failed to recover cocoa window");
return VLC_EGENERIC;
}
switch(i_query) {
case VOUT_WINDOW_SET_STATE:
{
unsigned i_state = va_arg(args, unsigned);
// TODO
// [o_window performSelectorOnMainThread:@selector(setWindowLevel:) withObject:[NSNumber numberWithUnsignedInt:i_state] waitUntilDone:NO];
return VLC_SUCCESS;
}
case VOUT_WINDOW_SET_SIZE:
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
unsigned int i_width = va_arg(args, unsigned int);
unsigned int i_height = va_arg(args, unsigned int);
NSSize newSize = NSMakeSize(i_width, i_height);
// TODO
[o_pool release];
return VLC_SUCCESS;
}
case VOUT_WINDOW_SET_FULLSCREEN:
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
int i_full = va_arg(args, int);
if (i_full)
[o_window performSelectorOnMainThread:@selector(enterFullscreen) withObject:nil waitUntilDone:NO];
else
[o_window performSelectorOnMainThread:@selector(leaveFullscreen) withObject:nil waitUntilDone:NO];
[o_pool release];
return VLC_SUCCESS;
}
default:
msg_Warn(p_wnd, "unsupported control query");
return VLC_EGENERIC;
}
}
void WindowClose(vout_window_t *p_wnd)
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
NSWindow * o_window = [(id)p_wnd->handle.nsobject window];
if (o_window)
[o_window release];
[o_pool release];
}
modules/gui/minimal_macosx/voutgl.m
View file @
d8532131
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "intf.h"
#include "intf.h"
#include "voutgl.h"
#include "voutgl.h"
# if 0
static int WindowControl( vout_window_t *, int i_query, va_list );
static int WindowControl( vout_window_t *, int i_query, va_list );
...
@@ -78,3 +79,5 @@ void WindowClose( vout_window_t *p_wnd )
...
@@ -78,3 +79,5 @@ void WindowClose( vout_window_t *p_wnd )
/* Clean up */
/* Clean up */
free( p_wnd->sys );
free( p_wnd->sys );
}
}
#endif
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