diff options
author | Glenn Kasten <gkasten@google.com> | 2012-01-23 13:58:49 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-01-26 16:50:19 -0800 |
commit | eba51fb3a361f67a6a64d5a16eba6084fe27d60e (patch) | |
tree | 2d3dc41818d33d596e66486dcf509086b9dde1e0 /include/media/AudioRecord.h | |
parent | 80a0d2de0a7db5cdcaf40fe33b14523b65d19423 (diff) | |
download | frameworks_av-eba51fb3a361f67a6a64d5a16eba6084fe27d60e.zip frameworks_av-eba51fb3a361f67a6a64d5a16eba6084fe27d60e.tar.gz frameworks_av-eba51fb3a361f67a6a64d5a16eba6084fe27d60e.tar.bz2 |
Use audio_source_t consistently
Was a mix of audio_source_t, uint8_t, and int.
Related fixes:
- fix comments in MediaRecorder.java
- AudioPolicyService server side was not checking source parameter at
all, so if the client wrapper was bypassed, invalid values could be
passed into audio HAL
- JNI android_media_AudioRecord_setup was checking source for positive
values, but not negative values. This test is redundant, since already
checked at Java and now checked by AudioPolicyService also, but might
as well make it correct.
Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
Diffstat (limited to 'include/media/AudioRecord.h')
-rw-r--r-- | include/media/AudioRecord.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 756e91d..76ec3b1 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -149,7 +149,7 @@ public: RECORD_IIR_ENABLE = AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE, }; - AudioRecord(int inputSource, + AudioRecord(audio_source_t inputSource, uint32_t sampleRate = 0, audio_format_t format = AUDIO_FORMAT_DEFAULT, uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, @@ -175,7 +175,7 @@ public: * - NO_INIT: audio server or audio hardware not initialized * - PERMISSION_DENIED: recording is not allowed for the requesting process * */ - status_t set(int inputSource = 0, + status_t set(audio_source_t inputSource = AUDIO_SOURCE_DEFAULT, uint32_t sampleRate = 0, audio_format_t format = AUDIO_FORMAT_DEFAULT, uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, @@ -208,7 +208,7 @@ public: int channels() const; uint32_t frameCount() const; size_t frameSize() const; - int inputSource() const; + audio_source_t inputSource() const; /* After it's created the track is not active. Call start() to @@ -367,8 +367,7 @@ private: audio_track_cblk_t* mCblk; audio_format_t mFormat; uint8_t mChannelCount; - uint8_t mInputSource; - uint8_t mReserved[2]; + audio_source_t mInputSource; status_t mStatus; uint32_t mLatency; |