diff --git a/frameworks/js/avplayer/avplayer_callback.cpp b/frameworks/js/avplayer/avplayer_callback.cpp index 3ac79ceca9926e29e9082870eab131f1e9c81d7b..7863306f675989d26ce52d90999fe12220067540 100644 --- a/frameworks/js/avplayer/avplayer_callback.cpp +++ b/frameworks/js/avplayer/avplayer_callback.cpp @@ -691,7 +691,7 @@ void AVPlayerCallback::OnVolumeChangeCb(const int32_t extra, const Format &infoB MEDIA_LOGD("OnVolumeChangeCb in volume=%{public}f", volumeLevel); if (refMap_.find(AVPlayerEvent::EVENT_VOLUME_CHANGE) == refMap_.end()) { - MEDIA_LOGW("can not find vol change callback!"); + MEDIA_LOGD("can not find vol change callback!"); return; } diff --git a/frameworks/js/soundpool/src/soundpool_napi.cpp b/frameworks/js/soundpool/src/soundpool_napi.cpp index 73eba963c3b38addc27ee3d149b28dc6ecc81588..bbd4e0e848c024a8e1716dceada8eb381e57c7a1 100644 --- a/frameworks/js/soundpool/src/soundpool_napi.cpp +++ b/frameworks/js/soundpool/src/soundpool_napi.cpp @@ -71,7 +71,7 @@ napi_value SoundPoolNapi::Init(napi_env env, napi_value exports) status = napi_define_properties(env, exports, sizeof(staticProperty) / sizeof(staticProperty[0]), staticProperty); CHECK_AND_RETURN_RET_LOG(status == napi_ok, nullptr, "Failed to define static function"); - MEDIA_LOGI("Init success"); + MEDIA_LOGD("Init success"); return exports; } @@ -243,7 +243,7 @@ napi_value SoundPoolNapi::JsPlay(napi_env env, napi_callback_info info) } else { asyncCtx->JsResult = std::make_unique(streamId); } - MEDIA_LOGI("The js thread of play finishes execution and returns"); + MEDIA_LOGI("The js thread of play finishes execution and returns, streamId: %{public}d", streamId); }, MediaAsyncContext::CompleteCallback, static_cast(asyncCtx.get()), &asyncCtx->work)); } else { NAPI_CALL(env, napi_create_async_work(env, nullptr, resource, [](napi_env env, void* data) {}, @@ -600,7 +600,7 @@ napi_value SoundPoolNapi::JsSetOnCallback(napi_env env, napi_callback_info info) napi_value SoundPoolNapi::JsClearOnCallback(napi_env env, napi_callback_info info) { MediaTrace trace("SoundPool::JsClearOnCallback"); - MEDIA_LOGI("JsClearOnCallback Start"); + MEDIA_LOGD("JsClearOnCallback Start"); napi_value result = nullptr; napi_get_undefined(env, &result); @@ -624,7 +624,7 @@ napi_value SoundPoolNapi::JsClearOnCallback(napi_env env, napi_callback_info inf soundPoolNapi->CancelCallbackReference(callbackName); - MEDIA_LOGI("JsClearOnCallback End"); + MEDIA_LOGI("0x%{public}06" PRIXPTR " JsClearOnCallback success", FAKE_POINTER(soundPoolNapi)); return result; } diff --git a/services/engine/histreamer/avmetadatahelper/avmetadata_collector.cpp b/services/engine/histreamer/avmetadatahelper/avmetadata_collector.cpp index 4c9f4d0f138eaf0223cb23113290340bbf9c48ae..017a0b54fe1a4b81eb092e9ef68c59155060aaee 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadata_collector.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadata_collector.cpp @@ -101,7 +101,7 @@ std::unordered_map AVMetaDataCollector::GetMetadata(const FormatAVMeta(metadata, imageTrackCount, globalInfo); auto it = metadata.tbl_.begin(); while (it != metadata.tbl_.end()) { - MEDIA_LOGI("metadata tbl, key: %{public}d, keyName: %{public}s, val: %{public}s", it->first, + MEDIA_LOGD("metadata tbl, key: %{public}d, keyName: %{public}s, val: %{public}s", it->first, AVMETA_KEY_TO_X_MAP.find(it->first)->second.c_str(), it->second.c_str()); it++; } diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index cf9e76546efd9150b74f2e58a8f8dd94dfc5002c..5d011e1899b7205bcb30ebe444585a7c892ede4d 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -140,7 +140,7 @@ void AVMetadataHelperImpl::OnError(MediaAVCodec::AVCodecErrorType errorType, int void AVMetadataHelperImpl::OnOutputFormatChanged(const MediaAVCodec::Format &format) { - MEDIA_LOGI("OnOutputFormatChanged"); + MEDIA_LOGD("OnOutputFormatChanged"); outputFormat_ = format; } @@ -148,7 +148,7 @@ void AVMetadataHelperImpl::OnInputBufferAvailable(uint32_t index, std::shared_pt { MEDIA_LOGD("OnInputBufferAvailable index:%{public}u", index); if (stopProcessing_.load()) { - MEDIA_LOGI("Has stopped processing, will not queue input buffer."); + MEDIA_LOGD("Has stopped processing, will not queue input buffer."); return; } CHECK_AND_RETURN_LOG(mediaDemuxer_ != nullptr, "OnInputBufferAvailable demuxer is nullptr."); @@ -161,7 +161,7 @@ void AVMetadataHelperImpl::OnOutputBufferAvailable(uint32_t index, std::shared_p { MEDIA_LOGD("OnOutputBufferAvailable index:%{public}u", index); if (stopProcessing_.load()) { - MEDIA_LOGI("Has stopped processing, will not release output buffer."); + MEDIA_LOGD("Has stopped processing, will not release output buffer."); return; } CHECK_AND_RETURN_LOG(videoDecoder_ != nullptr, "OnOutputBufferAvailable videoDecoder_ is nullptr"); @@ -287,8 +287,8 @@ bool AVMetadataHelperImpl::ConvertToAVSharedMemory(const sptr &su int32_t size = surfaceBuffer->GetSize(); int32_t width = surfaceBuffer->GetWidth(); int32_t height = surfaceBuffer->GetHeight(); - MEDIA_LOGI("Convert to AVSharedMemory format:%{public}d, size:%{public}d, " - "width:%{public}d, height:%{public}d", format, size, width, height); + MEDIA_LOGI("0x%{public}06" PRIXPTR " format:%{public}d, size:%{public}d, " + "width:%{public}d, height:%{public}d", FAKE_POINTER(this), format, size, width, height); std::unique_ptr yuvPixelMap = GetYuvDataAlignStride(surfaceBuffer); SourceOptions srcOpts; @@ -350,11 +350,12 @@ int32_t AVMetadataHelperImpl::SetSource(const std::string &uri, int32_t usage) } usage_ = usage; - MEDIA_LOGI("SetSource uri: %{private}s, type:%{public}d, usage: %{public}d", uri.c_str(), - uriHelper.UriType(), usage); + MEDIA_LOGI("0x%{public}06" PRIXPTR " SetSource uri: %{private}s, type:%{public}d, usage: %{public}d", + FAKE_POINTER(this), uri.c_str(), uriHelper.UriType(), usage); Status ret = SetSourceInternel(uri, usage); - CHECK_AND_RETURN_RET_LOG(ret == Status::OK, MSERR_INVALID_VAL, "Failed to call SetSourceInternel"); + CHECK_AND_RETURN_RET_LOG(ret == Status::OK, MSERR_INVALID_VAL, + "0x%{public}06" PRIXPTR " Failed to call SetSourceInternel", FAKE_POINTER(this)); return MSERR_OK; } @@ -390,12 +391,12 @@ std::string AVMetadataHelperImpl::ResolveMetadata(int32_t key) std::unordered_map AVMetadataHelperImpl::ResolveMetadata() { - MEDIA_LOGI("enter ResolveMetadata"); + MEDIA_LOGD("enter ResolveMetadata"); int32_t ret = ExtractMetadata(); CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, {}, "Failed to call ExtractMetadata"); - MEDIA_LOGI("exit ResolveMetadata"); + MEDIA_LOGD("exit ResolveMetadata"); return collectedMeta_; } @@ -433,12 +434,11 @@ std::shared_ptr AVMetadataHelperImpl::GetTargetTrackInfo() Plugins::MediaType mediaType; CHECK_AND_RETURN_RET_LOG(trackInfos[index]->GetData(Tag::MEDIA_TYPE, mediaType), nullptr, "GetTargetTrackInfo failed to get mediaType, index:%{public}d", index); - MEDIA_LOGI("GetData mediaType:%{public}d", static_cast(mediaType)); CHECK_AND_RETURN_RET_LOG(mediaType == Plugins::MediaType::VIDEO, nullptr, "GetTargetTrackInfo mediaType is not video, index:%{public}d", index); trackIndex_ = index; - MEDIA_LOGI("GetTargetTrackInfo success trackIndex_:%{public}d, trackMime_:%{public}s", - trackIndex_, trackMime_.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " GetTrackInfo success trackIndex_:%{public}d, trackMime_:%{public}s", + FAKE_POINTER(this), trackIndex_, trackMime_.c_str()); return trackInfos[trackIndex_]; } } @@ -470,14 +470,15 @@ std::shared_ptr AVMetadataHelperImpl::FetchFrameAtTime( mediaDemuxer_->SelectTrack(trackIndex_); int64_t realSeekTime = timeUs; mediaDemuxer_->SeekTo(timeUs, static_cast(option), realSeekTime); - MEDIA_LOGI("FetchFrameAtTime realSeekTime:%{public}" PRId64"", realSeekTime); + MEDIA_LOGI("0x%{public}06" PRIXPTR " FetchFrameAtTime realSeekTime:%{public}" PRId64"", + FAKE_POINTER(this), realSeekTime); { std::unique_lock lock(mutex_); // wait up to 3s to fetch frame AVSharedMemory at time. if (cond_.wait_for(lock, std::chrono::seconds(3), [this] {return hasFetchedFrame_.load();})) { - MEDIA_LOGI("Fetch frame OK srcUri_:%{private}s, width:%{public}d, height:%{public}d", - srcUri_.c_str(), outputConfig_.dstWidth, outputConfig_.dstHeight); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Fetch frame OK width:%{public}d, height:%{public}d", + FAKE_POINTER(this), outputConfig_.dstWidth, outputConfig_.dstHeight); } else { hasFetchedFrame_ = true; MEDIA_LOGI("Fetch frame timeout srcUri_:%{private}s, width:%{public}d, height:%{public}d", @@ -497,7 +498,8 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, int32_t u "SetSourceInternel demuxer is nullptr"); mediaDemuxer_->SetEventReceiver(std::make_shared(this)); Status ret = mediaDemuxer_->SetDataSource(std::make_shared(srcUri_)); - CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "SetSourceInternel demuxer failed to call SetDataSource"); + CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, + "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); return Status::OK; } @@ -549,7 +551,7 @@ void AVMetadataHelperImpl::Destroy() videoDecoder_->Release(); } - MEDIA_LOGI("Finish Destroy."); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Finish Destroy.", FAKE_POINTER(this)); } Status AVMetadataHelperImpl::InitDecoder() @@ -558,7 +560,7 @@ Status AVMetadataHelperImpl::InitDecoder() MEDIA_LOGD("InitDecoder already."); return Status::OK; } - MEDIA_LOGI("Init decoder start."); + MEDIA_LOGD("Init decoder start."); videoDecoder_ = MediaAVCodec::VideoDecoderFactory::CreateByMime(trackMime_); CHECK_AND_RETURN_RET_LOG(videoDecoder_ != nullptr, Status::ERROR_NO_MEMORY, "Create videoDecoder_ is nullptr"); @@ -568,7 +570,8 @@ Status AVMetadataHelperImpl::InitDecoder() int32_t height; trackFormat.GetIntValue(MediaDescriptionKey::MD_KEY_WIDTH, width); trackFormat.GetIntValue(MediaDescriptionKey::MD_KEY_HEIGHT, height); - MEDIA_LOGI("Init decoder trackFormat width:%{public}d, height:%{public}d", width, height); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Init decoder trackFormat width:%{public}d, height:%{public}d", + FAKE_POINTER(this), width, height); trackFormat.PutIntValue(MediaDescriptionKey::MD_KEY_PIXEL_FORMAT, static_cast(Plugins::VideoPixelFormat::NV12)); videoDecoder_->Configure(trackFormat); @@ -578,7 +581,7 @@ Status AVMetadataHelperImpl::InitDecoder() videoDecoder_->SetOutputSurface(producerSurface_); videoDecoder_->Prepare(); videoDecoder_->Start(); - MEDIA_LOGI("Init decoder success."); + MEDIA_LOGD("Init decoder success."); return Status::OK; } diff --git a/services/services/avmetadatahelper/ipc/avmetadatahelper_service_stub.cpp b/services/services/avmetadatahelper/ipc/avmetadatahelper_service_stub.cpp index 7b441c4938aeec010c4168cbe9e334b8ba7c1e1a..7146259d05e8da75ccf2c7d4502f90c4f4fa07ff 100644 --- a/services/services/avmetadatahelper/ipc/avmetadatahelper_service_stub.cpp +++ b/services/services/avmetadatahelper/ipc/avmetadatahelper_service_stub.cpp @@ -81,7 +81,8 @@ int32_t AVMetadataHelperServiceStub::DestroyStub() int AVMetadataHelperServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - MEDIA_LOGI("Stub: OnRemoteRequest of code: %{public}u is received", code); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Stub: OnRemoteRequest of code: %{public}u is received", + FAKE_POINTER(this), code); auto remoteDescriptor = data.ReadInterfaceToken(); if (AVMetadataHelperServiceStub::GetDescriptor() != remoteDescriptor) { diff --git a/services/services/avmetadatahelper/server/avmetadatahelper_server.cpp b/services/services/avmetadatahelper/server/avmetadatahelper_server.cpp index 0dbef98a31955c6b21d47c2d04f13dd4780efca2..1c5c0e9dec07f50fa271adb1026c3ecece2ca095 100644 --- a/services/services/avmetadatahelper/server/avmetadatahelper_server.cpp +++ b/services/services/avmetadatahelper/server/avmetadatahelper_server.cpp @@ -87,7 +87,7 @@ int32_t AVMetadataHelperServer::SetSource(const std::string &uri, int32_t usage) CHECK_AND_RETURN_RET_LOG(avMetadataHelperEngine_ != nullptr, (int32_t)MSERR_CREATE_AVMETADATAHELPER_ENGINE_FAILED, "Failed to create avmetadatahelper engine."); int32_t ret = avMetadataHelperEngine_->SetSource(uriHelper_->FormattedUri(), usage); - CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "SetSource failed"); + CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "0x%{public}06" PRIXPTR " SetSource failed", FAKE_POINTER(this)); return ret; }); int32_t ret = taskQue_.EnqueueTask(task); diff --git a/services/services/factory/engine_factory_repo.cpp b/services/services/factory/engine_factory_repo.cpp index 8a65cfaabb57145d3d16b904a6b3378b97bc65ed..e00de0040597bbead4ea3abff785cdc5f4d48115 100644 --- a/services/services/factory/engine_factory_repo.cpp +++ b/services/services/factory/engine_factory_repo.cpp @@ -116,7 +116,7 @@ int32_t EngineFactoryRepo::LoadHistreamerEngine(const int32_t& appUid) { std::unique_lock lock(mutex_); if (isLoadHistreamer_) { - MEDIA_LOGI("Histreamer is enabled"); + MEDIA_LOGD("Histreamer is enabled"); return MSERR_OK; } diff --git a/services/services/player/ipc/player_service_proxy.cpp b/services/services/player/ipc/player_service_proxy.cpp index eea8b68e474dfbb4ede7300a05e0d44cb3ca58fa..6c42ea9673956cd4ca39992999206d1593df38d8 100644 --- a/services/services/player/ipc/player_service_proxy.cpp +++ b/services/services/player/ipc/player_service_proxy.cpp @@ -84,7 +84,8 @@ int32_t PlayerServiceProxy::SendRequest(uint32_t code, MessageParcel &data, Mess if (itFunc != playerFuncs_.end()) { funcName = itFunc->second; } - MEDIA_LOGI("Proxy: SendRequest task: %{public}s is received", funcName.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Proxy: SendRequest task: %{public}s is received", + FAKE_POINTER(this), funcName.c_str()); int32_t error = -1; error = Remote()->SendRequest(code, data, reply, option); return error; diff --git a/services/services/player/ipc/player_service_stub.cpp b/services/services/player/ipc/player_service_stub.cpp index 89d0f692eb333081059b713cbfd7642f0675f541..629b65c989e0a55282b3a51c8c4c0c6bb71e6c69 100644 --- a/services/services/player/ipc/player_service_stub.cpp +++ b/services/services/player/ipc/player_service_stub.cpp @@ -154,7 +154,8 @@ int PlayerServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa if (itFunc != playerFuncs_.end()) { auto memberFunc = itFunc->second.first; auto funcName = itFunc->second.second; - MEDIA_LOGI("Stub: OnRemoteRequest task: %{public}s is received", funcName.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Stub: OnRemoteRequest task: %{public}s is received", + FAKE_POINTER(this), funcName.c_str()); if (memberFunc != nullptr) { auto task = std::make_shared>([&, this] { (void)IpcRecovery(false); diff --git a/services/services/player/server/player_server_state.cpp b/services/services/player/server/player_server_state.cpp index 2d395acd757d165da239133562129cf81e33c4b8..0075547fbe1813a4b7190d4674286d261f34b4ab 100644 --- a/services/services/player/server/player_server_state.cpp +++ b/services/services/player/server/player_server_state.cpp @@ -113,8 +113,8 @@ int32_t PlayerServer::BaseState::MessageStateChange(int32_t extra) } else { HandleStateChange(extra); BehaviorEventWrite(server_.GetStatusDescription(extra).c_str(), "Player"); - MEDIA_LOGI("Callback State change, currentState is %{public}s", - server_.GetStatusDescription(extra).c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " Callback State change, currentState is %{public}s", + FAKE_POINTER(this), server_.GetStatusDescription(extra).c_str()); } if (extra == PLAYER_STOPPED && server_.disableStoppedCb_) { diff --git a/services/services/player/server/player_server_task_mgr.cpp b/services/services/player/server/player_server_task_mgr.cpp index a6e741f1494af7aeff4c262a56541cedd0ab11d1..5332e12e0ac2883ea76081543738b334ff8f27e7 100644 --- a/services/services/player/server/player_server_task_mgr.cpp +++ b/services/services/player/server/player_server_task_mgr.cpp @@ -59,7 +59,7 @@ int32_t PlayerServerTaskMgr::EnqueueTask(const std::shared_ptr &ta currTwoPhaseTask_ = task; currTwoPhaseType_ = type; currTwoPhaseTaskName_ = taskName; - MEDIA_LOGI("task[%{public}s] start", currTwoPhaseTaskName_.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " task[%{public}s] start", FAKE_POINTER(this), currTwoPhaseTaskName_.c_str()); return MSERR_OK; } @@ -80,8 +80,8 @@ int32_t PlayerServerTaskMgr::LaunchTask(const std::shared_ptr &tas if (currTwoPhaseTask_ == nullptr) { return EnqueueTask(task, type, taskName); } else { - MEDIA_LOGI("current task[%{public}s] is in processing, the new task[%{public}s]", - currTwoPhaseTaskName_.c_str(), taskName.c_str()); + MEDIA_LOGI("current 0x%{public}06" PRIXPTR " task[%{public}s] is in processing, the new task[%{public}s]", + FAKE_POINTER(this), currTwoPhaseTaskName_.c_str(), taskName.c_str()); pendingTwoPhaseTasks_.push_back({ type, task, nullptr, taskName }); } } @@ -165,7 +165,7 @@ int32_t PlayerServerTaskMgr::MarkTaskDone(const std::string &taskName) std::unique_lock lock(mutex_); CHECK_AND_RETURN_RET_LOG(isInited_, MSERR_INVALID_OPERATION, "not init"); - MEDIA_LOGI("task[%{public}s] end", taskName.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " task[%{public}s] end", FAKE_POINTER(this), taskName.c_str()); currTwoPhaseTask_ = nullptr; currTwoPhaseType_ = PlayerServerTaskType::BUTT; currTwoPhaseTaskName_ = "None"; @@ -192,7 +192,8 @@ int32_t PlayerServerTaskMgr::MarkTaskDone(const std::string &taskName) CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "execute the stack top task failed, type: %{public}hhu", item.type); - MEDIA_LOGI("task[%{public}s] start", currTwoPhaseTaskName_.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " task[%{public}s] start", + FAKE_POINTER(this), currTwoPhaseTaskName_.c_str()); } return MSERR_OK; } diff --git a/services/utils/uri_helper.cpp b/services/utils/uri_helper.cpp index b4dfe545af8da8939ad61a37c91c7c1603ea58a5..ac390bf4849fc018417da190c74b85f1a9fa170e 100644 --- a/services/utils/uri_helper.cpp +++ b/services/utils/uri_helper.cpp @@ -166,7 +166,7 @@ void UriHelper::FormatMeForUri(const std::string_view &uri) noexcept break; } - MEDIA_LOGI("formatted uri: %{public}s", formattedUri_.c_str()); + MEDIA_LOGI("0x%{public}06" PRIXPTR " formatted uri: %{private}s", FAKE_POINTER(this), formattedUri_.c_str()); } void UriHelper::FormatMeForFd() noexcept