Merge "Use AudioRecord::record_flags consistently"
diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp
index 68a8de8..b34dbce 100644
--- a/core/jni/android_media_AudioRecord.cpp
+++ b/core/jni/android_media_AudioRecord.cpp
@@ -203,7 +203,7 @@
format, // word length, PCM
channels,
frameCount,
- 0, // flags
+ (AudioRecord::record_flags) 0, // flags
recorderCallback,// callback_t
lpCallbackData,// void* user
0, // notificationFrames,
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 4fbeb38..7df6668 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -143,6 +143,8 @@
* user Context for use by the callback receiver.
*/
+ // FIXME consider removing this alias and replacing it by audio_in_acoustics_t
+ // or removing the parameter entirely if it is unused
enum record_flags {
RECORD_AGC_ENABLE = AUDIO_IN_ACOUSTICS_AGC_ENABLE,
RECORD_NS_ENABLE = AUDIO_IN_ACOUSTICS_NS_ENABLE,
@@ -154,7 +156,7 @@
audio_format_t format = AUDIO_FORMAT_DEFAULT,
uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
int frameCount = 0,
- uint32_t flags = 0,
+ record_flags flags = (record_flags) 0,
callback_t cbf = NULL,
void* user = NULL,
int notificationFrames = 0,
@@ -180,7 +182,7 @@
audio_format_t format = AUDIO_FORMAT_DEFAULT,
uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
int frameCount = 0,
- uint32_t flags = 0,
+ record_flags flags = (record_flags) 0,
callback_t cbf = NULL,
void* user = NULL,
int notificationFrames = 0,
@@ -383,7 +385,7 @@
bool mMarkerReached;
uint32_t mNewPosition;
uint32_t mUpdatePeriod;
- uint32_t mFlags;
+ record_flags mFlags;
uint32_t mChannelMask;
audio_io_handle_t mInput;
int mSessionId;
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 943f3af..22c3a18 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -89,7 +89,7 @@
audio_format_t format,
uint32_t channelMask,
int frameCount,
- uint32_t flags,
+ record_flags flags,
callback_t cbf,
void* user,
int notificationFrames,
@@ -124,7 +124,7 @@
audio_format_t format,
uint32_t channelMask,
int frameCount,
- uint32_t flags,
+ record_flags flags,
callback_t cbf,
void* user,
int notificationFrames,
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index 5b2ea1f..cbe709b 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -56,9 +56,10 @@
ALOGV("sampleRate: %d, channels: %d", sampleRate, channels);
CHECK(channels == 1 || channels == 2);
- uint32_t flags = AudioRecord::RECORD_AGC_ENABLE |
+ AudioRecord::record_flags flags = (AudioRecord::record_flags)
+ (AudioRecord::RECORD_AGC_ENABLE |
AudioRecord::RECORD_NS_ENABLE |
- AudioRecord::RECORD_IIR_ENABLE;
+ AudioRecord::RECORD_IIR_ENABLE);
mRecord = new AudioRecord(
inputSource, sampleRate, AUDIO_FORMAT_PCM_16_BIT,
channels > 1? AUDIO_CHANNEL_IN_STEREO: AUDIO_CHANNEL_IN_MONO,