diff options
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioEffect.cpp | 12 | ||||
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 30 | ||||
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 14 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 91 | ||||
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 6 | ||||
-rw-r--r-- | media/libmedia/IAudioRecord.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/IAudioTrack.cpp | 4 | ||||
-rw-r--r-- | media/libmedia/IMediaDeathNotifier.cpp | 6 | ||||
-rw-r--r-- | media/libmedia/IOMX.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/JetPlayer.cpp | 20 | ||||
-rw-r--r-- | media/libmedia/MediaProfiles.cpp | 28 | ||||
-rw-r--r-- | media/libmedia/MediaScanner.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/MediaScannerClient.cpp | 6 | ||||
-rw-r--r-- | media/libmedia/Metadata.cpp | 4 | ||||
-rw-r--r-- | media/libmedia/ToneGenerator.cpp | 18 | ||||
-rw-r--r-- | media/libmedia/Visualizer.cpp | 4 | ||||
-rw-r--r-- | media/libmedia/mediametadataretriever.cpp | 24 | ||||
-rw-r--r-- | media/libmedia/mediaplayer.cpp | 42 | ||||
-rw-r--r-- | media/libmedia/mediarecorder.cpp | 130 |
19 files changed, 224 insertions, 221 deletions
diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp index 6e53a15..6639d06 100644 --- a/media/libmedia/AudioEffect.cpp +++ b/media/libmedia/AudioEffect.cpp @@ -101,18 +101,18 @@ status_t AudioEffect::set(const effect_uuid_t *type, ALOGV("set %p mUserData: %p uuid: %p timeLow %08x", this, user, type, type ? type->timeLow : 0); if (mIEffect != 0) { - LOGW("Effect already in use"); + ALOGW("Effect already in use"); return INVALID_OPERATION; } const sp<IAudioFlinger>& audioFlinger = AudioSystem::get_audio_flinger(); if (audioFlinger == 0) { - LOGE("set(): Could not get audioflinger"); + ALOGE("set(): Could not get audioflinger"); return NO_INIT; } if (type == NULL && uuid == NULL) { - LOGW("Must specify at least type or uuid"); + ALOGW("Must specify at least type or uuid"); return BAD_VALUE; } @@ -138,7 +138,7 @@ status_t AudioEffect::set(const effect_uuid_t *type, mIEffectClient, priority, io, mSessionId, &mStatus, &mId, &enabled); if (iEffect == 0 || (mStatus != NO_ERROR && mStatus != ALREADY_EXISTS)) { - LOGE("set(): AudioFlinger could not create effect, status: %d", mStatus); + ALOGE("set(): AudioFlinger could not create effect, status: %d", mStatus); return mStatus; } @@ -148,7 +148,7 @@ status_t AudioEffect::set(const effect_uuid_t *type, cblk = iEffect->getCblk(); if (cblk == 0) { mStatus = NO_INIT; - LOGE("Could not get control block"); + ALOGE("Could not get control block"); return mStatus; } @@ -340,7 +340,7 @@ status_t AudioEffect::getParameter(effect_param_t *param) void AudioEffect::binderDied() { - LOGW("IEffect died"); + ALOGW("IEffect died"); mStatus = NO_INIT; if (mCbf) { status_t status = DEAD_OBJECT; diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index dd1c6a5..2674070 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -54,12 +54,12 @@ status_t AudioRecord::getMinFrameCount( size_t size = 0; if (AudioSystem::getInputBufferSize(sampleRate, format, channelCount, &size) != NO_ERROR) { - LOGE("AudioSystem could not query the input buffer size."); + ALOGE("AudioSystem could not query the input buffer size."); return NO_INIT; } if (size == 0) { - LOGE("Unsupported configuration: sampleRate %d, format %d, channelCount %d", + ALOGE("Unsupported configuration: sampleRate %d, format %d, channelCount %d", sampleRate, format, channelCount); return BAD_VALUE; } @@ -153,7 +153,7 @@ status_t AudioRecord::set( } // validate parameters if (!audio_is_valid_format(format)) { - LOGE("Invalid format"); + ALOGE("Invalid format"); return BAD_VALUE; } @@ -177,7 +177,7 @@ status_t AudioRecord::set( (audio_in_acoustics_t)flags, mSessionId); if (input == 0) { - LOGE("Could not get audio input for record source %d", inputSource); + ALOGE("Could not get audio input for record source %d", inputSource); return BAD_VALUE; } @@ -292,7 +292,7 @@ status_t AudioRecord::start() if (t != 0) { if (t->exitPending()) { if (t->requestExitAndWait() == WOULD_BLOCK) { - LOGE("AudioRecord::start called from thread"); + ALOGE("AudioRecord::start called from thread"); return WOULD_BLOCK; } } @@ -472,12 +472,12 @@ status_t AudioRecord::openRecord_l( &status); if (record == 0) { - LOGE("AudioFlinger could not create record track, status: %d", status); + ALOGE("AudioFlinger could not create record track, status: %d", status); return status; } sp<IMemory> cblk = record->getCblk(); if (cblk == 0) { - LOGE("Could not get control block"); + ALOGE("Could not get control block"); return NO_INIT; } mAudioRecord.clear(); @@ -535,7 +535,7 @@ status_t AudioRecord::obtainBuffer(Buffer* audioBuffer, int32_t waitCount) if (CC_UNLIKELY(result != NO_ERROR)) { cblk->waitTimeMs += waitTimeMs; if (cblk->waitTimeMs >= cblk->bufferTimeoutMs) { - LOGW( "obtainBuffer timed out (is the CPU pegged?) " + ALOGW( "obtainBuffer timed out (is the CPU pegged?) " "user=%08x, server=%08x", cblk->user, cblk->server); cblk->lock.unlock(); result = mAudioRecord->start(); @@ -546,7 +546,7 @@ create_new_record: result = AudioRecord::restoreRecord_l(cblk); } if (result != NO_ERROR) { - LOGW("obtainBuffer create Track error %d", result); + ALOGW("obtainBuffer create Track error %d", result); cblk->lock.unlock(); return result; } @@ -626,7 +626,7 @@ ssize_t AudioRecord::read(void* buffer, size_t userSize) if (ssize_t(userSize) < 0) { // sanity-check. user is most-likely passing an error code. - LOGE("AudioRecord::read(buffer=%p, size=%u (%d)", + ALOGE("AudioRecord::read(buffer=%p, size=%u (%d)", buffer, userSize, userSize); return BAD_VALUE; } @@ -709,7 +709,7 @@ bool AudioRecord::processAudioBuffer(const sp<ClientRecordThread>& thread) status_t err = obtainBuffer(&audioBuffer, 1); if (err < NO_ERROR) { if (err != TIMED_OUT) { - LOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up."); + ALOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up."); return false; } break; @@ -764,7 +764,7 @@ status_t AudioRecord::restoreRecord_l(audio_track_cblk_t*& cblk) status_t result; if (!(android_atomic_or(CBLK_RESTORING_ON, &cblk->flags) & CBLK_RESTORING_MSK)) { - LOGW("dead IAudioRecord, creating a new one"); + ALOGW("dead IAudioRecord, creating a new one"); // signal old cblk condition so that other threads waiting for available buffers stop // waiting now cblk->cv.broadcast(); @@ -787,13 +787,13 @@ status_t AudioRecord::restoreRecord_l(audio_track_cblk_t*& cblk) cblk->cv.broadcast(); } else { if (!(cblk->flags & CBLK_RESTORED_MSK)) { - LOGW("dead IAudioRecord, waiting for a new one to be created"); + ALOGW("dead IAudioRecord, waiting for a new one to be created"); mLock.unlock(); result = cblk->cv.waitRelative(cblk->lock, milliseconds(RESTORE_TIMEOUT_MS)); cblk->lock.unlock(); mLock.lock(); } else { - LOGW("dead IAudioRecord, already restored"); + ALOGW("dead IAudioRecord, already restored"); result = NO_ERROR; cblk->lock.unlock(); } @@ -810,7 +810,7 @@ status_t AudioRecord::restoreRecord_l(audio_track_cblk_t*& cblk) } cblk->lock.lock(); - LOGW_IF(result != NO_ERROR, "restoreRecord_l() error %d", result); + ALOGW_IF(result != NO_ERROR, "restoreRecord_l() error %d", result); return result; } diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index 61d0dad..f7f129c 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -56,7 +56,7 @@ const sp<IAudioFlinger>& AudioSystem::get_audio_flinger() binder = sm->getService(String16("media.audio_flinger")); if (binder != 0) break; - LOGW("AudioFlinger not published, waiting..."); + ALOGW("AudioFlinger not published, waiting..."); usleep(500000); // 0.5 s } while(true); if (gAudioFlingerClient == NULL) { @@ -70,7 +70,7 @@ const sp<IAudioFlinger>& AudioSystem::get_audio_flinger() gAudioFlinger = interface_cast<IAudioFlinger>(binder); gAudioFlinger->registerClient(gAudioFlingerClient); } - LOGE_IF(gAudioFlinger==0, "no AudioFlinger!?"); + ALOGE_IF(gAudioFlinger==0, "no AudioFlinger!?"); return gAudioFlinger; } @@ -383,7 +383,7 @@ void AudioSystem::AudioFlingerClient::binderDied(const wp<IBinder>& who) { if (gAudioErrorCallback) { gAudioErrorCallback(DEAD_OBJECT); } - LOGW("AudioFlinger server died!"); + ALOGW("AudioFlinger server died!"); } void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, void *param2) { @@ -419,7 +419,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, v } break; case OUTPUT_CLOSED: { if (gOutputs.indexOfKey(ioHandle) < 0) { - LOGW("ioConfigChanged() closing unknow output! %d", ioHandle); + ALOGW("ioConfigChanged() closing unknow output! %d", ioHandle); break; } ALOGV("ioConfigChanged() output %d closed", ioHandle); @@ -435,7 +435,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, v case OUTPUT_CONFIG_CHANGED: { int index = gOutputs.indexOfKey(ioHandle); if (index < 0) { - LOGW("ioConfigChanged() modifying unknow output! %d", ioHandle); + ALOGW("ioConfigChanged() modifying unknow output! %d", ioHandle); break; } if (param2 == 0) break; @@ -491,7 +491,7 @@ const sp<IAudioPolicyService>& AudioSystem::get_audio_policy_service() binder = sm->getService(String16("media.audio_policy")); if (binder != 0) break; - LOGW("AudioPolicyService not published, waiting..."); + ALOGW("AudioPolicyService not published, waiting..."); usleep(500000); // 0.5 s } while(true); if (gAudioPolicyServiceClient == NULL) { @@ -747,7 +747,7 @@ void AudioSystem::AudioPolicyServiceClient::binderDied(const wp<IBinder>& who) { Mutex::Autolock _l(AudioSystem::gLock); AudioSystem::gAudioPolicyService.clear(); - LOGW("AudioPolicyService server died!"); + ALOGW("AudioPolicyService server died!"); } }; // namespace android diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index e0c6ca5..191fbaf 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -158,7 +158,7 @@ status_t AudioTrack::set( AutoMutex lock(mLock); if (mAudioTrack != 0) { - LOGE("Track already in use"); + ALOGE("Track already in use"); return INVALID_OPERATION; } @@ -188,7 +188,7 @@ status_t AudioTrack::set( // validate parameters if (!audio_is_valid_format(format)) { - LOGE("Invalid format"); + ALOGE("Invalid format"); return BAD_VALUE; } @@ -198,7 +198,7 @@ status_t AudioTrack::set( } if (!audio_is_output_channel(channelMask)) { - LOGE("Invalid channel mask"); + ALOGE("Invalid channel mask"); return BAD_VALUE; } uint32_t channelCount = popcount(channelMask); @@ -209,7 +209,7 @@ status_t AudioTrack::set( (audio_policy_output_flags_t)flags); if (output == 0) { - LOGE("Could not get audio output for stream type %d", streamType); + ALOGE("Could not get audio output for stream type %d", streamType); return BAD_VALUE; } @@ -239,7 +239,7 @@ status_t AudioTrack::set( if (cbf != 0) { mAudioTrackThread = new AudioTrackThread(*this, threadCanCallJava); if (mAudioTrackThread == 0) { - LOGE("Could not create callback thread"); + ALOGE("Could not create callback thread"); return NO_INIT; } } @@ -252,7 +252,7 @@ status_t AudioTrack::set( mChannelCount = channelCount; mSharedBuffer = sharedBuffer; mMuted = false; - mActive = 0; + mActive = false; mCbf = cbf; mUserData = user; mLoopCount = 0; @@ -324,7 +324,7 @@ void AudioTrack::start() if (t != 0) { if (t->exitPending()) { if (t->requestExitAndWait() == WOULD_BLOCK) { - LOGE("AudioTrack::start called from thread"); + ALOGE("AudioTrack::start called from thread"); return; } } @@ -338,9 +338,9 @@ void AudioTrack::start() sp <IMemory> iMem = mCblkMemory; audio_track_cblk_t* cblk = mCblk; - if (mActive == 0) { + if (!mActive) { mFlushed = false; - mActive = 1; + mActive = true; mNewPosition = cblk->server + mUpdatePeriod; cblk->lock.lock(); cblk->bufferTimeoutMs = MAX_STARTUP_TIMEOUT_MS; @@ -369,7 +369,7 @@ void AudioTrack::start() cblk->lock.unlock(); if (status != NO_ERROR) { ALOGV("start() failed"); - mActive = 0; + mActive = false; if (t != 0) { t->requestExit(); } else { @@ -394,8 +394,8 @@ void AudioTrack::stop() } AutoMutex lock(mLock); - if (mActive == 1) { - mActive = 0; + if (mActive) { + mActive = false; mCblk->cv.signal(); mAudioTrack->stop(); // Cancel loops (If we are in the middle of a loop, playback @@ -424,7 +424,8 @@ void AudioTrack::stop() bool AudioTrack::stopped() const { - return !mActive; + AutoMutex lock(mLock); + return stopped_l(); } void AudioTrack::flush() @@ -456,8 +457,8 @@ void AudioTrack::pause() { ALOGV("pause"); AutoMutex lock(mLock); - if (mActive == 1) { - mActive = 0; + if (mActive) { + mActive = false; mAudioTrack->pause(); } } @@ -566,12 +567,12 @@ status_t AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCou if (loopStart >= loopEnd || loopEnd - loopStart > cblk->frameCount || cblk->server > loopStart) { - LOGE("setLoop invalid value: loopStart %d, loopEnd %d, loopCount %d, framecount %d, user %d", loopStart, loopEnd, loopCount, cblk->frameCount, cblk->user); + ALOGE("setLoop invalid value: loopStart %d, loopEnd %d, loopCount %d, framecount %d, user %d", loopStart, loopEnd, loopCount, cblk->frameCount, cblk->user); return BAD_VALUE; } if ((mSharedBuffer != 0) && (loopEnd > cblk->frameCount)) { - LOGE("setLoop invalid value: loop markers beyond data: loopStart %d, loopEnd %d, framecount %d", + ALOGE("setLoop invalid value: loop markers beyond data: loopStart %d, loopEnd %d, framecount %d", loopStart, loopEnd, cblk->frameCount); return BAD_VALUE; } @@ -647,9 +648,10 @@ status_t AudioTrack::getPositionUpdatePeriod(uint32_t *updatePeriod) status_t AudioTrack::setPosition(uint32_t position) { AutoMutex lock(mLock); - Mutex::Autolock _l(mCblk->lock); - if (!stopped()) return INVALID_OPERATION; + if (!stopped_l()) return INVALID_OPERATION; + + Mutex::Autolock _l(mCblk->lock); if (position > mCblk->user) return BAD_VALUE; @@ -672,7 +674,7 @@ status_t AudioTrack::reload() { AutoMutex lock(mLock); - if (!stopped()) return INVALID_OPERATION; + if (!stopped_l()) return INVALID_OPERATION; flush_l(); @@ -726,7 +728,7 @@ status_t AudioTrack::createTrack_l( status_t status; const sp<IAudioFlinger>& audioFlinger = AudioSystem::get_audio_flinger(); if (audioFlinger == 0) { - LOGE("Could not get audioflinger"); + ALOGE("Could not get audioflinger"); return NO_INIT; } @@ -769,7 +771,7 @@ status_t AudioTrack::createTrack_l( } if (frameCount < minFrameCount) { if (enforceFrameCount) { - LOGE("Invalid buffer size: minFrameCount %d, frameCount %d", minFrameCount, frameCount); + ALOGE("Invalid buffer size: minFrameCount %d, frameCount %d", minFrameCount, frameCount); return BAD_VALUE; } else { frameCount = minFrameCount; @@ -779,7 +781,7 @@ status_t AudioTrack::createTrack_l( // Ensure that buffer alignment matches channelcount int channelCount = popcount(channelMask); if (((uint32_t)sharedBuffer->pointer() & (channelCount | 1)) != 0) { - LOGE("Invalid buffer alignement: address %p, channelCount %d", sharedBuffer->pointer(), channelCount); + ALOGE("Invalid buffer alignement: address %p, channelCount %d", sharedBuffer->pointer(), channelCount); return BAD_VALUE; } frameCount = sharedBuffer->size()/channelCount/sizeof(int16_t); @@ -799,12 +801,12 @@ status_t AudioTrack::createTrack_l( &status); if (track == 0) { - LOGE("AudioFlinger could not create track, status: %d", status); + ALOGE("AudioFlinger could not create track, status: %d", status); return status; } sp<IMemory> cblk = track->getCblk(); if (cblk == 0) { - LOGE("Could not get control block"); + ALOGE("Could not get control block"); return NO_INIT; } mAudioTrack = track; @@ -832,7 +834,7 @@ status_t AudioTrack::createTrack_l( status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, int32_t waitCount) { AutoMutex lock(mLock); - int active; + bool active; status_t result = NO_ERROR; audio_track_cblk_t* cblk = mCblk; uint32_t framesReq = audioBuffer->frameCount; @@ -868,7 +870,7 @@ status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, int32_t waitCount) result = cblk->cv.waitRelative(cblk->lock, milliseconds(waitTimeMs)); cblk->lock.unlock(); mLock.lock(); - if (mActive == 0) { + if (!mActive) { return status_t(STOPPED); } cblk->lock.lock(); @@ -883,7 +885,7 @@ status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, int32_t waitCount) // timing out when a loop has been set and we have already written upto loop end // is a normal condition: no need to wake AudioFlinger up. if (cblk->user < cblk->loopEnd) { - LOGW( "obtainBuffer timed out (is the CPU pegged?) %p " + ALOGW( "obtainBuffer timed out (is the CPU pegged?) %p " "user=%08x, server=%08x", this, cblk->user, cblk->server); //unlock cblk mutex before calling mAudioTrack->start() (see issue #1617140) cblk->lock.unlock(); @@ -895,7 +897,7 @@ create_new_track: result = restoreTrack_l(cblk, false); } if (result != NO_ERROR) { - LOGW("obtainBuffer create Track error %d", result); + ALOGW("obtainBuffer create Track error %d", result); cblk->lock.unlock(); return result; } @@ -918,7 +920,7 @@ create_new_track: // restart track if it was disabled by audioflinger due to previous underrun if (mActive && (cblk->flags & CBLK_DISABLED_MSK)) { android_atomic_and(~CBLK_DISABLED_ON, &cblk->flags); - LOGW("obtainBuffer() track %p disabled, restarting", this); + ALOGW("obtainBuffer() track %p disabled, restarting", this); mAudioTrack->start(); } @@ -964,7 +966,7 @@ ssize_t AudioTrack::write(const void* buffer, size_t userSize) if (ssize_t(userSize) < 0) { // sanity-check. user is most-likely passing an error code. - LOGE("AudioTrack::write(buffer=%p, size=%u (%d)", + ALOGE("AudioTrack::write(buffer=%p, size=%u (%d)", buffer, userSize, userSize); return BAD_VALUE; } @@ -1035,10 +1037,11 @@ bool AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread) sp <IAudioTrack> audioTrack = mAudioTrack; sp <IMemory> iMem = mCblkMemory; audio_track_cblk_t* cblk = mCblk; + bool active = mActive; mLock.unlock(); // Manage underrun callback - if (mActive && (cblk->framesAvailable() == cblk->frameCount)) { + if (active && (cblk->framesAvailable() == cblk->frameCount)) { ALOGV("Underrun user: %x, server: %x, flags %04x", cblk->user, cblk->server, cblk->flags); if (!(android_atomic_or(CBLK_UNDERRUN_ON, &cblk->flags) & CBLK_UNDERRUN_MSK)) { mCbf(EVENT_UNDERRUN, mUserData, 0); @@ -1096,7 +1099,7 @@ bool AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread) status_t err = obtainBuffer(&audioBuffer, waitCount); if (err < NO_ERROR) { if (err != TIMED_OUT) { - LOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up."); + ALOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up."); return false; } break; @@ -1164,7 +1167,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) status_t result; if (!(android_atomic_or(CBLK_RESTORING_ON, &cblk->flags) & CBLK_RESTORING_MSK)) { - LOGW("dead IAudioTrack, creating a new one from %s TID %d", + ALOGW("dead IAudioTrack, creating a new one from %s TID %d", fromStart ? "start()" : "obtainBuffer()", gettid()); // signal old cblk condition so that other threads waiting for available buffers stop @@ -1220,7 +1223,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) } if (mActive) { result = mAudioTrack->start(); - LOGW_IF(result != NO_ERROR, "restoreTrack_l() start() failed status %d", result); + ALOGW_IF(result != NO_ERROR, "restoreTrack_l() start() failed status %d", result); } if (fromStart && result == NO_ERROR) { mNewPosition = mCblk->server + mUpdatePeriod; @@ -1228,7 +1231,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) } if (result != NO_ERROR) { android_atomic_and(~CBLK_RESTORING_ON, &cblk->flags); - LOGW_IF(result != NO_ERROR, "restoreTrack_l() failed status %d", result); + ALOGW_IF(result != NO_ERROR, "restoreTrack_l() failed status %d", result); } mRestoreStatus = result; // signal old cblk condition for other threads waiting for restore completion @@ -1236,7 +1239,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) cblk->cv.broadcast(); } else { if (!(cblk->flags & CBLK_RESTORED_MSK)) { - LOGW("dead IAudioTrack, waiting for a new one TID %d", gettid()); + ALOGW("dead IAudioTrack, waiting for a new one TID %d", gettid()); mLock.unlock(); result = cblk->cv.waitRelative(cblk->lock, milliseconds(RESTORE_TIMEOUT_MS)); if (result == NO_ERROR) { @@ -1245,7 +1248,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) cblk->lock.unlock(); mLock.lock(); } else { - LOGW("dead IAudioTrack, already restored TID %d", gettid()); + ALOGW("dead IAudioTrack, already restored TID %d", gettid()); result = mRestoreStatus; cblk->lock.unlock(); } @@ -1259,7 +1262,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) } cblk->lock.lock(); - LOGW_IF(result != NO_ERROR, "restoreTrack_l() error %d TID %d", result, gettid()); + ALOGW_IF(result != NO_ERROR, "restoreTrack_l() error %d TID %d", result, gettid()); return result; } @@ -1328,7 +1331,7 @@ uint32_t audio_track_cblk_t::stepUser(uint32_t frameCount) bufferTimeoutMs = MAX_RUN_TIMEOUT_MS; } } else if (u > server) { - LOGW("stepServer occurred after track reset"); + ALOGW("stepServer occurred after track reset"); u = server; } @@ -1349,7 +1352,7 @@ uint32_t audio_track_cblk_t::stepUser(uint32_t frameCount) bool audio_track_cblk_t::stepServer(uint32_t frameCount) { if (!tryLock()) { - LOGW("stepServer() could not lock cblk"); + ALOGW("stepServer() could not lock cblk"); return false; } @@ -1367,13 +1370,13 @@ bool audio_track_cblk_t::stepServer(uint32_t frameCount) // stepServer() is called After the flush() has reset u & s and // we have s > u if (s > user) { - LOGW("stepServer occurred after track reset"); + ALOGW("stepServer occurred after track reset"); s = user; } } if (s >= loopEnd) { - LOGW_IF(s > loopEnd, "stepServer: s %u > loopEnd %u", s, loopEnd); + ALOGW_IF(s > loopEnd, "stepServer: s %u > loopEnd %u", s, loopEnd); s = loopStart; if (--loopCount == 0) { loopEnd = UINT_MAX; @@ -1428,7 +1431,7 @@ uint32_t audio_track_cblk_t::framesReady() } else { // do not block on mutex shared with client on AudioFlinger side if (!tryLock()) { - LOGW("framesReady() could not lock cblk"); + ALOGW("framesReady() could not lock cblk"); return 0; } uint32_t frames = UINT_MAX; diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index bedf8d3..abd491f 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -112,7 +112,7 @@ public: data.writeInt32(lSessionId); status_t lStatus = remote()->transact(CREATE_TRACK, data, &reply); if (lStatus != NO_ERROR) { - LOGE("createTrack error: %s", strerror(-lStatus)); + ALOGE("createTrack error: %s", strerror(-lStatus)); } else { lSessionId = reply.readInt32(); if (sessionId != NULL) { @@ -155,7 +155,7 @@ public: data.writeInt32(lSessionId); status_t lStatus = remote()->transact(OPEN_RECORD, data, &reply); if (lStatus != NO_ERROR) { - LOGE("openRecord error: %s", strerror(-lStatus)); + ALOGE("openRecord error: %s", strerror(-lStatus)); } else { lSessionId = reply.readInt32(); if (sessionId != NULL) { @@ -632,7 +632,7 @@ public: status_t lStatus = remote()->transact(CREATE_EFFECT, data, &reply); if (lStatus != NO_ERROR) { - LOGE("createEffect error: %s", strerror(-lStatus)); + ALOGE("createEffect error: %s", strerror(-lStatus)); } else { lStatus = reply.readInt32(); int tmp = reply.readInt32(); diff --git a/media/libmedia/IAudioRecord.cpp b/media/libmedia/IAudioRecord.cpp index ba0d55b..8c7a960 100644 --- a/media/libmedia/IAudioRecord.cpp +++ b/media/libmedia/IAudioRecord.cpp @@ -50,7 +50,7 @@ public: if (status == NO_ERROR) { status = reply.readInt32(); } else { - LOGW("start() error: %s", strerror(-status)); + ALOGW("start() error: %s", strerror(-status)); } return status; } diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp index 0791437..e618619 100644 --- a/media/libmedia/IAudioTrack.cpp +++ b/media/libmedia/IAudioTrack.cpp @@ -66,7 +66,7 @@ public: if (status == NO_ERROR) { status = reply.readInt32(); } else { - LOGW("start() error: %s", strerror(-status)); + ALOGW("start() error: %s", strerror(-status)); } return status; } @@ -109,7 +109,7 @@ public: if (status == NO_ERROR) { status = reply.readInt32(); } else { - LOGW("attachAuxEffect() error: %s", strerror(-status)); + ALOGW("attachAuxEffect() error: %s", strerror(-status)); } return status; } diff --git a/media/libmedia/IMediaDeathNotifier.cpp b/media/libmedia/IMediaDeathNotifier.cpp index da33edb..8525482 100644 --- a/media/libmedia/IMediaDeathNotifier.cpp +++ b/media/libmedia/IMediaDeathNotifier.cpp @@ -44,7 +44,7 @@ IMediaDeathNotifier::getMediaPlayerService() if (binder != 0) { break; } - LOGW("Media player service not published, waiting..."); + ALOGW("Media player service not published, waiting..."); usleep(500000); // 0.5 s } while(true); @@ -54,7 +54,7 @@ IMediaDeathNotifier::getMediaPlayerService() binder->linkToDeath(sDeathNotifier); sMediaPlayerService = interface_cast<IMediaPlayerService>(binder); } - LOGE_IF(sMediaPlayerService == 0, "no media player service!?"); + ALOGE_IF(sMediaPlayerService == 0, "no media player service!?"); return sMediaPlayerService; } @@ -76,7 +76,7 @@ IMediaDeathNotifier::removeObitRecipient(const wp<IMediaDeathNotifier>& recipien void IMediaDeathNotifier::DeathNotifier::binderDied(const wp<IBinder>& who) { - LOGW("media server died"); + ALOGW("media server died"); // Need to do this with the lock held SortedVector< wp<IMediaDeathNotifier> > list; diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp index 7d2fbce..d2f5f71 100644 --- a/media/libmedia/IOMX.cpp +++ b/media/libmedia/IOMX.cpp @@ -407,7 +407,7 @@ IMPLEMENT_META_INTERFACE(OMX, "android.hardware.IOMX"); #define CHECK_INTERFACE(interface, data, reply) \ do { if (!data.enforceInterface(interface::getInterfaceDescriptor())) { \ - LOGW("Call incorrectly routed to " #interface); \ + ALOGW("Call incorrectly routed to " #interface); \ return PERMISSION_DENIED; \ } } while (0) diff --git a/media/libmedia/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp index afa84b7..188e582 100644 --- a/media/libmedia/JetPlayer.cpp +++ b/media/libmedia/JetPlayer.cpp @@ -68,21 +68,21 @@ int JetPlayer::init() if (pLibConfig == NULL) pLibConfig = EAS_Config(); if (pLibConfig == NULL) { - LOGE("JetPlayer::init(): EAS library configuration could not be retrieved, aborting."); + ALOGE("JetPlayer::init(): EAS library configuration could not be retrieved, aborting."); return EAS_FAILURE; } // init the EAS library result = EAS_Init(&mEasData); if( result != EAS_SUCCESS) { - LOGE("JetPlayer::init(): Error initializing Sonivox EAS library, aborting."); + ALOGE("JetPlayer::init(): Error initializing Sonivox EAS library, aborting."); mState = EAS_STATE_ERROR; return result; } // init the JET library with the default app event controller range result = JET_Init(mEasData, NULL, sizeof(S_JET_CONFIG)); if( result != EAS_SUCCESS) { - LOGE("JetPlayer::init(): Error initializing JET library, aborting."); + ALOGE("JetPlayer::init(): Error initializing JET library, aborting."); mState = EAS_STATE_ERROR; return result; } @@ -109,7 +109,7 @@ int JetPlayer::init() ALOGV("JetPlayer::init(): render thread(%d) successfully started.", mTid); mState = EAS_STATE_READY; } else { - LOGE("JetPlayer::init(): failed to start render thread."); + ALOGE("JetPlayer::init(): failed to start render thread."); mState = EAS_STATE_ERROR; return EAS_FAILURE; } @@ -169,7 +169,7 @@ int JetPlayer::render() { mAudioBuffer = new EAS_PCM[pLibConfig->mixBufferSize * pLibConfig->numChannels * MIX_NUM_BUFFERS]; if (!mAudioBuffer) { - LOGE("JetPlayer::render(): mAudioBuffer allocate failed"); + ALOGE("JetPlayer::render(): mAudioBuffer allocate failed"); goto threadExit; } @@ -210,7 +210,7 @@ int JetPlayer::render() { for (int i = 0; i < MIX_NUM_BUFFERS; i++) { result = EAS_Render(mEasData, p, pLibConfig->mixBufferSize, &count); if (result != EAS_SUCCESS) { - LOGE("JetPlayer::render(): EAS_Render returned error %ld", result); + ALOGE("JetPlayer::render(): EAS_Render returned error %ld", result); } p += count * pLibConfig->numChannels; num_output += count * pLibConfig->numChannels * sizeof(EAS_PCM); @@ -229,14 +229,14 @@ int JetPlayer::render() { // check audio output track if (mAudioTrack == NULL) { - LOGE("JetPlayer::render(): output AudioTrack was not created"); + ALOGE("JetPlayer::render(): output AudioTrack was not created"); goto threadExit; } // Write data to the audio hardware //ALOGV("JetPlayer::render(): writing to audio output"); if ((temp = mAudioTrack->write(mAudioBuffer, num_output)) < 0) { - LOGE("JetPlayer::render(): Error in writing:%d",temp); + ALOGE("JetPlayer::render(): Error in writing:%d",temp); return temp; } @@ -469,7 +469,7 @@ int JetPlayer::clearQueue() //------------------------------------------------------------------------------------------------- void JetPlayer::dump() { - LOGE("JetPlayer dump: JET file=%s", mEasJetFileLoc->path); + ALOGE("JetPlayer dump: JET file=%s", mEasJetFileLoc->path); } void JetPlayer::dumpJetStatus(S_JET_STATUS* pJetStatus) @@ -479,7 +479,7 @@ void JetPlayer::dumpJetStatus(S_JET_STATUS* pJetStatus) pJetStatus->currentUserID, pJetStatus->segmentRepeatCount, pJetStatus->numQueuedSegments, pJetStatus->paused); else - LOGE(">> JET player status is NULL"); + ALOGE(">> JET player status is NULL"); } diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp index 109f294..c905762 100644 --- a/media/libmedia/MediaProfiles.cpp +++ b/media/libmedia/MediaProfiles.cpp @@ -620,7 +620,7 @@ MediaProfiles::getInstance() const char *defaultXmlFile = "/etc/media_profiles.xml"; FILE *fp = fopen(defaultXmlFile, "r"); if (fp == NULL) { - LOGW("could not find media config xml file"); + ALOGW("could not find media config xml file"); sInstance = createDefaultInstance(); } else { fclose(fp); // close the file first. @@ -903,7 +903,7 @@ MediaProfiles::createInstanceFromXmlFile(const char *xml) expat is not compiled with -DXML_DTD. We don't have DTD parsing support. if (!::XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS)) { - LOGE("failed to enable DTD support in the xml file"); + ALOGE("failed to enable DTD support in the xml file"); return UNKNOWN_ERROR; } @@ -913,7 +913,7 @@ MediaProfiles::createInstanceFromXmlFile(const char *xml) for (;;) { void *buff = ::XML_GetBuffer(parser, BUFF_SIZE); if (buff == NULL) { - LOGE("failed to in call to XML_GetBuffer()"); + ALOGE("failed to in call to XML_GetBuffer()"); delete profiles; profiles = NULL; goto exit; @@ -921,7 +921,7 @@ MediaProfiles::createInstanceFromXmlFile(const char *xml) int bytes_read = ::fread(buff, 1, BUFF_SIZE, fp); if (bytes_read < 0) { - LOGE("failed in call to read"); + ALOGE("failed in call to read"); delete profiles; profiles = NULL; goto exit; @@ -963,7 +963,7 @@ int MediaProfiles::getVideoEncoderParamByName(const char *name, video_encoder co } } if (index == -1) { - LOGE("The given video encoder %d is not found", codec); + ALOGE("The given video encoder %d is not found", codec); return -1; } @@ -976,7 +976,7 @@ int MediaProfiles::getVideoEncoderParamByName(const char *name, video_encoder co if (!strcmp("enc.vid.fps.min", name)) return mVideoEncoders[index]->mMinFrameRate; if (!strcmp("enc.vid.fps.max", name)) return mVideoEncoders[index]->mMaxFrameRate; - LOGE("The given video encoder param name %s is not found", name); + ALOGE("The given video encoder param name %s is not found", name); return -1; } int MediaProfiles::getVideoEditorExportParamByName( @@ -993,7 +993,7 @@ int MediaProfiles::getVideoEditorExportParamByName( } } if (index == -1) { - LOGE("The given video decoder %d is not found", codec); + ALOGE("The given video decoder %d is not found", codec); return -1; } if (!strcmp("videoeditor.export.profile", name)) @@ -1001,7 +1001,7 @@ int MediaProfiles::getVideoEditorExportParamByName( if (!strcmp("videoeditor.export.level", name)) return exportProfile->mLevel; - LOGE("The given video editor export param name %s is not found", name); + ALOGE("The given video editor export param name %s is not found", name); return -1; } int MediaProfiles::getVideoEditorCapParamByName(const char *name) const @@ -1009,7 +1009,7 @@ int MediaProfiles::getVideoEditorCapParamByName(const char *name) const ALOGV("getVideoEditorCapParamByName: %s", name); if (mVideoEditorCap == NULL) { - LOGE("The mVideoEditorCap is not created, then create default cap."); + ALOGE("The mVideoEditorCap is not created, then create default cap."); createDefaultVideoEditorCap(sInstance); } @@ -1024,7 +1024,7 @@ int MediaProfiles::getVideoEditorCapParamByName(const char *name) const if (!strcmp("maxPrefetchYUVFrames", name)) return mVideoEditorCap->mMaxPrefetchYUVFrames; - LOGE("The given video editor param name %s is not found", name); + ALOGE("The given video editor param name %s is not found", name); return -1; } @@ -1048,7 +1048,7 @@ int MediaProfiles::getAudioEncoderParamByName(const char *name, audio_encoder co } } if (index == -1) { - LOGE("The given audio encoder %d is not found", codec); + ALOGE("The given audio encoder %d is not found", codec); return -1; } @@ -1059,7 +1059,7 @@ int MediaProfiles::getAudioEncoderParamByName(const char *name, audio_encoder co if (!strcmp("enc.aud.hz.min", name)) return mAudioEncoders[index]->mMinSampleRate; if (!strcmp("enc.aud.hz.max", name)) return mAudioEncoders[index]->mMaxSampleRate; - LOGE("The given audio encoder param name %s is not found", name); + ALOGE("The given audio encoder param name %s is not found", name); return -1; } @@ -1103,7 +1103,7 @@ int MediaProfiles::getCamcorderProfileParamByName(const char *name, int index = getCamcorderProfileIndex(cameraId, quality); if (index == -1) { - LOGE("The given camcorder profile camera %d quality %d is not found", + ALOGE("The given camcorder profile camera %d quality %d is not found", cameraId, quality); return -1; } @@ -1120,7 +1120,7 @@ int MediaProfiles::getCamcorderProfileParamByName(const char *name, if (!strcmp("aud.ch", name)) return mCamcorderProfiles[index]->mAudioCodec->mChannels; if (!strcmp("aud.hz", name)) return mCamcorderProfiles[index]->mAudioCodec->mSampleRate; - LOGE("The given camcorder profile param id %d name %s is not found", cameraId, name); + ALOGE("The given camcorder profile param id %d name %s is not found", cameraId, name); return -1; } diff --git a/media/libmedia/MediaScanner.cpp b/media/libmedia/MediaScanner.cpp index cda185f..79cab74 100644 --- a/media/libmedia/MediaScanner.cpp +++ b/media/libmedia/MediaScanner.cpp @@ -153,7 +153,7 @@ MediaScanResult MediaScanner::doProcessDirectory( DIR* dir = opendir(path); if (!dir) { - LOGW("Error opening directory '%s', skipping: %s.", path, strerror(errno)); + ALOGW("Error opening directory '%s', skipping: %s.", path, strerror(errno)); return MEDIA_SCAN_RESULT_SKIPPED; } diff --git a/media/libmedia/MediaScannerClient.cpp b/media/libmedia/MediaScannerClient.cpp index 629b165..40b8188 100644 --- a/media/libmedia/MediaScannerClient.cpp +++ b/media/libmedia/MediaScannerClient.cpp @@ -142,12 +142,12 @@ void MediaScannerClient::convertValues(uint32_t encoding) UConverter *conv = ucnv_open(enc, &status); if (U_FAILURE(status)) { - LOGE("could not create UConverter for %s\n", enc); + ALOGE("could not create UConverter for %s\n", enc); return; } UConverter *utf8Conv = ucnv_open("UTF-8", &status); if (U_FAILURE(status)) { - LOGE("could not create UConverter for UTF-8\n"); + ALOGE("could not create UConverter for UTF-8\n"); ucnv_close(conv); return; } @@ -180,7 +180,7 @@ void MediaScannerClient::convertValues(uint32_t encoding) ucnv_convertEx(utf8Conv, conv, &target, target + targetLength, &source, (const char *)dest, NULL, NULL, NULL, NULL, TRUE, TRUE, &status); if (U_FAILURE(status)) { - LOGE("ucnv_convertEx failed: %d\n", status); + ALOGE("ucnv_convertEx failed: %d\n", status); mValues->setEntry(i, "???"); } else { // zero terminate diff --git a/media/libmedia/Metadata.cpp b/media/libmedia/Metadata.cpp index 8eeebbb..546a9b0 100644 --- a/media/libmedia/Metadata.cpp +++ b/media/libmedia/Metadata.cpp @@ -135,7 +135,7 @@ bool Metadata::checkKey(int key) { if (key < FIRST_SYSTEM_ID || (LAST_SYSTEM_ID < key && key < FIRST_CUSTOM_ID)) { - LOGE("Bad key %d", key); + ALOGE("Bad key %d", key); return false; } size_t curr = mData->dataPosition(); @@ -152,7 +152,7 @@ bool Metadata::checkKey(int key) break; } if (mData->readInt32() == key) { - LOGE("Key exists already %d", key); + ALOGE("Key exists already %d", key); error = true; break; } diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index 28b54b5..35dfbb8 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -805,7 +805,7 @@ ToneGenerator::ToneGenerator(int streamType, float volume, bool threadCanCallJav mState = TONE_IDLE; if (AudioSystem::getOutputSamplingRate(&mSamplingRate, streamType) != NO_ERROR) { - LOGE("Unable to marshal AudioFlinger"); + ALOGE("Unable to marshal AudioFlinger"); return; } mThreadCanCallJava = threadCanCallJava; @@ -906,7 +906,7 @@ bool ToneGenerator::startTone(int toneType, int durationMs) { ALOGV("Start waiting for previous tone to stop"); lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3)); if (lStatus != NO_ERROR) { - LOGE("--- start wait for stop timed out, status %d", lStatus); + ALOGE("--- start wait for stop timed out, status %d", lStatus); mState = TONE_IDLE; mLock.unlock(); return lResult; @@ -925,7 +925,7 @@ bool ToneGenerator::startTone(int toneType, int durationMs) { ALOGV("Wait for start callback"); lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3)); if (lStatus != NO_ERROR) { - LOGE("--- Immediate start timed out, status %d", lStatus); + ALOGE("--- Immediate start timed out, status %d", lStatus); mState = TONE_IDLE; lResult = false; } @@ -943,14 +943,14 @@ bool ToneGenerator::startTone(int toneType, int durationMs) { } ALOGV("cond received"); } else { - LOGE("--- Delayed start timed out, status %d", lStatus); + ALOGE("--- Delayed start timed out, status %d", lStatus); mState = TONE_IDLE; } } mLock.unlock(); ALOGV_IF(lResult, "Tone started, time %d\n", (unsigned int)(systemTime()/1000000)); - LOGW_IF(!lResult, "Tone start failed!!!, time %d\n", (unsigned int)(systemTime()/1000000)); + ALOGW_IF(!lResult, "Tone start failed!!!, time %d\n", (unsigned int)(systemTime()/1000000)); return lResult; } @@ -979,7 +979,7 @@ void ToneGenerator::stopTone() { if (lStatus == NO_ERROR) { ALOGV("track stop complete, time %d", (unsigned int)(systemTime()/1000000)); } else { - LOGE("--- Stop timed out"); + ALOGE("--- Stop timed out"); mState = TONE_IDLE; mpAudioTrack->stop(); } @@ -1018,7 +1018,7 @@ bool ToneGenerator::initAudioTrack() { // Open audio track in mono, PCM 16bit, default sampling rate, default buffer size mpAudioTrack = new AudioTrack(); if (mpAudioTrack == 0) { - LOGE("AudioTrack allocation failed"); + ALOGE("AudioTrack allocation failed"); goto initAudioTrack_exit; } ALOGV("Create Track: %p\n", mpAudioTrack); @@ -1036,7 +1036,7 @@ bool ToneGenerator::initAudioTrack() { mThreadCanCallJava); if (mpAudioTrack->initCheck() != NO_ERROR) { - LOGE("AudioTrack->initCheck failed"); + ALOGE("AudioTrack->initCheck failed"); goto initAudioTrack_exit; } @@ -1261,7 +1261,7 @@ audioCallback_EndLoop: // must reload lpToneDesc as prepareWave() may change mpToneDesc lpToneDesc = lpToneGen->mpToneDesc; } else { - LOGW("Cbk restarting prepareWave() failed\n"); + ALOGW("Cbk restarting prepareWave() failed\n"); lpToneGen->mState = TONE_IDLE; lpToneGen->mpAudioTrack->stop(); // Force loop exit diff --git a/media/libmedia/Visualizer.cpp b/media/libmedia/Visualizer.cpp index de40f98..d08ffa5 100644 --- a/media/libmedia/Visualizer.cpp +++ b/media/libmedia/Visualizer.cpp @@ -61,7 +61,7 @@ status_t Visualizer::setEnabled(bool enabled) if (enabled) { if (t->exitPending()) { if (t->requestExitAndWait() == WOULD_BLOCK) { - LOGE("Visualizer::enable() called from thread"); + ALOGE("Visualizer::enable() called from thread"); return INVALID_OPERATION; } } @@ -116,7 +116,7 @@ status_t Visualizer::setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t if (cbk != NULL) { mCaptureThread = new CaptureThread(*this, rate, ((flags & CAPTURE_CALL_JAVA) != 0)); if (mCaptureThread == 0) { - LOGE("Could not create callback thread"); + ALOGE("Could not create callback thread"); return NO_INIT; } } diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp index fd8c065..88e269f 100644 --- a/media/libmedia/mediametadataretriever.cpp +++ b/media/libmedia/mediametadataretriever.cpp @@ -43,7 +43,7 @@ const sp<IMediaPlayerService>& MediaMetadataRetriever::getService() if (binder != 0) { break; } - LOGW("MediaPlayerService not published, waiting..."); + ALOGW("MediaPlayerService not published, waiting..."); usleep(500000); // 0.5 s } while(true); if (sDeathNotifier == NULL) { @@ -52,7 +52,7 @@ const sp<IMediaPlayerService>& MediaMetadataRetriever::getService() binder->linkToDeath(sDeathNotifier); sService = interface_cast<IMediaPlayerService>(binder); } - LOGE_IF(sService == 0, "no MediaPlayerService!?"); + ALOGE_IF(sService == 0, "no MediaPlayerService!?"); return sService; } @@ -61,12 +61,12 @@ MediaMetadataRetriever::MediaMetadataRetriever() ALOGV("constructor"); const sp<IMediaPlayerService>& service(getService()); if (service == 0) { - LOGE("failed to obtain MediaMetadataRetrieverService"); + ALOGE("failed to obtain MediaMetadataRetrieverService"); return; } sp<IMediaMetadataRetriever> retriever(service->createMetadataRetriever(getpid())); if (retriever == 0) { - LOGE("failed to create IMediaMetadataRetriever object from server"); + ALOGE("failed to create IMediaMetadataRetriever object from server"); } mRetriever = retriever; } @@ -98,11 +98,11 @@ status_t MediaMetadataRetriever::setDataSource( ALOGV("setDataSource"); Mutex::Autolock _l(mLock); if (mRetriever == 0) { - LOGE("retriever is not initialized"); + ALOGE("retriever is not initialized"); return INVALID_OPERATION; } if (srcUrl == NULL) { - LOGE("data source is a null pointer"); + ALOGE("data source is a null pointer"); return UNKNOWN_ERROR; } ALOGV("data source (%s)", srcUrl); @@ -114,11 +114,11 @@ status_t MediaMetadataRetriever::setDataSource(int fd, int64_t offset, int64_t l ALOGV("setDataSource(%d, %lld, %lld)", fd, offset, length); Mutex::Autolock _l(mLock); if (mRetriever == 0) { - LOGE("retriever is not initialized"); + ALOGE("retriever is not initialized"); return INVALID_OPERATION; } if (fd < 0 || offset < 0 || length < 0) { - LOGE("Invalid negative argument"); + ALOGE("Invalid negative argument"); return UNKNOWN_ERROR; } return mRetriever->setDataSource(fd, offset, length); @@ -129,7 +129,7 @@ sp<IMemory> MediaMetadataRetriever::getFrameAtTime(int64_t timeUs, int option) ALOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option); Mutex::Autolock _l(mLock); if (mRetriever == 0) { - LOGE("retriever is not initialized"); + ALOGE("retriever is not initialized"); return NULL; } return mRetriever->getFrameAtTime(timeUs, option); @@ -140,7 +140,7 @@ const char* MediaMetadataRetriever::extractMetadata(int keyCode) ALOGV("extractMetadata(%d)", keyCode); Mutex::Autolock _l(mLock); if (mRetriever == 0) { - LOGE("retriever is not initialized"); + ALOGE("retriever is not initialized"); return NULL; } return mRetriever->extractMetadata(keyCode); @@ -151,7 +151,7 @@ sp<IMemory> MediaMetadataRetriever::extractAlbumArt() ALOGV("extractAlbumArt"); Mutex::Autolock _l(mLock); if (mRetriever == 0) { - LOGE("retriever is not initialized"); + ALOGE("retriever is not initialized"); return NULL; } return mRetriever->extractAlbumArt(); @@ -160,7 +160,7 @@ sp<IMemory> MediaMetadataRetriever::extractAlbumArt() void MediaMetadataRetriever::DeathNotifier::binderDied(const wp<IBinder>& who) { Mutex::Autolock lock(MediaMetadataRetriever::sServiceLock); MediaMetadataRetriever::sService.clear(); - LOGW("MediaMetadataRetriever server died!"); + ALOGW("MediaMetadataRetriever server died!"); } MediaMetadataRetriever::DeathNotifier::~DeathNotifier() diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 695c4a8..2284927 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -115,7 +115,7 @@ status_t MediaPlayer::attachNewPlayer(const sp<IMediaPlayer>& player) if ( !( (mCurrentState & MEDIA_PLAYER_IDLE) || (mCurrentState == MEDIA_PLAYER_STATE_ERROR ) ) ) { - LOGE("attachNewPlayer called in state %d", mCurrentState); + ALOGE("attachNewPlayer called in state %d", mCurrentState); return INVALID_OPERATION; } @@ -126,7 +126,7 @@ status_t MediaPlayer::attachNewPlayer(const sp<IMediaPlayer>& player) mCurrentState = MEDIA_PLAYER_INITIALIZED; err = NO_ERROR; } else { - LOGE("Unable to to create media player"); + ALOGE("Unable to to create media player"); } } @@ -195,7 +195,7 @@ status_t MediaPlayer::invoke(const Parcel& request, Parcel *reply) ALOGV("invoke %d", request.dataSize()); return mPlayer->invoke(request, reply); } - LOGE("invoke failed: wrong state %X", mCurrentState); + ALOGE("invoke failed: wrong state %X", mCurrentState); return INVALID_OPERATION; } @@ -236,7 +236,7 @@ status_t MediaPlayer::prepareAsync_l() mCurrentState = MEDIA_PLAYER_PREPARING; return mPlayer->prepareAsync(); } - LOGE("prepareAsync called in state %d", mCurrentState); + ALOGE("prepareAsync called in state %d", mCurrentState); return INVALID_OPERATION; } @@ -298,7 +298,7 @@ status_t MediaPlayer::start() } return ret; } - LOGE("start called in state %d", mCurrentState); + ALOGE("start called in state %d", mCurrentState); return INVALID_OPERATION; } @@ -317,7 +317,7 @@ status_t MediaPlayer::stop() } return ret; } - LOGE("stop called in state %d", mCurrentState); + ALOGE("stop called in state %d", mCurrentState); return INVALID_OPERATION; } @@ -336,7 +336,7 @@ status_t MediaPlayer::pause() } return ret; } - LOGE("pause called in state %d", mCurrentState); + ALOGE("pause called in state %d", mCurrentState); return INVALID_OPERATION; } @@ -348,7 +348,7 @@ bool MediaPlayer::isPlaying() mPlayer->isPlaying(&temp); ALOGV("isPlaying: %d", temp); if ((mCurrentState & MEDIA_PLAYER_STARTED) && ! temp) { - LOGE("internal/external state mismatch corrected"); + ALOGE("internal/external state mismatch corrected"); mCurrentState = MEDIA_PLAYER_PAUSED; } return temp; @@ -402,7 +402,7 @@ status_t MediaPlayer::getDuration_l(int *msec) *msec = mDuration; return ret; } - LOGE("Attempt to call getDuration without a valid mediaplayer"); + ALOGE("Attempt to call getDuration without a valid mediaplayer"); return INVALID_OPERATION; } @@ -417,10 +417,10 @@ status_t MediaPlayer::seekTo_l(int msec) ALOGV("seekTo %d", msec); if ((mPlayer != 0) && ( mCurrentState & ( MEDIA_PLAYER_STARTED | MEDIA_PLAYER_PREPARED | MEDIA_PLAYER_PAUSED | MEDIA_PLAYER_PLAYBACK_COMPLETE) ) ) { if ( msec < 0 ) { - LOGW("Attempt to seek to invalid position: %d", msec); + ALOGW("Attempt to seek to invalid position: %d", msec); msec = 0; } else if ((mDuration > 0) && (msec > mDuration)) { - LOGW("Attempt to seek to past end of file: request = %d, EOF = %d", msec, mDuration); + ALOGW("Attempt to seek to past end of file: request = %d, EOF = %d", msec, mDuration); msec = mDuration; } // cache duration @@ -435,7 +435,7 @@ status_t MediaPlayer::seekTo_l(int msec) return NO_ERROR; } } - LOGE("Attempt to perform seekTo in wrong state: mPlayer=%p, mCurrentState=%u", mPlayer.get(), mCurrentState); + ALOGE("Attempt to perform seekTo in wrong state: mPlayer=%p, mCurrentState=%u", mPlayer.get(), mCurrentState); return INVALID_OPERATION; } @@ -457,7 +457,7 @@ status_t MediaPlayer::reset_l() if (mPlayer != 0) { status_t ret = mPlayer->reset(); if (ret != NO_ERROR) { - LOGE("reset() failed with return code (%d)", ret); + ALOGE("reset() failed with return code (%d)", ret); mCurrentState = MEDIA_PLAYER_STATE_ERROR; } else { mCurrentState = MEDIA_PLAYER_IDLE; @@ -486,7 +486,7 @@ status_t MediaPlayer::setAudioStreamType(int type) if (mCurrentState & ( MEDIA_PLAYER_PREPARED | MEDIA_PLAYER_STARTED | MEDIA_PLAYER_PAUSED | MEDIA_PLAYER_PLAYBACK_COMPLETE ) ) { // Can't change the stream type after prepare - LOGE("setAudioStream called in state %d", mCurrentState); + ALOGE("setAudioStream called in state %d", mCurrentState); return INVALID_OPERATION; } // cache @@ -532,7 +532,7 @@ status_t MediaPlayer::setAudioSessionId(int sessionId) ALOGV("MediaPlayer::setAudioSessionId(%d)", sessionId); Mutex::Autolock _l(mLock); if (!(mCurrentState & MEDIA_PLAYER_IDLE)) { - LOGE("setAudioSessionId called in state %d", mCurrentState); + ALOGE("setAudioSessionId called in state %d", mCurrentState); return INVALID_OPERATION; } if (sessionId < 0) { @@ -570,7 +570,7 @@ status_t MediaPlayer::attachAuxEffect(int effectId) if (mPlayer == 0 || (mCurrentState & MEDIA_PLAYER_IDLE) || (mCurrentState == MEDIA_PLAYER_STATE_ERROR )) { - LOGE("attachAuxEffect called in state %d", mCurrentState); + ALOGE("attachAuxEffect called in state %d", mCurrentState); return INVALID_OPERATION; } @@ -641,7 +641,7 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj) case MEDIA_PLAYBACK_COMPLETE: ALOGV("playback complete"); if (mCurrentState == MEDIA_PLAYER_IDLE) { - LOGE("playback complete in idle state"); + ALOGE("playback complete in idle state"); } if (!mLoop) { mCurrentState = MEDIA_PLAYER_PLAYBACK_COMPLETE; @@ -651,7 +651,7 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj) // Always log errors. // ext1: Media framework error code. // ext2: Implementation dependant error code. - LOGE("error (%d, %d)", ext1, ext2); + ALOGE("error (%d, %d)", ext1, ext2); mCurrentState = MEDIA_PLAYER_STATE_ERROR; if (mPrepareSync) { @@ -666,7 +666,7 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj) // ext1: Media framework error code. // ext2: Implementation dependant error code. if (ext1 != MEDIA_INFO_VIDEO_TRACK_LAGGING) { - LOGW("info/warning (%d, %d)", ext1, ext2); + ALOGW("info/warning (%d, %d)", ext1, ext2); } break; case MEDIA_SEEK_COMPLETE: @@ -717,7 +717,7 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj) if (service != 0) { p = service->decode(url, pSampleRate, pNumChannels, pFormat); } else { - LOGE("Unable to locate media service"); + ALOGE("Unable to locate media service"); } return p; @@ -737,7 +737,7 @@ void MediaPlayer::died() if (service != 0) { p = service->decode(fd, offset, length, pSampleRate, pNumChannels, pFormat); } else { - LOGE("Unable to locate media service"); + ALOGE("Unable to locate media service"); } return p; diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp index ec62978..8d947d8 100644 --- a/media/libmedia/mediarecorder.cpp +++ b/media/libmedia/mediarecorder.cpp @@ -33,11 +33,11 @@ status_t MediaRecorder::setCamera(const sp<ICamera>& camera, const sp<ICameraRec { ALOGV("setCamera(%p,%p)", camera.get(), proxy.get()); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_IDLE)) { - LOGE("setCamera called in an invalid state(%d)", mCurrentState); + ALOGE("setCamera called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -54,15 +54,15 @@ status_t MediaRecorder::setPreviewSurface(const sp<Surface>& surface) { ALOGV("setPreviewSurface(%p)", surface.get()); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setPreviewSurface called in an invalid state(%d)", mCurrentState); + ALOGE("setPreviewSurface called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } if (!mIsVideoSourceSet) { - LOGE("try to set preview surface without setting the video source first"); + ALOGE("try to set preview surface without setting the video source first"); return INVALID_OPERATION; } @@ -79,11 +79,11 @@ status_t MediaRecorder::init() { ALOGV("init"); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_IDLE)) { - LOGE("init called in an invalid state(%d)", mCurrentState); + ALOGE("init called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -109,11 +109,11 @@ status_t MediaRecorder::setVideoSource(int vs) { ALOGV("setVideoSource(%d)", vs); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (mIsVideoSourceSet) { - LOGE("video source has already been set"); + ALOGE("video source has already been set"); return INVALID_OPERATION; } if (mCurrentState & MEDIA_RECORDER_IDLE) { @@ -124,7 +124,7 @@ status_t MediaRecorder::setVideoSource(int vs) } } if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) { - LOGE("setVideoSource called in an invalid state(%d)", mCurrentState); + ALOGE("setVideoSource called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -144,7 +144,7 @@ status_t MediaRecorder::setAudioSource(int as) { ALOGV("setAudioSource(%d)", as); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (mCurrentState & MEDIA_RECORDER_IDLE) { @@ -155,11 +155,11 @@ status_t MediaRecorder::setAudioSource(int as) } } if (mIsAudioSourceSet) { - LOGE("audio source has already been set"); + ALOGE("audio source has already been set"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) { - LOGE("setAudioSource called in an invalid state(%d)", mCurrentState); + ALOGE("setAudioSource called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -177,21 +177,21 @@ status_t MediaRecorder::setOutputFormat(int of) { ALOGV("setOutputFormat(%d)", of); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) { - LOGE("setOutputFormat called in an invalid state: %d", mCurrentState); + ALOGE("setOutputFormat called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } if (mIsVideoSourceSet && of >= OUTPUT_FORMAT_AUDIO_ONLY_START && of != OUTPUT_FORMAT_RTP_AVP && of != OUTPUT_FORMAT_MPEG2TS) { //first non-video output format - LOGE("output format (%d) is meant for audio recording only and incompatible with video recording", of); + ALOGE("output format (%d) is meant for audio recording only and incompatible with video recording", of); return INVALID_OPERATION; } status_t ret = mMediaRecorder->setOutputFormat(of); if (OK != ret) { - LOGE("setOutputFormat failed: %d", ret); + ALOGE("setOutputFormat failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -203,19 +203,19 @@ status_t MediaRecorder::setVideoEncoder(int ve) { ALOGV("setVideoEncoder(%d)", ve); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!mIsVideoSourceSet) { - LOGE("try to set the video encoder without setting the video source first"); + ALOGE("try to set the video encoder without setting the video source first"); return INVALID_OPERATION; } if (mIsVideoEncoderSet) { - LOGE("video encoder has already been set"); + ALOGE("video encoder has already been set"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setVideoEncoder called in an invalid state(%d)", mCurrentState); + ALOGE("setVideoEncoder called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -233,19 +233,19 @@ status_t MediaRecorder::setAudioEncoder(int ae) { ALOGV("setAudioEncoder(%d)", ae); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!mIsAudioSourceSet) { - LOGE("try to set the audio encoder without setting the audio source first"); + ALOGE("try to set the audio encoder without setting the audio source first"); return INVALID_OPERATION; } if (mIsAudioEncoderSet) { - LOGE("audio encoder has already been set"); + ALOGE("audio encoder has already been set"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setAudioEncoder called in an invalid state(%d)", mCurrentState); + ALOGE("setAudioEncoder called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -263,15 +263,15 @@ status_t MediaRecorder::setOutputFile(const char* path) { ALOGV("setOutputFile(%s)", path); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (mIsOutputFileSet) { - LOGE("output file has already been set"); + ALOGE("output file has already been set"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setOutputFile called in an invalid state(%d)", mCurrentState); + ALOGE("setOutputFile called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -289,15 +289,15 @@ status_t MediaRecorder::setOutputFile(int fd, int64_t offset, int64_t length) { ALOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (mIsOutputFileSet) { - LOGE("output file has already been set"); + ALOGE("output file has already been set"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setOutputFile called in an invalid state(%d)", mCurrentState); + ALOGE("setOutputFile called in an invalid state(%d)", mCurrentState); return INVALID_OPERATION; } @@ -308,7 +308,7 @@ status_t MediaRecorder::setOutputFile(int fd, int64_t offset, int64_t length) // this issue by checking the file descriptor first before passing // it through binder call. if (fd < 0) { - LOGE("Invalid file descriptor: %d", fd); + ALOGE("Invalid file descriptor: %d", fd); return BAD_VALUE; } @@ -326,21 +326,21 @@ status_t MediaRecorder::setVideoSize(int width, int height) { ALOGV("setVideoSize(%d, %d)", width, height); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setVideoSize called in an invalid state: %d", mCurrentState); + ALOGE("setVideoSize called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } if (!mIsVideoSourceSet) { - LOGE("Cannot set video size without setting video source first"); + ALOGE("Cannot set video size without setting video source first"); return INVALID_OPERATION; } status_t ret = mMediaRecorder->setVideoSize(width, height); if (OK != ret) { - LOGE("setVideoSize failed: %d", ret); + ALOGE("setVideoSize failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -358,7 +358,7 @@ sp<ISurfaceTexture> MediaRecorder:: mSurfaceMediaSource = mMediaRecorder->querySurfaceMediaSource(); if (mSurfaceMediaSource == NULL) { - LOGE("SurfaceMediaSource could not be initialized!"); + ALOGE("SurfaceMediaSource could not be initialized!"); } return mSurfaceMediaSource; } @@ -369,21 +369,21 @@ status_t MediaRecorder::setVideoFrameRate(int frames_per_second) { ALOGV("setVideoFrameRate(%d)", frames_per_second); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("setVideoFrameRate called in an invalid state: %d", mCurrentState); + ALOGE("setVideoFrameRate called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } if (!mIsVideoSourceSet) { - LOGE("Cannot set video frame rate without setting video source first"); + ALOGE("Cannot set video frame rate without setting video source first"); return INVALID_OPERATION; } status_t ret = mMediaRecorder->setVideoFrameRate(frames_per_second); if (OK != ret) { - LOGE("setVideoFrameRate failed: %d", ret); + ALOGE("setVideoFrameRate failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -393,7 +393,7 @@ status_t MediaRecorder::setVideoFrameRate(int frames_per_second) status_t MediaRecorder::setParameters(const String8& params) { ALOGV("setParameters(%s)", params.string()); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } @@ -402,13 +402,13 @@ status_t MediaRecorder::setParameters(const String8& params) { MEDIA_RECORDER_RECORDING | MEDIA_RECORDER_ERROR)); if (isInvalidState) { - LOGE("setParameters is called in an invalid state: %d", mCurrentState); + ALOGE("setParameters is called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } status_t ret = mMediaRecorder->setParameters(params); if (OK != ret) { - LOGE("setParameters(%s) failed: %d", params.string(), ret); + ALOGE("setParameters(%s) failed: %d", params.string(), ret); // Do not change our current state to MEDIA_RECORDER_ERROR, failures // of the only currently supported parameters, "max-duration" and // "max-filesize" are _not_ fatal. @@ -421,34 +421,34 @@ status_t MediaRecorder::prepare() { ALOGV("prepare"); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) { - LOGE("prepare called in an invalid state: %d", mCurrentState); + ALOGE("prepare called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } if (mIsAudioSourceSet != mIsAudioEncoderSet) { if (mIsAudioSourceSet) { - LOGE("audio source is set, but audio encoder is not set"); + ALOGE("audio source is set, but audio encoder is not set"); } else { // must not happen, since setAudioEncoder checks this already - LOGE("audio encoder is set, but audio source is not set"); + ALOGE("audio encoder is set, but audio source is not set"); } return INVALID_OPERATION; } if (mIsVideoSourceSet != mIsVideoEncoderSet) { if (mIsVideoSourceSet) { - LOGE("video source is set, but video encoder is not set"); + ALOGE("video source is set, but video encoder is not set"); } else { // must not happen, since setVideoEncoder checks this already - LOGE("video encoder is set, but video source is not set"); + ALOGE("video encoder is set, but video source is not set"); } return INVALID_OPERATION; } status_t ret = mMediaRecorder->prepare(); if (OK != ret) { - LOGE("prepare failed: %d", ret); + ALOGE("prepare failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -460,17 +460,17 @@ status_t MediaRecorder::getMaxAmplitude(int* max) { ALOGV("getMaxAmplitude"); if(mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (mCurrentState & MEDIA_RECORDER_ERROR) { - LOGE("getMaxAmplitude called in an invalid state: %d", mCurrentState); + ALOGE("getMaxAmplitude called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } status_t ret = mMediaRecorder->getMaxAmplitude(max); if (OK != ret) { - LOGE("getMaxAmplitude failed: %d", ret); + ALOGE("getMaxAmplitude failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -481,17 +481,17 @@ status_t MediaRecorder::start() { ALOGV("start"); if (mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_PREPARED)) { - LOGE("start called in an invalid state: %d", mCurrentState); + ALOGE("start called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } status_t ret = mMediaRecorder->start(); if (OK != ret) { - LOGE("start failed: %d", ret); + ALOGE("start failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -503,17 +503,17 @@ status_t MediaRecorder::stop() { ALOGV("stop"); if (mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } if (!(mCurrentState & MEDIA_RECORDER_RECORDING)) { - LOGE("stop called in an invalid state: %d", mCurrentState); + ALOGE("stop called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } status_t ret = mMediaRecorder->stop(); if (OK != ret) { - LOGE("stop failed: %d", ret); + ALOGE("stop failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } @@ -531,7 +531,7 @@ status_t MediaRecorder::reset() { ALOGV("reset"); if (mMediaRecorder == NULL) { - LOGE("media recorder is not initialized yet"); + ALOGE("media recorder is not initialized yet"); return INVALID_OPERATION; } @@ -556,7 +556,7 @@ status_t MediaRecorder::reset() break; default: { - LOGE("Unexpected non-existing state: %d", mCurrentState); + ALOGE("Unexpected non-existing state: %d", mCurrentState); break; } } @@ -567,12 +567,12 @@ status_t MediaRecorder::close() { ALOGV("close"); if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) { - LOGE("close called in an invalid state: %d", mCurrentState); + ALOGE("close called in an invalid state: %d", mCurrentState); return INVALID_OPERATION; } status_t ret = mMediaRecorder->close(); if (OK != ret) { - LOGE("close failed: %d", ret); + ALOGE("close failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return UNKNOWN_ERROR; } else { @@ -586,7 +586,7 @@ status_t MediaRecorder::doReset() ALOGV("doReset"); status_t ret = mMediaRecorder->reset(); if (OK != ret) { - LOGE("doReset failed: %d", ret); + ALOGE("doReset failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; return ret; } else { |