Changeset 5050 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Sep 26, 2007 2:55:04 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/alsaaudio.c
r3784 r5050 33 33 34 34 #include "Builtins.h" 35 #include " ../../vl_vbox.h"35 #include "vl_vbox.h" 36 36 #include "audio.h" 37 37 #include <iprt/alloc.h> … … 1089 1089 }; 1090 1090 1091 extern DECLEXPORT(struct audio_driver) alsa_audio_driver; 1091 1092 struct audio_driver alsa_audio_driver = { 1092 1093 INIT_FIELD (name = ) "alsa", -
trunk/src/VBox/Devices/Audio/audio.c
r4521 r5050 33 33 #include <iprt/alloc.h> 34 34 35 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_ALSA) 36 # include <iprt/ldr.h> 37 # define VBOX_LIB_ALSA "VBoxAlsa" 38 #endif 39 35 40 #include "Builtins.h" 36 41 #include "../../vl_vbox.h" … … 62 67 } DRVAUDIO, *PDRVAUDIO; 63 68 69 #if !(defined(RT_OS_LINUX) && defined(VBOX_WITH_ALSA)) 64 70 static struct audio_driver *drvtab[] = { 65 # ifdef RT_OS_LINUX71 # ifdef RT_OS_LINUX 66 72 &oss_audio_driver, 67 #ifdef VBOX_WITH_ALSA 68 &alsa_audio_driver, 69 #endif 70 #endif 71 #ifdef RT_OS_DARWIN 73 # endif 74 # ifdef RT_OS_DARWIN 72 75 &coreaudio_audio_driver, 73 # endif74 # ifdef RT_OS_WINDOWS76 # endif 77 # ifdef RT_OS_WINDOWS 75 78 &dsound_audio_driver, 76 # endif77 # ifdef RT_OS_L479 # endif 80 # ifdef RT_OS_L4 78 81 &oss_audio_driver, 79 # endif82 # endif 80 83 &no_audio_driver 81 84 }; 85 #else 86 static struct audio_driver *drvtab[] = { 87 &oss_audio_driver, 88 NULL, /* alsa_audio_driver is now in a shared object */ 89 &no_audio_driver 90 }; 91 #endif 82 92 83 93 struct fixed_settings { … … 1545 1555 1546 1556 for (i = 0; i < sizeof (drvtab) / sizeof (drvtab[0]); i++) { 1547 if (!strcmp (drvname, drvtab[i]->name)) { 1548 done = !audio_driver_init (s, drvtab[i]); 1549 found = 1; 1550 break; 1557 /* The ALSA entry can be null if we couldn't load the library */ 1558 if (drvtab[i] != NULL) 1559 { 1560 if (!strcmp (drvname, drvtab[i]->name)) { 1561 done = !audio_driver_init (s, drvtab[i]); 1562 found = 1; 1563 break; 1564 } 1551 1565 } 1552 1566 } … … 1859 1873 PDRVAUDIO pData = PDMINS2DATA(pDrvIns, PDRVAUDIO); 1860 1874 char *drvname; 1875 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_ALSA) 1876 RTLDRMOD hLibVBoxAlsa; 1877 #endif 1861 1878 1862 1879 LogFlow(("drvAUDIOConstruct:\n")); 1880 /* 1881 * Load the ALSA driver if needed 1882 */ 1883 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_ALSA) 1884 Log2(("Loading ALSA library %s\n", VBOX_LIB_ALSA)); 1885 rc = (RTLdrLoad(VBOX_LIB_ALSA, &hLibVBoxAlsa)); 1886 if (RT_FAILURE(rc)) 1887 { 1888 Log(("Failed to load ALSA library %s. Reason: %Rrc\n", VBOX_LIB_ALSA, rc)); 1889 } 1890 else 1891 { 1892 rc = RTLdrGetSymbol(hLibVBoxAlsa, "alsa_audio_driver", (void **) &drvtab[1]); 1893 if (RT_FAILURE(rc)) 1894 { 1895 Log(("Failed to get symbol \"alsa_audio_driver\" from library %s. Reason: %Rrc\n", 1896 VBOX_LIB_ALSA, rc)); 1897 drvtab[1] = NULL; 1898 } 1899 } 1900 #endif 1863 1901 /* 1864 1902 * Validate the config. -
trunk/src/VBox/Devices/Audio/audio.h
r3214 r5050 25 25 #define QEMU_AUDIO_H 26 26 27 #ifdef VBOX 28 # include <iprt/types.h> 29 #endif 30 27 31 #include "sys-queue.h" 28 32 … … 105 109 } QEMUAudioTimeStamp; 106 110 111 #ifdef VBOX 112 extern DECLEXPORT(void) AUD_vlog (const char *cap, const char *fmt, va_list ap); 113 extern DECLEXPORT(void) AUD_log (const char *cap, const char *fmt, ...) 114 #else 107 115 void AUD_vlog (const char *cap, const char *fmt, va_list ap); 108 116 void AUD_log (const char *cap, const char *fmt, ...) 117 #endif 109 118 #if defined (__GNUC__) && !defined (VBOX) /* VBox: oh, please, shut up. */ 110 119 __attribute__ ((__format__ (__printf__, 2, 3))) -
trunk/src/VBox/Devices/Audio/audio_int.h
r1636 r5050 34 34 #endif 35 35 36 #ifdef VBOX 37 #include <iprt/types.h> 38 #endif 39 36 40 #include <limits.h> 37 41 #include "mixeng.h" … … 215 219 extern struct audio_driver coreaudio_audio_driver; 216 220 extern struct audio_driver dsound_audio_driver; 217 extern volume_t nominal_volume;218 221 #ifdef VBOX 222 extern DECLEXPORT(volume_t) nominal_volume; 219 223 extern volume_t pcm_out_volume; 220 224 extern volume_t pcm_in_volume; 225 #else 226 extern volume_t nominal_volume; 221 227 #endif 222 228 … … 224 230 uint64_t audio_get_ticks_per_sec (void); 225 231 232 #ifdef VBOX 233 extern DECLEXPORT(void) audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as); 234 void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len); 235 236 extern DECLEXPORT(int) audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int len); 237 extern DECLEXPORT(int) audio_pcm_hw_get_live_in (HWVoiceIn *hw); 238 239 extern DECLEXPORT(int) audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int len); 240 extern DECLEXPORT(int) audio_pcm_hw_get_live_out (HWVoiceOut *hw); 241 int audio_pcm_hw_get_live_out2 (HWVoiceOut *hw, int *nb_live); 242 243 int audio_bug (const char *funcname, int cond); 244 extern DECLEXPORT(void *)audio_calloc (const char *funcname, int nmemb, size_t size); 245 #else 226 246 void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as); 227 247 void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len); … … 236 256 int audio_bug (const char *funcname, int cond); 237 257 void *audio_calloc (const char *funcname, int nmemb, size_t size); 258 #endif 238 259 239 260 #define VOICE_ENABLE 1
Note:
See TracChangeset
for help on using the changeset viewer.