diff --git a/castplus_cast_engine_part.gni b/castplus_cast_engine_part.gni index bafd8afec369e98054de230ae08c17230de78f60..6d6348b9752174c5dcc2c956833ca34d0657ad77 100644 --- a/castplus_cast_engine_part.gni +++ b/castplus_cast_engine_part.gni @@ -13,7 +13,7 @@ if (!defined(global_parts_info) || defined(global_parts_info.castplus_cast_engine)) { - castplus_cast_engine_enable = false + castplus_cast_engine_enable = true } else { castplus_cast_engine_enable = false } diff --git a/services/session/ipc/proxy/avcast_controller_callback_proxy.cpp b/services/session/ipc/proxy/avcast_controller_callback_proxy.cpp index 8f9519d5d241b7c4e043890fbba16d5077cbcfe8..77cd4e3c8bb7c85e60cfbac152de945be6f1ade5 100644 --- a/services/session/ipc/proxy/avcast_controller_callback_proxy.cpp +++ b/services/session/ipc/proxy/avcast_controller_callback_proxy.cpp @@ -168,7 +168,7 @@ void AVCastControllerCallbackProxy::OnKeyRequest(const std::string &assetId, con MessageOption option = { MessageOption::TF_ASYNC }; auto len = keyRequestData.size(); if (len > parcel.GetDataCapacity()) { - SLOGI("OnKeyRequest SetDataCapacity totalSize: %lu", len); + SLOGI("OnKeyRequest SetDataCapacity totalSize: %llu", (long long)len); parcel.SetMaxCapacity(len + len); parcel.SetDataCapacity(len); } diff --git a/services/session/ipc/proxy/avcast_controller_proxy.cpp b/services/session/ipc/proxy/avcast_controller_proxy.cpp index 8fd371ab26e15d9bceccbe11de381f31a948c1d1..526001bd40b88171b2534bc2fe04d01f38856438 100644 --- a/services/session/ipc/proxy/avcast_controller_proxy.cpp +++ b/services/session/ipc/proxy/avcast_controller_proxy.cpp @@ -207,7 +207,7 @@ int32_t AVCastControllerProxy::SetDisplaySurface(std::string& surfaceId) sptr surface = SurfaceUtils::GetInstance()->GetSurface(surfaceUniqueId); if (!surface) { - SLOGE("surface is null, surface uniqueId %{public}lu", surfaceUniqueId); + SLOGE("surface is null, surface uniqueId %{public}llu", (unsigned long long)surfaceUniqueId); return AVSESSION_ERROR; } sptr producer = surface->GetProducer(); diff --git a/services/session/ipc/stub/avcast_controller_stub.cpp b/services/session/ipc/stub/avcast_controller_stub.cpp index 6465ae0501536b0ed424ff492d5a171af420aae3..0b9cb1f1ff5861175c2b050da47e307251fa2a1d 100644 --- a/services/session/ipc/stub/avcast_controller_stub.cpp +++ b/services/session/ipc/stub/avcast_controller_stub.cpp @@ -170,7 +170,7 @@ int32_t AVCastControllerStub::HandleSetDisplaySurface(MessageParcel& data, Messa uint64_t uniqueId = pSurface->GetUniqueId(); auto surfaceId = std::to_string(uniqueId); - SLOGI("Get surface id uint64_t: %{public}lu, get the string: %{public}s", uniqueId, surfaceId.c_str()); + SLOGI("Get surface id uint64_t: %{public}llu, get the string: %{public}s", (unsigned long long)uniqueId, surfaceId.c_str()); CHECK_AND_RETURN_RET_LOG(reply.WriteInt32(SetDisplaySurface(surfaceId)), AVSESSION_ERROR, "WriteInt32 result failed"); return ERR_NONE; diff --git a/services/session/server/avrouter_impl.cpp b/services/session/server/avrouter_impl.cpp index 35bc84412f49a53808fa2de005dc958118dc8904..c75f5fa79d9dab99828474c42ef5a89c8957dad1 100644 --- a/services/session/server/avrouter_impl.cpp +++ b/services/session/server/avrouter_impl.cpp @@ -81,7 +81,7 @@ bool AVRouterImpl::Release() SLOGE("Start Release AVRouter err for no provider"); return false; } - std::lock_ground lockGuard(providerManagerLock_); + std::lock_guard lockGuard(providerManagerLock_); if (hwProvider_ == nullptr) { SLOGE("repeat check for no pvd"); diff --git a/services/session/server/avsession_item.cpp b/services/session/server/avsession_item.cpp index 94d68ef991bec92ba6b25fc1d2cde25c0e4daa40..b1a17d09c82e673093624c6b906a6e48aa433e5f 100644 --- a/services/session/server/avsession_item.cpp +++ b/services/session/server/avsession_item.cpp @@ -151,7 +151,7 @@ int32_t AVSessionItem::DestroyTask() } #ifdef CASTPLUS_CAST_ENGINE_ENABLE - SLOGI("Session destroy with castHandle: %{public}ld", castHandle_); + SLOGI("Session destroy with castHandle: %{public}lld", (long long)castHandle_); if (descriptor_.sessionTag_ != "RemoteCast" && castHandle_ > 0) { if (!collaborationNeedNetworkId_.empty()) { CollaborationManager::GetInstance().PublishServiceState(collaborationNeedNetworkId_.c_str(), @@ -612,7 +612,7 @@ sptr AVSessionItem::GetAVCastControllerInner() } supportedCastCmds = supportedCastCmds_; return; - } + }; sharedPtr->Init(castControllerProxy_, callback); { @@ -848,7 +848,7 @@ int32_t AVSessionItem::RegisterListenerStreamToCast(const std::map 0) { if (castHandleDeviceId_ == outputDeviceInfo.deviceInfos_[0].deviceId_) { - SLOGI("repeat startcast %{public}ld", castHandle_); + SLOGI("repeat startcast %{public}lld", (long long)castHandle_); return AVSESSION_ERROR; } else { SLOGI("cast check with pre cast alive %{public}ld, unregister callback", castHandle_); @@ -1102,7 +1102,7 @@ int32_t AVSessionItem::SubStartCast(const OutputDeviceInfo& outputDeviceInfo) CHECK_AND_RETURN_RET_LOG(castHandle != AVSESSION_ERROR, AVSESSION_ERROR, "StartCast failed"); castHandle_ = castHandle; - SLOGI("start cast check handle set to %{public}ld", castHandle_); + SLOGI("start cast check handle set to %{public}lld", (long long)castHandle_); int32_t ret = AddDevice(static_cast(castHandle), outputDeviceInfo); if (ret == AVSESSION_SUCCESS) { castHandleDeviceId_ = outputDeviceInfo.deviceInfos_[0].deviceId_; @@ -1124,7 +1124,7 @@ int32_t AVSessionItem::AddDevice(const int64_t castHandle, const OutputDeviceInf void AVSessionItem::DealDisconnect(DeviceInfo deviceInfo, bool isNeedRemove) { - SLOGI("Is remotecast, received disconnect event for castHandle_: %{public}ld", castHandle_); + SLOGI("Is remotecast, received disconnect event for castHandle_: %{public}lld", (long long)castHandle_); if (isNeedRemove) { AVRouter::GetInstance().UnRegisterCallback(castHandle_, cssListener_, GetSessionId()); AVRouter::GetInstance().StopCastSession(castHandle_); @@ -1329,7 +1329,7 @@ int32_t AVSessionItem::StopCast() AVSessionRadar::GetInstance().StopCastBegin(descriptor_.outputDeviceInfo_, info); int64_t ret = AVRouter::GetInstance().StopCast(castHandle_); AVSessionRadar::GetInstance().StopCastEnd(descriptor_.outputDeviceInfo_, info); - SLOGI("StopCast with unchange castHandle is %{public}ld", castHandle_); + SLOGI("StopCast with unchange castHandle is %{public}lld", (long long)castHandle_); CHECK_AND_RETURN_RET_LOG(ret != AVSESSION_ERROR, AVSESSION_ERROR, "StopCast failed"); } } @@ -1361,7 +1361,7 @@ void AVSessionItem::UnRegisterDeviceStateCallback() void AVSessionItem::StopCastSession() { - SLOGI("Stop cast session process with castHandle: %{public}ld", castHandle_); + SLOGI("Stop cast session process with castHandle: %{public}lld", (long long)castHandle_); int64_t ret = AVRouter::GetInstance().StopCastSession(castHandle_); DoContinuousTaskUnregister(); if (ret != AVSESSION_ERROR) { diff --git a/services/session/server/avsession_item.h b/services/session/server/avsession_item.h index 991dabb5d9b689b100fe7c64cd7cd352694dcf83..2cc7ba84d3dd2c755f8b6ba483c1a4c9b91ba6c8 100644 --- a/services/session/server/avsession_item.h +++ b/services/session/server/avsession_item.h @@ -425,7 +425,7 @@ private: std::shared_ptr cssListener_; std::shared_ptr iAVRouterListener_; sptr displayListener_; - std::recursive_mutex displayListenerLock_; + std::recursive_mutex mirrorToStreamLock_; std::map castDeviceInfoMap_; std::function serviceCallbackForStream_; diff --git a/services/session/server/hw_cast_provider.cpp b/services/session/server/hw_cast_provider.cpp index 80f72653747502b4d1d6c490c3d4f49121beffd2..917b542967ee8092761ef1b878ec9e033cbf4368 100644 --- a/services/session/server/hw_cast_provider.cpp +++ b/services/session/server/hw_cast_provider.cpp @@ -152,7 +152,6 @@ int HwCastProvider::StartCastSession() return castId; } -} void HwCastProvider::StopCastSession(int castId) { @@ -411,7 +410,7 @@ void HwCastProvider::OnDeviceFound(const std::vector &deviceLi void HwCastProvider::OnLogEvent(const int32_t eventId, const int64_t param) { - SLOGI("eventId is %{public}d, param is %{public}ld", eventId, param); + SLOGI("eventId is %{public}d, param is %{public}lld", eventId, (long long)param); std::lock_guard lockGuard(mutexLock_); for (auto listener : castStateListenerList_) { if (listener != nullptr) { diff --git a/services/session/server/test/BUILD.gn b/services/session/server/test/BUILD.gn index 69439117847cd3d7c52c59304842555dc81834aa..06451dda140cf4de6c54d7fe0b6458b3b5c198b3 100644 --- a/services/session/server/test/BUILD.gn +++ b/services/session/server/test/BUILD.gn @@ -100,8 +100,8 @@ ohos_unittest("AVSessionServiceSupplementTest") { "../../../../services/session:avsession_router", ] external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -161,8 +161,8 @@ ohos_unittest("RemoteSessionSinkTest") { "../../../../services/session:avsession_router", ] external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -201,8 +201,8 @@ ohos_unittest("RemoteSessionSourceTest") { "../../../../services/session:avsession_router", ] external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -486,8 +486,8 @@ ohos_unittest("AVSessionProxyTest") { "../../../../services/session:avsession_router", ] external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -837,8 +837,8 @@ ohos_unittest("AVSessionServiceTest") { "../../../../services/session:avsession_router", ] external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -1305,8 +1305,8 @@ if (castplus_cast_engine_enable) { external_deps = common_external_deps external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -1334,8 +1334,8 @@ if (castplus_cast_engine_enable) { external_deps = common_external_deps external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -1363,8 +1363,8 @@ if (castplus_cast_engine_enable) { external_deps = common_external_deps external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] } @@ -1392,8 +1392,8 @@ if (castplus_cast_engine_enable) { external_deps = common_external_deps external_deps += [ - "CollaborationFwk:cfwk_allconnect_client", - "CollaborationFwk:collaborationfwk_client", + #"CollaborationFwk:cfwk_allconnect_client", + #"CollaborationFwk:collaborationfwk_client", "cast_engine:cast_engine_client", ] }