OSDN Git Service

Merge "Use audio_session_t consistently" into nyc-dev
[android-x86/hardware-libhardware_legacy.git] / audio / A2dpAudioInterface.cpp
index 57c23bb..50708ba 100644 (file)
@@ -20,6 +20,7 @@
 #define LOG_TAG "A2dpAudioInterface"
 #include <utils/Log.h>
 #include <utils/String8.h>
+#include <utils/Timers.h>
 
 #include "A2dpAudioInterface.h"
 #include "audio/liba2dp.h"
@@ -38,7 +39,7 @@ static const char *sA2dpWakeLock = "A2dpOutputStream";
 //    AudioHardwareInterface* hw = 0;
 //
 //    hw = AudioHardwareInterface::create();
-//    LOGD("new A2dpAudioInterface(hw: %p)", hw);
+//    ALOGD("new A2dpAudioInterface(hw: %p)", hw);
 //    hw = new A2dpAudioInterface(hw);
 //    return hw;
 //}
@@ -63,7 +64,7 @@ status_t A2dpAudioInterface::initCheck()
 AudioStreamOut* A2dpAudioInterface::openOutputStream(
         uint32_t devices, int *format, uint32_t *channels, uint32_t *sampleRate, status_t *status)
 {
-    if (!AudioSystem::isA2dpDevice((AudioSystem::audio_devices)devices)) {
+    if (!audio_is_a2dp_out_device(devices)) {
         ALOGV("A2dpAudioInterface::openOutputStream() open HW device: %x", devices);
         return mHardwareInterface->openOutputStream(devices, format, channels, sampleRate, status);
     }
@@ -239,7 +240,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::set(
     uint32_t lChannels = pChannels ? *pChannels : 0;
     uint32_t lRate = pRate ? *pRate : 0;
 
-    LOGD("A2dpAudioStreamOut::set %x, %d, %d, %d\n", device, lFormat, lChannels, lRate);
+    ALOGD("A2dpAudioStreamOut::set %x, %d, %d, %d\n", device, lFormat, lChannels, lRate);
 
     // fix up defaults
     if (lFormat == 0) lFormat = format();
@@ -301,7 +302,7 @@ ssize_t A2dpAudioInterface::A2dpAudioStreamOut::write(const void* buffer, size_t
         while (remaining > 0 && retries) {
             status = a2dp_write(mData, buffer, remaining);
             if (status < 0) {
-                LOGE("a2dp_write failed err: %d\n", status);
+                ALOGE("a2dp_write failed err: %d\n", status);
                 goto Error;
             }
             if (status == 0) {
@@ -338,7 +339,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::init()
     if (!mData) {
         status_t status = a2dp_init(44100, 2, &mData);
         if (status < 0) {
-            LOGE("a2dp_init failed err: %d\n", status);
+            ALOGE("a2dp_init failed err: %d\n", status);
             mData = NULL;
             return status;
         }
@@ -398,7 +399,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::setParameters(const String8& ke
     }
     key = AudioParameter::keyRouting;
     if (param.getInt(key, device) == NO_ERROR) {
-        if (AudioSystem::isA2dpDevice((AudioSystem::audio_devices)device)) {
+        if (audio_is_a2dp_out_device(device)) {
             mDevice = device;
             status = NO_ERROR;
         } else {
@@ -448,7 +449,7 @@ status_t A2dpAudioInterface::A2dpAudioStreamOut::setAddress(const char* address)
 
 status_t A2dpAudioInterface::A2dpAudioStreamOut::setBluetoothEnabled(bool enabled)
 {
-    LOGD("setBluetoothEnabled %d", enabled);
+    ALOGD("setBluetoothEnabled %d", enabled);
 
     Mutex::Autolock lock(mLock);