summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-20 17:00:00 -0800
committerGlenn Kasten <gkasten@google.com>2012-01-20 17:12:59 -0800
commit34f9f8bb8384b9045bc6aff9289bd1cb8705f427 (patch)
tree24e206f7cb1eb96c75016f2eefca6f69c95d418b /services
parent0a204ed0f58a9baaac5630864cd75495486c6cbe (diff)
downloadframeworks_base-34f9f8bb8384b9045bc6aff9289bd1cb8705f427.zip
frameworks_base-34f9f8bb8384b9045bc6aff9289bd1cb8705f427.tar.gz
frameworks_base-34f9f8bb8384b9045bc6aff9289bd1cb8705f427.tar.bz2
Remove AudioFlinger dependencies on client
Change-Id: Ibb591e41a3ca5d7015e2b66b98b8fef5f415fb37
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp10
-rw-r--r--services/audioflinger/AudioFlinger.h7
2 files changed, 10 insertions, 7 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index c6a9c77..f5892d4 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -37,8 +37,6 @@
#include <cutils/properties.h>
#include <cutils/compiler.h>
-#include <media/AudioTrack.h>
-#include <media/AudioRecord.h>
#include <media/IMediaPlayerService.h>
#include <media/IMediaDeathNotifier.h>
@@ -3909,7 +3907,7 @@ bool AudioFlinger::PlaybackThread::OutputTrack::write(int16_t* data, uint32_t fr
if (mOutBuffer.frameCount == 0) {
mOutBuffer.frameCount = pInBuffer->frameCount;
nsecs_t startTime = systemTime();
- if (obtainBuffer(&mOutBuffer, waitTimeLeftMs) == (status_t)AudioTrack::NO_MORE_BUFFERS) {
+ if (obtainBuffer(&mOutBuffer, waitTimeLeftMs) == (status_t)NO_MORE_BUFFERS) {
ALOGV ("OutputTrack::write() %p thread %p no more output buffers", this, mThread.unsafe_get());
outputBufferFull = true;
break;
@@ -4000,11 +3998,11 @@ status_t AudioFlinger::PlaybackThread::OutputTrack::obtainBuffer(AudioBufferProv
active = mActive;
if (CC_UNLIKELY(!active)) {
ALOGV("Not active and NO_MORE_BUFFERS");
- return AudioTrack::NO_MORE_BUFFERS;
+ return NO_MORE_BUFFERS;
}
result = cblk->cv.waitRelative(cblk->lock, milliseconds(waitTimeMs));
if (result != NO_ERROR) {
- return AudioTrack::NO_MORE_BUFFERS;
+ return NO_MORE_BUFFERS;
}
// read the server count again
start_loop_here:
@@ -4013,7 +4011,7 @@ status_t AudioFlinger::PlaybackThread::OutputTrack::obtainBuffer(AudioBufferProv
}
// if (framesAvail < framesReq) {
-// return AudioTrack::NO_MORE_BUFFERS;
+// return NO_MORE_BUFFERS;
// }
if (framesReq > framesAvail) {
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index d862c1d..48edfcd 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -26,7 +26,7 @@
#include <media/IAudioFlingerClient.h>
#include <media/IAudioTrack.h>
#include <media/IAudioRecord.h>
-#include <media/AudioTrack.h>
+#include <media/AudioSystem.h>
#include <utils/Atomic.h>
#include <utils/Errors.h>
@@ -207,6 +207,7 @@ public:
bool btNrecIsOff() { return mBtNrecIsOff; }
private:
+
AudioFlinger();
virtual ~AudioFlinger();
@@ -674,6 +675,10 @@ private:
private:
+ enum {
+ NO_MORE_BUFFERS = 0x80000001, // same in AudioTrack.h, ok to be different value
+ };
+
status_t obtainBuffer(AudioBufferProvider::Buffer* buffer, uint32_t waitTimeMs);
void clearBufferQueue();