summaryrefslogtreecommitdiffstats
path: root/libs/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-05-22 09:18:15 -0700
committerEric Laurent <elaurent@google.com>2009-05-26 07:44:28 -0700
commit4bc035a65cac177be9294e69f110497e3b6e34e6 (patch)
tree634b5bde8fc4cae5a7b77ee3cde01f04bc9ae7fc /libs/audioflinger/AudioFlinger.cpp
parenta5f158bdde77f8d173d1f1c95d0f92405c519b0f (diff)
downloadframeworks_base-4bc035a65cac177be9294e69f110497e3b6e34e6.zip
frameworks_base-4bc035a65cac177be9294e69f110497e3b6e34e6.tar.gz
frameworks_base-4bc035a65cac177be9294e69f110497e3b6e34e6.tar.bz2
Fix issue 1846343 - part 1
This change is the first part of a fix for issue 1846343, : - Added new enum values for input sources in AudioRecord and MediaRecorder for voice uplink, downlink and uplink+downlink sources. - renamed streamType to inputSource in all native functions handling audio record. A second change is required in opencore author driver and android audio input to completely fix the issue.
Diffstat (limited to 'libs/audioflinger/AudioFlinger.cpp')
-rw-r--r--libs/audioflinger/AudioFlinger.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index e4f4aad..13e457f 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -1553,7 +1553,6 @@ size_t AudioFlinger::MixerThread::getOutputFrameCount()
AudioFlinger::MixerThread::TrackBase::TrackBase(
const sp<MixerThread>& mixerThread,
const sp<Client>& client,
- int streamType,
uint32_t sampleRate,
int format,
int channelCount,
@@ -1563,7 +1562,6 @@ AudioFlinger::MixerThread::TrackBase::TrackBase(
: RefBase(),
mMixerThread(mixerThread),
mClient(client),
- mStreamType(streamType),
mFrameCount(0),
mState(IDLE),
mClientTid(-1),
@@ -1713,12 +1711,13 @@ AudioFlinger::MixerThread::Track::Track(
int channelCount,
int frameCount,
const sp<IMemory>& sharedBuffer)
- : TrackBase(mixerThread, client, streamType, sampleRate, format, channelCount, frameCount, 0, sharedBuffer)
+ : TrackBase(mixerThread, client, sampleRate, format, channelCount, frameCount, 0, sharedBuffer)
{
mVolume[0] = 1.0f;
mVolume[1] = 1.0f;
mMute = false;
mSharedBuffer = sharedBuffer;
+ mStreamType = streamType;
}
AudioFlinger::MixerThread::Track::~Track()
@@ -1902,15 +1901,15 @@ void AudioFlinger::MixerThread::Track::setVolume(float left, float right)
AudioFlinger::MixerThread::RecordTrack::RecordTrack(
const sp<MixerThread>& mixerThread,
const sp<Client>& client,
- int streamType,
+ int inputSource,
uint32_t sampleRate,
int format,
int channelCount,
int frameCount,
uint32_t flags)
- : TrackBase(mixerThread, client, streamType, sampleRate, format,
+ : TrackBase(mixerThread, client, sampleRate, format,
channelCount, frameCount, flags, 0),
- mOverflow(false)
+ mOverflow(false), mInputSource(inputSource)
{
}
@@ -2235,7 +2234,7 @@ status_t AudioFlinger::TrackHandle::onTransact(
sp<IAudioRecord> AudioFlinger::openRecord(
pid_t pid,
- int streamType,
+ int inputSource,
uint32_t sampleRate,
int format,
int channelCount,
@@ -2258,7 +2257,7 @@ sp<IAudioRecord> AudioFlinger::openRecord(
goto Exit;
}
- if (uint32_t(streamType) >= AudioRecord::NUM_STREAM_TYPES) {
+ if (uint32_t(inputSource) >= AudioRecord::NUM_INPUT_SOURCES) {
LOGE("invalid stream type");
lStatus = BAD_VALUE;
goto Exit;
@@ -2301,7 +2300,7 @@ sp<IAudioRecord> AudioFlinger::openRecord(
frameCount = ((frameCount - 1)/inFrameCount + 1) * inFrameCount;
// create new record track. The record track uses one track in mHardwareMixerThread by convention.
- recordTrack = new MixerThread::RecordTrack(mHardwareMixerThread, client, streamType, sampleRate,
+ recordTrack = new MixerThread::RecordTrack(mHardwareMixerThread, client, inputSource, sampleRate,
format, channelCount, frameCount, flags);
}
if (recordTrack->getCblk() == NULL) {
@@ -2408,7 +2407,7 @@ bool AudioFlinger::AudioRecordThread::threadLoop()
LOGV("AudioRecordThread: loop starting");
if (mRecordTrack != 0) {
input = mAudioHardware->openInputStream(
- mRecordTrack->type(),
+ mRecordTrack->inputSource(),
mRecordTrack->format(),
mRecordTrack->channelCount(),
mRecordTrack->sampleRate(),