Merge "Use audio_policy_output_flags_t consistently"
This commit is contained in:
@@ -279,7 +279,7 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th
|
||||
format,// word length, PCM
|
||||
nativeChannelMask,
|
||||
frameCount,
|
||||
0,// flags
|
||||
AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
audioCallback, &(lpJniStorage->mCallbackData),//callback, callback data (user)
|
||||
0,// notificationFrames == 0 since not using EVENT_MORE_DATA to feed the AudioTrack
|
||||
0,// shared mem
|
||||
@@ -300,7 +300,7 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th
|
||||
format,// word length, PCM
|
||||
nativeChannelMask,
|
||||
frameCount,
|
||||
0,// flags
|
||||
AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
audioCallback, &(lpJniStorage->mCallbackData),//callback, callback data (user));
|
||||
0,// notificationFrames == 0 since not using EVENT_MORE_DATA to feed the AudioTrack
|
||||
lpJniStorage->mMemBase,// shared mem
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
audio_format_t format = AUDIO_FORMAT_DEFAULT,
|
||||
int channelMask = 0,
|
||||
int frameCount = 0,
|
||||
uint32_t flags = 0,
|
||||
audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
callback_t cbf = NULL,
|
||||
void* user = NULL,
|
||||
int notificationFrames = 0,
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
int format = AUDIO_FORMAT_DEFAULT,
|
||||
int channelMask = 0,
|
||||
int frameCount = 0,
|
||||
uint32_t flags = 0,
|
||||
uint32_t flags = (uint32_t) AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
callback_t cbf = 0,
|
||||
void* user = 0,
|
||||
int notificationFrames = 0,
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
audio_format_t format = AUDIO_FORMAT_DEFAULT,
|
||||
int channelMask = 0,
|
||||
const sp<IMemory>& sharedBuffer = 0,
|
||||
uint32_t flags = 0,
|
||||
audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
callback_t cbf = NULL,
|
||||
void* user = NULL,
|
||||
int notificationFrames = 0,
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
audio_format_t format = AUDIO_FORMAT_DEFAULT,
|
||||
int channelMask = 0,
|
||||
int frameCount = 0,
|
||||
uint32_t flags = 0,
|
||||
audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
callback_t cbf = NULL,
|
||||
void* user = NULL,
|
||||
int notificationFrames = 0,
|
||||
@@ -473,7 +473,7 @@ protected:
|
||||
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);
|
||||
@@ -515,7 +515,7 @@ protected:
|
||||
uint32_t mNewPosition;
|
||||
uint32_t mUpdatePeriod;
|
||||
bool mFlushed; // FIXME will be made obsolete by making flush() synchronous
|
||||
uint32_t mFlags;
|
||||
audio_policy_output_flags_t mFlags;
|
||||
int mSessionId;
|
||||
int mAuxEffectId;
|
||||
mutable Mutex mLock;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <media/IAudioRecord.h>
|
||||
#include <media/IAudioFlingerClient.h>
|
||||
#include <system/audio.h>
|
||||
#include <system/audio_policy.h>
|
||||
#include <hardware/audio_effect.h>
|
||||
#include <media/IEffect.h>
|
||||
#include <media/IEffectClient.h>
|
||||
@@ -121,7 +122,7 @@ public:
|
||||
audio_format_t *pFormat,
|
||||
uint32_t *pChannels,
|
||||
uint32_t *pLatencyMs,
|
||||
uint32_t flags) = 0;
|
||||
audio_policy_output_flags_t flags) = 0;
|
||||
virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1,
|
||||
audio_io_handle_t output2) = 0;
|
||||
virtual status_t closeOutput(audio_io_handle_t output) = 0;
|
||||
|
||||
@@ -608,10 +608,11 @@ void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftV
|
||||
// do not create a new audio track if current track is compatible with sample parameters
|
||||
#ifdef USE_SHARED_MEM_BUFFER
|
||||
newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
|
||||
channels, sample->getIMemory(), 0, callback, userData);
|
||||
channels, sample->getIMemory(), AUDIO_POLICY_OUTPUT_FLAG_NONE, callback, userData);
|
||||
#else
|
||||
newTrack = new AudioTrack(streamType, sampleRate, sample->format(),
|
||||
channels, frameCount, 0, callback, userData, bufferFrames);
|
||||
channels, frameCount, AUDIO_POLICY_OUTPUT_FLAG_NONE, callback, userData,
|
||||
bufferFrames);
|
||||
#endif
|
||||
oldTrack = mAudioTrack;
|
||||
status = newTrack->initCheck();
|
||||
|
||||
@@ -92,7 +92,7 @@ AudioTrack::AudioTrack(
|
||||
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 @@ AudioTrack::AudioTrack(
|
||||
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 @@ AudioTrack::AudioTrack(
|
||||
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 @@ status_t AudioTrack::set(
|
||||
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 @@ status_t AudioTrack::set(
|
||||
|
||||
// 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 @@ status_t AudioTrack::set(
|
||||
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()
|
||||
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 @@ status_t AudioTrack::createTrack_l(
|
||||
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)
|
||||
|
||||
@@ -362,7 +362,7 @@ public:
|
||||
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 @@ public:
|
||||
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 @@ status_t BnAudioFlinger::onTransact(
|
||||
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,
|
||||
|
||||
@@ -94,7 +94,7 @@ int JetPlayer::init()
|
||||
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
|
||||
{
|
||||
|
||||
@@ -1024,7 +1024,7 @@ bool ToneGenerator::initAudioTrack() {
|
||||
AUDIO_FORMAT_PCM_16_BIT,
|
||||
AUDIO_CHANNEL_OUT_MONO,
|
||||
0,
|
||||
0,
|
||||
AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
audioCallback,
|
||||
this,
|
||||
0,
|
||||
|
||||
@@ -1503,7 +1503,7 @@ status_t MediaPlayerService::AudioOutput::open(
|
||||
format,
|
||||
channelMask,
|
||||
frameCount,
|
||||
0 /* flags */,
|
||||
AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
CallbackWrapper,
|
||||
this,
|
||||
0,
|
||||
@@ -1515,7 +1515,7 @@ status_t MediaPlayerService::AudioOutput::open(
|
||||
format,
|
||||
channelMask,
|
||||
frameCount,
|
||||
0,
|
||||
AUDIO_POLICY_OUTPUT_FLAG_NONE,
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
|
||||
@@ -151,7 +151,7 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
|
||||
|
||||
mAudioTrack = new AudioTrack(
|
||||
AUDIO_STREAM_MUSIC, mSampleRate, AUDIO_FORMAT_PCM_16_BIT, audioMask,
|
||||
0, 0, &AudioCallback, this, 0);
|
||||
0, AUDIO_POLICY_OUTPUT_FLAG_NONE, &AudioCallback, this, 0);
|
||||
|
||||
if ((err = mAudioTrack->initCheck()) != OK) {
|
||||
delete mAudioTrack;
|
||||
|
||||
@@ -5356,7 +5356,7 @@ audio_io_handle_t AudioFlinger::openOutput(uint32_t *pDevices,
|
||||
audio_format_t *pFormat,
|
||||
uint32_t *pChannels,
|
||||
uint32_t *pLatencyMs,
|
||||
uint32_t flags)
|
||||
audio_policy_output_flags_t flags)
|
||||
{
|
||||
status_t status;
|
||||
PlaybackThread *thread = NULL;
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
audio_format_t *pFormat,
|
||||
uint32_t *pChannels,
|
||||
uint32_t *pLatencyMs,
|
||||
uint32_t flags);
|
||||
audio_policy_output_flags_t flags);
|
||||
|
||||
virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1,
|
||||
audio_io_handle_t output2);
|
||||
|
||||
Reference in New Issue
Block a user