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

* ALL: Move CoreAudio aout into seperate module.

parent 00afb055
......@@ -1992,7 +1992,7 @@ dnl
dnl freetype module
dnl
AC_ARG_ENABLE(freetype,
[ --enable-freetype freetype support (default enabled)])
[ --enable-freetype freetype support (default enabled)])
if test "x${enable_freetype}" != "xno"
then
FREETYPE_PATH="${PATH}"
......@@ -2262,6 +2262,22 @@ if test "x${enable_waveout}" != "xno"; then
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 Interface plugins
dnl
......@@ -2278,7 +2294,7 @@ dnl
dnl Skins module
dnl
AC_ARG_ENABLE(skins,
[ --enable-skins Win32 skins module (default enabled on Win32)])
[ --enable-skins Win32 skins module (default enabled on Win32)])
if test "x${enable_skins}" != "xno"; then
if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
PLUGINS="${PLUGINS} skins"
......@@ -2630,15 +2646,11 @@ AC_ARG_ENABLE(macosx,
[if test "x${enable_macosx}" = "xyes"
then
BUILTINS="${BUILTINS} macosx"
PLUGINS="${PLUGINS} coreaudio_resampler"
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"
LDFLAGS_macosx="${LDFLAGS_macosx} -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
fi],
[AC_CHECK_HEADERS(Cocoa/Cocoa.h,
BUILTINS="${BUILTINS} macosx"
PLUGINS="${PLUGINS} coreaudio_resampler"
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"
LDFLAGS_macosx="${LDFLAGS_macosx} -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
)])
dnl
......
SOURCES_alsa = modules/audio_output/alsa.c
SOURCES_arts = modules/audio_output/arts.c
SOURCES_coreaudio = modules/audio_output/coreaudio.c
SOURCES_aout_directx = modules/audio_output/directx.c
SOURCES_esd = modules/audio_output/esd.c
SOURCES_aout_file = modules/audio_output/file.c
......
/*****************************************************************************
* aout.m: CoreAudio output plugin
* coreaudio.c: CoreAudio output plugin
*****************************************************************************
* 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>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -35,9 +35,7 @@
#include "aout_internal.h"
#include <Carbon/Carbon.h>
#include <CoreAudio/HostTime.h>
#include <CoreAudio/AudioHardware.h>
#include <CoreAudio/CoreAudio.h>
#define A52_FRAME_NB 1536
......@@ -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,
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 OSStatus IOCallback ( AudioDeviceID inDevice,
......@@ -211,10 +212,23 @@ static OSStatus StreamListener ( AudioStreamID inStream,
AudioDevicePropertyID inPropertyID,
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
*****************************************************************************/
int E_(OpenAudio)( vlc_object_t * p_this )
static int Open( vlc_object_t * p_this )
{
OSStatus err;
UInt32 i_param_size;
......@@ -246,7 +260,7 @@ int E_(OpenAudio)( vlc_object_t * p_this )
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 );
}
......@@ -501,9 +515,10 @@ int E_(OpenAudio)( vlc_object_t * p_this )
/*****************************************************************************
* Close: close the CoreAudio HAL device
*****************************************************************************/
void E_(CloseAudio)( aout_instance_t * p_aout )
static void Close( vlc_object_t * p_this )
{
OSStatus err;
aout_instance_t * p_aout = (aout_instance_t *)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
if( p_sys->b_dev_alive )
......@@ -581,9 +596,9 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
if( p_buffer != NULL )
{
/* move data into output data buffer */
BlockMoveData( p_buffer->p_buffer,
outOutputData->mBuffers[ 0 ].mData,
p_sys->i_buffer_size );
p_aout->p_vlc->pf_memcpy( outOutputData->mBuffers[ 0 ].mData,
p_buffer->p_buffer,
p_sys->i_buffer_size );
aout_BufferFree( p_buffer );
}
......@@ -1250,7 +1265,7 @@ static int InitDevice( aout_instance_t * p_aout )
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->devid = p_dev->devid;
......@@ -1463,7 +1478,7 @@ static void InitDeviceVar( aout_instance_t * p_aout, int i_option,
{
p_sys->i_sel_opt = i;
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 = \
modules/gui/macosx/applescript.h \
modules/gui/macosx/applescript.m \
modules/gui/macosx/aout.m \
modules/gui/macosx/controls.h \
modules/gui/macosx/controls.m \
modules/gui/macosx/intf.m \
......
......@@ -2,7 +2,7 @@
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
* 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>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......@@ -38,16 +38,12 @@
int E_(OpenIntf) ( 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 * );
void E_(CloseVideo) ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define ADEV_TEXT N_("audio device")
#define VDEV_TEXT N_("video device")
vlc_module_begin();
......@@ -60,10 +56,5 @@ vlc_module_begin();
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_category_hint( N_("Video"), NULL, 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();
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