Abstract away access to audio devices HAL
In this CL all direct access to audio_hw_device_t and its functions is
encapsulated within the new class DeviceHalLocal. Loading of hardware
modules is encapsulated withing DevicesFactoryHalLocal. AudioFlinger
uses interface classes DevicesFactoryHalInterface and DeviceHalInterface
to access these functions.
Bug: 30222631
Change-Id: Ic88b20c55813a24b898f4a832e082c17d81935b7
diff --git a/services/audioflinger/EffectHalLocal.cpp b/services/audioflinger/EffectHalLocal.cpp
index 11fdc30..aae1921 100644
--- a/services/audioflinger/EffectHalLocal.cpp
+++ b/services/audioflinger/EffectHalLocal.cpp
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+#define LOG_TAG "AudioFlinger::EffectHalLocal"
+//#define LOG_NDEBUG 0
+
#include <media/EffectsFactoryApi.h>
#include <utils/Log.h>
@@ -27,9 +30,8 @@
EffectHalLocal::~EffectHalLocal() {
int status = EffectRelease(mHandle);
- if (status != 0) {
- ALOGW("Error releasing effect %p: %s", mHandle, strerror(-status));
- }
+ ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status));
+ mHandle = 0;
}
status_t EffectHalLocal::process(audio_buffer_t *inBuffer, audio_buffer_t *outBuffer) {