diff options
author | Glenn Kasten <gkasten@google.com> | 2012-02-02 10:56:47 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-02-14 07:30:48 -0800 |
commit | 6dbc1359f778575d09d6da722b060a6d72c2e7c5 (patch) | |
tree | 721c46e8b89595b51a80ee71c71542895edc1308 /services/audioflinger | |
parent | 7a8b0ed6419e57dd8b41d3806893d63d3df91aab (diff) | |
download | frameworks_av-6dbc1359f778575d09d6da722b060a6d72c2e7c5.zip frameworks_av-6dbc1359f778575d09d6da722b060a6d72c2e7c5.tar.gz frameworks_av-6dbc1359f778575d09d6da722b060a6d72c2e7c5.tar.bz2 |
AudioRecord and AudioTrack client tid
Inform AudioFlinger of the tid of the callback thread.
Change-Id: I670df92dd06749b057238b48ed1094b13aab720b
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 28 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 13 |
2 files changed, 21 insertions, 20 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 5c964b2..fb163d1 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -3494,11 +3494,11 @@ bool AudioFlinger::PlaybackThread::Track::isReady() const { return false; } -status_t AudioFlinger::PlaybackThread::Track::start() +status_t AudioFlinger::PlaybackThread::Track::start(pid_t tid) { status_t status = NO_ERROR; - ALOGV("start(%d), calling pid %d session %d", - mName, IPCThreadState::self()->getCallingPid(), mSessionId); + ALOGV("start(%d), calling pid %d session %d tid %d", + mName, IPCThreadState::self()->getCallingPid(), mSessionId, tid); sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { Mutex::Autolock _l(thread->mLock); @@ -3717,12 +3717,12 @@ getNextBuffer_exit: return NOT_ENOUGH_DATA; } -status_t AudioFlinger::RecordThread::RecordTrack::start() +status_t AudioFlinger::RecordThread::RecordTrack::start(pid_t tid) { sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { RecordThread *recordThread = (RecordThread *)thread.get(); - return recordThread->start(this); + return recordThread->start(this, tid); } else { return BAD_VALUE; } @@ -3789,9 +3789,9 @@ AudioFlinger::PlaybackThread::OutputTrack::~OutputTrack() clearBufferQueue(); } -status_t AudioFlinger::PlaybackThread::OutputTrack::start() +status_t AudioFlinger::PlaybackThread::OutputTrack::start(pid_t tid) { - status_t status = Track::start(); + status_t status = Track::start(tid); if (status != NO_ERROR) { return status; } @@ -3821,7 +3821,7 @@ bool AudioFlinger::PlaybackThread::OutputTrack::write(int16_t* data, uint32_t fr uint32_t waitTimeLeftMs = mSourceThread->waitTimeMs(); if (!mActive && frames != 0) { - start(); + start(0); sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { MixerThread *mixerThread = (MixerThread *)thread.get(); @@ -4056,8 +4056,8 @@ sp<IMemory> AudioFlinger::TrackHandle::getCblk() const { return mTrack->getCblk(); } -status_t AudioFlinger::TrackHandle::start() { - return mTrack->start(); +status_t AudioFlinger::TrackHandle::start(pid_t tid) { + return mTrack->start(tid); } void AudioFlinger::TrackHandle::stop() { @@ -4179,9 +4179,9 @@ sp<IMemory> AudioFlinger::RecordHandle::getCblk() const { return mRecordTrack->getCblk(); } -status_t AudioFlinger::RecordHandle::start() { +status_t AudioFlinger::RecordHandle::start(pid_t tid) { ALOGV("RecordHandle::start()"); - return mRecordTrack->start(); + return mRecordTrack->start(tid); } void AudioFlinger::RecordHandle::stop() { @@ -4473,9 +4473,9 @@ Exit: return track; } -status_t AudioFlinger::RecordThread::start(RecordThread::RecordTrack* recordTrack) +status_t AudioFlinger::RecordThread::start(RecordThread::RecordTrack* recordTrack, pid_t tid) { - ALOGV("RecordThread::start"); + ALOGV("RecordThread::start tid=%d", tid); sp <ThreadBase> strongMe = this; status_t status = NO_ERROR; { diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index fdcd916..aa0ee76 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -314,7 +314,7 @@ private: int sessionId); virtual ~TrackBase(); - virtual status_t start() = 0; + virtual status_t start(pid_t tid) = 0; virtual void stop() = 0; sp<IMemory> getCblk() const { return mCblkMemory; } audio_track_cblk_t* cblk() const { return mCblk; } @@ -586,7 +586,7 @@ private: virtual ~Track(); void dump(char* buffer, size_t size); - virtual status_t start(); + virtual status_t start(pid_t tid); virtual void stop(); void pause(); @@ -668,7 +668,7 @@ private: int frameCount); virtual ~OutputTrack(); - virtual status_t start(); + virtual status_t start(pid_t tid); virtual void stop(); bool write(int16_t* data, uint32_t frames); bool bufferQueueEmpty() const { return (mBufferQueue.size() == 0) ? true : false; } @@ -905,7 +905,7 @@ private: TrackHandle(const sp<PlaybackThread::Track>& track); virtual ~TrackHandle(); virtual sp<IMemory> getCblk() const; - virtual status_t start(); + virtual status_t start(pid_t tid); virtual void stop(); virtual void flush(); virtual void mute(bool); @@ -943,7 +943,7 @@ private: int sessionId); virtual ~RecordTrack(); - virtual status_t start(); + virtual status_t start(pid_t tid); virtual void stop(); bool overflow() { bool tmp = mOverflow; mOverflow = false; return tmp; } @@ -988,6 +988,7 @@ private: status_t *status); status_t start(RecordTrack* recordTrack); + status_t start(RecordTrack* recordTrack, pid_t tid); void stop(RecordTrack* recordTrack); status_t dump(int fd, const Vector<String16>& args); AudioStreamIn* getInput() const; @@ -1028,7 +1029,7 @@ private: RecordHandle(const sp<RecordThread::RecordTrack>& recordTrack); virtual ~RecordHandle(); virtual sp<IMemory> getCblk() const; - virtual status_t start(); + virtual status_t start(pid_t tid); virtual void stop(); virtual status_t onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags); |