diff options
-rw-r--r-- | media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 9 | ||||
-rw-r--r-- | media/libmedia/JetPlayer.cpp | 2 | ||||
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.cpp | 2 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 2 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 6 | ||||
-rw-r--r-- | services/audioflinger/AudioMixer.cpp | 4 | ||||
-rw-r--r-- | services/audioflinger/AudioMixer.h | 5 |
8 files changed, 22 insertions, 10 deletions
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp index ca93ce5..40dffd4 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp @@ -1493,7 +1493,7 @@ int VolumeSetVolumeLevel(EffectContext *pContext, int16_t level){ pContext->pBundledContext->firstVolume = LVM_FALSE; } return 0; -} /* end setVolumeLevel */ +} /* end VolumeSetVolumeLevel */ //---------------------------------------------------------------------------- // VolumeGetVolumeLevel() diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 048be1d..60143c6 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -104,9 +104,10 @@ AudioTrack::AudioTrack( { mStatus = set(streamType, sampleRate, format, channelMask, frameCount, flags, cbf, user, notificationFrames, - 0, false, sessionId); + 0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId); } +// DEPRECATED AudioTrack::AudioTrack( int streamType, uint32_t sampleRate, @@ -124,7 +125,7 @@ AudioTrack::AudioTrack( { mStatus = set((audio_stream_type_t)streamType, sampleRate, (audio_format_t)format, channelMask, frameCount, (audio_policy_output_flags_t)flags, cbf, user, notificationFrames, - 0, false, sessionId); + 0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId); } AudioTrack::AudioTrack( @@ -144,8 +145,8 @@ AudioTrack::AudioTrack( mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) { mStatus = set(streamType, sampleRate, format, channelMask, - 0, flags, cbf, user, notificationFrames, - sharedBuffer, false, sessionId); + 0 /*frameCount*/, flags, cbf, user, notificationFrames, + sharedBuffer, false /*threadCanCallJava*/, sessionId); } AudioTrack::~AudioTrack() diff --git a/media/libmedia/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp index f1f62f7..7fa6bb7 100644 --- a/media/libmedia/JetPlayer.cpp +++ b/media/libmedia/JetPlayer.cpp @@ -89,7 +89,7 @@ int JetPlayer::init() // create the output AudioTrack mAudioTrack = new AudioTrack(); - mAudioTrack->set(AUDIO_STREAM_MUSIC, //TODO parametrize this + mAudioTrack->set(AUDIO_STREAM_MUSIC, //TODO parameterize this pLibConfig->sampleRate, AUDIO_FORMAT_PCM_16_BIT, audio_channel_out_mask_from_count(pLibConfig->numChannels), diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index 8f62ee4..148018d 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -1571,7 +1571,7 @@ status_t MediaPlayerService::AudioOutput::open( AUDIO_POLICY_OUTPUT_FLAG_NONE, CallbackWrapper, mCallbackData, - 0, + 0, // notification frames mSessionId); } else { t = new AudioTrack( diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index d83d19a..85168ce 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -4261,7 +4261,7 @@ void AudioFlinger::RecordThread::RecordTrack::stop() RecordThread *recordThread = (RecordThread *)thread.get(); recordThread->stop(this); TrackBase::reset(); - // Force overerrun condition to avoid false overrun callback until first data is + // Force overrun condition to avoid false overrun callback until first data is // read from buffer android_atomic_or(CBLK_UNDERRUN_ON, &mCblk->flags); } diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 0e4b24a..7a57613 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -899,6 +899,7 @@ public: protected: SortedVector< wp<Track> > mActiveTracks; + // Allocate a track name. Returns name >= 0 if successful, -1 on failure. virtual int getTrackName_l() = 0; virtual void deleteTrackName_l(int name) = 0; virtual uint32_t activeSleepTimeUs(); @@ -1559,9 +1560,10 @@ mutable Mutex mLock; // mutex for process, commands and handl uint32_t mNewLeftVolume; // new volume on left channel uint32_t mNewRightVolume; // new volume on right channel uint32_t mStrategy; // strategy for this effect chain - // mSuspendedEffects lists all effect currently suspended in the chain - // use effect type UUID timelow field as key. There is no real risk of identical + // mSuspendedEffects lists all effects currently suspended in the chain. + // Use effect type UUID timelow field as key. There is no real risk of identical // timeLow fields among effect type UUIDs. + // Updated by updateSuspendedSessions_l() only. KeyedVector< int, sp<SuspendedEffectDesc> > mSuspendedEffects; }; diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index 1ec238b..bd4c939 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -57,6 +57,10 @@ AudioMixer::AudioMixer(size_t frameCount, uint32_t sampleRate) mState.outputTemp = NULL; mState.resampleTemp = NULL; // mState.reserved + + // FIXME Most of the following initialization is probably redundant since + // tracks[i] should only be referenced if (mTrackNames & (1 << i)) != 0 + // and mTrackNames is initially 0. However, leave it here until that's verified. track_t* t = mState.tracks; for (unsigned i=0 ; i < MAX_NUM_TRACKS ; i++) { t->needs = 0; diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h index b210212..ab80a9a 100644 --- a/services/audioflinger/AudioMixer.h +++ b/services/audioflinger/AudioMixer.h @@ -70,9 +70,14 @@ public: // For all APIs with "name": TRACK0 <= name < TRACK0 + MAX_NUM_TRACKS + + // Allocate a track name. Returns new track name if successful, -1 on failure. int getTrackName(); + + // Free an allocated track by name void deleteTrackName(int name); + // Enable or disable an allocated track by name void enable(int name); void disable(int name); |