]> git.sesse.net Git - vlc/commitdiff
* ALL: Move CoreAudio aout into seperate module.
authorJon Lech Johansen <jlj@videolan.org>
Sun, 30 Mar 2003 23:35:06 +0000 (23:35 +0000)
committerJon Lech Johansen <jlj@videolan.org>
Sun, 30 Mar 2003 23:35:06 +0000 (23:35 +0000)
configure.ac.in
modules/audio_output/Modules.am
modules/audio_output/coreaudio.c [moved from modules/gui/macosx/aout.m with 97% similarity]
modules/gui/macosx/Modules.am
modules/gui/macosx/macosx.m

index 53863e1f52c48abe37e431707bac171971dd4e4a..e19d9ddb0029c2c82c702a50d6186b0cdee17e66 100644 (file)
@@ -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
index 2faf24f352fc272f97d51e4671c750ff0d1ae8c9..7239c0c4ac9fee963284352b164f308e6c513b0e 100644 (file)
@@ -1,5 +1,6 @@
 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
similarity index 97%
rename from modules/gui/macosx/aout.m
rename to modules/audio_output/coreaudio.c
index d65b269856819fadc79c040f2ea3e10a4063d370..53c85c152dc418b84d1c0510bfc7496a527991e8 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * 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 );
         }
     }
 
index 0e182394e357eae3c8b442eca6359c49f7c3d02d..951f9d1fa2df5f3017d7bacd207950d3303bab3f 100644 (file)
@@ -1,7 +1,6 @@
 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 \
index 77645d42d519b342ba2c7bc5eadf108d4b7bd1bb..04bc46ed532a6578bc32099e21975d69518cdde3 100644 (file)
@@ -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>
 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();