diff options
author | Glenn Kasten <gkasten@google.com> | 2013-07-10 17:03:19 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-07-10 17:08:15 -0700 |
commit | fb1fdc9d6603aa228362e7349451f6455c9849c2 (patch) | |
tree | 1caac6c881db81bcfedb596b292ce62ecbaf6a2c /media | |
parent | 551ababe67ce31778000d52958e53e1c56e1a294 (diff) | |
download | frameworks_av-fb1fdc9d6603aa228362e7349451f6455c9849c2.zip frameworks_av-fb1fdc9d6603aa228362e7349451f6455c9849c2.tar.gz frameworks_av-fb1fdc9d6603aa228362e7349451f6455c9849c2.tar.bz2 |
Add comments
Change-Id: Ifbf3a46a4183c8abc0feee1c588953ab10303cc1
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 7 | ||||
-rw-r--r-- | media/libmediaplayerservice/MidiFile.cpp | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index 22d6763..7ceffd3 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -537,6 +537,8 @@ const sp<IAudioPolicyService>& AudioSystem::get_audio_policy_service() return gAudioPolicyService; } +// --------------------------------------------------------------------------- + status_t AudioSystem::setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state, const char *device_address) diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 33c4462..3f4cbc2 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -585,6 +585,7 @@ void AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount) status_t AudioTrack::setMarkerPosition(uint32_t marker) { + // The only purpose of setting marker position is to get a callback if (mCbf == NULL) { return INVALID_OPERATION; } @@ -610,6 +611,7 @@ status_t AudioTrack::getMarkerPosition(uint32_t *marker) const status_t AudioTrack::setPositionUpdatePeriod(uint32_t updatePeriod) { + // The only purpose of setting position update period is to get a callback if (mCbf == NULL) { return INVALID_OPERATION; } @@ -1220,6 +1222,11 @@ status_t TimedAudioTrack::setMediaTimeTransform(const LinearTransform& xform, nsecs_t AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread) { + // Currently the AudioTrack thread is not created if there are no callbacks. + // Would it ever make sense to run the thread, even without callbacks? + // If so, then replace this by checks at each use for mCbf != NULL. + LOG_ALWAYS_FATAL_IF(mCblk == NULL); + mLock.lock(); if (mAwaitBoost) { mAwaitBoost = false; diff --git a/media/libmediaplayerservice/MidiFile.cpp b/media/libmediaplayerservice/MidiFile.cpp index 8db5b9b..270b872 100644 --- a/media/libmediaplayerservice/MidiFile.cpp +++ b/media/libmediaplayerservice/MidiFile.cpp @@ -422,7 +422,7 @@ status_t MidiFile::setLooping(int loop) status_t MidiFile::createOutputTrack() { if (mAudioSink->open(pLibConfig->sampleRate, pLibConfig->numChannels, - CHANNEL_MASK_USE_CHANNEL_ORDER, AUDIO_FORMAT_PCM_16_BIT, 2) != NO_ERROR) { + CHANNEL_MASK_USE_CHANNEL_ORDER, AUDIO_FORMAT_PCM_16_BIT, 2 /*bufferCount*/) != NO_ERROR) { ALOGE("mAudioSink open failed"); return ERROR_OPEN_FAILED; } |