Use audio_stream_type_t consistently
At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t. Java is still int. Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.
Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 9c650ad..98fec83 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -49,7 +49,7 @@
// static
status_t AudioTrack::getMinFrameCount(
int* frameCount,
- int streamType,
+ audio_stream_type_t streamType,
uint32_t sampleRate)
{
int afSampleRate;
@@ -83,7 +83,7 @@
}
AudioTrack::AudioTrack(
- int streamType,
+ audio_stream_type_t streamType,
uint32_t sampleRate,
audio_format_t format,
int channelMask,
@@ -102,7 +102,7 @@
}
AudioTrack::AudioTrack(
- int streamType,
+ audio_stream_type_t streamType,
uint32_t sampleRate,
audio_format_t format,
int channelMask,
@@ -140,7 +140,7 @@
}
status_t AudioTrack::set(
- int streamType,
+ audio_stream_type_t streamType,
uint32_t sampleRate,
audio_format_t format,
int channelMask,
@@ -204,7 +204,7 @@
uint32_t channelCount = popcount(channelMask);
audio_io_handle_t output = AudioSystem::getOutput(
- (audio_stream_type_t)streamType,
+ streamType,
sampleRate, format, channelMask,
(audio_policy_output_flags_t)flags);
@@ -275,7 +275,7 @@
return mLatency;
}
-int AudioTrack::streamType() const
+audio_stream_type_t AudioTrack::streamType() const
{
return mStreamType;
}
@@ -688,7 +688,7 @@
// must be called with mLock held
audio_io_handle_t AudioTrack::getOutput_l()
{
- return AudioSystem::getOutput((audio_stream_type_t)mStreamType,
+ return AudioSystem::getOutput(mStreamType,
mCblk->sampleRate, mFormat, mChannelMask, (audio_policy_output_flags_t)mFlags);
}
@@ -711,7 +711,7 @@
// must be called with mLock held
status_t AudioTrack::createTrack_l(
- int streamType,
+ audio_stream_type_t streamType,
uint32_t sampleRate,
audio_format_t format,
uint32_t channelMask,