summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/TrackBase.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-12-04 12:22:46 -0800
committerGlenn Kasten <gkasten@google.com>2012-12-12 12:21:59 -0800
commite3aa659e9cee7df5c12a80d285cc29ab3b2cbb39 (patch)
tree90fdb6e9da1a03f4f24691aae27ae94ff913f1c7 /services/audioflinger/TrackBase.h
parent84b6440fa1d1274267deabe0bd8dc626b5548e4c (diff)
downloadframeworks_av-e3aa659e9cee7df5c12a80d285cc29ab3b2cbb39.zip
frameworks_av-e3aa659e9cee7df5c12a80d285cc29ab3b2cbb39.tar.gz
frameworks_av-e3aa659e9cee7df5c12a80d285cc29ab3b2cbb39.tar.bz2
Start isolating control block accesses in a proxy
The proxy object will eventually be the only code that understands the details of the control block. This should make it easier to change the control block in the future. Initial set of control block fields that are isolated: - sample rate - send level - volume Prepare for streaming/static separation by adding a union to the control block for the new fields. Fix bug in handling of max sample rate on a track. It was only checking at re-configuration, not at each mix. Simplify OutputTrack::obtainBuffer. Change-Id: I2249f9d04f73a911a922ad1d7f6197292c74cd92
Diffstat (limited to 'services/audioflinger/TrackBase.h')
-rw-r--r--services/audioflinger/TrackBase.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/audioflinger/TrackBase.h b/services/audioflinger/TrackBase.h
index 17de49b..e0bd97a 100644
--- a/services/audioflinger/TrackBase.h
+++ b/services/audioflinger/TrackBase.h
@@ -44,7 +44,8 @@ public:
audio_channel_mask_t channelMask,
size_t frameCount,
const sp<IMemory>& sharedBuffer,
- int sessionId);
+ int sessionId,
+ bool isOut);
virtual ~TrackBase();
virtual status_t start(AudioSystem::sync_event_t event,
@@ -108,7 +109,8 @@ protected:
bool step(); // mStepCount is an implicit input
void reset();
- virtual bool isOut() const = 0; // true for Track and TimedTrack, false for RecordTrack,
+ bool isOut() const { return mIsOut; }
+ // true for Track and TimedTrack, false for RecordTrack,
// this could be a track type if needed later
const wp<ThreadBase> mThread;
@@ -116,6 +118,7 @@ protected:
sp<IMemory> mCblkMemory;
audio_track_cblk_t* mCblk;
void* mBuffer; // start of track buffer, typically in shared memory
+ // except for OutputTrack when it is in local memory
void* mBufferEnd; // &mBuffer[mFrameCount * frameSize], where frameSize
// is based on mChannelCount and 16-bit samples
uint32_t mStepCount; // saves AudioBufferProvider::Buffer::frameCount as of
@@ -136,4 +139,6 @@ protected:
bool mStepServerFailed;
const int mSessionId;
Vector < sp<SyncEvent> >mSyncEvents;
+ const bool mIsOut;
+ ServerProxy* mServerProxy;
};