summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioRecord.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-11-06 16:15:41 -0800
committerGlenn Kasten <gkasten@google.com>2012-11-07 08:32:40 -0800
commit864585df53eb97c31e77b3ad7c0d89e4f9b42588 (patch)
tree529492712326aa5aa997aa2d2f66a65baf4356b1 /media/libmedia/AudioRecord.cpp
parent8fa3ad0e4c77f7868348ad2a4cacc34c34e7c39e (diff)
downloadframeworks_av-864585df53eb97c31e77b3ad7c0d89e4f9b42588.zip
frameworks_av-864585df53eb97c31e77b3ad7c0d89e4f9b42588.tar.gz
frameworks_av-864585df53eb97c31e77b3ad7c0d89e4f9b42588.tar.bz2
Remove CBLK_DIRECTION from control block flags
This is part of a series to clean up the control block. Change-Id: I0265fece3247356b585d4d48fbda6f37aea8a851
Diffstat (limited to 'media/libmedia/AudioRecord.cpp')
-rw-r--r--media/libmedia/AudioRecord.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 3c28ca7..ae1842e 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -466,7 +466,6 @@ status_t AudioRecord::openRecord_l(
mCblkMemory = cblk;
mCblk = static_cast<audio_track_cblk_t*>(cblk->pointer());
mCblk->buffers = (char*)mCblk + sizeof(audio_track_cblk_t);
- android_atomic_and(~CBLK_DIRECTION, &mCblk->flags);
mCblk->bufferTimeoutMs = MAX_RUN_TIMEOUT_MS;
mCblk->waitTimeMs = 0;
return NO_ERROR;
@@ -484,7 +483,7 @@ status_t AudioRecord::obtainBuffer(Buffer* audioBuffer, int32_t waitCount)
audioBuffer->frameCount = 0;
audioBuffer->size = 0;
- uint32_t framesReady = cblk->framesReady();
+ uint32_t framesReady = cblk->framesReadyIn();
if (framesReady == 0) {
cblk->lock.lock();
@@ -540,7 +539,7 @@ create_new_record:
}
// read the server count again
start_loop_here:
- framesReady = cblk->framesReady();
+ framesReady = cblk->framesReadyIn();
}
cblk->lock.unlock();
}
@@ -570,7 +569,7 @@ create_new_record:
void AudioRecord::releaseBuffer(Buffer* audioBuffer)
{
AutoMutex lock(mLock);
- mCblk->stepUser(audioBuffer->frameCount);
+ mCblk->stepUserIn(audioBuffer->frameCount);
}
audio_io_handle_t AudioRecord::getInput() const
@@ -732,7 +731,7 @@ bool AudioRecord::processAudioBuffer(const sp<AudioRecordThread>& thread)
// Manage overrun callback
- if (active && (cblk->framesAvailable() == 0)) {
+ if (active && (cblk->framesAvailableIn() == 0)) {
// The value of active is stale, but we are almost sure to be active here because
// otherwise we would have exited when obtainBuffer returned STOPPED earlier.
ALOGV("Overrun user: %x, server: %x, flags %04x", cblk->user, cblk->server, cblk->flags);