summaryrefslogtreecommitdiffstats
path: root/audio/AudioHardwareInterface.cpp
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-04-19 16:53:42 -0700
committerDima Zavin <dima@android.com>2011-04-27 10:48:25 -0700
commite81531e91ecae92aff471dbff9cbeb0f95ff4a80 (patch)
tree203c16c95e297163138f465e3a2a60c827873ce6 /audio/AudioHardwareInterface.cpp
parentf01215993dda68b6b52111d754bd0c7c2d5bcfa3 (diff)
downloadhardware_libhardware_legacy-e81531e91ecae92aff471dbff9cbeb0f95ff4a80.zip
hardware_libhardware_legacy-e81531e91ecae92aff471dbff9cbeb0f95ff4a80.tar.gz
hardware_libhardware_legacy-e81531e91ecae92aff471dbff9cbeb0f95ff4a80.tar.bz2
hardware_legacy: provide HAL helpers for legacy audio users
This doesn't actually create a HAL, but rather a set of helper static libraries that device specific libraries (i.e. the old libaudio pieces) can link against to create a proper audio HAL module. We provide an audio_policy static wrapper and audio hardware interface static wrapper. Change-Id: Ie56195447ad24b83888f752dca24674b0afd8a76 Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'audio/AudioHardwareInterface.cpp')
-rw-r--r--audio/AudioHardwareInterface.cpp43
1 files changed, 2 insertions, 41 deletions
diff --git a/audio/AudioHardwareInterface.cpp b/audio/AudioHardwareInterface.cpp
index f58e4c0..9cec267 100644
--- a/audio/AudioHardwareInterface.cpp
+++ b/audio/AudioHardwareInterface.cpp
@@ -38,7 +38,7 @@
// change to 1 to log routing calls
#define LOG_ROUTING_CALLS 1
-namespace android {
+namespace android_audio_legacy {
#if LOG_ROUTING_CALLS
static const char* routingModeStrings[] =
@@ -66,46 +66,7 @@ static const char* displayMode(int mode)
AudioHardwareInterface* AudioHardwareInterface::create()
{
- /*
- * FIXME: This code needs to instantiate the correct audio device
- * interface. For now - we use compile-time switches.
- */
- AudioHardwareInterface* hw = 0;
- char value[PROPERTY_VALUE_MAX];
-
-#ifdef GENERIC_AUDIO
- hw = new AudioHardwareGeneric();
-#else
- // if running in emulation - use the emulator driver
- if (property_get("ro.kernel.qemu", value, 0)) {
- LOGD("Running in emulation - using generic audio driver");
- hw = new AudioHardwareGeneric();
- }
- else {
- LOGV("Creating Vendor Specific AudioHardware");
- hw = createAudioHardware();
- }
-#endif
- if (hw->initCheck() != NO_ERROR) {
- LOGW("Using stubbed audio hardware. No sound will be produced.");
- delete hw;
- hw = new AudioHardwareStub();
- }
-
-#ifdef WITH_A2DP
- hw = new A2dpAudioInterface(hw);
-#endif
-
-#ifdef ENABLE_AUDIO_DUMP
- // This code adds a record of buffers in a file to write calls made by AudioFlinger.
- // It replaces the current AudioHardwareInterface object by an intermediate one which
- // will record buffers in a file (after sending them to hardware) for testing purpose.
- // This feature is enabled by defining symbol ENABLE_AUDIO_DUMP.
- // The output file is set with setParameters("test_cmd_file_name=<name>"). Pause are not recorded in the file.
- LOGV("opening PCM dump interface");
- hw = new AudioDumpInterface(hw); // replace interface
-#endif
- return hw;
+ return NULL;
}
AudioStreamOut::~AudioStreamOut()