Use audio_policy_output_flags_t consistently
This affects:
- IAudioFlinger::openOutput
- AudioTrack::AudioTrack
- AudioTrack::set
- apps that call these
Change-Id: I26fb281bac6cb87593d17697bc9cb37a835af205
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index a1c99e5..34563ca 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -92,7 +92,7 @@
audio_format_t format,
int channelMask,
int frameCount,
- uint32_t flags,
+ audio_policy_output_flags_t flags,
callback_t cbf,
void* user,
int notificationFrames,
@@ -119,10 +119,11 @@
int notificationFrames,
int sessionId)
: mStatus(NO_INIT),
+ mIsTimed(false),
mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT)
{
mStatus = set((audio_stream_type_t)streamType, sampleRate, (audio_format_t)format, channelMask,
- frameCount, flags, cbf, user, notificationFrames,
+ frameCount, (audio_policy_output_flags_t)flags, cbf, user, notificationFrames,
0, false, sessionId);
}
@@ -132,7 +133,7 @@
audio_format_t format,
int channelMask,
const sp<IMemory>& sharedBuffer,
- uint32_t flags,
+ audio_policy_output_flags_t flags,
callback_t cbf,
void* user,
int notificationFrames,
@@ -172,7 +173,7 @@
audio_format_t format,
int channelMask,
int frameCount,
- uint32_t flags,
+ audio_policy_output_flags_t flags,
callback_t cbf,
void* user,
int notificationFrames,
@@ -221,7 +222,7 @@
// force direct flag if format is not linear PCM
if (!audio_is_linear_pcm(format)) {
- flags |= AUDIO_POLICY_OUTPUT_FLAG_DIRECT;
+ flags = (audio_policy_output_flags_t) (flags | AUDIO_POLICY_OUTPUT_FLAG_DIRECT);
}
if (!audio_is_output_channel(channelMask)) {
@@ -233,7 +234,7 @@
audio_io_handle_t output = AudioSystem::getOutput(
streamType,
sampleRate, format, channelMask,
- (audio_policy_output_flags_t)flags);
+ flags);
if (output == 0) {
ALOGE("Could not get audio output for stream type %d", streamType);
@@ -707,7 +708,7 @@
audio_io_handle_t AudioTrack::getOutput_l()
{
return AudioSystem::getOutput(mStreamType,
- mCblk->sampleRate, mFormat, mChannelMask, (audio_policy_output_flags_t)mFlags);
+ mCblk->sampleRate, mFormat, mChannelMask, mFlags);
}
int AudioTrack::getSessionId() const
@@ -734,7 +735,7 @@
audio_format_t format,
uint32_t channelMask,
int frameCount,
- uint32_t flags,
+ audio_policy_output_flags_t flags,
const sp<IMemory>& sharedBuffer,
audio_io_handle_t output,
bool enforceFrameCount)
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index ebadbfa..47c261da 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -362,7 +362,7 @@
audio_format_t *pFormat,
uint32_t *pChannels,
uint32_t *pLatencyMs,
- uint32_t flags)
+ audio_policy_output_flags_t flags)
{
Parcel data, reply;
uint32_t devices = pDevices ? *pDevices : 0;
@@ -377,7 +377,7 @@
data.writeInt32(format);
data.writeInt32(channels);
data.writeInt32(latency);
- data.writeInt32(flags);
+ data.writeInt32((int32_t) flags);
remote()->transact(OPEN_OUTPUT, data, &reply);
audio_io_handle_t output = (audio_io_handle_t) reply.readInt32();
ALOGV("openOutput() returned output, %d", output);
@@ -845,7 +845,7 @@
audio_format_t format = (audio_format_t) data.readInt32();
uint32_t channels = data.readInt32();
uint32_t latency = data.readInt32();
- uint32_t flags = data.readInt32();
+ audio_policy_output_flags_t flags = (audio_policy_output_flags_t) data.readInt32();
audio_io_handle_t output = openOutput(&devices,
&samplingRate,
&format,
diff --git a/media/libmedia/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp
index 6cb5b82..a85956c 100644
--- a/media/libmedia/JetPlayer.cpp
+++ b/media/libmedia/JetPlayer.cpp
@@ -94,7 +94,7 @@
AUDIO_FORMAT_PCM_16_BIT,
(pLibConfig->numChannels == 2) ? AUDIO_CHANNEL_OUT_STEREO : AUDIO_CHANNEL_OUT_MONO,
mTrackBufferSize,
- 0);
+ AUDIO_POLICY_OUTPUT_FLAG_NONE);
// create render and playback thread
{
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 54eb98a..9c3170c 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -1024,7 +1024,7 @@
AUDIO_FORMAT_PCM_16_BIT,
AUDIO_CHANNEL_OUT_MONO,
0,
- 0,
+ AUDIO_POLICY_OUTPUT_FLAG_NONE,
audioCallback,
this,
0,