diff options
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.cpp | 166 | ||||
-rw-r--r-- | media/libmediaplayerservice/MediaRecorderClient.cpp | 48 | ||||
-rw-r--r-- | media/libmediaplayerservice/MetadataRetrieverClient.cpp | 36 | ||||
-rw-r--r-- | media/libmediaplayerservice/MidiFile.cpp | 62 | ||||
-rw-r--r-- | media/libmediaplayerservice/MidiMetadataRetriever.cpp | 10 | ||||
-rw-r--r-- | media/libmediaplayerservice/StagefrightPlayer.cpp | 36 | ||||
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.cpp | 98 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 50 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp | 10 |
9 files changed, 258 insertions, 258 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index b655358..5c9a8c2 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -215,7 +215,7 @@ void MediaPlayerService::instantiate() { MediaPlayerService::MediaPlayerService() { - LOGV("MediaPlayerService created"); + ALOGV("MediaPlayerService created"); mNextConnId = 1; mBatteryAudio.refCount = 0; @@ -230,7 +230,7 @@ MediaPlayerService::MediaPlayerService() MediaPlayerService::~MediaPlayerService() { - LOGV("MediaPlayerService destroyed"); + ALOGV("MediaPlayerService destroyed"); } sp<IMediaRecorder> MediaPlayerService::createMediaRecorder(pid_t pid) @@ -239,7 +239,7 @@ sp<IMediaRecorder> MediaPlayerService::createMediaRecorder(pid_t pid) wp<MediaRecorderClient> w = recorder; Mutex::Autolock lock(mLock); mMediaRecorderClients.add(w); - LOGV("Create new media recorder client from pid %d", pid); + ALOGV("Create new media recorder client from pid %d", pid); return recorder; } @@ -247,13 +247,13 @@ void MediaPlayerService::removeMediaRecorderClient(wp<MediaRecorderClient> clien { Mutex::Autolock lock(mLock); mMediaRecorderClients.remove(client); - LOGV("Delete media recorder client"); + ALOGV("Delete media recorder client"); } sp<IMediaMetadataRetriever> MediaPlayerService::createMetadataRetriever(pid_t pid) { sp<MetadataRetrieverClient> retriever = new MetadataRetrieverClient(pid); - LOGV("Create new media retriever from pid %d", pid); + ALOGV("Create new media retriever from pid %d", pid); return retriever; } @@ -266,7 +266,7 @@ sp<IMediaPlayer> MediaPlayerService::create(pid_t pid, const sp<IMediaPlayerClie this, pid, connId, client, audioSessionId, IPCThreadState::self()->getCallingUid()); - LOGV("Create new client(%d) from pid %d, uid %d, ", connId, pid, + ALOGV("Create new client(%d) from pid %d, uid %d, ", connId, pid, IPCThreadState::self()->getCallingUid()); wp<Client> w = c; @@ -478,7 +478,7 @@ MediaPlayerService::Client::Client( int32_t connId, const sp<IMediaPlayerClient>& client, int audioSessionId, uid_t uid) { - LOGV("Client(%d) constructor", connId); + ALOGV("Client(%d) constructor", connId); mPid = pid; mConnId = connId; mService = service; @@ -496,7 +496,7 @@ MediaPlayerService::Client::Client( MediaPlayerService::Client::~Client() { - LOGV("Client(%d) destructor pid = %d", mConnId, mPid); + ALOGV("Client(%d) destructor pid = %d", mConnId, mPid); mAudioOutput.clear(); wp<Client> client(this); disconnect(); @@ -505,7 +505,7 @@ MediaPlayerService::Client::~Client() void MediaPlayerService::Client::disconnect() { - LOGV("disconnect(%d) from pid %d", mConnId, mPid); + ALOGV("disconnect(%d) from pid %d", mConnId, mPid); // grab local reference and clear main reference to prevent future // access to object sp<MediaPlayerBase> p; @@ -614,19 +614,19 @@ static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie, sp<MediaPlayerBase> p; switch (playerType) { case SONIVOX_PLAYER: - LOGV(" create MidiFile"); + ALOGV(" create MidiFile"); p = new MidiFile(); break; case STAGEFRIGHT_PLAYER: - LOGV(" create StagefrightPlayer"); + ALOGV(" create StagefrightPlayer"); p = new StagefrightPlayer; break; case NU_PLAYER: - LOGV(" create NuPlayer"); + ALOGV(" create NuPlayer"); p = new NuPlayerDriver; break; case TEST_PLAYER: - LOGV("Create Test Player stub"); + ALOGV("Create Test Player stub"); p = new TestPlayerStub(); break; default: @@ -651,7 +651,7 @@ sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerT // determine if we have the right player type sp<MediaPlayerBase> p = mPlayer; if ((p != NULL) && (p->playerType() != playerType)) { - LOGV("delete player"); + ALOGV("delete player"); p.clear(); } if (p == NULL) { @@ -668,7 +668,7 @@ sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerT status_t MediaPlayerService::Client::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { - LOGV("setDataSource(%s)", url); + ALOGV("setDataSource(%s)", url); if (url == NULL) return UNKNOWN_ERROR; @@ -696,7 +696,7 @@ status_t MediaPlayerService::Client::setDataSource( return mStatus; } else { player_type playerType = getPlayerType(url); - LOGV("player type = %d", playerType); + ALOGV("player type = %d", playerType); // create the right type of player sp<MediaPlayerBase> p = createPlayer(playerType); @@ -708,7 +708,7 @@ status_t MediaPlayerService::Client::setDataSource( } // now set data source - LOGV(" setDataSource"); + ALOGV(" setDataSource"); mStatus = p->setDataSource(url, headers); if (mStatus == NO_ERROR) { mPlayer = p; @@ -721,7 +721,7 @@ status_t MediaPlayerService::Client::setDataSource( status_t MediaPlayerService::Client::setDataSource(int fd, int64_t offset, int64_t length) { - LOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length); + ALOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length); struct stat sb; int ret = fstat(fd, &sb); if (ret != 0) { @@ -729,11 +729,11 @@ status_t MediaPlayerService::Client::setDataSource(int fd, int64_t offset, int64 return UNKNOWN_ERROR; } - LOGV("st_dev = %llu", sb.st_dev); - LOGV("st_mode = %u", sb.st_mode); - LOGV("st_uid = %lu", sb.st_uid); - LOGV("st_gid = %lu", sb.st_gid); - LOGV("st_size = %llu", sb.st_size); + ALOGV("st_dev = %llu", sb.st_dev); + ALOGV("st_mode = %u", sb.st_mode); + ALOGV("st_uid = %lu", sb.st_uid); + ALOGV("st_gid = %lu", sb.st_gid); + ALOGV("st_size = %llu", sb.st_size); if (offset >= sb.st_size) { LOGE("offset error"); @@ -742,11 +742,11 @@ status_t MediaPlayerService::Client::setDataSource(int fd, int64_t offset, int64 } if (offset + length > sb.st_size) { length = sb.st_size - offset; - LOGV("calculated length = %lld", length); + ALOGV("calculated length = %lld", length); } player_type playerType = getPlayerType(fd, offset, length); - LOGV("player type = %d", playerType); + ALOGV("player type = %d", playerType); // create the right type of player sp<MediaPlayerBase> p = createPlayer(playerType); @@ -790,7 +790,7 @@ status_t MediaPlayerService::Client::setDataSource( status_t MediaPlayerService::Client::setVideoSurface(const sp<Surface>& surface) { - LOGV("[%d] setVideoSurface(%p)", mConnId, surface.get()); + ALOGV("[%d] setVideoSurface(%p)", mConnId, surface.get()); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->setVideoSurface(surface); @@ -812,7 +812,7 @@ void MediaPlayerService::Client::disconnectNativeWindow() { status_t MediaPlayerService::Client::setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture) { - LOGV("[%d] setVideoSurfaceTexture(%p)", mConnId, surfaceTexture.get()); + ALOGV("[%d] setVideoSurfaceTexture(%p)", mConnId, surfaceTexture.get()); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; @@ -928,7 +928,7 @@ status_t MediaPlayerService::Client::getMetadata( status_t MediaPlayerService::Client::prepareAsync() { - LOGV("[%d] prepareAsync", mConnId); + ALOGV("[%d] prepareAsync", mConnId); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; status_t ret = p->prepareAsync(); @@ -941,7 +941,7 @@ status_t MediaPlayerService::Client::prepareAsync() status_t MediaPlayerService::Client::start() { - LOGV("[%d] start", mConnId); + ALOGV("[%d] start", mConnId); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; p->setLooping(mLoop); @@ -950,7 +950,7 @@ status_t MediaPlayerService::Client::start() status_t MediaPlayerService::Client::stop() { - LOGV("[%d] stop", mConnId); + ALOGV("[%d] stop", mConnId); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->stop(); @@ -958,7 +958,7 @@ status_t MediaPlayerService::Client::stop() status_t MediaPlayerService::Client::pause() { - LOGV("[%d] pause", mConnId); + ALOGV("[%d] pause", mConnId); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->pause(); @@ -970,18 +970,18 @@ status_t MediaPlayerService::Client::isPlaying(bool* state) sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; *state = p->isPlaying(); - LOGV("[%d] isPlaying: %d", mConnId, *state); + ALOGV("[%d] isPlaying: %d", mConnId, *state); return NO_ERROR; } status_t MediaPlayerService::Client::getCurrentPosition(int *msec) { - LOGV("getCurrentPosition"); + ALOGV("getCurrentPosition"); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; status_t ret = p->getCurrentPosition(msec); if (ret == NO_ERROR) { - LOGV("[%d] getCurrentPosition = %d", mConnId, *msec); + ALOGV("[%d] getCurrentPosition = %d", mConnId, *msec); } else { LOGE("getCurrentPosition returned %d", ret); } @@ -990,12 +990,12 @@ status_t MediaPlayerService::Client::getCurrentPosition(int *msec) status_t MediaPlayerService::Client::getDuration(int *msec) { - LOGV("getDuration"); + ALOGV("getDuration"); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; status_t ret = p->getDuration(msec); if (ret == NO_ERROR) { - LOGV("[%d] getDuration = %d", mConnId, *msec); + ALOGV("[%d] getDuration = %d", mConnId, *msec); } else { LOGE("getDuration returned %d", ret); } @@ -1004,7 +1004,7 @@ status_t MediaPlayerService::Client::getDuration(int *msec) status_t MediaPlayerService::Client::seekTo(int msec) { - LOGV("[%d] seekTo(%d)", mConnId, msec); + ALOGV("[%d] seekTo(%d)", mConnId, msec); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->seekTo(msec); @@ -1012,7 +1012,7 @@ status_t MediaPlayerService::Client::seekTo(int msec) status_t MediaPlayerService::Client::reset() { - LOGV("[%d] reset", mConnId); + ALOGV("[%d] reset", mConnId); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->reset(); @@ -1020,7 +1020,7 @@ status_t MediaPlayerService::Client::reset() status_t MediaPlayerService::Client::setAudioStreamType(int type) { - LOGV("[%d] setAudioStreamType(%d)", mConnId, type); + ALOGV("[%d] setAudioStreamType(%d)", mConnId, type); // TODO: for hardware output, call player instead Mutex::Autolock l(mLock); if (mAudioOutput != 0) mAudioOutput->setAudioStreamType(type); @@ -1029,7 +1029,7 @@ status_t MediaPlayerService::Client::setAudioStreamType(int type) status_t MediaPlayerService::Client::setLooping(int loop) { - LOGV("[%d] setLooping(%d)", mConnId, loop); + ALOGV("[%d] setLooping(%d)", mConnId, loop); mLoop = loop; sp<MediaPlayerBase> p = getPlayer(); if (p != 0) return p->setLooping(loop); @@ -1038,7 +1038,7 @@ status_t MediaPlayerService::Client::setLooping(int loop) status_t MediaPlayerService::Client::setVolume(float leftVolume, float rightVolume) { - LOGV("[%d] setVolume(%f, %f)", mConnId, leftVolume, rightVolume); + ALOGV("[%d] setVolume(%f, %f)", mConnId, leftVolume, rightVolume); // TODO: for hardware output, call player instead Mutex::Autolock l(mLock); if (mAudioOutput != 0) mAudioOutput->setVolume(leftVolume, rightVolume); @@ -1047,7 +1047,7 @@ status_t MediaPlayerService::Client::setVolume(float leftVolume, float rightVolu status_t MediaPlayerService::Client::setAuxEffectSendLevel(float level) { - LOGV("[%d] setAuxEffectSendLevel(%f)", mConnId, level); + ALOGV("[%d] setAuxEffectSendLevel(%f)", mConnId, level); Mutex::Autolock l(mLock); if (mAudioOutput != 0) return mAudioOutput->setAuxEffectSendLevel(level); return NO_ERROR; @@ -1055,21 +1055,21 @@ status_t MediaPlayerService::Client::setAuxEffectSendLevel(float level) status_t MediaPlayerService::Client::attachAuxEffect(int effectId) { - LOGV("[%d] attachAuxEffect(%d)", mConnId, effectId); + ALOGV("[%d] attachAuxEffect(%d)", mConnId, effectId); Mutex::Autolock l(mLock); if (mAudioOutput != 0) return mAudioOutput->attachAuxEffect(effectId); return NO_ERROR; } status_t MediaPlayerService::Client::setParameter(int key, const Parcel &request) { - LOGV("[%d] setParameter(%d)", mConnId, key); + ALOGV("[%d] setParameter(%d)", mConnId, key); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->setParameter(key, request); } status_t MediaPlayerService::Client::getParameter(int key, Parcel *reply) { - LOGV("[%d] getParameter(%d)", mConnId, key); + ALOGV("[%d] getParameter(%d)", mConnId, key); sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; return p->getParameter(key, reply); @@ -1092,7 +1092,7 @@ void MediaPlayerService::Client::notify( // also access mMetadataUpdated and clears it. client->addNewMetadataUpdate(metadata_type); } - LOGV("[%d] notify (%p, %d, %d, %d)", client->mConnId, cookie, msg, ext1, ext2); + ALOGV("[%d] notify (%p, %d, %d, %d)", client->mConnId, cookie, msg, ext1, ext2); client->mClient->notify(msg, ext1, ext2, obj); } @@ -1143,7 +1143,7 @@ int Antagonizer::callbackThread(void* user) Antagonizer* p = reinterpret_cast<Antagonizer*>(user); while (!p->mExit) { if (p->mActive) { - LOGV("send event"); + ALOGV("send event"); p->mCb(p->mClient, 0, 0, 0); } usleep(interval); @@ -1159,7 +1159,7 @@ static size_t kDefaultHeapSize = 1024 * 1024; // 1MB sp<IMemory> MediaPlayerService::decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) { - LOGV("decode(%s)", url); + ALOGV("decode(%s)", url); sp<MemoryBase> mem; sp<MediaPlayerBase> player; @@ -1173,7 +1173,7 @@ sp<IMemory> MediaPlayerService::decode(const char* url, uint32_t *pSampleRate, i } player_type playerType = getPlayerType(url); - LOGV("player type = %d", playerType); + ALOGV("player type = %d", playerType); // create the right type of player sp<AudioCache> cache = new AudioCache(url); @@ -1186,16 +1186,16 @@ sp<IMemory> MediaPlayerService::decode(const char* url, uint32_t *pSampleRate, i // set data source if (player->setDataSource(url) != NO_ERROR) goto Exit; - LOGV("prepare"); + ALOGV("prepare"); player->prepareAsync(); - LOGV("wait for prepare"); + ALOGV("wait for prepare"); if (cache->wait() != NO_ERROR) goto Exit; - LOGV("start"); + ALOGV("start"); player->start(); - LOGV("wait for playback complete"); + ALOGV("wait for playback complete"); cache->wait(); // in case of error, return what was successfully decoded. if (cache->size() == 0) { @@ -1206,7 +1206,7 @@ sp<IMemory> MediaPlayerService::decode(const char* url, uint32_t *pSampleRate, i *pSampleRate = cache->sampleRate(); *pNumChannels = cache->channelCount(); *pFormat = (int)cache->format(); - LOGV("return memory @ %p, sampleRate=%u, channelCount = %d, format = %d", mem->pointer(), *pSampleRate, *pNumChannels, *pFormat); + ALOGV("return memory @ %p, sampleRate=%u, channelCount = %d, format = %d", mem->pointer(), *pSampleRate, *pNumChannels, *pFormat); Exit: if (player != 0) player->reset(); @@ -1215,12 +1215,12 @@ Exit: sp<IMemory> MediaPlayerService::decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) { - LOGV("decode(%d, %lld, %lld)", fd, offset, length); + ALOGV("decode(%d, %lld, %lld)", fd, offset, length); sp<MemoryBase> mem; sp<MediaPlayerBase> player; player_type playerType = getPlayerType(fd, offset, length); - LOGV("player type = %d", playerType); + ALOGV("player type = %d", playerType); // create the right type of player sp<AudioCache> cache = new AudioCache("decode_fd"); @@ -1233,16 +1233,16 @@ sp<IMemory> MediaPlayerService::decode(int fd, int64_t offset, int64_t length, u // set data source if (player->setDataSource(fd, offset, length) != NO_ERROR) goto Exit; - LOGV("prepare"); + ALOGV("prepare"); player->prepareAsync(); - LOGV("wait for prepare"); + ALOGV("wait for prepare"); if (cache->wait() != NO_ERROR) goto Exit; - LOGV("start"); + ALOGV("start"); player->start(); - LOGV("wait for playback complete"); + ALOGV("wait for playback complete"); cache->wait(); // in case of error, return what was successfully decoded. if (cache->size() == 0) { @@ -1253,7 +1253,7 @@ sp<IMemory> MediaPlayerService::decode(int fd, int64_t offset, int64_t length, u *pSampleRate = cache->sampleRate(); *pNumChannels = cache->channelCount(); *pFormat = cache->format(); - LOGV("return memory @ %p, sampleRate=%u, channelCount = %d, format = %d", mem->pointer(), *pSampleRate, *pNumChannels, *pFormat); + ALOGV("return memory @ %p, sampleRate=%u, channelCount = %d, format = %d", mem->pointer(), *pSampleRate, *pNumChannels, *pFormat); Exit: if (player != 0) player->reset(); @@ -1268,7 +1268,7 @@ MediaPlayerService::AudioOutput::AudioOutput(int sessionId) : mCallback(NULL), mCallbackCookie(NULL), mSessionId(sessionId) { - LOGV("AudioOutput(%d)", sessionId); + ALOGV("AudioOutput(%d)", sessionId); mTrack = 0; mStreamType = AUDIO_STREAM_MUSIC; mLeftVolume = 1.0; @@ -1359,7 +1359,7 @@ status_t MediaPlayerService::AudioOutput::open( bufferCount = mMinBufferCount; } - LOGV("open(%u, %d, %d, %d, %d)", sampleRate, channelCount, format, bufferCount,mSessionId); + ALOGV("open(%u, %d, %d, %d, %d)", sampleRate, channelCount, format, bufferCount,mSessionId); if (mTrack) close(); int afSampleRate; int afFrameCount; @@ -1407,7 +1407,7 @@ status_t MediaPlayerService::AudioOutput::open( return NO_INIT; } - LOGV("setVolume"); + ALOGV("setVolume"); t->setVolume(mLeftVolume, mRightVolume); mMsecsPerFrame = 1.e3 / (float) sampleRate; @@ -1420,7 +1420,7 @@ status_t MediaPlayerService::AudioOutput::open( void MediaPlayerService::AudioOutput::start() { - LOGV("start"); + ALOGV("start"); if (mTrack) { mTrack->setVolume(mLeftVolume, mRightVolume); mTrack->setAuxEffectSendLevel(mSendLevel); @@ -1434,7 +1434,7 @@ ssize_t MediaPlayerService::AudioOutput::write(const void* buffer, size_t size) { LOG_FATAL_IF(mCallback != NULL, "Don't call write if supplying a callback."); - //LOGV("write(%p, %u)", buffer, size); + //ALOGV("write(%p, %u)", buffer, size); if (mTrack) { ssize_t ret = mTrack->write(buffer, size); return ret; @@ -1444,32 +1444,32 @@ ssize_t MediaPlayerService::AudioOutput::write(const void* buffer, size_t size) void MediaPlayerService::AudioOutput::stop() { - LOGV("stop"); + ALOGV("stop"); if (mTrack) mTrack->stop(); } void MediaPlayerService::AudioOutput::flush() { - LOGV("flush"); + ALOGV("flush"); if (mTrack) mTrack->flush(); } void MediaPlayerService::AudioOutput::pause() { - LOGV("pause"); + ALOGV("pause"); if (mTrack) mTrack->pause(); } void MediaPlayerService::AudioOutput::close() { - LOGV("close"); + ALOGV("close"); delete mTrack; mTrack = 0; } void MediaPlayerService::AudioOutput::setVolume(float left, float right) { - LOGV("setVolume(%f, %f)", left, right); + ALOGV("setVolume(%f, %f)", left, right); mLeftVolume = left; mRightVolume = right; if (mTrack) { @@ -1479,7 +1479,7 @@ void MediaPlayerService::AudioOutput::setVolume(float left, float right) status_t MediaPlayerService::AudioOutput::setAuxEffectSendLevel(float level) { - LOGV("setAuxEffectSendLevel(%f)", level); + ALOGV("setAuxEffectSendLevel(%f)", level); mSendLevel = level; if (mTrack) { return mTrack->setAuxEffectSendLevel(level); @@ -1489,7 +1489,7 @@ status_t MediaPlayerService::AudioOutput::setAuxEffectSendLevel(float level) status_t MediaPlayerService::AudioOutput::attachAuxEffect(int effectId) { - LOGV("attachAuxEffect(%d)", effectId); + ALOGV("attachAuxEffect(%d)", effectId); mAuxEffectId = effectId; if (mTrack) { return mTrack->attachAuxEffect(effectId); @@ -1500,7 +1500,7 @@ status_t MediaPlayerService::AudioOutput::attachAuxEffect(int effectId) // static void MediaPlayerService::AudioOutput::CallbackWrapper( int event, void *cookie, void *info) { - //LOGV("callbackwrapper"); + //ALOGV("callbackwrapper"); if (event != AudioTrack::EVENT_MORE_DATA) { return; } @@ -1622,7 +1622,7 @@ status_t MediaPlayerService::AudioCache::open( uint32_t sampleRate, int channelCount, int format, int bufferCount, AudioCallback cb, void *cookie) { - LOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount); + ALOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount); if (mHeap->getHeapID() < 0) { return NO_INIT; } @@ -1652,13 +1652,13 @@ void MediaPlayerService::AudioCache::stop() { ssize_t MediaPlayerService::AudioCache::write(const void* buffer, size_t size) { - LOGV("write(%p, %u)", buffer, size); + ALOGV("write(%p, %u)", buffer, size); if ((buffer == 0) || (size == 0)) return size; uint8_t* p = static_cast<uint8_t*>(mHeap->getBase()); if (p == NULL) return NO_INIT; p += mSize; - LOGV("memcpy(%p, %p, %u)", p, buffer, size); + ALOGV("memcpy(%p, %p, %u)", p, buffer, size); if (mSize + size > mHeap->getSize()) { LOGE("Heap size overflow! req size: %d, max size: %d", (mSize + size), mHeap->getSize()); size = mHeap->getSize() - mSize; @@ -1678,9 +1678,9 @@ status_t MediaPlayerService::AudioCache::wait() mCommandComplete = false; if (mError == NO_ERROR) { - LOGV("wait - success"); + ALOGV("wait - success"); } else { - LOGV("wait - error"); + ALOGV("wait - error"); } return mError; } @@ -1688,7 +1688,7 @@ status_t MediaPlayerService::AudioCache::wait() void MediaPlayerService::AudioCache::notify( void* cookie, int msg, int ext1, int ext2, const Parcel *obj) { - LOGV("notify(%p, %d, %d, %d)", cookie, msg, ext1, ext2); + ALOGV("notify(%p, %d, %d, %d)", cookie, msg, ext1, ext2); AudioCache* p = static_cast<AudioCache*>(cookie); // ignore buffering messages @@ -1699,13 +1699,13 @@ void MediaPlayerService::AudioCache::notify( p->mError = ext1; break; case MEDIA_PREPARED: - LOGV("prepared"); + ALOGV("prepared"); break; case MEDIA_PLAYBACK_COMPLETE: - LOGV("playback complete"); + ALOGV("playback complete"); break; default: - LOGV("ignored"); + ALOGV("ignored"); return; } diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp index 6f80b35..ca92c77 100644 --- a/media/libmediaplayerservice/MediaRecorderClient.cpp +++ b/media/libmediaplayerservice/MediaRecorderClient.cpp @@ -61,7 +61,7 @@ static bool checkPermission(const char* permissionString) { sp<ISurfaceTexture> MediaRecorderClient::querySurfaceMediaSource() { - LOGV("Query SurfaceMediaSource"); + ALOGV("Query SurfaceMediaSource"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -75,7 +75,7 @@ sp<ISurfaceTexture> MediaRecorderClient::querySurfaceMediaSource() status_t MediaRecorderClient::setCamera(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy) { - LOGV("setCamera"); + ALOGV("setCamera"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -86,7 +86,7 @@ status_t MediaRecorderClient::setCamera(const sp<ICamera>& camera, status_t MediaRecorderClient::setPreviewSurface(const sp<Surface>& surface) { - LOGV("setPreviewSurface"); + ALOGV("setPreviewSurface"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -97,7 +97,7 @@ status_t MediaRecorderClient::setPreviewSurface(const sp<Surface>& surface) status_t MediaRecorderClient::setVideoSource(int vs) { - LOGV("setVideoSource(%d)", vs); + ALOGV("setVideoSource(%d)", vs); if (!checkPermission(cameraPermission)) { return PERMISSION_DENIED; } @@ -111,7 +111,7 @@ status_t MediaRecorderClient::setVideoSource(int vs) status_t MediaRecorderClient::setAudioSource(int as) { - LOGV("setAudioSource(%d)", as); + ALOGV("setAudioSource(%d)", as); if (!checkPermission(recordAudioPermission)) { return PERMISSION_DENIED; } @@ -125,7 +125,7 @@ status_t MediaRecorderClient::setAudioSource(int as) status_t MediaRecorderClient::setOutputFormat(int of) { - LOGV("setOutputFormat(%d)", of); + ALOGV("setOutputFormat(%d)", of); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -136,7 +136,7 @@ status_t MediaRecorderClient::setOutputFormat(int of) status_t MediaRecorderClient::setVideoEncoder(int ve) { - LOGV("setVideoEncoder(%d)", ve); + ALOGV("setVideoEncoder(%d)", ve); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -147,7 +147,7 @@ status_t MediaRecorderClient::setVideoEncoder(int ve) status_t MediaRecorderClient::setAudioEncoder(int ae) { - LOGV("setAudioEncoder(%d)", ae); + ALOGV("setAudioEncoder(%d)", ae); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -158,7 +158,7 @@ status_t MediaRecorderClient::setAudioEncoder(int ae) status_t MediaRecorderClient::setOutputFile(const char* path) { - LOGV("setOutputFile(%s)", path); + ALOGV("setOutputFile(%s)", path); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -169,7 +169,7 @@ status_t MediaRecorderClient::setOutputFile(const char* path) status_t MediaRecorderClient::setOutputFile(int fd, int64_t offset, int64_t length) { - LOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length); + ALOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -180,7 +180,7 @@ status_t MediaRecorderClient::setOutputFile(int fd, int64_t offset, int64_t leng status_t MediaRecorderClient::setVideoSize(int width, int height) { - LOGV("setVideoSize(%dx%d)", width, height); + ALOGV("setVideoSize(%dx%d)", width, height); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -191,7 +191,7 @@ status_t MediaRecorderClient::setVideoSize(int width, int height) status_t MediaRecorderClient::setVideoFrameRate(int frames_per_second) { - LOGV("setVideoFrameRate(%d)", frames_per_second); + ALOGV("setVideoFrameRate(%d)", frames_per_second); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -201,7 +201,7 @@ status_t MediaRecorderClient::setVideoFrameRate(int frames_per_second) } status_t MediaRecorderClient::setParameters(const String8& params) { - LOGV("setParameters(%s)", params.string()); + ALOGV("setParameters(%s)", params.string()); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -212,7 +212,7 @@ status_t MediaRecorderClient::setParameters(const String8& params) { status_t MediaRecorderClient::prepare() { - LOGV("prepare"); + ALOGV("prepare"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -224,7 +224,7 @@ status_t MediaRecorderClient::prepare() status_t MediaRecorderClient::getMaxAmplitude(int* max) { - LOGV("getMaxAmplitude"); + ALOGV("getMaxAmplitude"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -235,7 +235,7 @@ status_t MediaRecorderClient::getMaxAmplitude(int* max) status_t MediaRecorderClient::start() { - LOGV("start"); + ALOGV("start"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -247,7 +247,7 @@ status_t MediaRecorderClient::start() status_t MediaRecorderClient::stop() { - LOGV("stop"); + ALOGV("stop"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -258,7 +258,7 @@ status_t MediaRecorderClient::stop() status_t MediaRecorderClient::init() { - LOGV("init"); + ALOGV("init"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -269,7 +269,7 @@ status_t MediaRecorderClient::init() status_t MediaRecorderClient::close() { - LOGV("close"); + ALOGV("close"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -281,7 +281,7 @@ status_t MediaRecorderClient::close() status_t MediaRecorderClient::reset() { - LOGV("reset"); + ALOGV("reset"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); @@ -292,7 +292,7 @@ status_t MediaRecorderClient::reset() status_t MediaRecorderClient::release() { - LOGV("release"); + ALOGV("release"); Mutex::Autolock lock(mLock); if (mRecorder != NULL) { delete mRecorder; @@ -305,7 +305,7 @@ status_t MediaRecorderClient::release() MediaRecorderClient::MediaRecorderClient(const sp<MediaPlayerService>& service, pid_t pid) { - LOGV("Client constructor"); + ALOGV("Client constructor"); mPid = pid; mRecorder = new StagefrightRecorder; mMediaPlayerService = service; @@ -313,13 +313,13 @@ MediaRecorderClient::MediaRecorderClient(const sp<MediaPlayerService>& service, MediaRecorderClient::~MediaRecorderClient() { - LOGV("Client destructor"); + ALOGV("Client destructor"); release(); } status_t MediaRecorderClient::setListener(const sp<IMediaRecorderClient>& listener) { - LOGV("setListener"); + ALOGV("setListener"); Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp index d574ea3..f945c6a 100644 --- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp +++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp @@ -46,7 +46,7 @@ extern player_type getPlayerType(int fd, int64_t offset, int64_t length); MetadataRetrieverClient::MetadataRetrieverClient(pid_t pid) { - LOGV("MetadataRetrieverClient constructor pid(%d)", pid); + ALOGV("MetadataRetrieverClient constructor pid(%d)", pid); mPid = pid; mThumbnail = NULL; mAlbumArt = NULL; @@ -55,7 +55,7 @@ MetadataRetrieverClient::MetadataRetrieverClient(pid_t pid) MetadataRetrieverClient::~MetadataRetrieverClient() { - LOGV("MetadataRetrieverClient destructor"); + ALOGV("MetadataRetrieverClient destructor"); disconnect(); } @@ -74,7 +74,7 @@ status_t MetadataRetrieverClient::dump(int fd, const Vector<String16>& args) con void MetadataRetrieverClient::disconnect() { - LOGV("disconnect from pid %d", mPid); + ALOGV("disconnect from pid %d", mPid); Mutex::Autolock lock(mLock); mRetriever.clear(); mThumbnail.clear(); @@ -92,7 +92,7 @@ static sp<MediaMetadataRetrieverBase> createRetriever(player_type playerType) break; } case SONIVOX_PLAYER: - LOGV("create midi metadata retriever"); + ALOGV("create midi metadata retriever"); p = new MidiMetadataRetriever(); break; default: @@ -110,13 +110,13 @@ static sp<MediaMetadataRetrieverBase> createRetriever(player_type playerType) status_t MetadataRetrieverClient::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { - LOGV("setDataSource(%s)", url); + ALOGV("setDataSource(%s)", url); Mutex::Autolock lock(mLock); if (url == NULL) { return UNKNOWN_ERROR; } player_type playerType = getPlayerType(url); - LOGV("player type = %d", playerType); + ALOGV("player type = %d", playerType); sp<MediaMetadataRetrieverBase> p = createRetriever(playerType); if (p == NULL) return NO_INIT; status_t ret = p->setDataSource(url, headers); @@ -126,7 +126,7 @@ status_t MetadataRetrieverClient::setDataSource( status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t length) { - LOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length); + ALOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length); Mutex::Autolock lock(mLock); struct stat sb; int ret = fstat(fd, &sb); @@ -134,11 +134,11 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t LOGE("fstat(%d) failed: %d, %s", fd, ret, strerror(errno)); return BAD_VALUE; } - LOGV("st_dev = %llu", sb.st_dev); - LOGV("st_mode = %u", sb.st_mode); - LOGV("st_uid = %lu", sb.st_uid); - LOGV("st_gid = %lu", sb.st_gid); - LOGV("st_size = %llu", sb.st_size); + ALOGV("st_dev = %llu", sb.st_dev); + ALOGV("st_mode = %u", sb.st_mode); + ALOGV("st_uid = %lu", sb.st_uid); + ALOGV("st_gid = %lu", sb.st_gid); + ALOGV("st_size = %llu", sb.st_size); if (offset >= sb.st_size) { LOGE("offset (%lld) bigger than file size (%llu)", offset, sb.st_size); @@ -147,11 +147,11 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t } if (offset + length > sb.st_size) { length = sb.st_size - offset; - LOGV("calculated length = %lld", length); + ALOGV("calculated length = %lld", length); } player_type playerType = getPlayerType(fd, offset, length); - LOGV("player type = %d", playerType); + ALOGV("player type = %d", playerType); sp<MediaMetadataRetrieverBase> p = createRetriever(playerType); if (p == NULL) { ::close(fd); @@ -165,7 +165,7 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option) { - LOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option); + ALOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option); Mutex::Autolock lock(mLock); mThumbnail.clear(); if (mRetriever == NULL) { @@ -197,7 +197,7 @@ sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option) frameCopy->mDisplayHeight = frame->mDisplayHeight; frameCopy->mSize = frame->mSize; frameCopy->mRotationAngle = frame->mRotationAngle; - LOGV("rotation: %d", frameCopy->mRotationAngle); + ALOGV("rotation: %d", frameCopy->mRotationAngle); frameCopy->mData = (uint8_t *)frameCopy + sizeof(VideoFrame); memcpy(frameCopy->mData, frame->mData, frame->mSize); delete frame; // Fix memory leakage @@ -206,7 +206,7 @@ sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option) sp<IMemory> MetadataRetrieverClient::extractAlbumArt() { - LOGV("extractAlbumArt"); + ALOGV("extractAlbumArt"); Mutex::Autolock lock(mLock); mAlbumArt.clear(); if (mRetriever == NULL) { @@ -241,7 +241,7 @@ sp<IMemory> MetadataRetrieverClient::extractAlbumArt() const char* MetadataRetrieverClient::extractMetadata(int keyCode) { - LOGV("extractMetadata"); + ALOGV("extractMetadata"); Mutex::Autolock lock(mLock); if (mRetriever == NULL) { LOGE("retriever is not initialized"); diff --git a/media/libmediaplayerservice/MidiFile.cpp b/media/libmediaplayerservice/MidiFile.cpp index 7e04523..85b1f9d 100644 --- a/media/libmediaplayerservice/MidiFile.cpp +++ b/media/libmediaplayerservice/MidiFile.cpp @@ -58,7 +58,7 @@ MidiFile::MidiFile() : mStreamType(AUDIO_STREAM_MUSIC), mLoop(false), mExit(false), mPaused(false), mRender(false), mTid(-1) { - LOGV("constructor"); + ALOGV("constructor"); mFileLocator.path = NULL; mFileLocator.fd = -1; @@ -88,12 +88,12 @@ MidiFile::MidiFile() : Mutex::Autolock l(mMutex); createThreadEtc(renderThread, this, "midithread", ANDROID_PRIORITY_AUDIO); mCondition.wait(mMutex); - LOGV("thread started"); + ALOGV("thread started"); } // indicate success if (mTid > 0) { - LOGV(" render thread(%d) started", mTid); + ALOGV(" render thread(%d) started", mTid); mState = EAS_STATE_READY; } @@ -108,13 +108,13 @@ status_t MidiFile::initCheck() } MidiFile::~MidiFile() { - LOGV("MidiFile destructor"); + ALOGV("MidiFile destructor"); release(); } status_t MidiFile::setDataSource( const char* path, const KeyedVector<String8, String8> *) { - LOGV("MidiFile::setDataSource url=%s", path); + ALOGV("MidiFile::setDataSource url=%s", path); Mutex::Autolock lock(mMutex); // file still open? @@ -145,7 +145,7 @@ status_t MidiFile::setDataSource( status_t MidiFile::setDataSource(int fd, int64_t offset, int64_t length) { - LOGV("MidiFile::setDataSource fd=%d", fd); + ALOGV("MidiFile::setDataSource fd=%d", fd); Mutex::Autolock lock(mMutex); // file still open? @@ -173,7 +173,7 @@ status_t MidiFile::setDataSource(int fd, int64_t offset, int64_t length) status_t MidiFile::prepare() { - LOGV("MidiFile::prepare"); + ALOGV("MidiFile::prepare"); Mutex::Autolock lock(mMutex); if (!mEasHandle) { return ERROR_NOT_OPEN; @@ -189,7 +189,7 @@ status_t MidiFile::prepare() status_t MidiFile::prepareAsync() { - LOGV("MidiFile::prepareAsync"); + ALOGV("MidiFile::prepareAsync"); status_t ret = prepare(); // don't hold lock during callback @@ -203,7 +203,7 @@ status_t MidiFile::prepareAsync() status_t MidiFile::start() { - LOGV("MidiFile::start"); + ALOGV("MidiFile::start"); Mutex::Autolock lock(mMutex); if (!mEasHandle) { return ERROR_NOT_OPEN; @@ -221,14 +221,14 @@ status_t MidiFile::start() mRender = true; // wake up render thread - LOGV(" wakeup render thread"); + ALOGV(" wakeup render thread"); mCondition.signal(); return NO_ERROR; } status_t MidiFile::stop() { - LOGV("MidiFile::stop"); + ALOGV("MidiFile::stop"); Mutex::Autolock lock(mMutex); if (!mEasHandle) { return ERROR_NOT_OPEN; @@ -246,7 +246,7 @@ status_t MidiFile::stop() status_t MidiFile::seekTo(int position) { - LOGV("MidiFile::seekTo %d", position); + ALOGV("MidiFile::seekTo %d", position); // hold lock during EAS calls { Mutex::Autolock lock(mMutex); @@ -268,7 +268,7 @@ status_t MidiFile::seekTo(int position) status_t MidiFile::pause() { - LOGV("MidiFile::pause"); + ALOGV("MidiFile::pause"); Mutex::Autolock lock(mMutex); if (!mEasHandle) { return ERROR_NOT_OPEN; @@ -283,14 +283,14 @@ status_t MidiFile::pause() bool MidiFile::isPlaying() { - LOGV("MidiFile::isPlaying, mState=%d", int(mState)); + ALOGV("MidiFile::isPlaying, mState=%d", int(mState)); if (!mEasHandle || mPaused) return false; return (mState == EAS_STATE_PLAY); } status_t MidiFile::getCurrentPosition(int* position) { - LOGV("MidiFile::getCurrentPosition"); + ALOGV("MidiFile::getCurrentPosition"); if (!mEasHandle) { LOGE("getCurrentPosition(): file not open"); return ERROR_NOT_OPEN; @@ -306,7 +306,7 @@ status_t MidiFile::getCurrentPosition(int* position) status_t MidiFile::getDuration(int* duration) { - LOGV("MidiFile::getDuration"); + ALOGV("MidiFile::getDuration"); { Mutex::Autolock lock(mMutex); if (!mEasHandle) return ERROR_NOT_OPEN; @@ -349,7 +349,7 @@ status_t MidiFile::getDuration(int* duration) status_t MidiFile::release() { - LOGV("MidiFile::release"); + ALOGV("MidiFile::release"); Mutex::Autolock l(mMutex); reset_nosync(); @@ -372,7 +372,7 @@ status_t MidiFile::release() status_t MidiFile::reset() { - LOGV("MidiFile::reset"); + ALOGV("MidiFile::reset"); Mutex::Autolock lock(mMutex); return reset_nosync(); } @@ -380,7 +380,7 @@ status_t MidiFile::reset() // call only with mutex held status_t MidiFile::reset_nosync() { - LOGV("MidiFile::reset_nosync"); + ALOGV("MidiFile::reset_nosync"); // close file if (mEasHandle) { EAS_CloseFile(mEasData, mEasHandle); @@ -407,7 +407,7 @@ status_t MidiFile::reset_nosync() status_t MidiFile::setLooping(int loop) { - LOGV("MidiFile::setLooping"); + ALOGV("MidiFile::setLooping"); Mutex::Autolock lock(mMutex); if (!mEasHandle) { return ERROR_NOT_OPEN; @@ -438,7 +438,7 @@ int MidiFile::render() { int temp; bool audioStarted = false; - LOGV("MidiFile::render"); + ALOGV("MidiFile::render"); // allocate render buffer mAudioBuffer = new EAS_PCM[pLibConfig->mixBufferSize * pLibConfig->numChannels * NUM_BUFFERS]; @@ -451,7 +451,7 @@ int MidiFile::render() { { Mutex::Autolock l(mMutex); mTid = gettid(); - LOGV("render thread(%d) signal", mTid); + ALOGV("render thread(%d) signal", mTid); mCondition.signal(); } @@ -461,9 +461,9 @@ int MidiFile::render() { // nothing to render, wait for client thread to wake us up while (!mRender && !mExit) { - LOGV("MidiFile::render - signal wait"); + ALOGV("MidiFile::render - signal wait"); mCondition.wait(mMutex); - LOGV("MidiFile::render - signal rx'd"); + ALOGV("MidiFile::render - signal rx'd"); } if (mExit) { mMutex.unlock(); @@ -471,7 +471,7 @@ int MidiFile::render() { } // render midi data into the input buffer - //LOGV("MidiFile::render - rendering audio"); + //ALOGV("MidiFile::render - rendering audio"); int num_output = 0; EAS_PCM* p = mAudioBuffer; for (int i = 0; i < NUM_BUFFERS; i++) { @@ -484,20 +484,20 @@ int MidiFile::render() { } // update playback state and position - // LOGV("MidiFile::render - updating state"); + // ALOGV("MidiFile::render - updating state"); EAS_GetLocation(mEasData, mEasHandle, &mPlayTime); EAS_State(mEasData, mEasHandle, &mState); mMutex.unlock(); // create audio output track if necessary if (!mAudioSink->ready()) { - LOGV("MidiFile::render - create output track"); + ALOGV("MidiFile::render - create output track"); if (createOutputTrack() != NO_ERROR) goto threadExit; } // Write data to the audio hardware - // LOGV("MidiFile::render - writing to audio output"); + // ALOGV("MidiFile::render - writing to audio output"); if ((temp = mAudioSink->write(mAudioBuffer, num_output)) < 0) { LOGE("Error in writing:%d",temp); return temp; @@ -505,7 +505,7 @@ int MidiFile::render() { // start audio output if necessary if (!audioStarted) { - //LOGV("MidiFile::render - starting audio"); + //ALOGV("MidiFile::render - starting audio"); mAudioSink->start(); audioStarted = true; } @@ -517,7 +517,7 @@ int MidiFile::render() { switch(mState) { case EAS_STATE_STOPPED: { - LOGV("MidiFile::render - stopped"); + ALOGV("MidiFile::render - stopped"); sendEvent(MEDIA_PLAYBACK_COMPLETE); break; } @@ -528,7 +528,7 @@ int MidiFile::render() { break; } case EAS_STATE_PAUSED: - LOGV("MidiFile::render - paused"); + ALOGV("MidiFile::render - paused"); break; default: break; diff --git a/media/libmediaplayerservice/MidiMetadataRetriever.cpp b/media/libmediaplayerservice/MidiMetadataRetriever.cpp index aaf2d18..bb65ed4 100644 --- a/media/libmediaplayerservice/MidiMetadataRetriever.cpp +++ b/media/libmediaplayerservice/MidiMetadataRetriever.cpp @@ -31,14 +31,14 @@ static status_t ERROR_ALLOCATE_FAILED = -4; void MidiMetadataRetriever::clearMetadataValues() { - LOGV("clearMetadataValues"); + ALOGV("clearMetadataValues"); mMetadataValues[0][0] = '\0'; } status_t MidiMetadataRetriever::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { - LOGV("setDataSource: %s", url? url: "NULL pointer"); + ALOGV("setDataSource: %s", url? url: "NULL pointer"); Mutex::Autolock lock(mLock); clearMetadataValues(); if (mMidiPlayer == 0) { @@ -49,7 +49,7 @@ status_t MidiMetadataRetriever::setDataSource( status_t MidiMetadataRetriever::setDataSource(int fd, int64_t offset, int64_t length) { - LOGV("setDataSource: fd(%d), offset(%lld), and length(%lld)", fd, offset, length); + ALOGV("setDataSource: fd(%d), offset(%lld), and length(%lld)", fd, offset, length); Mutex::Autolock lock(mLock); clearMetadataValues(); if (mMidiPlayer == 0) { @@ -60,7 +60,7 @@ status_t MidiMetadataRetriever::setDataSource(int fd, int64_t offset, int64_t le const char* MidiMetadataRetriever::extractMetadata(int keyCode) { - LOGV("extractMetdata: key(%d)", keyCode); + ALOGV("extractMetdata: key(%d)", keyCode); Mutex::Autolock lock(mLock); if (mMidiPlayer == 0 || mMidiPlayer->initCheck() != NO_ERROR) { LOGE("Midi player is not initialized yet"); @@ -78,7 +78,7 @@ const char* MidiMetadataRetriever::extractMetadata(int keyCode) snprintf(mMetadataValues[0], MAX_METADATA_STRING_LENGTH, "%d", duration); } - LOGV("duration: %s ms", mMetadataValues[0]); + ALOGV("duration: %s ms", mMetadataValues[0]); return mMetadataValues[0]; } default: diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index cd4b1ef..e105eae 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -29,13 +29,13 @@ namespace android { StagefrightPlayer::StagefrightPlayer() : mPlayer(new AwesomePlayer) { - LOGV("StagefrightPlayer"); + ALOGV("StagefrightPlayer"); mPlayer->setListener(this); } StagefrightPlayer::~StagefrightPlayer() { - LOGV("~StagefrightPlayer"); + ALOGV("~StagefrightPlayer"); reset(); delete mPlayer; @@ -43,7 +43,7 @@ StagefrightPlayer::~StagefrightPlayer() { } status_t StagefrightPlayer::initCheck() { - LOGV("initCheck"); + ALOGV("initCheck"); return OK; } @@ -61,7 +61,7 @@ status_t StagefrightPlayer::setDataSource( // Warning: The filedescriptor passed into this method will only be valid until // the method returns, if you want to keep it, dup it! status_t StagefrightPlayer::setDataSource(int fd, int64_t offset, int64_t length) { - LOGV("setDataSource(%d, %lld, %lld)", fd, offset, length); + ALOGV("setDataSource(%d, %lld, %lld)", fd, offset, length); return mPlayer->setDataSource(dup(fd), offset, length); } @@ -70,14 +70,14 @@ status_t StagefrightPlayer::setDataSource(const sp<IStreamSource> &source) { } status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) { - LOGV("setVideoSurface"); + ALOGV("setVideoSurface"); return mPlayer->setSurface(surface); } status_t StagefrightPlayer::setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture) { - LOGV("setVideoSurfaceTexture"); + ALOGV("setVideoSurfaceTexture"); return mPlayer->setSurfaceTexture(surfaceTexture); } @@ -91,30 +91,30 @@ status_t StagefrightPlayer::prepareAsync() { } status_t StagefrightPlayer::start() { - LOGV("start"); + ALOGV("start"); return mPlayer->play(); } status_t StagefrightPlayer::stop() { - LOGV("stop"); + ALOGV("stop"); return pause(); // what's the difference? } status_t StagefrightPlayer::pause() { - LOGV("pause"); + ALOGV("pause"); return mPlayer->pause(); } bool StagefrightPlayer::isPlaying() { - LOGV("isPlaying"); + ALOGV("isPlaying"); return mPlayer->isPlaying(); } status_t StagefrightPlayer::seekTo(int msec) { - LOGV("seekTo %.2f secs", msec / 1E3); + ALOGV("seekTo %.2f secs", msec / 1E3); status_t err = mPlayer->seekTo((int64_t)msec * 1000); @@ -122,7 +122,7 @@ status_t StagefrightPlayer::seekTo(int msec) { } status_t StagefrightPlayer::getCurrentPosition(int *msec) { - LOGV("getCurrentPosition"); + ALOGV("getCurrentPosition"); int64_t positionUs; status_t err = mPlayer->getPosition(&positionUs); @@ -137,7 +137,7 @@ status_t StagefrightPlayer::getCurrentPosition(int *msec) { } status_t StagefrightPlayer::getDuration(int *msec) { - LOGV("getDuration"); + ALOGV("getDuration"); int64_t durationUs; status_t err = mPlayer->getDuration(&durationUs); @@ -153,7 +153,7 @@ status_t StagefrightPlayer::getDuration(int *msec) { } status_t StagefrightPlayer::reset() { - LOGV("reset"); + ALOGV("reset"); mPlayer->reset(); @@ -161,13 +161,13 @@ status_t StagefrightPlayer::reset() { } status_t StagefrightPlayer::setLooping(int loop) { - LOGV("setLooping"); + ALOGV("setLooping"); return mPlayer->setLooping(loop); } player_type StagefrightPlayer::playerType() { - LOGV("playerType"); + ALOGV("playerType"); return STAGEFRIGHT_PLAYER; } @@ -182,12 +182,12 @@ void StagefrightPlayer::setAudioSink(const sp<AudioSink> &audioSink) { } status_t StagefrightPlayer::setParameter(int key, const Parcel &request) { - LOGV("setParameter"); + ALOGV("setParameter"); return mPlayer->setParameter(key, request); } status_t StagefrightPlayer::getParameter(int key, Parcel *reply) { - LOGV("getParameter"); + ALOGV("getParameter"); return mPlayer->getParameter(key, reply); } diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index 6981668..c0ba091 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -71,17 +71,17 @@ StagefrightRecorder::StagefrightRecorder() mVideoSource(VIDEO_SOURCE_LIST_END), mStarted(false), mSurfaceMediaSource(NULL) { - LOGV("Constructor"); + ALOGV("Constructor"); reset(); } StagefrightRecorder::~StagefrightRecorder() { - LOGV("Destructor"); + ALOGV("Destructor"); stop(); } status_t StagefrightRecorder::init() { - LOGV("init"); + ALOGV("init"); return OK; } @@ -89,12 +89,12 @@ status_t StagefrightRecorder::init() { // and return a interface reference. The client side will use that // while encoding GL Frames sp<ISurfaceTexture> StagefrightRecorder::querySurfaceMediaSource() const { - LOGV("Get SurfaceMediaSource"); + ALOGV("Get SurfaceMediaSource"); return mSurfaceMediaSource; } status_t StagefrightRecorder::setAudioSource(audio_source_t as) { - LOGV("setAudioSource: %d", as); + ALOGV("setAudioSource: %d", as); if (as < AUDIO_SOURCE_DEFAULT || as >= AUDIO_SOURCE_CNT) { LOGE("Invalid audio source: %d", as); @@ -111,7 +111,7 @@ status_t StagefrightRecorder::setAudioSource(audio_source_t as) { } status_t StagefrightRecorder::setVideoSource(video_source vs) { - LOGV("setVideoSource: %d", vs); + ALOGV("setVideoSource: %d", vs); if (vs < VIDEO_SOURCE_DEFAULT || vs >= VIDEO_SOURCE_LIST_END) { LOGE("Invalid video source: %d", vs); @@ -128,7 +128,7 @@ status_t StagefrightRecorder::setVideoSource(video_source vs) { } status_t StagefrightRecorder::setOutputFormat(output_format of) { - LOGV("setOutputFormat: %d", of); + ALOGV("setOutputFormat: %d", of); if (of < OUTPUT_FORMAT_DEFAULT || of >= OUTPUT_FORMAT_LIST_END) { LOGE("Invalid output format: %d", of); @@ -145,7 +145,7 @@ status_t StagefrightRecorder::setOutputFormat(output_format of) { } status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) { - LOGV("setAudioEncoder: %d", ae); + ALOGV("setAudioEncoder: %d", ae); if (ae < AUDIO_ENCODER_DEFAULT || ae >= AUDIO_ENCODER_LIST_END) { LOGE("Invalid audio encoder: %d", ae); @@ -162,7 +162,7 @@ status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) { } status_t StagefrightRecorder::setVideoEncoder(video_encoder ve) { - LOGV("setVideoEncoder: %d", ve); + ALOGV("setVideoEncoder: %d", ve); if (ve < VIDEO_ENCODER_DEFAULT || ve >= VIDEO_ENCODER_LIST_END) { LOGE("Invalid video encoder: %d", ve); @@ -179,7 +179,7 @@ status_t StagefrightRecorder::setVideoEncoder(video_encoder ve) { } status_t StagefrightRecorder::setVideoSize(int width, int height) { - LOGV("setVideoSize: %dx%d", width, height); + ALOGV("setVideoSize: %dx%d", width, height); if (width <= 0 || height <= 0) { LOGE("Invalid video size: %dx%d", width, height); return BAD_VALUE; @@ -193,7 +193,7 @@ status_t StagefrightRecorder::setVideoSize(int width, int height) { } status_t StagefrightRecorder::setVideoFrameRate(int frames_per_second) { - LOGV("setVideoFrameRate: %d", frames_per_second); + ALOGV("setVideoFrameRate: %d", frames_per_second); if ((frames_per_second <= 0 && frames_per_second != -1) || frames_per_second > 120) { LOGE("Invalid video frame rate: %d", frames_per_second); @@ -208,7 +208,7 @@ status_t StagefrightRecorder::setVideoFrameRate(int frames_per_second) { status_t StagefrightRecorder::setCamera(const sp<ICamera> &camera, const sp<ICameraRecordingProxy> &proxy) { - LOGV("setCamera"); + ALOGV("setCamera"); if (camera == 0) { LOGE("camera is NULL"); return BAD_VALUE; @@ -224,7 +224,7 @@ status_t StagefrightRecorder::setCamera(const sp<ICamera> &camera, } status_t StagefrightRecorder::setPreviewSurface(const sp<Surface> &surface) { - LOGV("setPreviewSurface: %p", surface.get()); + ALOGV("setPreviewSurface: %p", surface.get()); mPreviewSurface = surface; return OK; @@ -239,7 +239,7 @@ status_t StagefrightRecorder::setOutputFile(const char *path) { } status_t StagefrightRecorder::setOutputFile(int fd, int64_t offset, int64_t length) { - LOGV("setOutputFile: %d, %lld, %lld", fd, offset, length); + ALOGV("setOutputFile: %d, %lld, %lld", fd, offset, length); // These don't make any sense, do they? CHECK_EQ(offset, 0); CHECK_EQ(length, 0); @@ -313,7 +313,7 @@ static void TrimString(String8 *s) { } status_t StagefrightRecorder::setParamAudioSamplingRate(int32_t sampleRate) { - LOGV("setParamAudioSamplingRate: %d", sampleRate); + ALOGV("setParamAudioSamplingRate: %d", sampleRate); if (sampleRate <= 0) { LOGE("Invalid audio sampling rate: %d", sampleRate); return BAD_VALUE; @@ -325,7 +325,7 @@ status_t StagefrightRecorder::setParamAudioSamplingRate(int32_t sampleRate) { } status_t StagefrightRecorder::setParamAudioNumberOfChannels(int32_t channels) { - LOGV("setParamAudioNumberOfChannels: %d", channels); + ALOGV("setParamAudioNumberOfChannels: %d", channels); if (channels <= 0 || channels >= 3) { LOGE("Invalid number of audio channels: %d", channels); return BAD_VALUE; @@ -337,7 +337,7 @@ status_t StagefrightRecorder::setParamAudioNumberOfChannels(int32_t channels) { } status_t StagefrightRecorder::setParamAudioEncodingBitRate(int32_t bitRate) { - LOGV("setParamAudioEncodingBitRate: %d", bitRate); + ALOGV("setParamAudioEncodingBitRate: %d", bitRate); if (bitRate <= 0) { LOGE("Invalid audio encoding bit rate: %d", bitRate); return BAD_VALUE; @@ -352,7 +352,7 @@ status_t StagefrightRecorder::setParamAudioEncodingBitRate(int32_t bitRate) { } status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) { - LOGV("setParamVideoEncodingBitRate: %d", bitRate); + ALOGV("setParamVideoEncodingBitRate: %d", bitRate); if (bitRate <= 0) { LOGE("Invalid video encoding bit rate: %d", bitRate); return BAD_VALUE; @@ -368,7 +368,7 @@ status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) { // Always rotate clockwise, and only support 0, 90, 180 and 270 for now. status_t StagefrightRecorder::setParamVideoRotation(int32_t degrees) { - LOGV("setParamVideoRotation: %d", degrees); + ALOGV("setParamVideoRotation: %d", degrees); if (degrees < 0 || degrees % 90 != 0) { LOGE("Unsupported video rotation angle: %d", degrees); return BAD_VALUE; @@ -378,7 +378,7 @@ status_t StagefrightRecorder::setParamVideoRotation(int32_t degrees) { } status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) { - LOGV("setParamMaxFileDurationUs: %lld us", timeUs); + ALOGV("setParamMaxFileDurationUs: %lld us", timeUs); // This is meant for backward compatibility for MediaRecorder.java if (timeUs <= 0) { @@ -397,7 +397,7 @@ status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) { } status_t StagefrightRecorder::setParamMaxFileSizeBytes(int64_t bytes) { - LOGV("setParamMaxFileSizeBytes: %lld bytes", bytes); + ALOGV("setParamMaxFileSizeBytes: %lld bytes", bytes); // This is meant for backward compatibility for MediaRecorder.java if (bytes <= 0) { @@ -418,7 +418,7 @@ status_t StagefrightRecorder::setParamMaxFileSizeBytes(int64_t bytes) { } status_t StagefrightRecorder::setParamInterleaveDuration(int32_t durationUs) { - LOGV("setParamInterleaveDuration: %d", durationUs); + ALOGV("setParamInterleaveDuration: %d", durationUs); if (durationUs <= 500000) { // 500 ms // If interleave duration is too small, it is very inefficient to do // interleaving since the metadata overhead will count for a significant @@ -440,20 +440,20 @@ status_t StagefrightRecorder::setParamInterleaveDuration(int32_t durationUs) { // If seconds == 0, all frames are encoded as I frames. No P frames // If seconds > 0, it is the time spacing (seconds) between 2 neighboring I frames status_t StagefrightRecorder::setParamVideoIFramesInterval(int32_t seconds) { - LOGV("setParamVideoIFramesInterval: %d seconds", seconds); + ALOGV("setParamVideoIFramesInterval: %d seconds", seconds); mIFramesIntervalSec = seconds; return OK; } status_t StagefrightRecorder::setParam64BitFileOffset(bool use64Bit) { - LOGV("setParam64BitFileOffset: %s", + ALOGV("setParam64BitFileOffset: %s", use64Bit? "use 64 bit file offset": "use 32 bit file offset"); mUse64BitFileOffset = use64Bit; return OK; } status_t StagefrightRecorder::setParamVideoCameraId(int32_t cameraId) { - LOGV("setParamVideoCameraId: %d", cameraId); + ALOGV("setParamVideoCameraId: %d", cameraId); if (cameraId < 0) { return BAD_VALUE; } @@ -462,7 +462,7 @@ status_t StagefrightRecorder::setParamVideoCameraId(int32_t cameraId) { } status_t StagefrightRecorder::setParamTrackTimeStatus(int64_t timeDurationUs) { - LOGV("setParamTrackTimeStatus: %lld", timeDurationUs); + ALOGV("setParamTrackTimeStatus: %lld", timeDurationUs); if (timeDurationUs < 20000) { // Infeasible if shorter than 20 ms? LOGE("Tracking time duration too short: %lld us", timeDurationUs); return BAD_VALUE; @@ -472,7 +472,7 @@ status_t StagefrightRecorder::setParamTrackTimeStatus(int64_t timeDurationUs) { } status_t StagefrightRecorder::setParamVideoEncoderProfile(int32_t profile) { - LOGV("setParamVideoEncoderProfile: %d", profile); + ALOGV("setParamVideoEncoderProfile: %d", profile); // Additional check will be done later when we load the encoder. // For now, we are accepting values defined in OpenMAX IL. @@ -481,7 +481,7 @@ status_t StagefrightRecorder::setParamVideoEncoderProfile(int32_t profile) { } status_t StagefrightRecorder::setParamVideoEncoderLevel(int32_t level) { - LOGV("setParamVideoEncoderLevel: %d", level); + ALOGV("setParamVideoEncoderLevel: %d", level); // Additional check will be done later when we load the encoder. // For now, we are accepting values defined in OpenMAX IL. @@ -490,7 +490,7 @@ status_t StagefrightRecorder::setParamVideoEncoderLevel(int32_t level) { } status_t StagefrightRecorder::setParamMovieTimeScale(int32_t timeScale) { - LOGV("setParamMovieTimeScale: %d", timeScale); + ALOGV("setParamMovieTimeScale: %d", timeScale); // The range is set to be the same as the audio's time scale range // since audio's time scale has a wider range. @@ -503,7 +503,7 @@ status_t StagefrightRecorder::setParamMovieTimeScale(int32_t timeScale) { } status_t StagefrightRecorder::setParamVideoTimeScale(int32_t timeScale) { - LOGV("setParamVideoTimeScale: %d", timeScale); + ALOGV("setParamVideoTimeScale: %d", timeScale); // 60000 is chosen to make sure that each video frame from a 60-fps // video has 1000 ticks. @@ -516,7 +516,7 @@ status_t StagefrightRecorder::setParamVideoTimeScale(int32_t timeScale) { } status_t StagefrightRecorder::setParamAudioTimeScale(int32_t timeScale) { - LOGV("setParamAudioTimeScale: %d", timeScale); + ALOGV("setParamAudioTimeScale: %d", timeScale); // 96000 Hz is the highest sampling rate support in AAC. if (timeScale < 600 || timeScale > 96000) { @@ -528,7 +528,7 @@ status_t StagefrightRecorder::setParamAudioTimeScale(int32_t timeScale) { } status_t StagefrightRecorder::setParamTimeLapseEnable(int32_t timeLapseEnable) { - LOGV("setParamTimeLapseEnable: %d", timeLapseEnable); + ALOGV("setParamTimeLapseEnable: %d", timeLapseEnable); if(timeLapseEnable == 0) { mCaptureTimeLapse = false; @@ -541,7 +541,7 @@ status_t StagefrightRecorder::setParamTimeLapseEnable(int32_t timeLapseEnable) { } status_t StagefrightRecorder::setParamTimeBetweenTimeLapseFrameCapture(int64_t timeUs) { - LOGV("setParamTimeBetweenTimeLapseFrameCapture: %lld us", timeUs); + ALOGV("setParamTimeBetweenTimeLapseFrameCapture: %lld us", timeUs); // Not allowing time more than a day if (timeUs <= 0 || timeUs > 86400*1E6) { @@ -575,7 +575,7 @@ status_t StagefrightRecorder::setParamGeoDataLatitude( status_t StagefrightRecorder::setParameter( const String8 &key, const String8 &value) { - LOGV("setParameter: key (%s) => value (%s)", key.string(), value.string()); + ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string()); if (key == "max-duration") { int64_t max_duration_ms; if (safe_strtoi64(value.string(), &max_duration_ms)) { @@ -689,7 +689,7 @@ status_t StagefrightRecorder::setParameter( } status_t StagefrightRecorder::setParameters(const String8 ¶ms) { - LOGV("setParameters: %s", params.string()); + ALOGV("setParameters: %s", params.string()); const char *cparams = params.string(); const char *key_start = cparams; for (;;) { @@ -1016,7 +1016,7 @@ status_t StagefrightRecorder::startMPEG2TSRecording() { } void StagefrightRecorder::clipVideoFrameRate() { - LOGV("clipVideoFrameRate: encoder %d", mVideoEncoder); + ALOGV("clipVideoFrameRate: encoder %d", mVideoEncoder); int minFrameRate = mEncoderProfiles->getVideoEncoderParamByName( "enc.vid.fps.min", mVideoEncoder); int maxFrameRate = mEncoderProfiles->getVideoEncoderParamByName( @@ -1033,7 +1033,7 @@ void StagefrightRecorder::clipVideoFrameRate() { } void StagefrightRecorder::clipVideoBitRate() { - LOGV("clipVideoBitRate: encoder %d", mVideoEncoder); + ALOGV("clipVideoBitRate: encoder %d", mVideoEncoder); int minBitRate = mEncoderProfiles->getVideoEncoderParamByName( "enc.vid.bps.min", mVideoEncoder); int maxBitRate = mEncoderProfiles->getVideoEncoderParamByName( @@ -1050,7 +1050,7 @@ void StagefrightRecorder::clipVideoBitRate() { } void StagefrightRecorder::clipVideoFrameWidth() { - LOGV("clipVideoFrameWidth: encoder %d", mVideoEncoder); + ALOGV("clipVideoFrameWidth: encoder %d", mVideoEncoder); int minFrameWidth = mEncoderProfiles->getVideoEncoderParamByName( "enc.vid.width.min", mVideoEncoder); int maxFrameWidth = mEncoderProfiles->getVideoEncoderParamByName( @@ -1082,7 +1082,7 @@ status_t StagefrightRecorder::checkVideoEncoderCapabilities() { // Set to use AVC baseline profile if the encoding parameters matches // CAMCORDER_QUALITY_LOW profile; this is for the sake of MMS service. void StagefrightRecorder::setDefaultProfileIfNecessary() { - LOGV("setDefaultProfileIfNecessary"); + ALOGV("setDefaultProfileIfNecessary"); camcorder_quality quality = CAMCORDER_QUALITY_LOW; @@ -1145,7 +1145,7 @@ status_t StagefrightRecorder::checkAudioEncoderCapabilities() { } void StagefrightRecorder::clipAudioBitRate() { - LOGV("clipAudioBitRate: encoder %d", mAudioEncoder); + ALOGV("clipAudioBitRate: encoder %d", mAudioEncoder); int minAudioBitRate = mEncoderProfiles->getAudioEncoderParamByName( @@ -1167,7 +1167,7 @@ void StagefrightRecorder::clipAudioBitRate() { } void StagefrightRecorder::clipAudioSampleRate() { - LOGV("clipAudioSampleRate: encoder %d", mAudioEncoder); + ALOGV("clipAudioSampleRate: encoder %d", mAudioEncoder); int minSampleRate = mEncoderProfiles->getAudioEncoderParamByName( @@ -1189,7 +1189,7 @@ void StagefrightRecorder::clipAudioSampleRate() { } void StagefrightRecorder::clipNumberOfAudioChannels() { - LOGV("clipNumberOfAudioChannels: encoder %d", mAudioEncoder); + ALOGV("clipNumberOfAudioChannels: encoder %d", mAudioEncoder); int minChannels = mEncoderProfiles->getAudioEncoderParamByName( @@ -1211,7 +1211,7 @@ void StagefrightRecorder::clipNumberOfAudioChannels() { } void StagefrightRecorder::clipVideoFrameHeight() { - LOGV("clipVideoFrameHeight: encoder %d", mVideoEncoder); + ALOGV("clipVideoFrameHeight: encoder %d", mVideoEncoder); int minFrameHeight = mEncoderProfiles->getVideoEncoderParamByName( "enc.vid.height.min", mVideoEncoder); int maxFrameHeight = mEncoderProfiles->getVideoEncoderParamByName( @@ -1548,7 +1548,7 @@ status_t StagefrightRecorder::startMPEG4Recording() { } status_t StagefrightRecorder::pause() { - LOGV("pause"); + ALOGV("pause"); if (mWriter == NULL) { return UNKNOWN_ERROR; } @@ -1573,7 +1573,7 @@ status_t StagefrightRecorder::pause() { } status_t StagefrightRecorder::stop() { - LOGV("stop"); + ALOGV("stop"); status_t err = OK; if (mCaptureTimeLapse && mCameraSourceTimeLapse != NULL) { @@ -1610,14 +1610,14 @@ status_t StagefrightRecorder::stop() { } status_t StagefrightRecorder::close() { - LOGV("close"); + ALOGV("close"); stop(); return OK; } status_t StagefrightRecorder::reset() { - LOGV("reset"); + ALOGV("reset"); stop(); // No audio or video source by default @@ -1664,7 +1664,7 @@ status_t StagefrightRecorder::reset() { } status_t StagefrightRecorder::getMaxAmplitude(int *max) { - LOGV("getMaxAmplitude"); + ALOGV("getMaxAmplitude"); if (max == NULL) { LOGE("Null pointer argument"); @@ -1682,7 +1682,7 @@ status_t StagefrightRecorder::getMaxAmplitude(int *max) { status_t StagefrightRecorder::dump( int fd, const Vector<String16>& args) const { - LOGV("dump"); + ALOGV("dump"); const size_t SIZE = 256; char buffer[SIZE]; String8 result; diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 70208f8..3a452d8 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -165,7 +165,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { switch (msg->what()) { case kWhatSetDataSource: { - LOGV("kWhatSetDataSource"); + ALOGV("kWhatSetDataSource"); CHECK(mSource == NULL); @@ -178,7 +178,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { case kWhatSetVideoNativeWindow: { - LOGV("kWhatSetVideoNativeWindow"); + ALOGV("kWhatSetVideoNativeWindow"); sp<RefBase> obj; CHECK(msg->findObject("native-window", &obj)); @@ -189,7 +189,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { case kWhatSetAudioSink: { - LOGV("kWhatSetAudioSink"); + ALOGV("kWhatSetAudioSink"); sp<RefBase> obj; CHECK(msg->findObject("sink", &obj)); @@ -200,7 +200,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { case kWhatStart: { - LOGV("kWhatStart"); + ALOGV("kWhatStart"); mVideoIsAVC = false; mAudioEOS = false; @@ -234,7 +234,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { mScanSourcesPending = false; - LOGV("scanning sources haveAudio=%d, haveVideo=%d", + ALOGV("scanning sources haveAudio=%d, haveVideo=%d", mAudioDecoder != NULL, mVideoDecoder != NULL); instantiateDecoder(false, &mVideoDecoder); @@ -290,9 +290,9 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { CHECK(codecRequest->findInt32("err", &err)); if (err == ERROR_END_OF_STREAM) { - LOGV("got %s decoder EOS", audio ? "audio" : "video"); + ALOGV("got %s decoder EOS", audio ? "audio" : "video"); } else { - LOGV("got %s decoder EOS w/ error %d", + ALOGV("got %s decoder EOS w/ error %d", audio ? "audio" : "video", err); } @@ -311,10 +311,10 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { mVideoLateByUs = 0; } - LOGV("decoder %s flush completed", audio ? "audio" : "video"); + ALOGV("decoder %s flush completed", audio ? "audio" : "video"); if (needShutdown) { - LOGV("initiating %s decoder shutdown", + ALOGV("initiating %s decoder shutdown", audio ? "audio" : "video"); (audio ? mAudioDecoder : mVideoDecoder)->initiateShutdown(); @@ -335,7 +335,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { int32_t sampleRate; CHECK(codecRequest->findInt32("sample-rate", &sampleRate)); - LOGV("Audio output format changed to %d Hz, %d channels", + ALOGV("Audio output format changed to %d Hz, %d channels", sampleRate, numChannels); mAudioSink->close(); @@ -360,7 +360,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { "crop", &cropLeft, &cropTop, &cropRight, &cropBottom)); - LOGV("Video output format changed to %d x %d " + ALOGV("Video output format changed to %d x %d " "(crop: %d x %d @ (%d, %d))", width, height, (cropRight - cropLeft + 1), @@ -373,7 +373,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { cropBottom - cropTop + 1); } } else if (what == ACodec::kWhatShutdownCompleted) { - LOGV("%s shutdown completed", audio ? "audio" : "video"); + ALOGV("%s shutdown completed", audio ? "audio" : "video"); if (audio) { mAudioDecoder.clear(); @@ -420,7 +420,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { } if (finalResult == ERROR_END_OF_STREAM) { - LOGV("reached %s EOS", audio ? "audio" : "video"); + ALOGV("reached %s EOS", audio ? "audio" : "video"); } else { LOGE("%s track encountered an error (%d)", audio ? "audio" : "video", finalResult); @@ -454,7 +454,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { int32_t audio; CHECK(msg->findInt32("audio", &audio)); - LOGV("renderer %s flush completed.", audio ? "audio" : "video"); + ALOGV("renderer %s flush completed.", audio ? "audio" : "video"); } break; } @@ -466,13 +466,13 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { case kWhatReset: { - LOGV("kWhatReset"); + ALOGV("kWhatReset"); if (mFlushingAudio != NONE || mFlushingVideo != NONE) { // We're currently flushing, postpone the reset until that's // completed. - LOGV("postponing reset"); + ALOGV("postponing reset"); mResetPostponed = true; break; @@ -500,7 +500,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { int64_t seekTimeUs; CHECK(msg->findInt64("seekTimeUs", &seekTimeUs)); - LOGV("kWhatSeek seekTimeUs=%lld us (%.2f secs)", + ALOGV("kWhatSeek seekTimeUs=%lld us (%.2f secs)", seekTimeUs, seekTimeUs / 1E6); mSource->seekTo(seekTimeUs); @@ -544,7 +544,7 @@ void NuPlayer::finishFlushIfPossible() { return; } - LOGV("both audio and video are flushed now."); + ALOGV("both audio and video are flushed now."); mRenderer->signalTimeDiscontinuity(); @@ -560,7 +560,7 @@ void NuPlayer::finishFlushIfPossible() { mFlushingVideo = NONE; if (mResetInProgress) { - LOGV("reset completed"); + ALOGV("reset completed"); mResetInProgress = false; finishReset(); @@ -671,7 +671,7 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { bool formatChange = type == ATSParser::DISCONTINUITY_FORMATCHANGE; - LOGV("%s discontinuity (formatChange=%d)", + ALOGV("%s discontinuity (formatChange=%d)", audio ? "audio" : "video", formatChange); if (audio) { @@ -721,12 +721,12 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { } } while (dropAccessUnit); - // LOGV("returned a valid buffer of %s data", audio ? "audio" : "video"); + // ALOGV("returned a valid buffer of %s data", audio ? "audio" : "video"); #if 0 int64_t mediaTimeUs; CHECK(accessUnit->meta()->findInt64("timeUs", &mediaTimeUs)); - LOGV("feeding %s input buffer at media time %.2f secs", + ALOGV("feeding %s input buffer at media time %.2f secs", audio ? "audio" : "video", mediaTimeUs / 1E6); #endif @@ -738,7 +738,7 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { } void NuPlayer::renderBuffer(bool audio, const sp<AMessage> &msg) { - // LOGV("renderBuffer %s", audio ? "audio" : "video"); + // ALOGV("renderBuffer %s", audio ? "audio" : "video"); sp<AMessage> reply; CHECK(msg->findMessage("reply", &reply)); @@ -749,7 +749,7 @@ void NuPlayer::renderBuffer(bool audio, const sp<AMessage> &msg) { // so we don't want any output buffers it sent us (from before // we initiated the flush) to be stuck in the renderer's queue. - LOGV("we're still flushing the %s decoder, sending its output buffer" + ALOGV("we're still flushing the %s decoder, sending its output buffer" " right back.", audio ? "audio" : "video"); reply->post(); @@ -771,7 +771,7 @@ void NuPlayer::renderBuffer(bool audio, const sp<AMessage> &msg) { CHECK(buffer->meta()->findInt64("timeUs", &mediaTimeUs)); if (mediaTimeUs < skipUntilMediaTimeUs) { - LOGV("dropping %s buffer at time %lld as requested.", + ALOGV("dropping %s buffer at time %lld as requested.", audio ? "audio" : "video", mediaTimeUs); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp index bf19040..4995846 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp @@ -230,7 +230,7 @@ bool NuPlayer::Renderer::onDrainAudioQueue() { if (numFramesAvailableToWrite == mAudioSink->frameCount()) { LOGI("audio sink underrun"); } else { - LOGV("audio queue has %d frames left to play", + ALOGV("audio queue has %d frames left to play", mAudioSink->frameCount() - numFramesAvailableToWrite); } #endif @@ -255,7 +255,7 @@ bool NuPlayer::Renderer::onDrainAudioQueue() { int64_t mediaTimeUs; CHECK(entry->mBuffer->meta()->findInt64("timeUs", &mediaTimeUs)); - LOGV("rendering audio at media time %.2f secs", mediaTimeUs / 1E6); + ALOGV("rendering audio at media time %.2f secs", mediaTimeUs / 1E6); mAnchorTimeMediaUs = mediaTimeUs; @@ -376,9 +376,9 @@ void NuPlayer::Renderer::onDrainVideoQueue() { bool tooLate = (mVideoLateByUs > 40000); if (tooLate) { - LOGV("video late by %lld us (%.2f secs)", lateByUs, lateByUs / 1E6); + ALOGV("video late by %lld us (%.2f secs)", lateByUs, lateByUs / 1E6); } else { - LOGV("rendering video at media time %.2f secs", mediaTimeUs / 1E6); + ALOGV("rendering video at media time %.2f secs", mediaTimeUs / 1E6); } entry->mNotifyConsumed->setInt32("render", true); @@ -454,7 +454,7 @@ void NuPlayer::Renderer::onQueueBuffer(const sp<AMessage> &msg) { int64_t diff = firstVideoTimeUs - firstAudioTimeUs; - LOGV("queueDiff = %.2f secs", diff / 1E6); + ALOGV("queueDiff = %.2f secs", diff / 1E6); if (diff > 100000ll) { // Audio data starts More than 0.1 secs before video. |