Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-alsa_sound: 提交

hardware/alsa_sound


Commit MetaInfo

修订版f03693d9d6235fb31f47ef3630c67dca4e399ed0 (tree)
时间2011-12-14 14:48:39
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

update for compatibility with ICS

Namespace has been changed from android to android_audio_legacy.
Module names have been updated to new ICS standards

更改概述

差异

--- a/ALSAControl.cpp
+++ b/ALSAControl.cpp
@@ -33,7 +33,7 @@
3333
3434 #include "AudioHardwareALSA.h"
3535
36-namespace android
36+namespace android_audio_legacy
3737 {
3838
3939 ALSAControl::ALSAControl(const char *device)
@@ -214,4 +214,4 @@ status_t ALSAControl::set(const char *name, const char *value)
214214 return BAD_VALUE;
215215 }
216216
217-}; // namespace android
217+}; // namespace android_audio_legacy
--- a/ALSAMixer.cpp
+++ b/ALSAMixer.cpp
@@ -42,7 +42,7 @@
4242 if (strlen(x) + strlen(y) < ALSA_NAME_MAX) \
4343 strcat(x, y);
4444
45-namespace android
45+namespace android_audio_legacy
4646 {
4747
4848 // ----------------------------------------------------------------------------
@@ -430,4 +430,4 @@ status_t ALSAMixer::getPlaybackMuteState(uint32_t device, bool *state)
430430 return BAD_VALUE;
431431 }
432432
433-}; // namespace android
433+}; // namespace android_audio_legacy
--- a/ALSAStreamOps.cpp
+++ b/ALSAStreamOps.cpp
@@ -33,7 +33,7 @@
3333
3434 #include "AudioHardwareALSA.h"
3535
36-namespace android
36+namespace android_audio_legacy
3737 {
3838
3939 // ----------------------------------------------------------------------------
@@ -289,4 +289,4 @@ status_t ALSAStreamOps::open(int mode)
289289 return mParent->mALSADevice->open(mHandle, mHandle->curDev, mode);
290290 }
291291
292-} // namespace android
292+} // namespace android_audio_legacy
--- a/Android.mk
+++ b/Android.mk
@@ -3,7 +3,7 @@
33 # Copyright 2008 Wind River Systems
44 #
55
6-ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
6+ifneq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
77
88 LOCAL_PATH := $(call my-dir)
99
@@ -24,7 +24,11 @@ ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
2424
2525 LOCAL_MODULE := libaudio
2626
27- LOCAL_STATIC_LIBRARIES += libaudiointerface
27+ LOCAL_STATIC_LIBRARIES := \
28+ libmedia_helper
29+
30+ LOCAL_WHOLE_STATIC_LIBRARIES := \
31+ libaudiohw_legacy
2832
2933 LOCAL_SHARED_LIBRARIES := \
3034 libasound \
@@ -37,6 +41,7 @@ ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
3741
3842 ifeq ($(BOARD_HAVE_BLUETOOTH),true)
3943 LOCAL_SHARED_LIBRARIES += liba2dp
44+# LOCAL_SHARED_LIBRARIES += audio.a2dp.default
4045 endif
4146
4247 include $(BUILD_SHARED_LIBRARY)
@@ -45,6 +50,8 @@ endif
4550
4651 include $(CLEAR_VARS)
4752
53+ LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
54+
4855 LOCAL_CFLAGS := -D_POSIX_SOURCE
4956
5057 ifeq ($(BOARD_HAVE_BLUETOOTH),true)
@@ -53,9 +60,15 @@ endif
5360
5461 LOCAL_SRC_FILES := AudioPolicyManagerALSA.cpp
5562
56- LOCAL_MODULE := libaudiopolicy
63+# LOCAL_MODULE := libaudiopolicy
64+ LOCAL_MODULE_TAGS := optional
65+ LOCAL_MODULE := audio_policy.$(TARGET_PRODUCT)
5766
58- LOCAL_WHOLE_STATIC_LIBRARIES += libaudiopolicybase
67+ LOCAL_STATIC_LIBRARIES := \
68+ libmedia_helper
69+
70+ LOCAL_WHOLE_STATIC_LIBRARIES := \
71+ libaudiopolicy_legacy
5972
6073 LOCAL_SHARED_LIBRARIES := \
6174 libcutils \
@@ -68,8 +81,6 @@ endif
6881
6982 include $(CLEAR_VARS)
7083
71- LOCAL_PRELINK_MODULE := false
72-
7384 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
7485
7586 LOCAL_CFLAGS := -D_POSIX_SOURCE -Wno-multichar
@@ -87,7 +98,7 @@ endif
8798 liblog
8899
89100 LOCAL_MODULE_TAGS := optional
90- LOCAL_MODULE:= alsa.default
101+ LOCAL_MODULE := audio.primary.$(TARGET_PRODUCT)
91102
92103 include $(BUILD_SHARED_LIBRARY)
93104
@@ -95,8 +106,6 @@ endif
95106
96107 include $(CLEAR_VARS)
97108
98- LOCAL_PRELINK_MODULE := false
99-
100109 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
101110
102111 LOCAL_CFLAGS := -D_POSIX_SOURCE -Wno-multichar
--- a/AudioHardwareALSA.cpp
+++ b/AudioHardwareALSA.cpp
@@ -33,19 +33,19 @@
3333
3434 #include "AudioHardwareALSA.h"
3535
36+namespace android_audio_legacy
37+{
38+
3639 extern "C"
3740 {
3841 //
3942 // Function for dlsym() to look up for creating a new AudioHardwareInterface.
4043 //
41- android::AudioHardwareInterface *createAudioHardware(void) {
42- return android::AudioHardwareALSA::create();
44+ AudioHardwareInterface *createAudioHardware(void) {
45+ return AudioHardwareALSA::create();
4346 }
4447 } // extern "C"
4548
46-namespace android
47-{
48-
4949 // ----------------------------------------------------------------------------
5050
5151 static void ALSAErrorHandler(const char *file,
@@ -79,7 +79,7 @@ AudioHardwareALSA::AudioHardwareALSA() :
7979 mMixer = new ALSAMixer;
8080
8181 hw_module_t *module;
82- int err = hw_get_module(ALSA_HARDWARE_MODULE_ID,
82+ int err = hw_get_module(AUDIO_HARDWARE_MODULE_ID,
8383 (hw_module_t const**)&module);
8484
8585 if (err == 0) {
@@ -262,4 +262,4 @@ status_t AudioHardwareALSA::dump(int fd, const Vector<String16>& args)
262262 return NO_ERROR;
263263 }
264264
265-} // namespace android
265+} // namespace android_audio_legacy
--- a/AudioHardwareALSA.h
+++ b/AudioHardwareALSA.h
@@ -19,15 +19,20 @@
1919 #define ANDROID_AUDIO_HARDWARE_ALSA_H
2020
2121 #include <utils/List.h>
22+#include <utils/threads.h>
2223 #include <hardware_legacy/AudioHardwareBase.h>
2324
2425 #include <alsa/asoundlib.h>
2526
2627 #include <hardware/hardware.h>
2728
28-namespace android
29+namespace android_audio_legacy
2930 {
3031
32+using android::List;
33+using android::Mutex;
34+using android::AutoMutex;
35+
3136 class AudioHardwareALSA;
3237
3338 /**
@@ -261,6 +266,15 @@ public:
261266 // Unit: the number of input audio frames
262267 virtual unsigned int getInputFramesLost() const;
263268
269+ virtual status_t addAudioEffect(effect_handle_t effect)
270+ {
271+ return NO_ERROR;
272+ }
273+ virtual status_t removeAudioEffect(effect_handle_t effect)
274+ {
275+ return NO_ERROR;
276+ }
277+
264278 status_t setAcousticParams(void* params);
265279
266280 status_t open(int mode);
@@ -360,5 +374,5 @@ protected:
360374
361375 // ----------------------------------------------------------------------------
362376
363-}; // namespace android
377+}; // namespace android_audio_legacy
364378 #endif // ANDROID_AUDIO_HARDWARE_ALSA_H
--- a/AudioPolicyManagerALSA.cpp
+++ b/AudioPolicyManagerALSA.cpp
@@ -20,7 +20,7 @@
2020 #include "AudioPolicyManagerALSA.h"
2121 #include <media/mediarecorder.h>
2222
23-namespace android {
23+namespace android_audio_legacy {
2424
2525 // ----------------------------------------------------------------------------
2626 // AudioPolicyManagerALSA
@@ -49,4 +49,4 @@ AudioPolicyManagerALSA::~AudioPolicyManagerALSA()
4949 {
5050 }
5151
52-}; // namespace android
52+}; // namespace android_audio_legacy
--- a/AudioPolicyManagerALSA.h
+++ b/AudioPolicyManagerALSA.h
@@ -23,7 +23,7 @@
2323 #include <hardware_legacy/AudioPolicyManagerBase.h>
2424
2525
26-namespace android {
26+namespace android_audio_legacy {
2727
2828 // ----------------------------------------------------------------------------
2929
--- a/AudioStreamInALSA.cpp
+++ b/AudioStreamInALSA.cpp
@@ -33,7 +33,7 @@
3333
3434 #include "AudioHardwareALSA.h"
3535
36-namespace android
36+namespace android_audio_legacy
3737 {
3838
3939 AudioStreamInALSA::AudioStreamInALSA(AudioHardwareALSA *parent,
@@ -168,4 +168,4 @@ status_t AudioStreamInALSA::setAcousticParams(void *params)
168168 return aDev ? aDev->set_params(aDev, mAcoustics, params) : (status_t)NO_ERROR;
169169 }
170170
171-} // namespace android
171+} // namespace android_audio_legacy
--- a/AudioStreamOutALSA.cpp
+++ b/AudioStreamOutALSA.cpp
@@ -37,7 +37,7 @@
3737 #define ALSA_DEFAULT_SAMPLE_RATE 44100 // in Hz
3838 #endif
3939
40-namespace android
40+namespace android_audio_legacy
4141 {
4242
4343 // ----------------------------------------------------------------------------
@@ -179,4 +179,4 @@ status_t AudioStreamOutALSA::getRenderPosition(uint32_t *dspFrames)
179179 return NO_ERROR;
180180 }
181181
182-} // namespace android
182+} // namespace android_audio_legacy
--- a/alsa_default.cpp
+++ b/alsa_default.cpp
@@ -33,7 +33,7 @@
3333 #define ALSA_DEFAULT_SAMPLE_RATE 44100 // in Hz
3434 #endif
3535
36-namespace android
36+namespace android_audio_legacy
3737 {
3838
3939 static int s_device_open(const hw_module_t*, const char*, hw_device_t**);
@@ -51,7 +51,7 @@ extern "C" const hw_module_t HAL_MODULE_INFO_SYM = {
5151 tag : HARDWARE_MODULE_TAG,
5252 version_major : 1,
5353 version_minor : 0,
54- id : ALSA_HARDWARE_MODULE_ID,
54+ id : AUDIO_HARDWARE_MODULE_ID,
5555 name : "ALSA module",
5656 author : "Wind River",
5757 methods : &s_module_methods,
@@ -119,7 +119,7 @@ static alsa_handle_t _defaultsIn = {
119119 handle : 0,
120120 format : SND_PCM_FORMAT_S16_LE, // AudioSystem::PCM_16_BIT
121121 channels : 1,
122- sampleRate : AudioRecord::DEFAULT_SAMPLE_RATE,
122+ sampleRate : android::AudioRecord::DEFAULT_SAMPLE_RATE,
123123 latency : 250000, // Desired Delay in usec
124124 bufferSize : 2048, // Desired Number of samples
125125 modPrivate : 0,
Show on old repository browser