diff options
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 18 | ||||
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 8 |
2 files changed, 16 insertions, 10 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 1720af0..4c8b02a 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -50,7 +50,7 @@ AudioRecord::AudioRecord() } AudioRecord::AudioRecord( - int streamType, + int inputSource, uint32_t sampleRate, int format, int channelCount, @@ -61,7 +61,7 @@ AudioRecord::AudioRecord( int notificationFrames) : mStatus(NO_INIT) { - mStatus = set(streamType, sampleRate, format, channelCount, + mStatus = set(inputSource, sampleRate, format, channelCount, frameCount, flags, cbf, user, notificationFrames); } @@ -82,7 +82,7 @@ AudioRecord::~AudioRecord() } status_t AudioRecord::set( - int streamType, + int inputSource, uint32_t sampleRate, int format, int channelCount, @@ -104,8 +104,8 @@ status_t AudioRecord::set( return NO_INIT; } - if (streamType == DEFAULT_INPUT) { - streamType = MIC_INPUT; + if (inputSource == DEFAULT_INPUT) { + inputSource = MIC_INPUT; } if (sampleRate == 0) { @@ -157,7 +157,7 @@ status_t AudioRecord::set( // open record channel status_t status; - sp<IAudioRecord> record = audioFlinger->openRecord(getpid(), streamType, + sp<IAudioRecord> record = audioFlinger->openRecord(getpid(), inputSource, sampleRate, format, channelCount, frameCount, @@ -201,6 +201,7 @@ status_t AudioRecord::set( mMarkerReached = false; mNewPosition = 0; mUpdatePeriod = 0; + mInputSource = (uint8_t)inputSource; return NO_ERROR; } @@ -242,6 +243,11 @@ int AudioRecord::frameSize() const return channelCount()*((format() == AudioSystem::PCM_8_BIT) ? sizeof(uint8_t) : sizeof(int16_t)); } +int AudioRecord::inputSource() const +{ + return (int)mInputSource; +} + // ------------------------------------------------------------------------- status_t AudioRecord::start() diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index 52bd7d4..eeaa54f 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -99,7 +99,7 @@ public: virtual sp<IAudioRecord> openRecord( pid_t pid, - int streamType, + int inputSource, uint32_t sampleRate, int format, int channelCount, @@ -110,7 +110,7 @@ public: Parcel data, reply; data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor()); data.writeInt32(pid); - data.writeInt32(streamType); + data.writeInt32(inputSource); data.writeInt32(sampleRate); data.writeInt32(format); data.writeInt32(channelCount); @@ -384,14 +384,14 @@ status_t BnAudioFlinger::onTransact( case OPEN_RECORD: { CHECK_INTERFACE(IAudioFlinger, data, reply); pid_t pid = data.readInt32(); - int streamType = data.readInt32(); + int inputSource = data.readInt32(); uint32_t sampleRate = data.readInt32(); int format = data.readInt32(); int channelCount = data.readInt32(); size_t bufferCount = data.readInt32(); uint32_t flags = data.readInt32(); status_t status; - sp<IAudioRecord> record = openRecord(pid, streamType, + sp<IAudioRecord> record = openRecord(pid, inputSource, sampleRate, format, channelCount, bufferCount, flags, &status); reply->writeInt32(status); reply->writeStrongBinder(record->asBinder()); |