summaryrefslogtreecommitdiffstats
path: root/include/private
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-11-14 13:42:25 -0800
committerGlenn Kasten <gkasten@google.com>2012-11-16 15:01:47 -0800
commitb603744e96b07b1d5bf745bde593fb2c025cefcf (patch)
tree0c8ae15dbd430ccfcb872c701de48907ec48afc8 /include/private
parentf91a3abb7d136e75f0f5d999193b8c8297d97628 (diff)
downloadframeworks_av-b603744e96b07b1d5bf745bde593fb2c025cefcf.zip
frameworks_av-b603744e96b07b1d5bf745bde593fb2c025cefcf.tar.gz
frameworks_av-b603744e96b07b1d5bf745bde593fb2c025cefcf.tar.bz2
Don't use control block frame count after create
This is part of a series to clean up the control block. Change-Id: I7f4cb05aef63053f8e2ab05b286d302260ef4758
Diffstat (limited to 'include/private')
-rw-r--r--include/private/media/AudioTrackShared.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index bbc5e26..48b6b21 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -55,7 +55,10 @@ struct audio_track_cblk_t
int mPad1; // unused, but preserves cache line alignment
- uint32_t frameCount;
+ size_t frameCount_; // used during creation to pass actual track buffer size
+ // from AudioFlinger to client, and not referenced again
+ // FIXME remove here and replace by createTrack() in/out parameter
+ // renamed to "_" to detect incorrect use
// Cache line boundary (32 bytes)
@@ -97,19 +100,23 @@ public:
// called by client only, where client includes regular
// AudioTrack and AudioFlinger::PlaybackThread::OutputTrack
- uint32_t stepUserIn(uint32_t frameCount) { return stepUser(frameCount, false); }
- uint32_t stepUserOut(uint32_t frameCount) { return stepUser(frameCount, true); }
+ uint32_t stepUserIn(size_t stepCount, size_t frameCount) { return stepUser(stepCount, frameCount, false); }
+ uint32_t stepUserOut(size_t stepCount, size_t frameCount) { return stepUser(stepCount, frameCount, true); }
- bool stepServer(uint32_t frameCount, bool isOut);
+ bool stepServer(size_t stepCount, size_t frameCount, bool isOut);
// if there is a shared buffer, "buffers" is the value of pointer() for the shared
// buffer, otherwise "buffers" points immediately after the control block
void* buffer(void *buffers, uint32_t frameSize, uint32_t offset) const;
- uint32_t framesAvailableIn() { return framesAvailable(false); }
- uint32_t framesAvailableOut() { return framesAvailable(true); }
- uint32_t framesAvailableIn_l() { return framesAvailable_l(false); }
- uint32_t framesAvailableOut_l() { return framesAvailable_l(true); }
+ uint32_t framesAvailableIn(size_t frameCount)
+ { return framesAvailable(frameCount, false); }
+ uint32_t framesAvailableOut(size_t frameCount)
+ { return framesAvailable(frameCount, true); }
+ uint32_t framesAvailableIn_l(size_t frameCount)
+ { return framesAvailable_l(frameCount, false); }
+ uint32_t framesAvailableOut_l(size_t frameCount)
+ { return framesAvailable_l(frameCount, true); }
uint32_t framesReadyIn() { return framesReady(false); }
uint32_t framesReadyOut() { return framesReady(true); }
@@ -140,9 +147,9 @@ public:
private:
// isOut == true means AudioTrack, isOut == false means AudioRecord
- uint32_t stepUser(uint32_t frameCount, bool isOut);
- uint32_t framesAvailable(bool isOut);
- uint32_t framesAvailable_l(bool isOut);
+ uint32_t stepUser(size_t stepCount, size_t frameCount, bool isOut);
+ uint32_t framesAvailable(size_t frameCount, bool isOut);
+ uint32_t framesAvailable_l(size_t frameCount, bool isOut);
uint32_t framesReady(bool isOut);
};