#define LOG_TAG "A2dpAudioInterface"
#include <utils/Log.h>
#include <utils/String8.h>
+#include <utils/Timers.h>
#include "A2dpAudioInterface.h"
#include "audio/liba2dp.h"
// AudioHardwareInterface* hw = 0;
//
// hw = AudioHardwareInterface::create();
-// LOGD("new A2dpAudioInterface(hw: %p)", hw);
+// ALOGD("new A2dpAudioInterface(hw: %p)", hw);
// hw = new A2dpAudioInterface(hw);
// return hw;
//}
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);
}
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();
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) {
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;
}
}
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 {
status_t A2dpAudioInterface::A2dpAudioStreamOut::setBluetoothEnabled(bool enabled)
{
- LOGD("setBluetoothEnabled %d", enabled);
+ ALOGD("setBluetoothEnabled %d", enabled);
Mutex::Autolock lock(mLock);