Commit 615f3482 authored by Felix Paul Kühne's avatar Felix Paul Kühne

minimal_macosx: removed no-longer needed vout code, which dated back to the pre-2.0 days

parent d8532131
......@@ -4,12 +4,8 @@ SOURCES_minimal_macosx = \
intf.m \
macosx.c \
VLCMinimalVoutWindow.m \
VLCOpenGLVoutView.m \
voutgl.m \
$(NULL)
noinst_HEADERS = \
intf.h \
VLCMinimalVoutWindow.h \
VLCOpenGLVoutView.h \
voutgl.h
VLCMinimalVoutWindow.h
......@@ -25,8 +25,6 @@
* Preamble
*****************************************************************************/
#include "intf.h"
#include "voutgl.h"
#include "VLCOpenGLVoutView.h"
#include "VLCMinimalVoutWindow.h"
#import <Cocoa/Cocoa.h>
......
/*****************************************************************************
* VLCOpenGLVoutView.h: MacOS X OpenGL provider
*****************************************************************************
* Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org>
* Damien Fouilleul <damienf at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <vlc_common.h>
#include <vlc_vout_window.h>
/* Entry point */
int cocoaglvoutviewInit( vout_window_t * p_vout, const vout_window_cfg_t *cfg );
void cocoaglvoutviewEnd( vout_window_t * p_vout );
/* To commmunicate with the VLC.framework */
@protocol VLCOpenGLVoutEmbedding <NSObject>
- (void)addVoutSubview:(NSView *)view;
- (void)removeVoutSubview:(NSView *)view;
- (void)enterFullscreen;
- (void)leaveFullscreen;
- (BOOL)stretchesVideo;
- (void)setOnTop: (BOOL)ontop; /* Do we really want that in protocol? */
@end
/* VLCOpenGLVoutView */
@interface VLCOpenGLVoutView : NSView
{
id <VLCOpenGLVoutEmbedding> container;
vout_window_t * p_wnd;
NSLock * objectLock;
}
/* Init a new gl view and register it to both the framework and the
* vout_thread_t. Must be called from main thread */
+ (void) autoinitOpenGLVoutViewIntVoutWithContainer: (NSData *) args;
- (id) initWithVoutWindow: (vout_window_t *) p_wnd container: (id <VLCOpenGLVoutEmbedding>) container;
- (void) detachFromVoutWindow;
- (id <VLCOpenGLVoutEmbedding>) container;
@end
/*****************************************************************************
* VLCOpenGLVoutView.m: MacOS X OpenGL provider
*****************************************************************************
* Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org>
* Damien Fouilleul <damienf at videolan dot org>
* Pierre d'Herbemont <pdherbemont at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "intf.h"
#include "voutgl.h"
#include "VLCOpenGLVoutView.h"
#include "VLCMinimalVoutWindow.h"
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#if 0
/*****************************************************************************
* cocoaglvoutviewInit
*****************************************************************************/
int cocoaglvoutviewInit( vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
{
vlc_value_t value_drawable;
id <VLCOpenGLVoutEmbedding> o_cocoaglview_container;
msg_Dbg( p_wnd, "Mac OS X Vout is opening" );
var_Create( p_wnd, "drawable-nsobject", VLC_VAR_DOINHERIT );
var_Get( p_wnd, "drawable-nsobject", &value_drawable );
p_wnd->sys->o_pool = [[NSAutoreleasePool alloc] init];
/* This will be released in cocoaglvoutviewEnd(), on
* main thread, after we are done using it. */
o_cocoaglview_container = [(id) value_drawable.p_address retain];
if (!o_cocoaglview_container)
{
msg_Warn( p_wnd, "No drawable!, spawing a window" );
}
//p_vout->p_sys->b_embedded = false;
/* Create the GL view */
struct args { vout_window_t *p_wnd; const vout_window_cfg_t *cfg; id <VLCOpenGLVoutEmbedding> container; } args = { p_wnd, cfg, o_cocoaglview_container };
[VLCOpenGLVoutView performSelectorOnMainThread:@selector(autoinitOpenGLVoutViewIntVoutWithContainer:)
withObject:[NSData dataWithBytes: &args length: sizeof(struct args)] waitUntilDone:YES];
return VLC_SUCCESS;
}
/*****************************************************************************
* cocoaglvoutviewEnd
*****************************************************************************/
void cocoaglvoutviewEnd( vout_window_t * p_wnd )
{
id <VLCOpenGLVoutEmbedding> o_cocoaglview_container;
if (!p_wnd->handle.nsobject)
return;
msg_Dbg( p_wnd, "Mac OS X Vout is closing" );
var_Destroy( p_wnd, "drawable-nsobject" );
o_cocoaglview_container = [(VLCOpenGLVoutView *)p_wnd->handle.nsobject container];
/* Make sure our view won't request the vout now */
[(VLCOpenGLVoutView *)p_wnd->handle.nsobject detachFromVoutWindow];
msg_Dbg( p_wnd, "Mac OS X Vout is closing" );
if( [(id)o_cocoaglview_container respondsToSelector:@selector(removeVoutSubview:)] )
[(id)o_cocoaglview_container performSelectorOnMainThread:@selector(removeVoutSubview:) withObject:p_wnd->handle.nsobject waitUntilDone:NO];
/* Let the view go and release it, _without_blocking_ */
[(id)p_wnd->handle.nsobject performSelectorOnMainThread:@selector(removeFromSuperviewAndRelease) withObject:nil waitUntilDone:NO];
p_wnd->handle.nsobject = nil;
/* Release the container now that we don't use it */
[(id)o_cocoaglview_container performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
[p_wnd->sys->o_pool release];
p_wnd->sys->o_pool = nil;
}
/*****************************************************************************
* VLCOpenGLVoutView implementation
*****************************************************************************/
@implementation VLCOpenGLVoutView
/* Init a new gl view and register it to both the framework and the
* vout_thread_t. Must be called from main thread. */
+ (void) autoinitOpenGLVoutViewIntVoutWithContainer: (NSData *) argsAsData
{
struct args { vout_window_t *p_wnd; vout_window_cfg_t *cfg; id <VLCOpenGLVoutEmbedding> container; } *
args = (struct args *)[argsAsData bytes];
VLCOpenGLVoutView * oglview;
if( !args->container )
{
args->container = [[VLCMinimalVoutWindow alloc] initWithContentRect: NSMakeRect( 0, 0, args->cfg->width, args->cfg->height )];
[(VLCMinimalVoutWindow *)args->container makeKeyAndOrderFront: nil];
}
oglview = [[VLCOpenGLVoutView alloc] initWithVoutWindow: args->p_wnd container: args->container];
args->p_wnd->handle.nsobject = oglview;
[args->container addVoutSubview: oglview];
}
- (void)dealloc
{
[objectLock dealloc];
[super dealloc];
}
- (void)removeFromSuperviewAndRelease
{
[self removeFromSuperview];
[self release];
}
- (id) initWithVoutWindow: (vout_window_t *) wnd container: (id <VLCOpenGLVoutEmbedding>) aContainer
{
if( self = [super initWithFrame: NSMakeRect(0,0,10,10)] )
{
p_wnd = wnd;
container = aContainer;
objectLock = [[NSLock alloc] init];
}
return self;
}
- (void) detachFromVoutWindow
{
[objectLock lock];
p_wnd = NULL;
[objectLock unlock];
}
- (id <VLCOpenGLVoutEmbedding>) container
{
return container;
}
- (void) destroyVoutWindow
{
[objectLock lock];
if( p_wnd )
{
vlc_object_release( p_wnd );
vlc_object_release( p_wnd );
}
[objectLock unlock];
}
- (BOOL)mouseDownCanMoveWindow
{
return YES;
}
@end
#endif
/*****************************************************************************
* voutgl.h: MacOS X OpenGL provider
*****************************************************************************
* Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import "VLCOpenGLVoutView.h"
struct vout_sys_t
{
NSAutoreleasePool * o_pool;
VLCOpenGLVoutView * o_glview;
bool b_saved_frame;
NSRect s_frame;
bool b_got_frame;
/* Mozilla plugin-related variables */
bool b_embedded;
int i_offx, i_offy;
int i_width, i_height;
WindowRef theWindow;
bool b_clipped_out;
Rect clipBounds, viewBounds;
};
struct vout_window_sys_t
{
NSAutoreleasePool *o_pool;
};
/*****************************************************************************
* voutgl.m: MacOS X OpenGL provider
*****************************************************************************
* Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org>
* Damien Fouilleul <damienf at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "intf.h"
#include "voutgl.h"
# if 0
static int WindowControl( vout_window_t *, int i_query, va_list );
int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
{
p_wnd->sys = malloc( sizeof( vout_window_sys_t ) );
if( p_wnd->sys == NULL )
return( 1 );
memset( p_wnd->sys, 0, sizeof( vout_window_sys_t ) );
if (cocoaglvoutviewInit(p_wnd, cfg)) {
msg_Err( p_wnd, "Mac OS X VoutGLView couldnt be initialized" );
return VLC_EGENERIC;
}
p_wnd->control = WindowControl;
return VLC_SUCCESS;
}
static int WindowControl( vout_window_t *p_wnd, int i_query, va_list args )
{
/* TODO */
if( i_query == VOUT_WINDOW_SET_STATE )
msg_Dbg( p_wnd, "WindowControl:VOUT_WINDOW_SET_STATE" );
else if( i_query == VOUT_WINDOW_SET_SIZE )
{
msg_Dbg( p_wnd, "WindowControl:VOUT_WINDOW_SET_SIZE" );
}
else if( i_query == VOUT_WINDOW_SET_FULLSCREEN )
{
msg_Dbg( p_wnd, "WindowControl:VOUT_WINDOW_SET_FULLSCREEN" );
}
else
msg_Dbg( p_wnd, "WindowControl: unknown query" );
return VLC_SUCCESS;
}
void WindowClose( vout_window_t *p_wnd )
{
cocoaglvoutviewEnd( p_wnd );
/* Clean up */
free( p_wnd->sys );
}
#endif
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