summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-11-19 09:00:56 -0800
committerEric Laurent <elaurent@google.com>2009-11-19 23:57:45 -0800
commit6100d2d60517ff33ed8eb35d0b7ea63cde0831c9 (patch)
tree9cd057df8eb60ff3e68bb6f9c04f92053dfb443e /include
parent583892d0185d102f3c9ca69ea48fe38af31ecd31 (diff)
downloadframeworks_av-6100d2d60517ff33ed8eb35d0b7ea63cde0831c9.zip
frameworks_av-6100d2d60517ff33ed8eb35d0b7ea63cde0831c9.tar.gz
frameworks_av-6100d2d60517ff33ed8eb35d0b7ea63cde0831c9.tar.bz2
Issue 2265163: Audio still reported routed through earpiece on sholes
This is a second attempt to fix the audio routed to earpiece syndrom. The root cause identified this time is the crash of an application having an active AudioTrack playing on the VOICE_CALL stream type. When this happens, the AudioTrack destructor is not called and the audio policy manager is not notified of the track stop. Results a situation where the VOICE_CALL stream is considered as always in use by audio policy manager which makes that audio is routed to earpiece. The fix consists in moving the track start/stop/close notification to audio policiy manager from AudioTrack to AudioFlinger Track objet. The net result is that in the case of a client application crash, the AudioFlinger TrackHandle object (which implements the remote side of the IAudioTrack binder interface) destructor is called which in turn destroys the Track object and we can notify the audio policy manager of the track stop and removal. The same modification is made for AudioRecord although no bug related to record has been reported yet. Also fixed a potential problem if record stop is called while the record thread is exiting.
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioRecord.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 008468c..622c596 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -268,7 +268,7 @@ public:
* Returned value:
* handle on audio hardware input
*/
- audio_io_handle_t getInput() { return mInput; }
+ audio_io_handle_t getInput();
/* obtains a buffer of "frameCount" frames. The buffer must be
* filled entirely. If the track is stopped, obtainBuffer() returns
@@ -318,7 +318,8 @@ private:
int format,
int channelCount,
int frameCount,
- uint32_t flags);
+ uint32_t flags,
+ audio_io_handle_t input);
sp<IAudioRecord> mAudioRecord;
sp<IMemory> mCblkMemory;
@@ -345,8 +346,8 @@ private:
bool mMarkerReached;
uint32_t mNewPosition;
uint32_t mUpdatePeriod;
- audio_io_handle_t mInput;
uint32_t mFlags;
+ uint32_t mChannels;
};
}; // namespace android