Commit 58ac1870 authored by Sam Hocevar's avatar Sam Hocevar
Browse files

* ./plugins/macosx/vout_macosx.m, ./plugins/macosx/aout_macosx.m,

    ./plugins/macosx/intf_vlc_wrapper.m: preliminary OS X compilation fixes.
parent 8fbbb959
/*****************************************************************************
* aout_macosx.c : CoreAudio output plugin
* aout_macosx.m: CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_macosx.m,v 1.6 2002/06/08 14:08:46 sam Exp $
* $Id: aout_macosx.m,v 1.7 2002/06/08 18:52:34 sam Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -442,7 +442,7 @@ static int CABeginFormat( aout_thread_t *p_aout )
p_aout->p_sys->clock_diff = mdate()
- AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()) / 1000
+ (mtime_t)p_aout->p_sys->ui_buffer_size / 4 * 1000000 / (mtime_t)p_aout->i_rate
+ p_main->i_desync;
+ p_aout->p_vlc->i_desync;
p_aout->p_sys->b_format = 1;
......
/*****************************************************************************
* intf_vlc_wrapper.c: MacOS X plugin for vlc
* intf_vlc_wrapper.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.m,v 1.13 2002/06/07 23:53:44 sam Exp $
* $Id: intf_vlc_wrapper.m,v 1.14 2002/06/08 18:52:34 sam Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -73,8 +73,6 @@ static Intf_VLCWrapper *o_intf = nil;
- (bool)manage
{
p_main->p_intf->pf_manage( p_main->p_intf );
if( p_main->p_intf->b_die )
{
/* Vout depends on intf */
......
/*****************************************************************************
* vout_macosx.c: MacOS X video output plugin
* vout_macosx.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
*
......@@ -29,12 +29,18 @@
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/intf.h>
#include "macosx.h"
#define QT_MAX_DIRECTBUFFERS 10
struct picture_sys_s
{
intf_thread_t *p_intf;
void *p_info;
unsigned int i_size;
......@@ -87,23 +93,35 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
static int vout_Create( vout_thread_t *p_vout )
{
OSErr err;
intf_thread_t *p_intf;
p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE );
if( p_intf == NULL )
{
msg_Err( p_vout, "no interface present" );
return 1;
}
if( !p_vout->p_vlc->p_intf || !p_vout->p_vlc->p_intf->p_module ||
strcmp( p_vout->p_vlc->p_intf->p_module->psz_name, MODULE_STRING ) != 0 )
if( p_intf->p_module == NULL
|| strcmp( p_intf->p_module->psz_name, MODULE_STRING ) != 0 )
{
msg_Err( p_vout, "MacOS X interface module required" );
return( 1 );
vlc_object_release( p_intf );
return 1;
}
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
{
msg_Err( p_vout, "out of memory" );
return( 1 );
vlc_object_release( p_intf );
return 1;
}
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
p_vout->p_sys->p_intf = p_intf;
p_vout->p_sys->h_img_descr =
(ImageDescriptionHandle)NewHandleClear( sizeof(ImageDescription) );
p_vout->p_sys->p_matrix = (MatrixRecordPtr)malloc( sizeof(MatrixRecord) );
......@@ -119,8 +137,9 @@ static int vout_Create( vout_thread_t *p_vout )
msg_Err( p_vout, "EnterMovies failed: %d", err );
free( p_vout->p_sys->p_matrix );
DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
vlc_object_release( p_intf );
free( p_vout->p_sys );
return( 1 );
return 1;
}
if( vout_ChromaCmp( p_vout->render.i_chroma, FOURCC_I420 ) )
......@@ -147,8 +166,9 @@ static int vout_Create( vout_thread_t *p_vout )
{
free( p_vout->p_sys->p_matrix );
DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
vlc_object_release( p_intf );
free( p_vout->p_sys );
return( 1 );
return 1;
}
if( CoCreateWindow( p_vout ) )
......@@ -156,11 +176,12 @@ static int vout_Create( vout_thread_t *p_vout )
msg_Err( p_vout, "unable to create window" );
free( p_vout->p_sys->p_matrix );
DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
vlc_object_release( p_intf );
free( p_vout->p_sys );
return( 1 );
return 1;
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -186,7 +207,7 @@ static int vout_Init( vout_thread_t *p_vout )
if( QTCreateSequence( p_vout ) )
{
msg_Err( p_vout, "unable to create sequence" );
return( 1 );
return 1;
}
/* Try to initialize up to QT_MAX_DIRECTBUFFERS direct buffers */
......@@ -218,7 +239,7 @@ static int vout_Init( vout_thread_t *p_vout )
I_OUTPUTPICTURES++;
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -252,6 +273,7 @@ static void vout_Destroy( vout_thread_t *p_vout )
free( p_vout->p_sys->p_matrix );
DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
vlc_object_release( p_vout->p_sys->p_intf );
free( p_vout->p_sys );
}
......@@ -267,7 +289,7 @@ static int vout_Manage( vout_thread_t *p_vout )
{
if( CoToggleFullscreen( p_vout ) )
{
return( 1 );
return 1;
}
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
......@@ -312,7 +334,7 @@ static int vout_Manage( vout_thread_t *p_vout )
}
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -366,7 +388,7 @@ static int CoSendRequest( vout_thread_t *p_vout, long i_request )
o_array = [NSArray arrayWithObject:
[NSData dataWithBytes: &p_req length: sizeof(void *)]];
o_msg = [[NSPortMessage alloc]
initWithSendPort: p_vout->p_vlc->p_intf->p_sys->o_port
initWithSendPort: p_vout->p_sys->p_intf->p_sys->o_port
receivePort: recvPort
components: o_array];
......@@ -380,7 +402,7 @@ static int CoSendRequest( vout_thread_t *p_vout, long i_request )
[recvPort release];
[o_pool release];
return( !req.i_result );
return !req.i_result;
}
/*****************************************************************************
......@@ -393,10 +415,10 @@ static int CoCreateWindow( vout_thread_t *p_vout )
if( CoSendRequest( p_vout, VOUT_REQ_CREATE_WINDOW ) )
{
msg_Err( p_vout, "CoSendRequest (CREATE_WINDOW) failed" );
return( 1 );
return 1;
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -415,10 +437,10 @@ static int CoDestroyWindow( vout_thread_t *p_vout )
if( CoSendRequest( p_vout, VOUT_REQ_DESTROY_WINDOW ) )
{
msg_Err( p_vout, "CoSendRequest (DESTROY_WINDOW) failed" );
return( 1 );
return 1;
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -433,7 +455,7 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
if( CoDestroyWindow( p_vout ) )
{
msg_Err( p_vout, "unable to destroy window" );
return( 1 );
return 1;
}
p_vout->b_fullscreen = !p_vout->b_fullscreen;
......@@ -441,7 +463,7 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
if( CoCreateWindow( p_vout ) )
{
msg_Err( p_vout, "unable to create window" );
return( 1 );
return 1;
}
SetPort( p_vout->p_sys->p_qdport );
......@@ -450,10 +472,10 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
if( QTCreateSequence( p_vout ) )
{
msg_Err( p_vout, "unable to create sequence" );
return( 1 );
return 1;
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -551,10 +573,10 @@ static int QTCreateSequence( vout_thread_t *p_vout )
p_vout->p_sys->img_dc ) ) )
{
msg_Err( p_vout, "DecompressSequenceBeginS failed: %d", err );
return( 1 );
return 1;
}
return( 0 );
return 0;
}
/*****************************************************************************
......@@ -581,7 +603,7 @@ static int QTNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
if( p_pic->p_sys == NULL )
{
return( -1 );
return -1;
}
switch( p_vout->output.i_chroma )
......@@ -640,10 +662,10 @@ static int QTNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
msg_Err( p_vout, "never heard of chroma 0x%.8x (%4.4s)",
p_vout->output.i_chroma, (char*)&p_vout->output.i_chroma );
p_pic->i_planes = 0;
return( -1 );
return -1;
}
return( 0 );
return 0;
}
/*****************************************************************************
......
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