Commit e7f79118 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Mac OS X gui: Backport part of [19115], in order to work around leopard...

Mac OS X gui: Backport part of [19115], in order to work around leopard glitches. (quickdraw part ignored for now). (We may need to also back port [19128] "Close the embedded window only when playlist stop.").
parent 03375ecf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>572 94 478 430 0 0 1440 878 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
<string>788 586 109 149 0 0 1440 878 </string>
<key>2197</key>
<string>422 532 596 143 0 0 1440 878 </string>
<key>2709</key>
<string>305 626 508 82 0 0 1024 746 </string>
<key>2730</key>
<string>396 512 130 249 0 0 1440 878 </string>
<key>29</key>
<string>130 802 438 44 0 0 1440 878 </string>
<key>915</key>
<string>777 479 187 249 0 0 1440 878 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBLockedObjects</key>
<array/>
<string>629</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>2809</integer>
<integer>2416</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8L127</string>
<key>IBUsesTextArchiving</key>
<true/>
<string>9B18</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
......@@ -103,7 +103,7 @@
o_vout_view = [o_embedded_vout_list getViewForWindow: o_window];
}
/* We have a detached vout */
else if( [[o_window className] isEqualToString: @"VLCWindow"] )
else if( [[o_window className] isEqualToString: @"VLCVoutWindow"] )
{
msg_Dbg( VLCIntf, "detached vout controls.m call getVoutView" );
o_vout_view = [o_window getVoutView];
......@@ -899,7 +899,7 @@
while( (o_window = [o_enumerator nextObject]))
{
if( [[o_window className] isEqualToString: @"VLCWindow"] ||
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
[[[VLCMain sharedInstance] getEmbeddedList]
windowContainsEmbedded: o_window])
{
......
......@@ -25,6 +25,7 @@
* VLCEmbeddedWindow interface
*****************************************************************************/
#import "misc.h"
@interface VLCEmbeddedWindow : NSWindow
{
......@@ -34,6 +35,7 @@
IBOutlet id o_btn_play;
IBOutlet id o_slider;
IBOutlet id o_time;
IBOutlet id o_view;
NSImage * o_img_play;
NSImage * o_img_play_pressed;
......@@ -41,6 +43,15 @@
NSImage * o_img_pause_pressed;
NSRect o_saved_frame;
VLCWindow * o_fullscreen_window;
NSViewAnimation * o_fullscreen_anim1;
NSViewAnimation * o_fullscreen_anim2;
NSView * o_temp_view;
/* set to yes if we are fullscreen and all animations are over */
BOOL b_fullscreen;
BOOL b_animation_lock_alreadylocked;
NSRecursiveLock * o_animation_lock;
}
- (void)setTime:(NSString *)o_arg_ime position:(float)f_position;
......@@ -48,5 +59,20 @@
- (void)setSeekable:(BOOL)b_seekable;
- (void)setFullscreen:(BOOL)b_fullscreen;
- (BOOL)isFullscreen;
- (void)lockFullscreenAnimation;
- (void)unlockFullscreenAnimation;
- (void)enterFullscreen;
- (void)leaveFullscreen;
/* Allows to leave fullscreen by simply fading out the display */
- (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
/* private */
- (void)hasEndedFullscreen;
- (void)hasBecomeFullscreen;
- (void)setFrameOnMainThread:(NSData*)packedargs;
@end
......@@ -25,9 +25,13 @@
* Preamble
*****************************************************************************/
/* DisableScreenUpdates, SetSystemUIMode, ... */
#import <QuickTime/QuickTime.h>
#include "intf.h"
#include "vout.h"
#include "embeddedwindow.h"
#import "fspanel.h"
/*****************************************************************************
* VLCEmbeddedWindow Implementation
......@@ -51,6 +55,22 @@
o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_blue"];
o_saved_frame = NSMakeRect( 0.0f, 0.0f, 0.0f, 0.0f );
/* Useful to save o_view frame in fullscreen mode */
o_temp_view = [[NSView alloc] init];
[o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
o_fullscreen_window = nil;
o_fullscreen_anim1 = o_fullscreen_anim2 = nil;
/* Not fullscreen when we wake up */
[o_btn_fullscreen setState: NO];
b_fullscreen = NO;
/* Use a recursive lock to be able to trigger enter/leavefullscreen
* in middle of an animation, providing that the enter/leave functions
* are called from the same thread */
o_animation_lock = [[NSRecursiveLock alloc] init];
b_animation_lock_alreadylocked = NO;
}
- (void)setTime:(NSString *)o_arg_time position:(float)f_position
......@@ -121,4 +141,212 @@
return YES;
}
/*****************************************************************************
* Fullscreen support
*/
- (BOOL)isFullscreen
{
return b_fullscreen;
}
- (void)lockFullscreenAnimation
{
[o_animation_lock lock];
}
- (void)unlockFullscreenAnimation
{
[o_animation_lock unlock];
}
- (void)enterFullscreen
{
NSMutableDictionary *dict1, *dict2;
NSScreen *screen;
NSRect screen_rect;
NSRect rect;
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
BOOL blackout_other_displays = var_GetBool( p_vout, "macosx-black" );
screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
vlc_object_release( p_vout );
[self lockFullscreenAnimation];
if (!screen)
screen = [self screen];
screen_rect = [screen frame];
[o_btn_fullscreen setState: YES];
[NSCursor setHiddenUntilMouseMoves: YES];
/* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */
if (!o_fullscreen_window)
{
/* We can't change the styleMask of an already created NSWindow, so we create an other window, and do eye catching stuff */
rect = [[o_view superview] convertRect: [o_view frame] toView: nil]; /* Convert to Window base coord */
rect.origin.x += [self frame].origin.x;
rect.origin.y += [self frame].origin.y;
o_fullscreen_window = [[VLCWindow alloc] initWithContentRect:rect styleMask: NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
[o_fullscreen_window setBackgroundColor: [NSColor blackColor]];
[o_fullscreen_window setCanBecomeKeyWindow: YES];
CGDisplayFadeReservationToken token;
[o_fullscreen_window setFrame:screen_rect display:NO];
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
if (blackout_other_displays)
[screen blackoutOtherScreens]; /* We should do something like [screen blackoutOtherScreens]; */
[o_view retain];
[[self contentView] replaceSubview:o_view with:o_temp_view];
[o_temp_view setFrame:[o_view frame]];
[o_fullscreen_window setContentView:o_view];
[o_view release];
[o_fullscreen_window makeKeyAndOrderFront:self];
CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
CGReleaseDisplayFadeReservation( token);
/* Will release the lock */
[self hasBecomeFullscreen];
return;
}
if (blackout_other_displays)
[screen blackoutOtherScreens]; /* We should do something like [screen blackoutOtherScreens]; */
b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation];
}
- (void)hasBecomeFullscreen
{
[o_fullscreen_window makeFirstResponder: [[[VLCMain sharedInstance] getControls] getVoutView]];
[o_fullscreen_window makeKeyWindow];
[o_fullscreen_window setAcceptsMouseMovedEvents: TRUE];
/* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
[super orderOut: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
b_fullscreen = YES;
[self unlockFullscreenAnimation];
}
- (void)leaveFullscreen
{
[self leaveFullscreenAndFadeOut: NO];
}
- (void)leaveFullscreenAndFadeOut: (BOOL)fadeout
{
NSMutableDictionary *dict1, *dict2;
NSRect frame;
[self lockFullscreenAnimation];
b_fullscreen = NO;
[o_btn_fullscreen setState: NO];
/* Don't do anything if o_fullscreen_window is already closed */
if (!o_fullscreen_window)
{
/* We always try to do so */
[NSScreen unblackoutScreens];
b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation];
return;
}
/* simply fade the display */
CGDisplayFadeReservationToken token;
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
/* We always try to do so */
[NSScreen unblackoutScreens];
if (!fadeout)
[self orderFront: self];
/* Will release the lock */
[self hasEndedFullscreen];
CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
CGReleaseDisplayFadeReservation( token);
}
- (void)hasEndedFullscreen
{
/* This function is private and should be only triggered at the end of the fullscreen change animation */
/* Make sure we don't see the o_view disappearing of the screen during this operation */
DisableScreenUpdates();
[o_view retain];
[o_view removeFromSuperviewWithoutNeedingDisplay];
[[self contentView] replaceSubview:o_temp_view with:o_view];
[o_view release];
[o_view setFrame:[o_temp_view frame]];
[self makeFirstResponder: o_view];
if ([self isVisible])
[self makeKeyAndOrderFront:self];
[o_fullscreen_window orderOut: self];
EnableScreenUpdates();
[o_fullscreen_window release];
o_fullscreen_window = nil;
b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation];
}
- (void)orderOut: (id)sender
{
[super orderOut: sender];
/* Make sure we leave fullscreen */
[self leaveFullscreenAndFadeOut: YES];
}
/* Make sure setFrame gets executed on main thread especially if we are animating.
* (Thus we won't block the video output thread) */
- (void)setFrame:(NSRect)frame display:(BOOL)display animate:(BOOL)animate
{
struct { NSRect frame; BOOL display; BOOL animate;} args;
NSData *packedargs;
args.frame = frame;
args.display = display;
args.animate = animate;
packedargs = [NSData dataWithBytes:&args length:sizeof(args)];
[self performSelectorOnMainThread:@selector(setFrameOnMainThread:)
withObject: packedargs waitUntilDone: YES];
}
- (void)setFrameOnMainThread:(NSData*)packedargs
{
struct args { NSRect frame; BOOL display; BOOL animate; } * args = (struct args*)[packedargs bytes];
[super setFrame: args->frame display: args->display animate:args->animate];
}
@end
......@@ -366,7 +366,7 @@ static VLCExtended *_o_sharedInstance = nil;
while ((o_window = [o_enumerator nextObject]))
{
if( [[o_window className] isEqualToString: @"VLCWindow"] ||
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] ||
[[[VLCMain sharedInstance] getEmbeddedList]
windowContainsEmbedded: o_window])
{
......
......@@ -132,7 +132,7 @@
while( ( o_window = [o_enum nextObject] ) )
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] )
{
vlc_object_release( (vlc_object_t *)p_vout );
break;
......
......@@ -475,8 +475,6 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);
var_AddCallback( p_playlist, "intf-show", ShowController, self);
[o_embedded_window setFullscreen: var_GetBool( p_playlist,
"fullscreen" )];
vlc_object_release( p_playlist );
}
......
......@@ -21,6 +21,37 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* NSScreen (VLCAdditions)
*
* Missing extension to NSScreen
*****************************************************************************/
@interface NSScreen (VLCAdditions)
+ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
- (BOOL)isMainScreen;
- (BOOL)isScreen: (NSScreen*)screen;
- (CGDirectDisplayID)displayID;
- (void)blackoutOtherScreens;
+ (void)unblackoutScreens;
@end
/*****************************************************************************
* VLCWindow
*
* Missing extension to NSWindow
*****************************************************************************/
@interface VLCWindow : NSWindow
{
BOOL b_canBecomeKeyWindow;
BOOL b_isset_canBecomeKeyWindow;
}
- (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey;
@end
/*****************************************************************************
* VLCControllerWindow
*****************************************************************************/
......
......@@ -28,6 +28,130 @@
#include "playlist.h"
#include "controls.h"
/*****************************************************************************
* NSScreen (VLCAdditions)
*
* Missing extension to NSScreen
*****************************************************************************/
@implementation NSScreen (VLCAdditions)
static NSMutableArray *blackoutWindows = NULL;
+ (void)load
{
/* init our fake object attribute */
blackoutWindows = [[NSMutableArray alloc] initWithCapacity:1];
}
+ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID
{
int i;
for( i = 0; i < [[NSScreen screens] count]; i++ )
{
NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
if([screen displayID] == displayID)
return screen;
}
return nil;
}
- (BOOL)isMainScreen
{
return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]);
}
- (BOOL)isScreen: (NSScreen*)screen
{
return ([self displayID] == [screen displayID]);
}
- (CGDirectDisplayID)displayID
{
return (CGDirectDisplayID)_screenNumber;
}
- (void)blackoutOtherScreens
{
unsigned int i;
/* Free our previous blackout window (follow blackoutWindow alloc strategy) */
[blackoutWindows makeObjectsPerformSelector:@selector(close)];
[blackoutWindows removeAllObjects];
for(i = 0; i < [[NSScreen screens] count]; i++)
{
NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
VLCWindow *blackoutWindow;
NSRect screen_rect;
if([self isScreen: screen])
continue;
screen_rect = [screen frame];
screen_rect.origin.x = screen_rect.origin.y = 0.0f;
/* blackoutWindow alloc strategy
- The NSMutableArray blackoutWindows has the blackoutWindow references
- blackoutOtherDisplays is responsible for alloc/releasing its Windows
*/
blackoutWindow = [[VLCWindow alloc] initWithContentRect: screen_rect styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered defer: NO screen: screen];
[blackoutWindow setBackgroundColor:[NSColor blackColor]];
[blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */
[blackoutWindow orderFront: self];
[blackoutWindows addObject: blackoutWindow];
[blackoutWindow release];
}
}
+ (void)unblackoutScreens
{
unsigned int i;
for(i = 0; i < [blackoutWindows count]; i++)
{
VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i];
[blackoutWindow close];
}
}
@end
/*****************************************************************************
* VLCWindow
*
* Missing extension to NSWindow
*****************************************************************************/
@implementation VLCWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
{
self = [super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag];
if( self )
b_isset_canBecomeKeyWindow = NO;
return self;
}
- (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey
{
b_isset_canBecomeKeyWindow = YES;
b_canBecomeKeyWindow = canBecomeKey;
}
- (BOOL)canBecomeKeyWindow
{
if(b_isset_canBecomeKeyWindow)
return b_canBecomeKeyWindow;
return [super canBecomeKeyWindow];
}
@end
/*****************************************************************************
* VLCControllerWindow
*****************************************************************************/
......
......@@ -44,12 +44,16 @@
/*****************************************************************************
* VLCVoutView interface
*****************************************************************************/
@protocol VLCVoutViewResetting
+ (void)resetVout: (vout_thread_t *)p_vout;
@end
@interface VLCVoutView : NSView
{
vout_thread_t * p_vout;
NSView * o_view;
NSRect * s_frame;
NSView <VLCVoutViewResetting> * o_view;
vout_thread_t * p_real_vout;
id o_window;
}
......@@ -70,6 +74,8 @@
frame: (NSRect *) s_frame;
+ (vout_thread_t *)getRealVout: (vout_thread_t *)p_vout;
- (void)enterFullscreen;
- (void)leaveFullscreen;
@end
/*****************************************************************************
......@@ -105,14 +111,15 @@
@interface VLCDetachedEmbeddedVoutView : VLCEmbeddedVoutView
{
id o_embeddedwindow;
}
@end
/*****************************************************************************
* VLCWindow interface
* VLCVoutWindow interface
*****************************************************************************/
@interface VLCWindow : NSWindow
@interface VLCVoutWindow : NSWindow
{
vout_thread_t * p_vout;
VLCVoutView * o_view;
......
......@@ -112,9 +112,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (BOOL)windowContainsEmbedded: (id)o_window
{
/* if( ![[o_window className] isEqualToString: @"VLCWindow"] )
/* if( ![[o_window className] isEqualToString: @"VLCVoutWindow"] )
{
NSLog( @"We were not given a VLCWindow" );
NSLog( @"We were not given a VLCVoutWindow" );
}*/
return ([self getViewForWindow: o_window] == nil ? NO : YES );
}
......@@ -373,11 +373,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
var_Get( p_real_vout, "fullscreen", &val );
val.b_bool = !val.b_bool;
var_Set( p_real_vout, "fullscreen", val );
if( [self isFullscreen] )
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
else
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
}
- (BOOL)isFullscreen
......@@ -713,6 +708,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
return o_return;
}
- (void)enterFullscreen
{
[[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
}
- (void)leaveFullscreen
{
[[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
}
@end
/*****************************************************************************
......@@ -732,7 +739,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{
BOOL b_return = [super setVout: p_arg_vout subView: view frame:s_arg_frame];
i_time_mouse_last_moved = mdate();
o_window = [[VLCWindow alloc] initWithVout: p_arg_vout view: self
o_window = [[VLCVoutWindow alloc] initWithVout: p_arg_vout view: self
frame: s_arg_frame];
[self updateTitle];
[view setFrame: [self frame]];
......@@ -861,6 +868,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
@end
@implementation VLCDetachedEmbeddedVoutView
- (void)awakeFromNib
{
o_embeddedwindow = [self window];
}
- (BOOL)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view
frame: (NSRect *) s_arg_frame
......@@ -883,12 +894,23 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[super closeVout];
}
- (void)enterFullscreen
{
/* We are in a VLCEmbeddedWindow */
[o_embeddedwindow performSelectorOnMainThread: @selector(enterFullscreen) withObject: NULL waitUntilDone: YES];
}
- (void)leaveFullscreen
{
/* We are in a VLCEmbeddedWindow */
[o_embeddedwindow performSelectorOnMainThread: @selector(leaveFullscreen) withObject: NULL waitUntilDone: YES];
}
@end
/*****************************************************************************
* VLCWindow implementation
* VLCVoutWindow implementation
*****************************************************************************/
@implementation VLCWindow
@implementation VLCVoutWindow
- (id) initWithVout: (vout_thread_t *) vout view: (VLCVoutView *) view
frame: (NSRect *) frame
......
......@@ -46,11 +46,12 @@
/*****************************************************************************
* VLCView interface
*****************************************************************************/
@interface VLCGLView : NSOpenGLView
@interface VLCGLView : NSOpenGLView <VLCVoutViewResetting>
{
vout_thread_t * p_vout;
}
+ (void)resetVout: (vout_thread_t *)p_vout;
- (id) initWithVout: (vout_thread_t *) p_vout;
@end
......@@ -243,22 +244,12 @@ static int Manage( vout_thread_t * p_vout )
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
if( !p_vout->b_fullscreen )
{
/* Save window size and position */
p_vout->p_sys->s_frame.size =
[p_vout->p_sys->o_vout_view frame].size;
p_vout->p_sys->s_frame.origin =
[[p_vout->p_sys->o_vout_view getWindow ]frame].origin;
p_vout->p_sys->b_saved_frame = VLC_TRUE;
}
[p_vout->p_sys->o_vout_view performSelectorOnMainThread:@selector(closeVout) withObject:NULL waitUntilDone:YES];
p_vout->b_fullscreen = !p_vout->b_fullscreen;
[VLCGLView performSelectorOnMainThread:@selector(initVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
[[p_vout->p_sys->o_glview openGLContext] makeCurrentContext];
if( p_vout->b_fullscreen )
[p_vout->p_sys->o_vout_view enterFullscreen];
else
[p_vout->p_sys->o_vout_view leaveFullscreen];
[o_pool release];
......@@ -338,6 +329,42 @@ static void Unlock( vout_thread_t * p_vout )
frame: frame];
}
/* This function will reset the o_vout_view. It's useful to go fullscreen. */
+ (void)resetVout:(NSData *)arg
{
vout_thread_t * p_vout = [arg pointerValue];
if( p_vout->b_fullscreen )
{
/* Save window size and position */
p_vout->p_sys->s_frame.size =
[p_vout->p_sys->o_vout_view frame].size;
p_vout->p_sys->s_frame.origin =
[[p_vout->p_sys->o_vout_view getWindow ]frame].origin;
p_vout->p_sys->b_saved_frame = VLC_TRUE;
}
[p_vout->p_sys->o_vout_view closeVout];
#define o_glview p_vout->p_sys->o_glview
o_glview = [[VLCGLView alloc] initWithVout: p_vout];
[o_glview autorelease];
if( p_vout->p_sys->b_saved_frame )
{
p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout
subView: o_glview
frame: &p_vout->p_sys->s_frame];
}
else
{
p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout
subView: o_glview frame: nil];
}
#undef o_glview
}
- (id) initWithVout: (vout_thread_t *) vout
{
p_vout = vout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment