summaryrefslogtreecommitdiffstats
path: root/include/private
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-06-25 16:13:23 -0700
committerGlenn Kasten <gkasten@google.com>2013-07-02 14:45:19 -0700
commit7db7df0e8d9d7cee8ba374468cdbfa0108e3337c (patch)
treed1f5c23d596c07854e75999dbf333194d500aaa5 /include/private
parent8f13428cb29a9b610a9e9a0f5fea437cd2d3f032 (diff)
downloadframeworks_av-7db7df0e8d9d7cee8ba374468cdbfa0108e3337c.zip
frameworks_av-7db7df0e8d9d7cee8ba374468cdbfa0108e3337c.tar.gz
frameworks_av-7db7df0e8d9d7cee8ba374468cdbfa0108e3337c.tar.bz2
AudioTrackShared cleanup
Maintain unreleased frame count on client side also (was already there on server side). Assertion failure instead of BAD_VALUE status for incorrect usage of APIs. Clean up error handling code. Change-Id: I23ca2f6f8a7c18645309ee5d64fbc844429bcba8
Diffstat (limited to 'include/private')
-rw-r--r--include/private/media/AudioTrackShared.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index b41684a..0592683 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -168,6 +168,7 @@ protected:
const bool mIsOut; // true for AudioTrack, false for AudioRecord
const bool mClientInServer; // true for OutputTrack, false for AudioTrack & AudioRecord
bool mIsShutdown; // latch set to true when shared memory corruption detected
+ size_t mUnreleased; // unreleased frames remaining from most recent obtainBuffer
};
// ----------------------------------------------------------------------------
@@ -213,7 +214,7 @@ public:
// DEAD_OBJECT Server has died or invalidated, caller should destroy this proxy and re-create.
// -EINTR Call has been interrupted. Look around to see why, and then perhaps try again.
// NO_INIT Shared memory is corrupt.
- // BAD_VALUE On entry buffer == NULL or buffer->mFrameCount == 0.
+ // Assertion failure on entry, if buffer == NULL or buffer->mFrameCount == 0.
status_t obtainBuffer(Buffer* buffer, const struct timespec *requested = NULL,
struct timespec *elapsed = NULL);
@@ -372,7 +373,6 @@ public:
virtual void releaseBuffer(Buffer* buffer);
protected:
- size_t mUnreleased; // unreleased frames remaining from most recent obtainBuffer()
size_t mAvailToClient; // estimated frames available to client prior to releaseBuffer()
private:
int32_t mFlush; // our copy of cblk->u.mStreaming.mFlush, for streaming output only