diff options
author | Glenn Kasten <gkasten@google.com> | 2014-01-16 17:44:23 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-03-25 16:22:54 -0700 |
commit | 66e4635cb09fadcaccf912f37c387396c428378a (patch) | |
tree | 7982a54dbc04375babd42e59c03ef930454a9687 | |
parent | 1392eb3d1802e9f894f87d7a7387207d1b6faca1 (diff) | |
download | frameworks_av-66e4635cb09fadcaccf912f37c387396c428378a.zip frameworks_av-66e4635cb09fadcaccf912f37c387396c428378a.tar.gz frameworks_av-66e4635cb09fadcaccf912f37c387396c428378a.tar.bz2 |
Use symbolic constants from <system/audio.h>
AUDIO_INTERLEAVE_*
AUDIO_STREAM_MIN
AUDIO_SESSION_ALLOCATE
Change-Id: I31dd6f327204685e50716079ce21c4ba206dff11
-rw-r--r-- | cmds/stagefright/stream.cpp | 2 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 5 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 12 | ||||
-rw-r--r-- | media/libmedia/ToneGenerator.cpp | 2 | ||||
-rw-r--r-- | services/audioflinger/Threads.cpp | 2 |
5 files changed, 9 insertions, 14 deletions
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp index b2abc0f..0566d14 100644 --- a/cmds/stagefright/stream.cpp +++ b/cmds/stagefright/stream.cpp @@ -374,7 +374,7 @@ int main(int argc, char **argv) { } sp<IMediaPlayer> player = - service->create(client, 0); + service->create(client, AUDIO_SESSION_ALLOCATE); if (player != NULL && player->setDataSource(source) == NO_ERROR) { player->setVideoSurfaceTexture(surface->getIGraphicBufferProducer()); diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 647748b..d3168ba 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -36,11 +36,6 @@ class StaticAudioTrackClientProxy; class AudioTrack : public RefBase { public: - enum channel_index { - MONO = 0, - LEFT = 0, - RIGHT = 1 - }; /* Events used by AudioTrack callback function (callback_t). * Keep in sync with frameworks/base/media/java/android/media/AudioTrack.java NATIVE_EVENT_*. diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 20c1cdb..74c1800 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -333,8 +333,8 @@ status_t AudioTrack::set( mOffloadInfo = NULL; } - mVolume[LEFT] = 1.0f; - mVolume[RIGHT] = 1.0f; + mVolume[AUDIO_INTERLEAVE_LEFT] = 1.0f; + mVolume[AUDIO_INTERLEAVE_RIGHT] = 1.0f; mSendLevel = 0.0f; // mFrameCount is initialized in createTrack_l mReqFrameCount = frameCount; @@ -573,8 +573,8 @@ status_t AudioTrack::setVolume(float left, float right) } AutoMutex lock(mLock); - mVolume[LEFT] = left; - mVolume[RIGHT] = right; + mVolume[AUDIO_INTERLEAVE_LEFT] = left; + mVolume[AUDIO_INTERLEAVE_RIGHT] = right; mProxy->setVolumeLR((uint32_t(uint16_t(right * 0x1000)) << 16) | uint16_t(left * 0x1000)); @@ -1134,8 +1134,8 @@ status_t AudioTrack::createTrack_l(size_t epoch) mStaticProxy = new StaticAudioTrackClientProxy(cblk, buffers, frameCount, mFrameSizeAF); mProxy = mStaticProxy; } - mProxy->setVolumeLR((uint32_t(uint16_t(mVolume[RIGHT] * 0x1000)) << 16) | - uint16_t(mVolume[LEFT] * 0x1000)); + mProxy->setVolumeLR((uint32_t(uint16_t(mVolume[AUDIO_INTERLEAVE_RIGHT] * 0x1000)) << 16) | + uint16_t(mVolume[AUDIO_INTERLEAVE_LEFT] * 0x1000)); mProxy->setSendLevel(mSendLevel); mProxy->setSampleRate(mSampleRate); mProxy->setEpoch(epoch); diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index adef3be..61b6d36 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -1057,7 +1057,7 @@ bool ToneGenerator::initAudioTrack() { 0, // notificationFrames 0, // sharedBuffer mThreadCanCallJava, - 0, // sessionId + AUDIO_SESSION_ALLOCATE, AudioTrack::TRANSFER_CALLBACK); if (mpAudioTrack->initCheck() != NO_ERROR) { diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index e046e03..c3c9033 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -1133,7 +1133,7 @@ AudioFlinger::PlaybackThread::PlaybackThread(const sp<AudioFlinger>& audioFlinge // mStreamTypes[AUDIO_STREAM_CNT] is initialized by stream_type_t default constructor // There is no AUDIO_STREAM_MIN, and ++ operator does not compile - for (audio_stream_type_t stream = (audio_stream_type_t) 0; stream < AUDIO_STREAM_CNT; + for (audio_stream_type_t stream = AUDIO_STREAM_MIN; stream < AUDIO_STREAM_CNT; stream = (audio_stream_type_t) (stream + 1)) { mStreamTypes[stream].volume = mAudioFlinger->streamVolume_l(stream); mStreamTypes[stream].mute = mAudioFlinger->streamMute_l(stream); |