Commit f3dd07bb authored by Jon Lech Johansen's avatar Jon Lech Johansen

* ALL: Move CoreAudio aout into seperate module.

parent 00afb055
...@@ -2262,6 +2262,22 @@ if test "x${enable_waveout}" != "xno"; then ...@@ -2262,6 +2262,22 @@ if test "x${enable_waveout}" != "xno"; then
fi fi
fi fi
dnl
dnl CoreAudio plugin
dnl
AC_ARG_ENABLE(coreaudio,
[ --enable-coreaudio CoreAudio module (default enabled on MacOS X)])
if test "x${enable_coreaudio}" != "xno" &&
(test "x${SYS}" = "xdarwin" || test "x${enable_coreaudio}" = "xyes")
then
AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
[ BUILTINS="${BUILTINS} coreaudio"
PLUGINS="${PLUGINS} coreaudio_resampler"
LDFLAGS_coreaudio="${LDFLAGS_coreaudio} -framework CoreAudio"
LDFLAGS_coreaudio_resampler="${LDFLAGS_coreaudio_resampler} -framework AudioToolbox" ],
[ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
fi
dnl dnl
dnl Interface plugins dnl Interface plugins
dnl dnl
...@@ -2630,15 +2646,11 @@ AC_ARG_ENABLE(macosx, ...@@ -2630,15 +2646,11 @@ AC_ARG_ENABLE(macosx,
[if test "x${enable_macosx}" = "xyes" [if test "x${enable_macosx}" = "xyes"
then then
BUILTINS="${BUILTINS} macosx" BUILTINS="${BUILTINS} macosx"
PLUGINS="${PLUGINS} coreaudio_resampler" LDFLAGS_macosx="${LDFLAGS_macosx} -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
LDFLAGS_coreaudio_resampler="${LDFLAGS_coreaudio_resampler} -framework AudioToolbox"
fi], fi],
[AC_CHECK_HEADERS(Cocoa/Cocoa.h, [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
BUILTINS="${BUILTINS} macosx" BUILTINS="${BUILTINS} macosx"
PLUGINS="${PLUGINS} coreaudio_resampler" LDFLAGS_macosx="${LDFLAGS_macosx} -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
LDFLAGS_coreaudio_resampler="${LDFLAGS_coreaudio_resampler} -framework AudioToolbox"
)]) )])
dnl dnl
......
SOURCES_alsa = modules/audio_output/alsa.c SOURCES_alsa = modules/audio_output/alsa.c
SOURCES_arts = modules/audio_output/arts.c SOURCES_arts = modules/audio_output/arts.c
SOURCES_coreaudio = modules/audio_output/coreaudio.c
SOURCES_aout_directx = modules/audio_output/directx.c SOURCES_aout_directx = modules/audio_output/directx.c
SOURCES_esd = modules/audio_output/esd.c SOURCES_esd = modules/audio_output/esd.c
SOURCES_aout_file = modules/audio_output/file.c SOURCES_aout_file = modules/audio_output/file.c
......
/***************************************************************************** /*****************************************************************************
* aout.m: CoreAudio output plugin * coreaudio.c: CoreAudio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: aout.m,v 1.29 2003/03/16 20:06:34 jlj Exp $ * $Id: coreaudio.c,v 1.1 2003/03/30 23:35:06 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -35,9 +35,7 @@ ...@@ -35,9 +35,7 @@
#include "aout_internal.h" #include "aout_internal.h"
#include <Carbon/Carbon.h> #include <CoreAudio/CoreAudio.h>
#include <CoreAudio/HostTime.h>
#include <CoreAudio/AudioHardware.h>
#define A52_FRAME_NB 1536 #define A52_FRAME_NB 1536
...@@ -187,6 +185,9 @@ static void FreeStreamInfo ( UInt32 i_dev, aout_instance_t * p_aout, ...@@ -187,6 +185,9 @@ static void FreeStreamInfo ( UInt32 i_dev, aout_instance_t * p_aout,
static void InitDeviceVar ( aout_instance_t * p_aout, int i_option, static void InitDeviceVar ( aout_instance_t * p_aout, int i_option,
vlc_bool_t b_change ); vlc_bool_t b_change );
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static void Play ( aout_instance_t * p_aout ); static void Play ( aout_instance_t * p_aout );
static OSStatus IOCallback ( AudioDeviceID inDevice, static OSStatus IOCallback ( AudioDeviceID inDevice,
...@@ -211,10 +212,23 @@ static OSStatus StreamListener ( AudioStreamID inStream, ...@@ -211,10 +212,23 @@ static OSStatus StreamListener ( AudioStreamID inStream,
AudioDevicePropertyID inPropertyID, AudioDevicePropertyID inPropertyID,
void * inClientData ); void * inClientData );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define ADEV_TEXT N_("audio device")
vlc_module_begin();
set_description( _("CoreAudio output") );
set_capability( "audio output", 100 );
set_callbacks( Open, Close );
add_category_hint( N_("Audio"), NULL, VLC_FALSE );
add_integer( "coreaudio-dev", -1, NULL, ADEV_TEXT, ADEV_TEXT, VLC_FALSE );
vlc_module_end();
/***************************************************************************** /*****************************************************************************
* Open: open a CoreAudio HAL device * Open: open a CoreAudio HAL device
*****************************************************************************/ *****************************************************************************/
int E_(OpenAudio)( vlc_object_t * p_this ) static int Open( vlc_object_t * p_this )
{ {
OSStatus err; OSStatus err;
UInt32 i_param_size; UInt32 i_param_size;
...@@ -246,7 +260,7 @@ int E_(OpenAudio)( vlc_object_t * p_this ) ...@@ -246,7 +260,7 @@ int E_(OpenAudio)( vlc_object_t * p_this )
if( var_Type( p_aout, "audio-device" ) == 0 ) if( var_Type( p_aout, "audio-device" ) == 0 )
{ {
InitDeviceVar( p_aout, config_GetInt( p_aout, "macosx-adev" ), InitDeviceVar( p_aout, config_GetInt( p_aout, "coreaudio-dev" ),
VLC_FALSE ); VLC_FALSE );
} }
...@@ -501,9 +515,10 @@ int E_(OpenAudio)( vlc_object_t * p_this ) ...@@ -501,9 +515,10 @@ int E_(OpenAudio)( vlc_object_t * p_this )
/***************************************************************************** /*****************************************************************************
* Close: close the CoreAudio HAL device * Close: close the CoreAudio HAL device
*****************************************************************************/ *****************************************************************************/
void E_(CloseAudio)( aout_instance_t * p_aout ) static void Close( vlc_object_t * p_this )
{ {
OSStatus err; OSStatus err;
aout_instance_t * p_aout = (aout_instance_t *)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys; struct aout_sys_t * p_sys = p_aout->output.p_sys;
if( p_sys->b_dev_alive ) if( p_sys->b_dev_alive )
...@@ -581,8 +596,8 @@ static OSStatus IOCallback( AudioDeviceID inDevice, ...@@ -581,8 +596,8 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
if( p_buffer != NULL ) if( p_buffer != NULL )
{ {
/* move data into output data buffer */ /* move data into output data buffer */
BlockMoveData( p_buffer->p_buffer, p_aout->p_vlc->pf_memcpy( outOutputData->mBuffers[ 0 ].mData,
outOutputData->mBuffers[ 0 ].mData, p_buffer->p_buffer,
p_sys->i_buffer_size ); p_sys->i_buffer_size );
aout_BufferFree( p_buffer ); aout_BufferFree( p_buffer );
...@@ -1250,7 +1265,7 @@ static int InitDevice( aout_instance_t * p_aout ) ...@@ -1250,7 +1265,7 @@ static int InitDevice( aout_instance_t * p_aout )
return( VLC_EGENERIC ); return( VLC_EGENERIC );
} }
config_PutInt( p_aout, "macosx-adev", i_option ); config_PutInt( p_aout, "coreaudio-dev", i_option );
p_sys->i_sel_opt = i_option; p_sys->i_sel_opt = i_option;
p_sys->devid = p_dev->devid; p_sys->devid = p_dev->devid;
...@@ -1463,7 +1478,7 @@ static void InitDeviceVar( aout_instance_t * p_aout, int i_option, ...@@ -1463,7 +1478,7 @@ static void InitDeviceVar( aout_instance_t * p_aout, int i_option,
{ {
p_sys->i_sel_opt = i; p_sys->i_sel_opt = i;
var_Set( p_aout, "audio-device", val ); var_Set( p_aout, "audio-device", val );
config_PutInt( p_aout, "macosx-adev", i_option ); config_PutInt( p_aout, "coreaudio-dev", i_option );
} }
} }
......
SOURCES_macosx = \ SOURCES_macosx = \
modules/gui/macosx/applescript.h \ modules/gui/macosx/applescript.h \
modules/gui/macosx/applescript.m \ modules/gui/macosx/applescript.m \
modules/gui/macosx/aout.m \
modules/gui/macosx/controls.h \ modules/gui/macosx/controls.h \
modules/gui/macosx/controls.m \ modules/gui/macosx/controls.m \
modules/gui/macosx/intf.m \ modules/gui/macosx/intf.m \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* macosx.m: MacOS X plugin for vlc * macosx.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.5 2003/03/30 18:14:38 gbazin Exp $ * $Id: macosx.m,v 1.6 2003/03/30 23:35:06 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu> * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
...@@ -38,16 +38,12 @@ ...@@ -38,16 +38,12 @@
int E_(OpenIntf) ( vlc_object_t * ); int E_(OpenIntf) ( vlc_object_t * );
void E_(CloseIntf) ( vlc_object_t * ); void E_(CloseIntf) ( vlc_object_t * );
int E_(OpenAudio) ( vlc_object_t * );
void E_(CloseAudio) ( vlc_object_t * );
int E_(OpenVideo) ( vlc_object_t * ); int E_(OpenVideo) ( vlc_object_t * );
void E_(CloseVideo) ( vlc_object_t * ); void E_(CloseVideo) ( vlc_object_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define ADEV_TEXT N_("audio device")
#define VDEV_TEXT N_("video device") #define VDEV_TEXT N_("video device")
vlc_module_begin(); vlc_module_begin();
...@@ -60,10 +56,5 @@ vlc_module_begin(); ...@@ -60,10 +56,5 @@ vlc_module_begin();
set_callbacks( E_(OpenVideo), E_(CloseVideo) ); set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_category_hint( N_("Video"), NULL, VLC_FALSE ); add_category_hint( N_("Video"), NULL, VLC_FALSE );
add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT, VLC_FALSE ); add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT, VLC_FALSE );
add_submodule();
set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) );
add_category_hint( N_("Audio"), NULL, VLC_FALSE );
add_integer( "macosx-adev", -1, NULL, ADEV_TEXT, ADEV_TEXT, VLC_FALSE );
vlc_module_end(); vlc_module_end();
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