diff options
Diffstat (limited to 'services/audioflinger/TrackBase.h')
-rw-r--r-- | services/audioflinger/TrackBase.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/services/audioflinger/TrackBase.h b/services/audioflinger/TrackBase.h index fac7071..523e4b2 100644 --- a/services/audioflinger/TrackBase.h +++ b/services/audioflinger/TrackBase.h @@ -25,10 +25,10 @@ class TrackBase : public ExtendedAudioBufferProvider, public RefBase { public: enum track_state { IDLE, - TERMINATED, FLUSHED, STOPPED, - // next 2 states are currently used for fast tracks only + // next 2 states are currently used for fast tracks + // and offloaded tracks only STOPPING_1, // waiting for first underrun STOPPING_2, // waiting for presentation complete RESUMING, @@ -74,7 +74,7 @@ protected: audio_channel_mask_t channelMask() const { return mChannelMask; } - uint32_t sampleRate() const; // FIXME inline after cblk sr moved + virtual uint32_t sampleRate() const { return mSampleRate; } // Return a pointer to the start of a contiguous slice of the track buffer. // Parameter 'offset' is the requested start position, expressed in @@ -89,7 +89,7 @@ protected: return (mState == STOPPED || mState == FLUSHED); } - // for fast tracks only + // for fast tracks and offloaded tracks only bool isStopping() const { return mState == STOPPING_1 || mState == STOPPING_2; } @@ -101,11 +101,12 @@ protected: } bool isTerminated() const { - return mState == TERMINATED; + return mTerminated; } - bool step(); // mStepCount is an implicit input - void reset(); + void terminate() { + mTerminated = true; + } bool isOut() const { return mIsOut; } // true for Track and TimedTrack, false for RecordTrack, @@ -117,24 +118,19 @@ protected: 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 - // time of releaseBuffer() for later use by step() // we don't really need a lock for these track_state mState; const uint32_t mSampleRate; // initial sample rate only; for tracks which // support dynamic rates, the current value is in control block const audio_format_t mFormat; const audio_channel_mask_t mChannelMask; - const uint8_t mChannelCount; + const uint32_t mChannelCount; const size_t mFrameSize; // AudioFlinger's view of frame size in shared memory, // where for AudioTrack (but not AudioRecord), // 8-bit PCM samples are stored as 16-bit const size_t mFrameCount;// size of track buffer given at createTrack() or // openRecord(), and then adjusted as needed - bool mStepServerFailed; const int mSessionId; Vector < sp<SyncEvent> >mSyncEvents; const bool mIsOut; @@ -142,4 +138,5 @@ protected: const int mId; sp<NBAIO_Sink> mTeeSink; sp<NBAIO_Source> mTeeSource; + bool mTerminated; }; |