From cfc9eaf36b4f243f7bf75a2a4b0ae522fa23ed55 Mon Sep 17 00:00:00 2001 From: "zhupengfei (F)" Date: Fri, 15 Aug 2025 14:31:14 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhupengfei (F) --- frameworks/cj/audio_haptic/src/cj_audio_haptic_ffi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/cj/audio_haptic/src/cj_audio_haptic_ffi.cpp b/frameworks/cj/audio_haptic/src/cj_audio_haptic_ffi.cpp index 8ffa8f397..0ec3131dc 100644 --- a/frameworks/cj/audio_haptic/src/cj_audio_haptic_ffi.cpp +++ b/frameworks/cj/audio_haptic/src/cj_audio_haptic_ffi.cpp @@ -18,7 +18,7 @@ #include "cj_audio_haptic_manager.h" #include "cj_audio_haptic_player.h" -namespace OHOS { +namespace OHOS { namespace Media { extern "C" { -- Gitee From 8578b38e721a41ba3a69ad099be15979e235fa86 Mon Sep 17 00:00:00 2001 From: zpf Date: Mon, 18 Aug 2025 17:41:44 +0800 Subject: [PATCH 02/11] =?UTF-8?q?log=E7=AD=89=E7=BA=A7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zpf22 --- services/engine/histreamer/transcoder/hitranscoder_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/engine/histreamer/transcoder/hitranscoder_impl.cpp b/services/engine/histreamer/transcoder/hitranscoder_impl.cpp index 782135e39..72a7aafe3 100644 --- a/services/engine/histreamer/transcoder/hitranscoder_impl.cpp +++ b/services/engine/histreamer/transcoder/hitranscoder_impl.cpp @@ -27,7 +27,7 @@ #include "osal/task/pipeline_threadpool.h" namespace { -constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_ONLY_PRERELEASE, LOG_DOMAIN_SYSTEM_PLAYER, "HiTransCoder" }; +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_DOMAIN_SYSTEM_PLAYER, "HiTransCoder" }; constexpr int32_t REPORT_PROGRESS_INTERVAL = 100; constexpr int32_t TRANSCODER_COMPLETE_PROGRESS = 100; constexpr int32_t MINIMUM_WIDTH_HEIGHT = 240; -- Gitee From a227cce56aa07e89ffe947c7929ec2e5e210791d Mon Sep 17 00:00:00 2001 From: zpf Date: Thu, 28 Aug 2025 06:54:45 +0000 Subject: [PATCH 03/11] update hisysevent.yaml. Signed-off-by: zpf --- hisysevent.yaml | 580 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 580 insertions(+) diff --git a/hisysevent.yaml b/hisysevent.yaml index 93fe8d376..097e8c0bc 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -1,3 +1,583 @@ +From 3883f1fbe3d13149e8a268d4fe55141e558e76b5 Mon Sep 17 00:00:00 2001 +From: z00654174 +Date: Thu, 28 Aug 2025 09:55:56 +0800 +Subject: [PATCH] TicketNo:DTS2022071803909 Description: pts Team:OTHERS + Feature or Bugfix:Bugfix Binary Source:NA PrivateCode(Yes/No):No + +Change-Id: Ic56a08bf0e57af135fe5d42d8c021fdd0250cf41 +--- + .../lppplayer/native_lpp_video_streamer.cpp | 12 ++++++++++++ + .../video_streamer_impl.cpp | 9 +++++++++ + .../lpp_video_streamer/video_streamer_impl.h | 2 ++ + .../inner_api/native/lpp_video_streamer.h | 2 ++ + interfaces/kits/c/lowpower_video_sink.h | 14 ++++++++++++++ + .../lpp/lpp_sync_manager/lpp_sync_manager.h | 1 + + .../lpp_sync_manager_adapter.h | 2 ++ + .../lpp_sync_manager/src/lpp_sync_manager.cpp | 10 ++++++++++ + .../src/lpp_sync_manager_adapter.cpp | 8 ++++++++ + .../lpp_video_streamer/hilpp_vstreamer_impl.h | 1 + + .../src/hilpp_vstreamer_impl.cpp | 7 +++++++ + .../include/i_lpp_video_streamer_service.h | 2 ++ + .../services/engine_intf/i_lpp_sync_manager.h | 1 + + .../engine_intf/i_lpp_video_streamer.h | 1 + + .../client/lpp_video_streamer_client.cpp | 9 +++++++++ + .../client/lpp_video_streamer_client.h | 2 ++ + .../i_standard_lpp_video_streamer_service.h | 3 +++ + .../ipc/lpp_video_streamer_service_proxy.cpp | 19 +++++++++++++++++++ + .../ipc/lpp_video_streamer_service_proxy.h | 2 ++ + .../ipc/lpp_video_streamer_service_stub.cpp | 19 +++++++++++++++++++ + .../ipc/lpp_video_streamer_service_stub.h | 3 +++ + .../server/lpp_video_streamer_server.cpp | 9 +++++++++ + .../server/lpp_video_streamer_server.h | 2 ++ + .../mock/i_lpp_sync_manager.h | 1 + + .../mock/hilpp_vstreamer_impl.h | 1 + + .../mock/lpp_sync_manager.h | 1 + + .../mock/lpp_sync_manager_adapter.h | 1 + + .../mock/v1_0/ilpp_sync_manager_adapter.h | 1 + + .../mock/lpp_sync_manager.h | 2 +- + .../mock/lpp_sync_manager_adapter.h | 1 + + .../mock/lpp_sync_manager.h | 1 + + 31 files changed, 148 insertions(+), 1 deletion(-) + +diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +index 2147b2427..5ed1622b2 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp ++++ b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +@@ -634,6 +634,7 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetStreamChangedListener( + int32_t res = callback->SetStreamChangedListener(onStreamChanged, userData); + return LppMsErrToOHAvErr(res); + } ++ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPowerVideoSinkCallback *callback, + OH_LowPowerVideoSink_OnFirstFrameDecoded onFirstFrameDecoded, void *userData) + { +@@ -643,3 +644,14 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow + int32_t res = callback->SetFirstFrameReadyListener(onFirstFrameDecoded, userData); + return LppMsErrToOHAvErr(res); + } ++ ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *streamer, int64_t *pts) ++{ ++ MEDIA_LOGD("OH_LowPowerVideoSink_GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamer != nullptr, AV_ERR_INVALID_VAL, "streamer is nullptr!"); ++ LowPowerVideoSinkObject *streamerObj = reinterpret_cast(streamer); ++ CHECK_AND_RETURN_RET_LOG(streamerObj != nullptr, AV_ERR_INVALID_VAL, "streamerObj is nullptr"); ++ CHECK_AND_RETURN_RET_LOG(streamerObj->videoStreamer_ != nullptr, AV_ERR_INVALID_VAL, "videoStreamer_ is nullptr"); ++ int32_t res = streamerObj->videoStreamer_->GetLatestPts(*pts); ++ return LppMsErrToOHAvErr(res); ++} +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +index f7adadd72..3f12cdfdf 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +@@ -262,5 +262,14 @@ std::string VideoStreamerImpl::GetStreamerId() + CHECK_AND_RETURN_RET_LOG(streamerService_ != nullptr, "", "player service does not exist.."); + return streamerService_->GetStreamerId(); + } ++ ++int32_t VideoStreamerImpl::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("VideoStreamerImpl GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamerService_ != nullptr, MSERR_SERVICE_DIED, "GetLatestPts player service does not exist.."); ++ int32_t ret = streamerService_->GetLatestPts(pts); ++ pts = (ret == MSERR_OK) ? pts : 0; ++ return ret; ++} + } // namespace Media + } // namespace OHOS +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.h b/frameworks/native/lpp_video_streamer/video_streamer_impl.h +index 16015c442..1a0b1e3e9 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.h ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.h +@@ -76,6 +76,8 @@ public: + + std::string GetStreamerId() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + private: + std::shared_ptr callback_; + std::shared_ptr streamerService_ = nullptr; +diff --git a/interfaces/inner_api/native/lpp_video_streamer.h b/interfaces/inner_api/native/lpp_video_streamer.h +index d29cd78a0..34de7d154 100644 +--- a/interfaces/inner_api/native/lpp_video_streamer.h ++++ b/interfaces/inner_api/native/lpp_video_streamer.h +@@ -103,6 +103,8 @@ public: + virtual int32_t RenderFirstFrame() = 0; + + virtual std::string GetStreamerId() = 0; ++ ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + + class __attribute__((visibility("default"))) VideoStreamerFactory { +diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h +index d1c11f7e3..f74db9821 100644 +--- a/interfaces/kits/c/lowpower_video_sink.h ++++ b/interfaces/kits/c/lowpower_video_sink.h +@@ -314,6 +314,20 @@ OH_AVErrCode OH_LowPowerVideoSink_SetTargetStartFrame( + const int64_t timeoutMs, + void* userData); + ++/** ++ * @brief Get the latest presentation timestamp (PTS) from lowpower video sink. ++ * ++ * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance. ++ * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds). ++ * @return Returns AV_ERR_OK if the timestamp is obtained successfully; ++ * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}: ++ * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid. ++ * {@link AV_ERR_SERVICE_DIED} media service is died. ++ * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted. ++ * @since 21 ++ */ ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *streamer, int64_t *pts); ++ + /** + * @brief Set playback speed for the lowpower video sink + * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h +index 229bbb003..52029e9a6 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h +@@ -50,6 +50,7 @@ public: + int32_t SetTunnelId(uint64_t tunnelId) override; + int32_t SetAudioIsLpp(bool isLpp) override; + void SetEventReceiver(std::shared_ptr eventReceiver) override; ++ int32_t GetLatestPts(int64_t &pts) override; + + private: + void ResetTimeAnchor(); +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h +index c602d662d..a78c947e6 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h +@@ -56,6 +56,8 @@ public: + int32_t UnbindOutputBuffers(); + int32_t GetShareBuffer(int32_t &fd); + int32_t SetTunnelId(uint64_t tunnelId); ++ int32_t GetLatestPts(int64_t &pts); ++ + void OnError(const int32_t errorCode, const std::string &errorMsg); + void OnTargetArrived(const int64_t targetPts, const bool isTimeout); + void OnRenderStarted(); +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp +index c6b7cdf88..392286602 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp +@@ -263,6 +263,16 @@ int32_t LppSyncManager::SetTunnelId(uint64_t tunnelId) + return MSERR_OK; + } + ++int32_t LppSyncManager::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOG_I("LppSyncManager::GetLatestPts"); ++ FALSE_RETURN_V_NOLOG(videoIsLpp_, MSERR_UNKNOWN); ++ FALSE_RETURN_V_MSG_E(adapter_ != nullptr, MSERR_INVALID_OPERATION, "adapter_ is nullptr"); ++ auto ret = adapter_->GetLatestPts(pts); ++ FALSE_RETURN_V_MSG_E(ret == MSERR_OK, ret, "adapter_ GetLatestPts failed"); ++ return MSERR_OK; ++} ++ + int32_t LppSyncManager::SetAudioIsLpp(bool isLpp) + { + audioIsLpp_ = isLpp; +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp +index 87b1d5615..dc5aa9195 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp +@@ -321,6 +321,14 @@ int32_t LppSyncManagerAdapter::SetTunnelId(uint64_t tunnelId) + return MSERR_OK; + } + ++int32_t LppSyncManagerAdapter::GetLatestPts(int64_t &pts) ++{ ++ MediaTrace trace("LppSyncManagerAdapter::GetLatestPts"); ++ MEDIA_LOG_I("GetLatestPts enter"); ++ FALSE_RETURN_V_MSG_E(syncMgrAdapter_ != nullptr, MSERR_INVALID_OPERATION, "syncMgrAdapter_ is nullptr"); ++ return syncMgrAdapter_->GetLatestPts(pts); ++} ++ + void LppSyncManagerAdapter::SetEventReceiver(std::shared_ptr eventReceiver) + { + eventReceiver_ = eventReceiver; +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h b/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h +index f39780d21..dd95907cc 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h +@@ -55,6 +55,7 @@ public: + std::string GetStreamerId() override; + std::shared_ptr GetLppSyncManager() override; + int32_t RenderFirstFrame() override; ++ int32_t GetLatestPts(int64_t &pts) override; + void OnEvent(const Event &event); + + private: +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +index 782c14678..3de63dc00 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +@@ -130,6 +130,13 @@ int32_t HiLppVideoStreamerImpl::SetParameter(const Format ¶m) + return MSERR_OK; + } + ++int32_t HiLppVideoStreamerImpl::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOG_I("HiLppVideoStreamerImpl::GetLatestPts"); ++ FALSE_RETURN_V_MSG(vdec_ != nullptr, MSERR_INVALID_OPERATION, "vdec_ nullptr"); ++ return syncMgr_->GetLatestPts(pts); ++} ++ + int32_t HiLppVideoStreamerImpl::Configure(const Format ¶m) + { + FALSE_RETURN_V_MSG(vdec_ != nullptr, MSERR_INVALID_OPERATION, "vdec_ nullptr"); +diff --git a/services/include/i_lpp_video_streamer_service.h b/services/include/i_lpp_video_streamer_service.h +index ffdc2c52f..770d1470e 100644 +--- a/services/include/i_lpp_video_streamer_service.h ++++ b/services/include/i_lpp_video_streamer_service.h +@@ -75,6 +75,8 @@ public: + virtual std::string GetStreamerId() = 0; + + virtual int32_t RenderFirstFrame() = 0; ++ ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + } // namespace Media + } // namespace OHOS +diff --git a/services/services/engine_intf/i_lpp_sync_manager.h b/services/services/engine_intf/i_lpp_sync_manager.h +index 2edba8cee..38f9bf540 100644 +--- a/services/services/engine_intf/i_lpp_sync_manager.h ++++ b/services/services/engine_intf/i_lpp_sync_manager.h +@@ -50,6 +50,7 @@ public: + virtual int32_t SetTunnelId(uint64_t tunnelId) = 0; + virtual int32_t SetAudioIsLpp(bool isLpp) = 0; + virtual void SetEventReceiver(std::shared_ptr eventReceiver) = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + + } +diff --git a/services/services/engine_intf/i_lpp_video_streamer.h b/services/services/engine_intf/i_lpp_video_streamer.h +index 507230511..c411b1c94 100644 +--- a/services/services/engine_intf/i_lpp_video_streamer.h ++++ b/services/services/engine_intf/i_lpp_video_streamer.h +@@ -66,6 +66,7 @@ public: + virtual std::string GetStreamerId() = 0; + virtual std::shared_ptr GetLppSyncManager() = 0; + virtual int32_t RenderFirstFrame() = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp +index 952fda07b..e48bdd064 100644 +--- a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp ++++ b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp +@@ -243,5 +243,14 @@ void LppVideoStreamerClient::MediaServerDied() + "mediaserver is died, please create a new video sink instance again"); + } + } ++ ++int32_t LppVideoStreamerClient::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerClient GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(playerProxy_ != nullptr, MSERR_SERVICE_DIED, "LppVideoStreamerClient GetLatestPts player service does not exist.."); ++ int32_t ret = playerProxy_->GetLatestPts(pts); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "LppVideoStreamerClient GetLatestPts failed."); ++ return MSERR_OK; ++} + } // namespace Media + } // namespace OHOS +\ No newline at end of file +diff --git a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h +index 7b5a6885d..325f8e4a1 100644 +--- a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h ++++ b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h +@@ -76,6 +76,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + void MediaServerDied(); + + private: +diff --git a/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h b/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h +index 32982afbf..c9928ef1d 100644 +--- a/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h ++++ b/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h +@@ -80,6 +80,8 @@ public: + + virtual int32_t RenderFirstFrame() = 0; + ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; ++ + /** + * IPC code ID + */ +@@ -109,6 +111,7 @@ public: + GET_STREAM_ID, + SET_AUDIO_STREAMER_ID, + RENDER_FIRST_FRAME, ++ GET_LATEST_PTS, + MAX_IPC_ID, // all IPC codes should be added before MAX_IPC_ID + }; + +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp +index c4556605e..898d65663 100644 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp +@@ -429,5 +429,24 @@ int32_t LppVideoStreamerServiceProxy::RenderFirstFrame() + return reply.ReadInt32(); + } + ++int32_t LppVideoStreamerServiceProxy::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServiceProxy GetLatestPts"); ++ MessageParcel data; ++ MessageParcel reply; ++ MessageOption option; ++ ++ bool token = data.WriteInterfaceToken(LppVideoStreamerServiceProxy::GetDescriptor()); ++ CHECK_AND_RETURN_RET_LOG(token, MSERR_INVALID_OPERATION, "Failed to write descriptor!"); ++ ++ int32_t error = Remote()->SendRequest(GET_LATEST_PTS, data, reply, option); ++ CHECK_AND_RETURN_RET_LOG( ++ error == MSERR_OK, MSERR_INVALID_OPERATION, "GetLatestPts SendRequest failed, error: %{public}d", error); ++ int32_t ret = reply.ReadInt32(); ++ pts = reply.ReadInt64(); ++ CHECK_AND_RETURN_RET_LOG( ++ ret == MSERR_OK, MSERR_INVALID_OPERATION, "GetLatestPts failed, error: %{public}d", ret); ++ return ret; ++} + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h +index efc84e5a7..3ba478a87 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h +@@ -74,6 +74,8 @@ public: + + std::string GetStreamerId() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + int32_t RenderFirstFrame() override; + private: + static inline BrokerDelegator delegator_; +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp +index a3c2b2974..824ff6a35 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp +@@ -134,6 +134,8 @@ void LppVideoStreamerServiceStub::FillPlayerFuncPart1() + [this](MessageParcel &data, MessageParcel &reply) { return GetStreamerId(data, reply); }}; + playerFuncs_[RENDER_FIRST_FRAME] = {"Player::RenderFirstFrame", + [this](MessageParcel &data, MessageParcel &reply) { return RenderFirstFrame(data, reply); }}; ++ playerFuncs_[GET_LATEST_PTS] = {"Player::GetLatestPts", ++ [this](MessageParcel &data, MessageParcel &reply) { return GetLatestPts(data, reply); }}; + } + + int LppVideoStreamerServiceStub::OnRemoteRequest( +@@ -532,5 +534,22 @@ int32_t LppVideoStreamerServiceStub::RenderFirstFrame(MessageParcel &data, Messa + return MSERR_OK; + } + ++int32_t LppVideoStreamerServiceStub::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServiceStub::GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(lppVideoPlayerServer_ != nullptr, MSERR_INVALID_OPERATION, "player server is nullptr"); ++ return lppVideoPlayerServer_->GetLatestPts(pts); ++} ++ ++int32_t LppVideoStreamerServiceStub::GetLatestPts(MessageParcel &data, MessageParcel &reply) ++{ ++ (void)data; ++ int64_t pts = 0; ++ int32_t ret = GetLatestPts(pts); ++ MEDIA_LOGI("LppVideoStreamerServiceStub::GetLatestPts %{public}d %{public}ld", ret, pts); ++ reply.WriteInt32(ret); ++ reply.WriteInt64(pts); ++ return MSERR_OK; ++} + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h +index eca927564..5ec967147 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h +@@ -81,6 +81,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + int32_t Init(); + void SetPlayerFuncs(); + void FillPlayerFuncPart1(); +@@ -114,6 +116,7 @@ public: + int32_t SetLppAudioStreamerId(MessageParcel &data, MessageParcel &reply); + int32_t GetStreamerId(MessageParcel &data, MessageParcel &reply); + int32_t RenderFirstFrame(MessageParcel &data, MessageParcel &reply); ++ int32_t GetLatestPts(MessageParcel &data, MessageParcel &reply); + + std::shared_ptr lppVideoPlayerServer_ = nullptr; + std::map> playerFuncs_; +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp +index aed5713f7..d1e3a1b1b 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp +@@ -287,6 +287,15 @@ int32_t LppVideoStreamerServer::SetLppVideoStreamerCallback(const std::shared_pt + return MSERR_OK; + } + ++int32_t LppVideoStreamerServer::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServer GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamerEngine_ != nullptr, MSERR_INVALID_OPERATION, "streamerEngine_ is nullptr"); ++ auto ret = streamerEngine_->GetLatestPts(pts); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "GetLatestPts Failed!"); ++ return ret; ++} ++ + int32_t LppVideoStreamerServer::SetLppAudioStreamerId(const std::string audioStreamId) + { + MEDIA_LOGI("LppVideoStreamerServer SetLppAudioStreamerId"); +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +index beec97728..0fbf7b171 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +@@ -94,6 +94,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + void OnDataNeeded(const int32_t maxBufferSize, const int32_t maxFrameNum) override; + bool OnAnchorUpdateNeeded(int64_t &anchorPts, int64_t &anchorClk) override; + void OnError(const MediaServiceErrCode errCode, const std::string &errMsg) override; +diff --git a/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h b/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h +index 25e1a4f3a..be06f4c77 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h +@@ -49,6 +49,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + } + } +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h +index 59dd5614a..22cb8bee1 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h +@@ -52,6 +52,7 @@ public: + std::string GetStreamerId() override; + std::shared_ptr GetLppSyncManager() override; + int32_t RenderFirstFrame() override; ++ int32_t GetLatestPts(int64_t &pts) override; + void OnEvent(const Event &event); + + private: +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h +index 73382ddfc..759e78384 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h +@@ -53,6 +53,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId), (override)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp), (override)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver), (override)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts), (override)); + }; + } // namespace Media + } // namespace OHOS +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h +index ffeb753ab..22c25138f 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h +@@ -51,6 +51,7 @@ public: + MOCK_METHOD(int32_t, GetShareBuffer, (int32_t& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + + class LowPowerPlayerFactory { +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h +index b522cb9dd..9c6e41ca8 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h +@@ -51,6 +51,7 @@ public: + MOCK_METHOD(int32_t, UnbindOutputBuffers, ()); + MOCK_METHOD(int32_t, GetShareBuffer, (int& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + } // V1_0 + } // LowPowerPlayer +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h +index 2bb991ea2..ef1f08996 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h +@@ -49,7 +49,7 @@ public: + int32_t SetTunnelId(uint64_t tunnelId); + int32_t SetAudioIsLpp(bool isLpp); + void SetEventReceiver(std::shared_ptr eventReceiver); +- ++ int32_t GetLatestPts(int64_t &pts); + private: + void ResetTimeAnchor(); + +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h +index 8c9532f45..341b27ab2 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h +@@ -52,6 +52,7 @@ public: + MOCK_METHOD(int32_t, GetShareBuffer, (int32_t& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + + class LowPowerPlayerFactory { +diff --git a/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h +index f7b3c55f1..6f4f09db0 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h +@@ -52,6 +52,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId), (override)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp), (override)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver), (override)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts), (override)); + }; + } // namespace Media + } // namespace OHOS +-- +2.45.2.huawei.10 + + + + + + + + + + + + + + + + + + + + + + + + + # Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -- Gitee From 6b7550de67988c39aa02ac8fb04bd1929629f1a2 Mon Sep 17 00:00:00 2001 From: zpf Date: Fri, 29 Aug 2025 06:08:49 +0000 Subject: [PATCH 04/11] update multimedia_player_framework_aafwk.gni. Signed-off-by: zpf --- multimedia_player_framework_aafwk.gni | 1049 +++++++++++++++++++++++++ 1 file changed, 1049 insertions(+) diff --git a/multimedia_player_framework_aafwk.gni b/multimedia_player_framework_aafwk.gni index 181a0980d..2317bb25a 100644 --- a/multimedia_player_framework_aafwk.gni +++ b/multimedia_player_framework_aafwk.gni @@ -1,3 +1,1052 @@ +From 998346ac68242a750c9bf0a8201e6c21a7c62352 Mon Sep 17 00:00:00 2001 +From: z00654174 +Date: Sun, 24 Aug 2025 18:46:13 +0800 +Subject: [PATCH] TicketNo:DTS2022071803909 Description: lppbug Team:OTHERS + Feature or Bugfix:Bugfix Binary Source:NA PrivateCode(Yes/No):No + +Change-Id: I7abc64d758de105c85d3613b9b9fcb0881fe4175 +--- + .../native/capi/common/native_player_magic.h | 4 + + .../native/capi/lppplayer/native_lpp_common.h | 10 + + .../lppplayer/native_lpp_video_streamer.cpp | 16 ++ + .../video_streamer_impl.cpp | 7 + + .../native/media_service_helper/BUILD.gn | 8 +- + interfaces/inner_api/native/BUILD.gn | 7 + + interfaces/inner_api/native/lpp_capability.h | 195 ++++++++++++++++++ + interfaces/inner_api/native/lpp_common.h | 2 +- + .../inner_api/native/lpp_video_streamer.h | 9 +- + .../native/player_framework.versionscript | 2 + + interfaces/kits/c/BUILD.gn | 46 +++++ + interfaces/kits/c/lowpower_audio_sink_base.h | 2 +- + interfaces/kits/c/lowpower_avsink_base.h | 22 +- + interfaces/kits/c/lowpower_video_sink.h | 1 - + .../src/hilpp_vstreamer_impl.cpp | 1 + + services/include/i_media_service.h | 2 + + services/services/BUILD.gn | 9 +- + .../server/lpp_video_streamer_server.h | 2 +- + .../services/sa_media/client/media_client.cpp | 10 + + .../services/sa_media/client/media_client.h | 1 + + .../sa_media/ipc/i_standard_media_service.h | 5 + + .../sa_media/ipc/media_service_proxy.cpp | 18 ++ + .../sa_media/ipc/media_service_proxy.h | 1 + + .../sa_media/ipc/media_service_stub.cpp | 27 +++ + .../sa_media/ipc/media_service_stub.h | 2 + + .../server_manager/media_server_manager.cpp | 16 ++ + .../server_manager/media_server_manager.h | 7 +- + test/unittest/avmetadatahelper_test/BUILD.gn | 6 + + .../avmetadatahelper_impl_unit_test.cpp | 6 + + .../lpp_video_streamer_unit_test/BUILD.gn | 8 +- + .../media_server_manager_test/BUILD.gn | 6 + + .../media_service_helper_test/BUILD.gn | 6 + + .../player_service_stub_test/BUILD.gn | 6 + + .../sa_media_client_unit_test/BUILD.gn | 6 + + test/unittest/timeout_test/BUILD.gn | 6 + + .../timeout_test/mock/mock_i_media_service.h | 1 + + 36 files changed, 472 insertions(+), 11 deletions(-) + create mode 100644 interfaces/inner_api/native/lpp_capability.h + +diff --git a/frameworks/native/capi/common/native_player_magic.h b/frameworks/native/capi/common/native_player_magic.h +index 83a1344c7..fea52bdea 100644 +--- a/frameworks/native/capi/common/native_player_magic.h ++++ b/frameworks/native/capi/common/native_player_magic.h +@@ -90,4 +90,8 @@ struct OH_AVTranscoder_Config : public OHOS::RefBase { + virtual ~OH_AVTranscoder_Config() = default; + }; + ++struct OH_LowPowerAVSink_Capability : public OHOS::RefBase { ++ OH_LowPowerAVSink_Capability() = default; ++ virtual ~OH_LowPowerAVSink_Capability() = default; ++}; + #endif // NATIVE_SCREEN_CAPTURE_MAGIC_H +\ No newline at end of file +diff --git a/frameworks/native/capi/lppplayer/native_lpp_common.h b/frameworks/native/capi/lppplayer/native_lpp_common.h +index e72ec635e..4780f568e 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_common.h ++++ b/frameworks/native/capi/lppplayer/native_lpp_common.h +@@ -35,6 +35,7 @@ + #include "lpp_video_streamer.h" + #include "lpp_common.h" + #include "native_window.h" ++#include "lpp_capability.h" + + namespace OHOS { + namespace Media { +@@ -93,6 +94,15 @@ struct LowPowerVideoSinkObject : public OH_LowPowerVideoSink { + const std::shared_ptr videoStreamer_ = nullptr; + AVSamplesBufferObject *framePacket_ = nullptr; + }; ++ ++struct LowPowerAVSinkCapabilityObject : public OH_LowPowerAVSink_Capability { ++ explicit LowPowerAVSinkCapabilityObject(std::shared_ptr lppCapibility) ++ : lppCapibility_(lppCapibility) ++ {} ++ ~LowPowerAVSinkCapabilityObject() = default; ++ ++ std::shared_ptr lppCapibility_ = nullptr; ++}; + } // namespace Media + } // namespace OHOS + #endif // NATIVE_LPP_COMMON_H +\ No newline at end of file +diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +index 2147b2427..94c60dfe5 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp ++++ b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +@@ -634,6 +634,7 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetStreamChangedListener( + int32_t res = callback->SetStreamChangedListener(onStreamChanged, userData); + return LppMsErrToOHAvErr(res); + } ++ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPowerVideoSinkCallback *callback, + OH_LowPowerVideoSink_OnFirstFrameDecoded onFirstFrameDecoded, void *userData) + { +@@ -643,3 +644,18 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow + int32_t res = callback->SetFirstFrameReadyListener(onFirstFrameDecoded, userData); + return LppMsErrToOHAvErr(res); + } ++ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() ++{ ++ MEDIA_LOGD("OH_LowPowerAVSink_GetCapability"); ++ LppAvCapabilityInfo *info = VideoStreamerFactory::GetLppCapacity(); ++ CHECK_AND_RETURN_RET_LOG(info != nullptr, nullptr, "info is nullptr!"); ++ std::shared_ptr sharedPtr(info); ++ info = nullptr; ++ CHECK_AND_RETURN_RET_LOG(sharedPtr != nullptr, nullptr, "sharedPtr is nullptr!"); ++ LowPowerAVSinkCapabilityObject *object = new(std::nothrow) LowPowerAVSinkCapabilityObject(sharedPtr); ++ CHECK_AND_RETURN_RET_LOG(object != nullptr, nullptr, "object is nullptr!"); ++ MEDIA_LOGI("OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() %{public}zu %{public}zu", ++ object->lppCapibility_->videoCap_.size(), object->lppCapibility_->audioCap_.size()); ++ return object; ++} +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +index f7adadd72..d7bf73f3f 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +@@ -34,6 +34,13 @@ std::shared_ptr VideoStreamerFactory::CreateByMime(const std::str + return impl; + } + ++LppAvCapabilityInfo *VideoStreamerFactory::GetLppCapacity() ++{ ++ LppAvCapabilityInfo *lppAvCapability = MediaServiceFactory::GetInstance().GetLppCapacity(); ++ CHECK_AND_RETURN_RET_LOG(lppAvCapability != nullptr, nullptr, "VideoStreamerFactory::failed to GetLppCapacity"); ++ return lppAvCapability; ++} ++ + int32_t VideoStreamerImpl::Init(const std::string &mime) + { + MEDIA_LOGI("VideoStreamerImpl Init, mime %{public}s", mime.c_str()); +diff --git a/frameworks/native/media_service_helper/BUILD.gn b/frameworks/native/media_service_helper/BUILD.gn +index a4124df86..357530135 100644 +--- a/frameworks/native/media_service_helper/BUILD.gn ++++ b/frameworks/native/media_service_helper/BUILD.gn +@@ -100,9 +100,15 @@ ohos_shared_library("media_helper_client") { + "hilog:libhilog", + "image_framework:image_native", + "ipc:ipc_single", +- "media_foundation:media_foundation" ++ "media_foundation:media_foundation", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "platformsdk" ] + subsystem_name = "multimedia" + part_name = "player_framework" +diff --git a/interfaces/inner_api/native/BUILD.gn b/interfaces/inner_api/native/BUILD.gn +index 10b2a4ae0..a89225c8c 100644 +--- a/interfaces/inner_api/native/BUILD.gn ++++ b/interfaces/inner_api/native/BUILD.gn +@@ -218,8 +218,15 @@ ohos_shared_library("media_client") { + "ipc:ipc_single", + "qos_manager:qos", + "samgr:samgr_proxy", ++ "hdf_core:libhdi", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + public_external_deps = [ + "graphic_2d:color_manager", + "media_foundation:media_foundation", +diff --git a/interfaces/inner_api/native/lpp_capability.h b/interfaces/inner_api/native/lpp_capability.h +new file mode 100644 +index 000000000..b78d734de +--- /dev/null ++++ b/interfaces/inner_api/native/lpp_capability.h +@@ -0,0 +1,195 @@ ++/* ++ * Copyright (C) 2025 Huawei Device Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef LPP_CAPABILITY_H ++#define LPP_CAPABILITY_H ++ ++#include "media_log.h" ++#include ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++#include "v1_0/ilow_power_player_factory.h" ++namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; ++#endif ++ ++namespace OHOS { ++namespace Media { ++struct VideoMimeCapIpc : public Parcelable { ++public: ++ std::string mime_ = ""; /** video/avc, video/hevc */ ++ uint32_t minWidth_ = 0; ++ uint32_t minHeight_ = 0; ++ uint32_t maxWidth_ = 0; ++ uint32_t maxHeight_ = 0; ++ uint32_t maxPixelPerSecond_ = 0; ++ uint32_t maxInstance_ = 0; ++ bool isSupportDRM_ = false; ++ std::vector supportHDRTypes_ = {}; /** HDR10, HDR10+, HDRVivid */ ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ VideoMimeCapIpc(const PlayerHDI::VideoMimeCap &videoMimeCap) ++ { ++ mime_ = videoMimeCap.mime; ++ minWidth_ = videoMimeCap.minWidth; ++ minHeight_ = videoMimeCap.minHeight; ++ maxWidth_ = videoMimeCap.maxWidth; ++ maxHeight_ = videoMimeCap.maxHeight; ++ maxPixelPerSecond_ = videoMimeCap.maxPixelPerSecond; ++ maxInstance_ = videoMimeCap.maxInstance; ++ isSupportDRM_ = videoMimeCap.isSupportDRM; ++ for (uint32_t i = 0; i < videoMimeCap.supportHDRTypes.size(); i++) { ++ supportHDRTypes_.push_back(videoMimeCap.supportHDRTypes[i]); ++ } ++ } ++#endif ++ ++ VideoMimeCapIpc() {} ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteString(mime_); ++ parcel.WriteUint32(minWidth_); ++ parcel.WriteUint32(minHeight_); ++ parcel.WriteUint32(maxWidth_); ++ parcel.WriteUint32(maxHeight_); ++ parcel.WriteUint32(maxPixelPerSecond_); ++ parcel.WriteUint32(maxInstance_); ++ parcel.WriteBool(isSupportDRM_); ++ uint32_t typeSize = supportHDRTypes_.size(); ++ parcel.WriteUint32(typeSize); ++ for (uint32_t i = 0; i < typeSize; i++) { ++ parcel.WriteUint32(supportHDRTypes_[i]); ++ } ++ return true; ++ } ++ ++ void UnmarshallingSelf(Parcel &parcel) ++ { ++ mime_ = parcel.ReadString(); ++ minWidth_ = parcel.ReadUint32(); ++ minHeight_ = parcel.ReadUint32(); ++ maxWidth_ = parcel.ReadUint32(); ++ maxHeight_ = parcel.ReadUint32(); ++ maxPixelPerSecond_ = parcel.ReadUint32(); ++ maxInstance_ = parcel.ReadUint32(); ++ isSupportDRM_ = parcel.ReadBool(); ++ uint32_t typeSize = parcel.ReadUint32(); ++ for (uint32_t i = 0; i < typeSize; i++) { ++ supportHDRTypes_.push_back(parcel.ReadUint32()); ++ } ++ } ++}; ++ ++struct AudioMimeCapIpc : public Parcelable { ++public: ++ std::string mime_ = ""; /** AAC, Flac, Vorbis, MPEG, G711mu, AMR(amrnb, amrwb), APE */ ++ uint32_t sampleRate_ = 0; ++ uint32_t channelCount_ = 0; ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ AudioMimeCapIpc(const PlayerHDI::AudioMimeCap &audioMimeCap) ++ { ++ mime_ = audioMimeCap.mime; ++ sampleRate_ = audioMimeCap.sampleRate; ++ channelCount_ = audioMimeCap.channelCount; ++ } ++#endif ++ ++ AudioMimeCapIpc() {} ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteString(mime_); ++ parcel.WriteUint32(sampleRate_); ++ parcel.WriteUint32(channelCount_); ++ return true; ++ } ++ ++ void UnmarshallingSelf(Parcel &parcel) ++ { ++ mime_ = parcel.ReadString(); ++ sampleRate_ = parcel.ReadUint32(); ++ channelCount_ = parcel.ReadUint32(); ++ } ++}; ++ ++struct LppAvCapabilityInfo : public Parcelable { ++public: ++ uint32_t maxInstance_ = 0; ++ std::vector videoCap_ = {}; /** videoCap */ ++ std::vector audioCap_ = {}; ++ ++ LppAvCapabilityInfo() {} ++ ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ void SetLppAvCapabilityInfo(PlayerHDI::LppAVCap &lppAVCap) ++ { ++ maxInstance_ = lppAVCap.maxInstance; ++ for (uint32_t i = 0; i < lppAVCap.videoCap.size(); i++) { ++ VideoMimeCapIpc videoMimeCapIpc(lppAVCap.videoCap[i]); ++ videoCap_.push_back(videoMimeCapIpc); ++ } ++ ++ for (uint32_t i = 0; i < lppAVCap.audioCap.size(); i++) { ++ AudioMimeCapIpc audioMimeCapIpc(lppAVCap.audioCap[i]); ++ audioCap_.push_back(audioMimeCapIpc); ++ } ++ } ++#endif ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteUint32(maxInstance_); ++ ++ parcel.WriteUint32(videoCap_.size()); ++ for (uint32_t i = 0; i< videoCap_.size(); i++) { ++ videoCap_[i].Marshalling(parcel); ++ } ++ ++ parcel.WriteUint32(audioCap_.size()); ++ for (uint32_t i = 0; i< audioCap_.size(); i++) { ++ audioCap_[i].Marshalling(parcel); ++ } ++ return true; ++ } ++ ++ static LppAvCapabilityInfo Unmarshalling(Parcel &parcel) ++ { ++ const uint32_t MAX_SIZE = 65535; ++ LppAvCapabilityInfo info; ++ info.maxInstance_ = parcel.ReadUint32(); ++ ++ uint32_t videoCapSize = parcel.ReadUint32(); ++ if (videoCapSize > MAX_SIZE) { ++ return info; ++ } ++ for (uint32_t i = 0; i< videoCapSize; i++) { ++ VideoMimeCapIpc videoCap; ++ videoCap.UnmarshallingSelf(parcel); ++ info.videoCap_.push_back(videoCap); ++ } ++ ++ uint32_t audioCapSize = parcel.ReadUint32(); ++ if (audioCapSize > MAX_SIZE) { ++ return info; ++ } ++ for (uint32_t i = 0; i< audioCapSize; i++) { ++ AudioMimeCapIpc audioCap; ++ audioCap.UnmarshallingSelf(parcel); ++ info.audioCap_.push_back(audioCap); ++ } ++ return info; ++ } ++}; ++} ++} ++#endif // LPP_CAPABILITY_H +\ No newline at end of file +diff --git a/interfaces/inner_api/native/lpp_common.h b/interfaces/inner_api/native/lpp_common.h +index 17f2ecac2..f42e2448e 100644 +--- a/interfaces/inner_api/native/lpp_common.h ++++ b/interfaces/inner_api/native/lpp_common.h +@@ -27,7 +27,7 @@ enum LppErrCode : int32_t { + LPP_ERROR_OK = 0, + LPP_ERROR_UNKONWN, + }; +- ++ + class LppDataPacket : public OHOS::RefBase { + public: + +diff --git a/interfaces/inner_api/native/lpp_video_streamer.h b/interfaces/inner_api/native/lpp_video_streamer.h +index d29cd78a0..ac6a72fac 100644 +--- a/interfaces/inner_api/native/lpp_video_streamer.h ++++ b/interfaces/inner_api/native/lpp_video_streamer.h +@@ -22,10 +22,9 @@ + #include "meta/format.h" + #include "lpp_audio_streamer.h" + #include "lpp_common.h" +- ++#include "lpp_capability.h" + namespace OHOS { + namespace Media { +- + class VideoStreamerKeys { + public: + static constexpr std::string_view LPP_CURRENT_POSITION = "current_position"; +@@ -113,9 +112,15 @@ public: + (void)mime; + return nullptr; + } ++ static LppAvCapabilityInfo *GetLppCapacity() ++ { ++ return nullptr; ++ } + #else + static std::shared_ptr CreateByMime(const std::string &mime); ++ static LppAvCapabilityInfo *GetLppCapacity(); + #endif ++ + private: + VideoStreamerFactory() = default; + ~VideoStreamerFactory() = default; +diff --git a/interfaces/inner_api/native/player_framework.versionscript b/interfaces/inner_api/native/player_framework.versionscript +index e6a712c86..7dc3297e6 100644 +--- a/interfaces/inner_api/native/player_framework.versionscript ++++ b/interfaces/inner_api/native/player_framework.versionscript +@@ -28,6 +28,8 @@ + *OHOS::Media::ScreenCaptureFactory::CreateScreenCaptureMonitor*; + *OHOS::Media::ScreenCaptureControllerFactory::CreateScreenCaptureController*; + *OHOS::Media::AudioStreamerFactory::CreateByMime*; ++ *OHOS::Media::VideoStreamerFactory::CreatePlayer*; ++ *OHOS::Media::VideoStreamerFactory::GetLppCapacity*; + *OHOS::Media::VideoStreamerFactory::CreateByMime*; + *OHOS::Media::Format::*; + *OHOS::Media::VideoCaps::*; +diff --git a/interfaces/kits/c/BUILD.gn b/interfaces/kits/c/BUILD.gn +index 3e308f4a6..3d533721d 100644 +--- a/interfaces/kits/c/BUILD.gn ++++ b/interfaces/kits/c/BUILD.gn +@@ -93,6 +93,13 @@ ohos_shared_library("native_avscreen_capture") { + "qos_manager:qos", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + output_extension = "so" + subsystem_name = "multimedia" + part_name = "player_framework" +@@ -133,6 +140,13 @@ ohos_shared_library("avplayer") { + "samgr:samgr_proxy", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_drm) { + public_external_deps = [ + "drm_framework:drm_framework", +@@ -187,6 +201,12 @@ ohos_shared_library("avrecorder") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_auto_create_file) { + external_deps += [ + "media_library:media_library", +@@ -240,6 +260,12 @@ ohos_shared_library("avimage_generator") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + output_extension = "so" +@@ -287,6 +313,13 @@ ohos_shared_library("avmetadata_extractor") { + "samgr:samgr_proxy", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_drm) { + public_external_deps = [ + "drm_framework:drm_framework", +@@ -341,6 +374,13 @@ ohos_shared_library("lowpower_avsink") { + "image_framework:pixelmap", + "hisysevent:libhisysevent", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + output_extension = "so" +@@ -388,6 +428,12 @@ ohos_shared_library("avtranscoder") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + defines = [] +diff --git a/interfaces/kits/c/lowpower_audio_sink_base.h b/interfaces/kits/c/lowpower_audio_sink_base.h +index 51fea73d2..93589ce6f 100644 +--- a/interfaces/kits/c/lowpower_audio_sink_base.h ++++ b/interfaces/kits/c/lowpower_audio_sink_base.h +@@ -59,7 +59,7 @@ typedef struct OH_LowPowerAudioSink OH_LowPowerAudioSink; + * @since 20 + */ + typedef struct OH_LowPowerAudioSinkCallback OH_LowPowerAudioSinkCallback; +- ++ + /** + * @brief When an error occurs in the running of the OH_LowPowerAudioSink instance, the function pointer will be called + * to report specific error information. +diff --git a/interfaces/kits/c/lowpower_avsink_base.h b/interfaces/kits/c/lowpower_avsink_base.h +index 27483c91d..1f5fdeb2e 100644 +--- a/interfaces/kits/c/lowpower_avsink_base.h ++++ b/interfaces/kits/c/lowpower_avsink_base.h +@@ -52,7 +52,14 @@ extern "C" { + * @since 20 + */ + typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; +- ++ ++/** ++ * @brief Forward declaration of OH_LowPowerAVSink_Capability. ++ * ++ * @since 21 ++ */ ++typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; ++ + /** + * @brief Append one OH_AVBuffer data to framePacketBuffer instance. + * +@@ -76,7 +83,20 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe + * @since 20 + */ + int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); ++ ++/** ++ * @brief Query the supported capabilities of a lowpower audio/video sink. ++ * ++ * This function queries and returns the capability set supported by the current ++ * lowpower audio/video sink, including but not limited to supported media formats, etc. ++ * ++ * @return {OH_LowPowerAVSink_Capability*} ++ * - A pointer to the capability structure if the sink supports capability queries and the query is successful. ++ * - nullptr if the sink does not support capability queries or the query fails. + ++ * @since 21 ++ */ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); + #ifdef __cplusplus + } + #endif +diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h +index d1c11f7e3..f363d3aa9 100644 +--- a/interfaces/kits/c/lowpower_video_sink.h ++++ b/interfaces/kits/c/lowpower_video_sink.h +@@ -470,7 +470,6 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener( + */ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetEosListener(OH_LowPowerVideoSinkCallback* callback, + OH_LowPowerVideoSink_OnEos onEos, void* userData); +- + #ifdef __cplusplus + } + #endif +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +index 782c14678..78becd0f9 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +@@ -85,6 +85,7 @@ int32_t HiLppVideoStreamerImpl::Init(const std::string &mime) + vdec_ = std::make_shared(streamerId_, isLpp_); + bool switchToCommon = false; + auto ret = vdec_->Init(mime, switchToCommon); ++ FALSE_RETURN_V_MSG(switchToCommon == false, AV_ERR_UNSUPPORT, "lpp is not support"); + FALSE_RETURN_V_MSG(ret == MSERR_OK, ret, "vdec_ init failed"); + FALSE_LOG_MSG_W(!switchToCommon, "switch isLpp_ to false"); + isLpp_ = isLpp_ ? !switchToCommon : isLpp_; +diff --git a/services/include/i_media_service.h b/services/include/i_media_service.h +index 9eed996ec..1c010933d 100644 +--- a/services/include/i_media_service.h ++++ b/services/include/i_media_service.h +@@ -234,6 +234,8 @@ public: + virtual std::shared_ptr CreateLppVideoStreamerService() = 0; + + virtual int32_t DestroyLppVideoStreamerService(std::shared_ptr lppVideoPlayer) = 0; ++ ++ virtual LppAvCapabilityInfo *GetLppCapacity() = 0; + #endif + + /** +diff --git a/services/services/BUILD.gn b/services/services/BUILD.gn +index 84494960d..e90102cd1 100644 +--- a/services/services/BUILD.gn ++++ b/services/services/BUILD.gn +@@ -318,7 +318,14 @@ ohos_shared_library("media_service") { + "window_manager:session_manager_lite", + ] + } +- ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ "hdf_core:libhdi", ++ ] ++ } ++ + if (player_framework_support_avsession_background) { + sources += [ "player/avsession_background/avsession_background.cpp" ] + external_deps += [ +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +index beec97728..1544d4297 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +@@ -102,7 +102,7 @@ public: + void OnTargetArrived(const int64_t targetPts, const bool isTimeout) override; + void OnFirstFrameReady() override; + void OnStreamChanged(Format &format) override; +- ++ + private: + int32_t CreateStreamerEngine(); + bool StateEnter(VideoState targetState, const std::string funcName = ""); +diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp +index 8252b1744..beab36136 100644 +--- a/services/services/sa_media/client/media_client.cpp ++++ b/services/services/sa_media/client/media_client.cpp +@@ -399,6 +399,16 @@ int32_t MediaClient::DestroyLppAudioStreamerService(std::shared_ptrGetLppCapacity(*lppAvCapabilityInfo); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, nullptr, "MediaClient::GetLppCapacityfailed"); ++ return lppAvCapabilityInfo; ++} ++ + std::shared_ptr MediaClient::CreateLppVideoStreamerService() + { + MEDIA_LOGI("CreateLppVideoStreamerService start"); +diff --git a/services/services/sa_media/client/media_client.h b/services/services/sa_media/client/media_client.h +index 92e597c70..bad6945f6 100644 +--- a/services/services/sa_media/client/media_client.h ++++ b/services/services/sa_media/client/media_client.h +@@ -94,6 +94,7 @@ public: + #ifdef SUPPORT_LPP_VIDEO_STRAMER + std::shared_ptr CreateLppVideoStreamerService() override; + int32_t DestroyLppVideoStreamerService(std::shared_ptr lppAudioPlayer) override; ++ LppAvCapabilityInfo *GetLppCapacity() override; + #endif + std::vector GetPlayerPids() override; + +diff --git a/services/services/sa_media/ipc/i_standard_media_service.h b/services/services/sa_media/ipc/i_standard_media_service.h +index 80f81713f..f387decaa 100644 +--- a/services/services/sa_media/ipc/i_standard_media_service.h ++++ b/services/services/sa_media/ipc/i_standard_media_service.h +@@ -20,6 +20,7 @@ + #include "iremote_broker.h" + #include "iremote_proxy.h" + #include "iremote_stub.h" ++#include "lpp_capability.h" + #include + + namespace OHOS { +@@ -81,6 +82,8 @@ public: + + virtual int32_t ResetAllProxy() = 0; + ++ virtual int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) = 0; ++ + /** + * IPC code ID + */ +@@ -92,6 +95,8 @@ public: + GET_PLAYER_PIDS = 4, + FREEZE = 5, + RESET_ALL_PROXY = 6, ++ GET_RAMAINED_CAPACITY = 7, ++ GET_LPP_CAPABILITY = 8, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"IStandardMediaService"); +diff --git a/services/services/sa_media/ipc/media_service_proxy.cpp b/services/services/sa_media/ipc/media_service_proxy.cpp +index c91e6ab56..595fd4b46 100644 +--- a/services/services/sa_media/ipc/media_service_proxy.cpp ++++ b/services/services/sa_media/ipc/media_service_proxy.cpp +@@ -76,6 +76,24 @@ std::vector MediaServiceProxy::GetPlayerPids() + return res; + } + ++int32_t MediaServiceProxy::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { ++ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity"); ++ MessageParcel data; ++ MessageParcel reply; ++ MessageOption option; ++ int32_t error = -1; ++ bool token = data.WriteInterfaceToken(MediaServiceProxy::GetDescriptor()); ++ CHECK_AND_RETURN_RET_LOG(token, error, "Failed to write descriptor!"); ++ error = Remote()->SendRequest(MediaServiceMsg::GET_LPP_CAPABILITY, data, reply, option); ++ CHECK_AND_RETURN_RET_LOG(error == MSERR_OK, error, "Failed to SendRequest"); ++ int32_t ret = reply.ReadInt32(); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "Fail to MediaServiceProxy::GetLppCapacity"); ++ lppAvCapability = LppAvCapabilityInfo::Unmarshalling(reply); ++ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity %{public}zu %{public}zu", ++ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ return ret; ++} ++ + sptr MediaServiceProxy::GetSubSystemAbility(IStandardMediaService::MediaSystemAbility subSystemId, + const sptr &listener) + { +diff --git a/services/services/sa_media/ipc/media_service_proxy.h b/services/services/sa_media/ipc/media_service_proxy.h +index d43cf9827..3ce5b8619 100644 +--- a/services/services/sa_media/ipc/media_service_proxy.h ++++ b/services/services/sa_media/ipc/media_service_proxy.h +@@ -41,6 +41,7 @@ public: + + int32_t ResetAllProxy() override; + ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; + private: + bool IsGetSubSystemAbilityASync() const; + static inline BrokerDelegator delegator_; +diff --git a/services/services/sa_media/ipc/media_service_stub.cpp b/services/services/sa_media/ipc/media_service_stub.cpp +index 0c701f82c..8955b126e 100644 +--- a/services/services/sa_media/ipc/media_service_stub.cpp ++++ b/services/services/sa_media/ipc/media_service_stub.cpp +@@ -58,6 +58,8 @@ void MediaServiceStub::Init() + [this](MessageParcel &data, MessageParcel &reply) { return HandleFreezeStubForPids(data, reply); }; + mediaFuncs_[RESET_ALL_PROXY] = + [this](MessageParcel &data, MessageParcel &reply) { return HandleResetAllProxy(data, reply); }; ++ mediaFuncs_[GET_LPP_CAPABILITY] = ++ [this] (MessageParcel &data, MessageParcel &reply) { return GetLppCapacityStub(data, reply); }; + } + + int32_t MediaServiceStub::HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply) +@@ -199,6 +201,17 @@ int32_t MediaServiceStub::ReleaseClientListenerStub(MessageParcel &data, Message + return MSERR_OK; + } + ++int32_t MediaServiceStub::GetLppCapacityStub(MessageParcel &data, MessageParcel &reply) ++{ ++ (void)data; ++ LppAvCapabilityInfo info; ++ int32_t ret = GetLppCapacity(info); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "Failed to write descriptor!"); ++ reply.WriteInt32(ret); ++ info.Marshalling(reply); ++ return MSERR_OK; ++} ++ + int32_t MediaServiceStub::GetPlayerPidsStub(MessageParcel &data, MessageParcel &reply) + { + (void)data; +@@ -222,6 +235,20 @@ std::vector MediaServiceStub::GetPlayerPids() + return MediaServerManager::GetInstance().GetPlayerPids(); + } + ++int32_t MediaServiceStub::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) ++{ ++ MEDIA_LOGI("MediaServiceStub::GetLppCapacity"); ++ #ifdef SUPPORT_LPP_VIDEO_STRAMER ++ int32_t ret = MediaServerManager::GetInstance().GetLppCapacity(lppAvCapability); ++ #else ++ int32_t ret = MSERR_UNKNOWN; ++ #endif ++ MEDIA_LOGI("MediaServiceStub::GetLppCapacity %{public}lu %{public}lu", ++ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, MSERR_UNKNOWN, "MediaServiceStub::GetLppCapacity GetLppCapacity"); ++ return ret; ++} ++ + int32_t MediaServiceStub::GetSystemAbility(MessageParcel &data, MessageParcel &reply) + { + int32_t mediaSystemAbility = data.ReadInt32(); +diff --git a/services/services/sa_media/ipc/media_service_stub.h b/services/services/sa_media/ipc/media_service_stub.h +index 46dbe0648..52e01926e 100644 +--- a/services/services/sa_media/ipc/media_service_stub.h ++++ b/services/services/sa_media/ipc/media_service_stub.h +@@ -44,6 +44,8 @@ private: + int32_t HandleKillMediaService(MessageParcel &data, MessageParcel &reply); + void ReleaseClientListener() override; + std::vector GetPlayerPids() override; ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; ++ int32_t GetLppCapacityStub(MessageParcel &data, MessageParcel &reply); + int32_t HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply); + int32_t HandleResetAllProxy(MessageParcel &data, MessageParcel &reply); + void ClientDied(pid_t pid); +diff --git a/services/services/sa_media/server_manager/media_server_manager.cpp b/services/services/sa_media/server_manager/media_server_manager.cpp +index 800e338f1..8579f7162 100644 +--- a/services/services/sa_media/server_manager/media_server_manager.cpp ++++ b/services/services/sa_media/server_manager/media_server_manager.cpp +@@ -50,6 +50,10 @@ + #include "player_xcollie.h" + #include "client/memory_collector_client.h" + #include ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++#include "v1_0/ilow_power_player_factory.h" ++namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; ++#endif + + namespace { + constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_PLAYER, "MediaServerManager"}; +@@ -530,6 +534,18 @@ sptr MediaServerManager::CreateLppAudioPlayerStubObject() + #endif + + #ifdef SUPPORT_LPP_VIDEO_STRAMER ++int32_t MediaServerManager::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { ++ auto factory = PlayerHDI::ILowPowerPlayerFactory::Get(true); ++ CHECK_AND_RETURN_RET_LOG(factory != nullptr, UNKNOWN_ERROR, "MediaServerManager::GetLppCapacity is failed"); ++ PlayerHDI::LppAVCap lppAVCap; ++ int32_t ret = factory->GetAVCapability(lppAVCap); ++ MEDIA_LOGI("MediaServerManager::GetLppCapacity %{public}lu %{public}lu", ++ lppAVCap.videoCap.size(), lppAVCap.audioCap.size()); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "FAILED MediaServerManager::GetLppCapacity"); ++ lppAvCapability.SetLppAvCapabilityInfo(lppAVCap); ++ return ret; ++} ++ + sptr MediaServerManager::CreateLppVideoPlayerStubObject() + { + MEDIA_LOGI("CreateLppVideoPlayerStubObject start"); +diff --git a/services/services/sa_media/server_manager/media_server_manager.h b/services/services/sa_media/server_manager/media_server_manager.h +index ddc10e4bd..cf1f13ef2 100644 +--- a/services/services/sa_media/server_manager/media_server_manager.h ++++ b/services/services/sa_media/server_manager/media_server_manager.h +@@ -25,10 +25,11 @@ + #include "nocopyable.h" + #include "osal/task/task.h" + #include +- ++#include "lpp_capability.h" + namespace OHOS { + namespace Media { + using DumperEntry = std::function; ++ + struct Dumper { + pid_t pid_; + pid_t uid_; +@@ -79,6 +80,10 @@ public: + #endif + bool CanKillMediaService(); + std::vector GetPlayerPids(); ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability); ++#endif ++ + private: + MediaServerManager(); + #ifdef SUPPORT_PLAYER +diff --git a/test/unittest/avmetadatahelper_test/BUILD.gn b/test/unittest/avmetadatahelper_test/BUILD.gn +index fc9a6f0b2..fa8d2d30b 100644 +--- a/test/unittest/avmetadatahelper_test/BUILD.gn ++++ b/test/unittest/avmetadatahelper_test/BUILD.gn +@@ -176,6 +176,12 @@ ohos_unittest("avmetadatahelper_unit_test") { + "samgr:samgr_proxy", + "window_manager:libwm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + + if (player_framework_support_video) { + external_deps += [ "graphic_surface:surface" ] +diff --git a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp +index 8d4166ebe..e5d703a2b 100644 +--- a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp ++++ b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp +@@ -114,6 +114,12 @@ int32_t MediaClient::ResetAllProxy() + return 0; + } + ++LppAvCapabilityInfo* MediaClient::GetLppCapacity() ++{ ++ LppAvCapabilityInfo *lppAvCapabilityInfo = new LppAvCapabilityInfo(); ++ return lppAvCapabilityInfo; ++} ++ + namespace Test { + void AVMetadtahelperImplUnitTest::SetUpTestCase(void) {} + +diff --git a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn +index 172487a43..d0b1cc797 100644 +--- a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn ++++ b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn +@@ -48,6 +48,12 @@ ohos_unittest("lpp_video_streamer_unit_test") { + "media_foundation:media_foundation" + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + resource_config_file = + "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" +-} +\ No newline at end of file ++} +diff --git a/test/unittest/media_server_manager_test/BUILD.gn b/test/unittest/media_server_manager_test/BUILD.gn +index 833753a60..cc4174ef8 100644 +--- a/test/unittest/media_server_manager_test/BUILD.gn ++++ b/test/unittest/media_server_manager_test/BUILD.gn +@@ -125,6 +125,12 @@ ohos_unittest("media_server_manager_test") { + "samgr:samgr_proxy", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_video) { + external_deps += [ "graphic_surface:surface" ] + } +diff --git a/test/unittest/media_service_helper_test/BUILD.gn b/test/unittest/media_service_helper_test/BUILD.gn +index 292d28380..fd91a2a29 100644 +--- a/test/unittest/media_service_helper_test/BUILD.gn ++++ b/test/unittest/media_service_helper_test/BUILD.gn +@@ -67,6 +67,12 @@ ohos_unittest("media_service_helper_unit_test") { + "ipc:ipc_single", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (defined(global_parts_info) && + defined(global_parts_info.multimedia_histreamer_ext)) { + defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] +diff --git a/test/unittest/player_service_stub_test/BUILD.gn b/test/unittest/player_service_stub_test/BUILD.gn +index bd0938811..374bb3469 100644 +--- a/test/unittest/player_service_stub_test/BUILD.gn ++++ b/test/unittest/player_service_stub_test/BUILD.gn +@@ -117,6 +117,12 @@ ohos_unittest("player_service_stub_test") { + external_deps += [ "graphic_surface:surface" ] + } + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_screen_capture_stopbycall) { + external_deps += [ + "call_manager:tel_call_manager_api", +diff --git a/test/unittest/sa_media_client_unit_test/BUILD.gn b/test/unittest/sa_media_client_unit_test/BUILD.gn +index 475525407..354aca6d0 100644 +--- a/test/unittest/sa_media_client_unit_test/BUILD.gn ++++ b/test/unittest/sa_media_client_unit_test/BUILD.gn +@@ -145,6 +145,12 @@ include_dirs = [ + "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service", + "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + + resource_config_file = + "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" +diff --git a/test/unittest/timeout_test/BUILD.gn b/test/unittest/timeout_test/BUILD.gn +index 33812ec07..272035ee1 100644 +--- a/test/unittest/timeout_test/BUILD.gn ++++ b/test/unittest/timeout_test/BUILD.gn +@@ -76,6 +76,12 @@ ohos_unittest("player_timeout_unit_test") { + "window_manager:libwm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (defined(global_parts_info) && + defined(global_parts_info.multimedia_histreamer_ext)) { + defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] +diff --git a/test/unittest/timeout_test/mock/mock_i_media_service.h b/test/unittest/timeout_test/mock/mock_i_media_service.h +index d95abad8c..4e3284a56 100644 +--- a/test/unittest/timeout_test/mock/mock_i_media_service.h ++++ b/test/unittest/timeout_test/mock/mock_i_media_service.h +@@ -71,6 +71,7 @@ public: + MOCK_METHOD(std::shared_ptr, CreateLppVideoStreamerService, (), (override)); + MOCK_METHOD(int32_t, + DestroyLppVideoStreamerService, (std::shared_ptr lppAudioPlayer), (override)); ++ MOCK_METHOD(LppAvCapabilityInfo*, GetLppCapacity, (), (override)); + #endif + + MOCK_METHOD(sptr, GetMonitorProxy, (), (override)); +-- +2.45.2.huawei.10 + + + # Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -- Gitee From 60ba64c50602af67cc6327e67ada99175b702757 Mon Sep 17 00:00:00 2001 From: zpf Date: Fri, 29 Aug 2025 06:19:40 +0000 Subject: [PATCH 05/11] 111 Signed-off-by: zpf --- 111 | 998 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 998 insertions(+) create mode 100644 111 diff --git a/111 b/111 new file mode 100644 index 000000000..e54e5d4dc --- /dev/null +++ b/111 @@ -0,0 +1,998 @@ +diff --git a/frameworks/native/capi/common/native_player_magic.h b/frameworks/native/capi/common/native_player_magic.h +index 83a1344c7..fea52bdea 100644 +--- a/frameworks/native/capi/common/native_player_magic.h ++++ b/frameworks/native/capi/common/native_player_magic.h +@@ -90,4 +90,8 @@ struct OH_AVTranscoder_Config : public OHOS::RefBase { + virtual ~OH_AVTranscoder_Config() = default; + }; + ++struct OH_LowPowerAVSink_Capability : public OHOS::RefBase { ++ OH_LowPowerAVSink_Capability() = default; ++ virtual ~OH_LowPowerAVSink_Capability() = default; ++}; + #endif // NATIVE_SCREEN_CAPTURE_MAGIC_H +\ No newline at end of file +diff --git a/frameworks/native/capi/lppplayer/native_lpp_common.h b/frameworks/native/capi/lppplayer/native_lpp_common.h +index e72ec635e..4780f568e 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_common.h ++++ b/frameworks/native/capi/lppplayer/native_lpp_common.h +@@ -35,6 +35,7 @@ + #include "lpp_video_streamer.h" + #include "lpp_common.h" + #include "native_window.h" ++#include "lpp_capability.h" + + namespace OHOS { + namespace Media { +@@ -93,6 +94,15 @@ struct LowPowerVideoSinkObject : public OH_LowPowerVideoSink { + const std::shared_ptr videoStreamer_ = nullptr; + AVSamplesBufferObject *framePacket_ = nullptr; + }; ++ ++struct LowPowerAVSinkCapabilityObject : public OH_LowPowerAVSink_Capability { ++ explicit LowPowerAVSinkCapabilityObject(std::shared_ptr lppCapibility) ++ : lppCapibility_(lppCapibility) ++ {} ++ ~LowPowerAVSinkCapabilityObject() = default; ++ ++ std::shared_ptr lppCapibility_ = nullptr; ++}; + } // namespace Media + } // namespace OHOS + #endif // NATIVE_LPP_COMMON_H +\ No newline at end of file +diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +index 2147b2427..94c60dfe5 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp ++++ b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +@@ -634,6 +634,7 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetStreamChangedListener( + int32_t res = callback->SetStreamChangedListener(onStreamChanged, userData); + return LppMsErrToOHAvErr(res); + } ++ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPowerVideoSinkCallback *callback, + OH_LowPowerVideoSink_OnFirstFrameDecoded onFirstFrameDecoded, void *userData) + { +@@ -643,3 +644,18 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow + int32_t res = callback->SetFirstFrameReadyListener(onFirstFrameDecoded, userData); + return LppMsErrToOHAvErr(res); + } ++ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() ++{ ++ MEDIA_LOGD("OH_LowPowerAVSink_GetCapability"); ++ LppAvCapabilityInfo *info = VideoStreamerFactory::GetLppCapacity(); ++ CHECK_AND_RETURN_RET_LOG(info != nullptr, nullptr, "info is nullptr!"); ++ std::shared_ptr sharedPtr(info); ++ info = nullptr; ++ CHECK_AND_RETURN_RET_LOG(sharedPtr != nullptr, nullptr, "sharedPtr is nullptr!"); ++ LowPowerAVSinkCapabilityObject *object = new(std::nothrow) LowPowerAVSinkCapabilityObject(sharedPtr); ++ CHECK_AND_RETURN_RET_LOG(object != nullptr, nullptr, "object is nullptr!"); ++ MEDIA_LOGI("OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() %{public}zu %{public}zu", ++ object->lppCapibility_->videoCap_.size(), object->lppCapibility_->audioCap_.size()); ++ return object; ++} +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +index f7adadd72..d7bf73f3f 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +@@ -34,6 +34,13 @@ std::shared_ptr VideoStreamerFactory::CreateByMime(const std::str + return impl; + } + ++LppAvCapabilityInfo *VideoStreamerFactory::GetLppCapacity() ++{ ++ LppAvCapabilityInfo *lppAvCapability = MediaServiceFactory::GetInstance().GetLppCapacity(); ++ CHECK_AND_RETURN_RET_LOG(lppAvCapability != nullptr, nullptr, "VideoStreamerFactory::failed to GetLppCapacity"); ++ return lppAvCapability; ++} ++ + int32_t VideoStreamerImpl::Init(const std::string &mime) + { + MEDIA_LOGI("VideoStreamerImpl Init, mime %{public}s", mime.c_str()); +diff --git a/frameworks/native/media_service_helper/BUILD.gn b/frameworks/native/media_service_helper/BUILD.gn +index a4124df86..357530135 100644 +--- a/frameworks/native/media_service_helper/BUILD.gn ++++ b/frameworks/native/media_service_helper/BUILD.gn +@@ -100,9 +100,15 @@ ohos_shared_library("media_helper_client") { + "hilog:libhilog", + "image_framework:image_native", + "ipc:ipc_single", +- "media_foundation:media_foundation" ++ "media_foundation:media_foundation", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "platformsdk" ] + subsystem_name = "multimedia" + part_name = "player_framework" +diff --git a/interfaces/inner_api/native/BUILD.gn b/interfaces/inner_api/native/BUILD.gn +index 10b2a4ae0..a89225c8c 100644 +--- a/interfaces/inner_api/native/BUILD.gn ++++ b/interfaces/inner_api/native/BUILD.gn +@@ -218,8 +218,15 @@ ohos_shared_library("media_client") { + "ipc:ipc_single", + "qos_manager:qos", + "samgr:samgr_proxy", ++ "hdf_core:libhdi", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + public_external_deps = [ + "graphic_2d:color_manager", + "media_foundation:media_foundation", +diff --git a/interfaces/inner_api/native/lpp_capability.h b/interfaces/inner_api/native/lpp_capability.h +new file mode 100644 +index 000000000..b78d734de +--- /dev/null ++++ b/interfaces/inner_api/native/lpp_capability.h +@@ -0,0 +1,195 @@ ++/* ++ * Copyright (C) 2025 Huawei Device Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef LPP_CAPABILITY_H ++#define LPP_CAPABILITY_H ++ ++#include "media_log.h" ++#include ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++#include "v1_0/ilow_power_player_factory.h" ++namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; ++#endif ++ ++namespace OHOS { ++namespace Media { ++struct VideoMimeCapIpc : public Parcelable { ++public: ++ std::string mime_ = ""; /** video/avc, video/hevc */ ++ uint32_t minWidth_ = 0; ++ uint32_t minHeight_ = 0; ++ uint32_t maxWidth_ = 0; ++ uint32_t maxHeight_ = 0; ++ uint32_t maxPixelPerSecond_ = 0; ++ uint32_t maxInstance_ = 0; ++ bool isSupportDRM_ = false; ++ std::vector supportHDRTypes_ = {}; /** HDR10, HDR10+, HDRVivid */ ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ VideoMimeCapIpc(const PlayerHDI::VideoMimeCap &videoMimeCap) ++ { ++ mime_ = videoMimeCap.mime; ++ minWidth_ = videoMimeCap.minWidth; ++ minHeight_ = videoMimeCap.minHeight; ++ maxWidth_ = videoMimeCap.maxWidth; ++ maxHeight_ = videoMimeCap.maxHeight; ++ maxPixelPerSecond_ = videoMimeCap.maxPixelPerSecond; ++ maxInstance_ = videoMimeCap.maxInstance; ++ isSupportDRM_ = videoMimeCap.isSupportDRM; ++ for (uint32_t i = 0; i < videoMimeCap.supportHDRTypes.size(); i++) { ++ supportHDRTypes_.push_back(videoMimeCap.supportHDRTypes[i]); ++ } ++ } ++#endif ++ ++ VideoMimeCapIpc() {} ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteString(mime_); ++ parcel.WriteUint32(minWidth_); ++ parcel.WriteUint32(minHeight_); ++ parcel.WriteUint32(maxWidth_); ++ parcel.WriteUint32(maxHeight_); ++ parcel.WriteUint32(maxPixelPerSecond_); ++ parcel.WriteUint32(maxInstance_); ++ parcel.WriteBool(isSupportDRM_); ++ uint32_t typeSize = supportHDRTypes_.size(); ++ parcel.WriteUint32(typeSize); ++ for (uint32_t i = 0; i < typeSize; i++) { ++ parcel.WriteUint32(supportHDRTypes_[i]); ++ } ++ return true; ++ } ++ ++ void UnmarshallingSelf(Parcel &parcel) ++ { ++ mime_ = parcel.ReadString(); ++ minWidth_ = parcel.ReadUint32(); ++ minHeight_ = parcel.ReadUint32(); ++ maxWidth_ = parcel.ReadUint32(); ++ maxHeight_ = parcel.ReadUint32(); ++ maxPixelPerSecond_ = parcel.ReadUint32(); ++ maxInstance_ = parcel.ReadUint32(); ++ isSupportDRM_ = parcel.ReadBool(); ++ uint32_t typeSize = parcel.ReadUint32(); ++ for (uint32_t i = 0; i < typeSize; i++) { ++ supportHDRTypes_.push_back(parcel.ReadUint32()); ++ } ++ } ++}; ++ ++struct AudioMimeCapIpc : public Parcelable { ++public: ++ std::string mime_ = ""; /** AAC, Flac, Vorbis, MPEG, G711mu, AMR(amrnb, amrwb), APE */ ++ uint32_t sampleRate_ = 0; ++ uint32_t channelCount_ = 0; ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ AudioMimeCapIpc(const PlayerHDI::AudioMimeCap &audioMimeCap) ++ { ++ mime_ = audioMimeCap.mime; ++ sampleRate_ = audioMimeCap.sampleRate; ++ channelCount_ = audioMimeCap.channelCount; ++ } ++#endif ++ ++ AudioMimeCapIpc() {} ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteString(mime_); ++ parcel.WriteUint32(sampleRate_); ++ parcel.WriteUint32(channelCount_); ++ return true; ++ } ++ ++ void UnmarshallingSelf(Parcel &parcel) ++ { ++ mime_ = parcel.ReadString(); ++ sampleRate_ = parcel.ReadUint32(); ++ channelCount_ = parcel.ReadUint32(); ++ } ++}; ++ ++struct LppAvCapabilityInfo : public Parcelable { ++public: ++ uint32_t maxInstance_ = 0; ++ std::vector videoCap_ = {}; /** videoCap */ ++ std::vector audioCap_ = {}; ++ ++ LppAvCapabilityInfo() {} ++ ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ void SetLppAvCapabilityInfo(PlayerHDI::LppAVCap &lppAVCap) ++ { ++ maxInstance_ = lppAVCap.maxInstance; ++ for (uint32_t i = 0; i < lppAVCap.videoCap.size(); i++) { ++ VideoMimeCapIpc videoMimeCapIpc(lppAVCap.videoCap[i]); ++ videoCap_.push_back(videoMimeCapIpc); ++ } ++ ++ for (uint32_t i = 0; i < lppAVCap.audioCap.size(); i++) { ++ AudioMimeCapIpc audioMimeCapIpc(lppAVCap.audioCap[i]); ++ audioCap_.push_back(audioMimeCapIpc); ++ } ++ } ++#endif ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteUint32(maxInstance_); ++ ++ parcel.WriteUint32(videoCap_.size()); ++ for (uint32_t i = 0; i< videoCap_.size(); i++) { ++ videoCap_[i].Marshalling(parcel); ++ } ++ ++ parcel.WriteUint32(audioCap_.size()); ++ for (uint32_t i = 0; i< audioCap_.size(); i++) { ++ audioCap_[i].Marshalling(parcel); ++ } ++ return true; ++ } ++ ++ static LppAvCapabilityInfo Unmarshalling(Parcel &parcel) ++ { ++ const uint32_t MAX_SIZE = 65535; ++ LppAvCapabilityInfo info; ++ info.maxInstance_ = parcel.ReadUint32(); ++ ++ uint32_t videoCapSize = parcel.ReadUint32(); ++ if (videoCapSize > MAX_SIZE) { ++ return info; ++ } ++ for (uint32_t i = 0; i< videoCapSize; i++) { ++ VideoMimeCapIpc videoCap; ++ videoCap.UnmarshallingSelf(parcel); ++ info.videoCap_.push_back(videoCap); ++ } ++ ++ uint32_t audioCapSize = parcel.ReadUint32(); ++ if (audioCapSize > MAX_SIZE) { ++ return info; ++ } ++ for (uint32_t i = 0; i< audioCapSize; i++) { ++ AudioMimeCapIpc audioCap; ++ audioCap.UnmarshallingSelf(parcel); ++ info.audioCap_.push_back(audioCap); ++ } ++ return info; ++ } ++}; ++} ++} ++#endif // LPP_CAPABILITY_H +\ No newline at end of file +diff --git a/interfaces/inner_api/native/lpp_common.h b/interfaces/inner_api/native/lpp_common.h +index 17f2ecac2..f42e2448e 100644 +--- a/interfaces/inner_api/native/lpp_common.h ++++ b/interfaces/inner_api/native/lpp_common.h +@@ -27,7 +27,7 @@ enum LppErrCode : int32_t { + LPP_ERROR_OK = 0, + LPP_ERROR_UNKONWN, + }; +- ++ + class LppDataPacket : public OHOS::RefBase { + public: + +diff --git a/interfaces/inner_api/native/lpp_video_streamer.h b/interfaces/inner_api/native/lpp_video_streamer.h +index d29cd78a0..ac6a72fac 100644 +--- a/interfaces/inner_api/native/lpp_video_streamer.h ++++ b/interfaces/inner_api/native/lpp_video_streamer.h +@@ -22,10 +22,9 @@ + #include "meta/format.h" + #include "lpp_audio_streamer.h" + #include "lpp_common.h" +- ++#include "lpp_capability.h" + namespace OHOS { + namespace Media { +- + class VideoStreamerKeys { + public: + static constexpr std::string_view LPP_CURRENT_POSITION = "current_position"; +@@ -113,9 +112,15 @@ public: + (void)mime; + return nullptr; + } ++ static LppAvCapabilityInfo *GetLppCapacity() ++ { ++ return nullptr; ++ } + #else + static std::shared_ptr CreateByMime(const std::string &mime); ++ static LppAvCapabilityInfo *GetLppCapacity(); + #endif ++ + private: + VideoStreamerFactory() = default; + ~VideoStreamerFactory() = default; +diff --git a/interfaces/inner_api/native/player_framework.versionscript b/interfaces/inner_api/native/player_framework.versionscript +index e6a712c86..7dc3297e6 100644 +--- a/interfaces/inner_api/native/player_framework.versionscript ++++ b/interfaces/inner_api/native/player_framework.versionscript +@@ -28,6 +28,8 @@ + *OHOS::Media::ScreenCaptureFactory::CreateScreenCaptureMonitor*; + *OHOS::Media::ScreenCaptureControllerFactory::CreateScreenCaptureController*; + *OHOS::Media::AudioStreamerFactory::CreateByMime*; ++ *OHOS::Media::VideoStreamerFactory::CreatePlayer*; ++ *OHOS::Media::VideoStreamerFactory::GetLppCapacity*; + *OHOS::Media::VideoStreamerFactory::CreateByMime*; + *OHOS::Media::Format::*; + *OHOS::Media::VideoCaps::*; +diff --git a/interfaces/kits/c/BUILD.gn b/interfaces/kits/c/BUILD.gn +index 3e308f4a6..3d533721d 100644 +--- a/interfaces/kits/c/BUILD.gn ++++ b/interfaces/kits/c/BUILD.gn +@@ -93,6 +93,13 @@ ohos_shared_library("native_avscreen_capture") { + "qos_manager:qos", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + output_extension = "so" + subsystem_name = "multimedia" + part_name = "player_framework" +@@ -133,6 +140,13 @@ ohos_shared_library("avplayer") { + "samgr:samgr_proxy", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_drm) { + public_external_deps = [ + "drm_framework:drm_framework", +@@ -187,6 +201,12 @@ ohos_shared_library("avrecorder") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_auto_create_file) { + external_deps += [ + "media_library:media_library", +@@ -240,6 +260,12 @@ ohos_shared_library("avimage_generator") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + output_extension = "so" +@@ -287,6 +313,13 @@ ohos_shared_library("avmetadata_extractor") { + "samgr:samgr_proxy", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_drm) { + public_external_deps = [ + "drm_framework:drm_framework", +@@ -341,6 +374,13 @@ ohos_shared_library("lowpower_avsink") { + "image_framework:pixelmap", + "hisysevent:libhisysevent", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + output_extension = "so" +@@ -388,6 +428,12 @@ ohos_shared_library("avtranscoder") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + defines = [] +diff --git a/interfaces/kits/c/lowpower_audio_sink_base.h b/interfaces/kits/c/lowpower_audio_sink_base.h +index 51fea73d2..93589ce6f 100644 +--- a/interfaces/kits/c/lowpower_audio_sink_base.h ++++ b/interfaces/kits/c/lowpower_audio_sink_base.h +@@ -59,7 +59,7 @@ typedef struct OH_LowPowerAudioSink OH_LowPowerAudioSink; + * @since 20 + */ + typedef struct OH_LowPowerAudioSinkCallback OH_LowPowerAudioSinkCallback; +- ++ + /** + * @brief When an error occurs in the running of the OH_LowPowerAudioSink instance, the function pointer will be called + * to report specific error information. +diff --git a/interfaces/kits/c/lowpower_avsink_base.h b/interfaces/kits/c/lowpower_avsink_base.h +index 27483c91d..1f5fdeb2e 100644 +--- a/interfaces/kits/c/lowpower_avsink_base.h ++++ b/interfaces/kits/c/lowpower_avsink_base.h +@@ -52,7 +52,14 @@ extern "C" { + * @since 20 + */ + typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; +- ++ ++/** ++ * @brief Forward declaration of OH_LowPowerAVSink_Capability. ++ * ++ * @since 21 ++ */ ++typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; ++ + /** + * @brief Append one OH_AVBuffer data to framePacketBuffer instance. + * +@@ -76,7 +83,20 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe + * @since 20 + */ + int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); ++ ++/** ++ * @brief Query the supported capabilities of a lowpower audio/video sink. ++ * ++ * This function queries and returns the capability set supported by the current ++ * lowpower audio/video sink, including but not limited to supported media formats, etc. ++ * ++ * @return {OH_LowPowerAVSink_Capability*} ++ * - A pointer to the capability structure if the sink supports capability queries and the query is successful. ++ * - nullptr if the sink does not support capability queries or the query fails. + ++ * @since 21 ++ */ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); + #ifdef __cplusplus + } + #endif +diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h +index d1c11f7e3..f363d3aa9 100644 +--- a/interfaces/kits/c/lowpower_video_sink.h ++++ b/interfaces/kits/c/lowpower_video_sink.h +@@ -470,7 +470,6 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener( + */ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetEosListener(OH_LowPowerVideoSinkCallback* callback, + OH_LowPowerVideoSink_OnEos onEos, void* userData); +- + #ifdef __cplusplus + } + #endif +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +index 782c14678..78becd0f9 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +@@ -85,6 +85,7 @@ int32_t HiLppVideoStreamerImpl::Init(const std::string &mime) + vdec_ = std::make_shared(streamerId_, isLpp_); + bool switchToCommon = false; + auto ret = vdec_->Init(mime, switchToCommon); ++ FALSE_RETURN_V_MSG(switchToCommon == false, AV_ERR_UNSUPPORT, "lpp is not support"); + FALSE_RETURN_V_MSG(ret == MSERR_OK, ret, "vdec_ init failed"); + FALSE_LOG_MSG_W(!switchToCommon, "switch isLpp_ to false"); + isLpp_ = isLpp_ ? !switchToCommon : isLpp_; +diff --git a/services/include/i_media_service.h b/services/include/i_media_service.h +index 9eed996ec..1c010933d 100644 +--- a/services/include/i_media_service.h ++++ b/services/include/i_media_service.h +@@ -234,6 +234,8 @@ public: + virtual std::shared_ptr CreateLppVideoStreamerService() = 0; + + virtual int32_t DestroyLppVideoStreamerService(std::shared_ptr lppVideoPlayer) = 0; ++ ++ virtual LppAvCapabilityInfo *GetLppCapacity() = 0; + #endif + + /** +diff --git a/services/services/BUILD.gn b/services/services/BUILD.gn +index 84494960d..e90102cd1 100644 +--- a/services/services/BUILD.gn ++++ b/services/services/BUILD.gn +@@ -318,7 +318,14 @@ ohos_shared_library("media_service") { + "window_manager:session_manager_lite", + ] + } +- ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ "hdf_core:libhdi", ++ ] ++ } ++ + if (player_framework_support_avsession_background) { + sources += [ "player/avsession_background/avsession_background.cpp" ] + external_deps += [ +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +index beec97728..1544d4297 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +@@ -102,7 +102,7 @@ public: + void OnTargetArrived(const int64_t targetPts, const bool isTimeout) override; + void OnFirstFrameReady() override; + void OnStreamChanged(Format &format) override; +- ++ + private: + int32_t CreateStreamerEngine(); + bool StateEnter(VideoState targetState, const std::string funcName = ""); +diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp +index 8252b1744..beab36136 100644 +--- a/services/services/sa_media/client/media_client.cpp ++++ b/services/services/sa_media/client/media_client.cpp +@@ -399,6 +399,16 @@ int32_t MediaClient::DestroyLppAudioStreamerService(std::shared_ptrGetLppCapacity(*lppAvCapabilityInfo); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, nullptr, "MediaClient::GetLppCapacityfailed"); ++ return lppAvCapabilityInfo; ++} ++ + std::shared_ptr MediaClient::CreateLppVideoStreamerService() + { + MEDIA_LOGI("CreateLppVideoStreamerService start"); +diff --git a/services/services/sa_media/client/media_client.h b/services/services/sa_media/client/media_client.h +index 92e597c70..bad6945f6 100644 +--- a/services/services/sa_media/client/media_client.h ++++ b/services/services/sa_media/client/media_client.h +@@ -94,6 +94,7 @@ public: + #ifdef SUPPORT_LPP_VIDEO_STRAMER + std::shared_ptr CreateLppVideoStreamerService() override; + int32_t DestroyLppVideoStreamerService(std::shared_ptr lppAudioPlayer) override; ++ LppAvCapabilityInfo *GetLppCapacity() override; + #endif + std::vector GetPlayerPids() override; + +diff --git a/services/services/sa_media/ipc/i_standard_media_service.h b/services/services/sa_media/ipc/i_standard_media_service.h +index 80f81713f..f387decaa 100644 +--- a/services/services/sa_media/ipc/i_standard_media_service.h ++++ b/services/services/sa_media/ipc/i_standard_media_service.h +@@ -20,6 +20,7 @@ + #include "iremote_broker.h" + #include "iremote_proxy.h" + #include "iremote_stub.h" ++#include "lpp_capability.h" + #include + + namespace OHOS { +@@ -81,6 +82,8 @@ public: + + virtual int32_t ResetAllProxy() = 0; + ++ virtual int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) = 0; ++ + /** + * IPC code ID + */ +@@ -92,6 +95,8 @@ public: + GET_PLAYER_PIDS = 4, + FREEZE = 5, + RESET_ALL_PROXY = 6, ++ GET_RAMAINED_CAPACITY = 7, ++ GET_LPP_CAPABILITY = 8, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"IStandardMediaService"); +diff --git a/services/services/sa_media/ipc/media_service_proxy.cpp b/services/services/sa_media/ipc/media_service_proxy.cpp +index c91e6ab56..595fd4b46 100644 +--- a/services/services/sa_media/ipc/media_service_proxy.cpp ++++ b/services/services/sa_media/ipc/media_service_proxy.cpp +@@ -76,6 +76,24 @@ std::vector MediaServiceProxy::GetPlayerPids() + return res; + } + ++int32_t MediaServiceProxy::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { ++ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity"); ++ MessageParcel data; ++ MessageParcel reply; ++ MessageOption option; ++ int32_t error = -1; ++ bool token = data.WriteInterfaceToken(MediaServiceProxy::GetDescriptor()); ++ CHECK_AND_RETURN_RET_LOG(token, error, "Failed to write descriptor!"); ++ error = Remote()->SendRequest(MediaServiceMsg::GET_LPP_CAPABILITY, data, reply, option); ++ CHECK_AND_RETURN_RET_LOG(error == MSERR_OK, error, "Failed to SendRequest"); ++ int32_t ret = reply.ReadInt32(); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "Fail to MediaServiceProxy::GetLppCapacity"); ++ lppAvCapability = LppAvCapabilityInfo::Unmarshalling(reply); ++ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity %{public}zu %{public}zu", ++ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ return ret; ++} ++ + sptr MediaServiceProxy::GetSubSystemAbility(IStandardMediaService::MediaSystemAbility subSystemId, + const sptr &listener) + { +diff --git a/services/services/sa_media/ipc/media_service_proxy.h b/services/services/sa_media/ipc/media_service_proxy.h +index d43cf9827..3ce5b8619 100644 +--- a/services/services/sa_media/ipc/media_service_proxy.h ++++ b/services/services/sa_media/ipc/media_service_proxy.h +@@ -41,6 +41,7 @@ public: + + int32_t ResetAllProxy() override; + ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; + private: + bool IsGetSubSystemAbilityASync() const; + static inline BrokerDelegator delegator_; +diff --git a/services/services/sa_media/ipc/media_service_stub.cpp b/services/services/sa_media/ipc/media_service_stub.cpp +index 0c701f82c..8955b126e 100644 +--- a/services/services/sa_media/ipc/media_service_stub.cpp ++++ b/services/services/sa_media/ipc/media_service_stub.cpp +@@ -58,6 +58,8 @@ void MediaServiceStub::Init() + [this](MessageParcel &data, MessageParcel &reply) { return HandleFreezeStubForPids(data, reply); }; + mediaFuncs_[RESET_ALL_PROXY] = + [this](MessageParcel &data, MessageParcel &reply) { return HandleResetAllProxy(data, reply); }; ++ mediaFuncs_[GET_LPP_CAPABILITY] = ++ [this] (MessageParcel &data, MessageParcel &reply) { return GetLppCapacityStub(data, reply); }; + } + + int32_t MediaServiceStub::HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply) +@@ -199,6 +201,17 @@ int32_t MediaServiceStub::ReleaseClientListenerStub(MessageParcel &data, Message + return MSERR_OK; + } + ++int32_t MediaServiceStub::GetLppCapacityStub(MessageParcel &data, MessageParcel &reply) ++{ ++ (void)data; ++ LppAvCapabilityInfo info; ++ int32_t ret = GetLppCapacity(info); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "Failed to write descriptor!"); ++ reply.WriteInt32(ret); ++ info.Marshalling(reply); ++ return MSERR_OK; ++} ++ + int32_t MediaServiceStub::GetPlayerPidsStub(MessageParcel &data, MessageParcel &reply) + { + (void)data; +@@ -222,6 +235,20 @@ std::vector MediaServiceStub::GetPlayerPids() + return MediaServerManager::GetInstance().GetPlayerPids(); + } + ++int32_t MediaServiceStub::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) ++{ ++ MEDIA_LOGI("MediaServiceStub::GetLppCapacity"); ++ #ifdef SUPPORT_LPP_VIDEO_STRAMER ++ int32_t ret = MediaServerManager::GetInstance().GetLppCapacity(lppAvCapability); ++ #else ++ int32_t ret = MSERR_UNKNOWN; ++ #endif ++ MEDIA_LOGI("MediaServiceStub::GetLppCapacity %{public}lu %{public}lu", ++ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, MSERR_UNKNOWN, "MediaServiceStub::GetLppCapacity GetLppCapacity"); ++ return ret; ++} ++ + int32_t MediaServiceStub::GetSystemAbility(MessageParcel &data, MessageParcel &reply) + { + int32_t mediaSystemAbility = data.ReadInt32(); +diff --git a/services/services/sa_media/ipc/media_service_stub.h b/services/services/sa_media/ipc/media_service_stub.h +index 46dbe0648..52e01926e 100644 +--- a/services/services/sa_media/ipc/media_service_stub.h ++++ b/services/services/sa_media/ipc/media_service_stub.h +@@ -44,6 +44,8 @@ private: + int32_t HandleKillMediaService(MessageParcel &data, MessageParcel &reply); + void ReleaseClientListener() override; + std::vector GetPlayerPids() override; ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; ++ int32_t GetLppCapacityStub(MessageParcel &data, MessageParcel &reply); + int32_t HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply); + int32_t HandleResetAllProxy(MessageParcel &data, MessageParcel &reply); + void ClientDied(pid_t pid); +diff --git a/services/services/sa_media/server_manager/media_server_manager.cpp b/services/services/sa_media/server_manager/media_server_manager.cpp +index 800e338f1..8579f7162 100644 +--- a/services/services/sa_media/server_manager/media_server_manager.cpp ++++ b/services/services/sa_media/server_manager/media_server_manager.cpp +@@ -50,6 +50,10 @@ + #include "player_xcollie.h" + #include "client/memory_collector_client.h" + #include ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++#include "v1_0/ilow_power_player_factory.h" ++namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; ++#endif + + namespace { + constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_PLAYER, "MediaServerManager"}; +@@ -530,6 +534,18 @@ sptr MediaServerManager::CreateLppAudioPlayerStubObject() + #endif + + #ifdef SUPPORT_LPP_VIDEO_STRAMER ++int32_t MediaServerManager::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { ++ auto factory = PlayerHDI::ILowPowerPlayerFactory::Get(true); ++ CHECK_AND_RETURN_RET_LOG(factory != nullptr, UNKNOWN_ERROR, "MediaServerManager::GetLppCapacity is failed"); ++ PlayerHDI::LppAVCap lppAVCap; ++ int32_t ret = factory->GetAVCapability(lppAVCap); ++ MEDIA_LOGI("MediaServerManager::GetLppCapacity %{public}lu %{public}lu", ++ lppAVCap.videoCap.size(), lppAVCap.audioCap.size()); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "FAILED MediaServerManager::GetLppCapacity"); ++ lppAvCapability.SetLppAvCapabilityInfo(lppAVCap); ++ return ret; ++} ++ + sptr MediaServerManager::CreateLppVideoPlayerStubObject() + { + MEDIA_LOGI("CreateLppVideoPlayerStubObject start"); +diff --git a/services/services/sa_media/server_manager/media_server_manager.h b/services/services/sa_media/server_manager/media_server_manager.h +index ddc10e4bd..cf1f13ef2 100644 +--- a/services/services/sa_media/server_manager/media_server_manager.h ++++ b/services/services/sa_media/server_manager/media_server_manager.h +@@ -25,10 +25,11 @@ + #include "nocopyable.h" + #include "osal/task/task.h" + #include +- ++#include "lpp_capability.h" + namespace OHOS { + namespace Media { + using DumperEntry = std::function; ++ + struct Dumper { + pid_t pid_; + pid_t uid_; +@@ -79,6 +80,10 @@ public: + #endif + bool CanKillMediaService(); + std::vector GetPlayerPids(); ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability); ++#endif ++ + private: + MediaServerManager(); + #ifdef SUPPORT_PLAYER +diff --git a/test/unittest/avmetadatahelper_test/BUILD.gn b/test/unittest/avmetadatahelper_test/BUILD.gn +index fc9a6f0b2..fa8d2d30b 100644 +--- a/test/unittest/avmetadatahelper_test/BUILD.gn ++++ b/test/unittest/avmetadatahelper_test/BUILD.gn +@@ -176,6 +176,12 @@ ohos_unittest("avmetadatahelper_unit_test") { + "samgr:samgr_proxy", + "window_manager:libwm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + + if (player_framework_support_video) { + external_deps += [ "graphic_surface:surface" ] +diff --git a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp +index 8d4166ebe..e5d703a2b 100644 +--- a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp ++++ b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp +@@ -114,6 +114,12 @@ int32_t MediaClient::ResetAllProxy() + return 0; + } + ++LppAvCapabilityInfo* MediaClient::GetLppCapacity() ++{ ++ LppAvCapabilityInfo *lppAvCapabilityInfo = new LppAvCapabilityInfo(); ++ return lppAvCapabilityInfo; ++} ++ + namespace Test { + void AVMetadtahelperImplUnitTest::SetUpTestCase(void) {} + +diff --git a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn +index 172487a43..d0b1cc797 100644 +--- a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn ++++ b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn +@@ -48,6 +48,12 @@ ohos_unittest("lpp_video_streamer_unit_test") { + "media_foundation:media_foundation" + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + resource_config_file = + "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" +-} +\ No newline at end of file ++} +diff --git a/test/unittest/media_server_manager_test/BUILD.gn b/test/unittest/media_server_manager_test/BUILD.gn +index 833753a60..cc4174ef8 100644 +--- a/test/unittest/media_server_manager_test/BUILD.gn ++++ b/test/unittest/media_server_manager_test/BUILD.gn +@@ -125,6 +125,12 @@ ohos_unittest("media_server_manager_test") { + "samgr:samgr_proxy", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_video) { + external_deps += [ "graphic_surface:surface" ] + } +diff --git a/test/unittest/media_service_helper_test/BUILD.gn b/test/unittest/media_service_helper_test/BUILD.gn +index 292d28380..fd91a2a29 100644 +--- a/test/unittest/media_service_helper_test/BUILD.gn ++++ b/test/unittest/media_service_helper_test/BUILD.gn +@@ -67,6 +67,12 @@ ohos_unittest("media_service_helper_unit_test") { + "ipc:ipc_single", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (defined(global_parts_info) && + defined(global_parts_info.multimedia_histreamer_ext)) { + defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] +diff --git a/test/unittest/player_service_stub_test/BUILD.gn b/test/unittest/player_service_stub_test/BUILD.gn +index bd0938811..374bb3469 100644 +--- a/test/unittest/player_service_stub_test/BUILD.gn ++++ b/test/unittest/player_service_stub_test/BUILD.gn +@@ -117,6 +117,12 @@ ohos_unittest("player_service_stub_test") { + external_deps += [ "graphic_surface:surface" ] + } + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_screen_capture_stopbycall) { + external_deps += [ + "call_manager:tel_call_manager_api", +diff --git a/test/unittest/sa_media_client_unit_test/BUILD.gn b/test/unittest/sa_media_client_unit_test/BUILD.gn +index 475525407..354aca6d0 100644 +--- a/test/unittest/sa_media_client_unit_test/BUILD.gn ++++ b/test/unittest/sa_media_client_unit_test/BUILD.gn +@@ -145,6 +145,12 @@ include_dirs = [ + "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service", + "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + + resource_config_file = + "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" +diff --git a/test/unittest/timeout_test/BUILD.gn b/test/unittest/timeout_test/BUILD.gn +index 33812ec07..272035ee1 100644 +--- a/test/unittest/timeout_test/BUILD.gn ++++ b/test/unittest/timeout_test/BUILD.gn +@@ -76,6 +76,12 @@ ohos_unittest("player_timeout_unit_test") { + "window_manager:libwm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (defined(global_parts_info) && + defined(global_parts_info.multimedia_histreamer_ext)) { + defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] +diff --git a/test/unittest/timeout_test/mock/mock_i_media_service.h b/test/unittest/timeout_test/mock/mock_i_media_service.h +index d95abad8c..4e3284a56 100644 +--- a/test/unittest/timeout_test/mock/mock_i_media_service.h ++++ b/test/unittest/timeout_test/mock/mock_i_media_service.h +@@ -71,6 +71,7 @@ public: + MOCK_METHOD(std::shared_ptr, CreateLppVideoStreamerService, (), (override)); + MOCK_METHOD(int32_t, + DestroyLppVideoStreamerService, (std::shared_ptr lppAudioPlayer), (override)); ++ MOCK_METHOD(LppAvCapabilityInfo*, GetLppCapacity, (), (override)); + #endif + + MOCK_METHOD(sptr, GetMonitorProxy, (), (override)); +-- -- Gitee From 438ac8eae2cb728b20b67a64bae9d16ad15b2e0e Mon Sep 17 00:00:00 2001 From: zpf Date: Fri, 29 Aug 2025 07:41:25 +0000 Subject: [PATCH 06/11] 1 Signed-off-by: zpf --- hisysevent.yaml | 4 ---- multimedia_player_framework_aafwk.gni | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hisysevent.yaml b/hisysevent.yaml index 097e8c0bc..fd79657d2 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -569,10 +569,6 @@ index f7b3c55f1..6f4f09db0 100644 - - - - diff --git a/multimedia_player_framework_aafwk.gni b/multimedia_player_framework_aafwk.gni index 2317bb25a..197fd2e27 100644 --- a/multimedia_player_framework_aafwk.gni +++ b/multimedia_player_framework_aafwk.gni @@ -1,3 +1,4 @@ +sed -i 's/[[:space:]]*$//' my_patch.diff From 998346ac68242a750c9bf0a8201e6c21a7c62352 Mon Sep 17 00:00:00 2001 From: z00654174 Date: Sun, 24 Aug 2025 18:46:13 +0800 -- Gitee From 02018772d3d230652a82f22a5a9bae0b927b584d Mon Sep 17 00:00:00 2001 From: zpf Date: Fri, 29 Aug 2025 08:58:08 +0000 Subject: [PATCH 07/11] 111 Signed-off-by: zpf --- multimedia_player_framework_aafwk.gni | 1438 ++++++++----------------- 1 file changed, 472 insertions(+), 966 deletions(-) diff --git a/multimedia_player_framework_aafwk.gni b/multimedia_player_framework_aafwk.gni index 197fd2e27..5460947aa 100644 --- a/multimedia_player_framework_aafwk.gni +++ b/multimedia_player_framework_aafwk.gni @@ -1,96 +1,46 @@ -sed -i 's/[[:space:]]*$//' my_patch.diff -From 998346ac68242a750c9bf0a8201e6c21a7c62352 Mon Sep 17 00:00:00 2001 +From 33b8f932d957909ccce2c668cc1bbf0a65fd9c07 Mon Sep 17 00:00:00 2001 From: z00654174 -Date: Sun, 24 Aug 2025 18:46:13 +0800 -Subject: [PATCH] TicketNo:DTS2022071803909 Description: lppbug Team:OTHERS +Date: Thu, 28 Aug 2025 09:55:56 +0800 +Subject: [PATCH] TicketNo:DTS2022071803909 Description: pts Team:OTHERS Feature or Bugfix:Bugfix Binary Source:NA PrivateCode(Yes/No):No -Change-Id: I7abc64d758de105c85d3613b9b9fcb0881fe4175 +Change-Id: Ic56a08bf0e57af135fe5d42d8c021fdd0250cf41 --- - .../native/capi/common/native_player_magic.h | 4 + - .../native/capi/lppplayer/native_lpp_common.h | 10 + - .../lppplayer/native_lpp_video_streamer.cpp | 16 ++ - .../video_streamer_impl.cpp | 7 + - .../native/media_service_helper/BUILD.gn | 8 +- - interfaces/inner_api/native/BUILD.gn | 7 + - interfaces/inner_api/native/lpp_capability.h | 195 ++++++++++++++++++ - interfaces/inner_api/native/lpp_common.h | 2 +- - .../inner_api/native/lpp_video_streamer.h | 9 +- - .../native/player_framework.versionscript | 2 + - interfaces/kits/c/BUILD.gn | 46 +++++ - interfaces/kits/c/lowpower_audio_sink_base.h | 2 +- - interfaces/kits/c/lowpower_avsink_base.h | 22 +- - interfaces/kits/c/lowpower_video_sink.h | 1 - - .../src/hilpp_vstreamer_impl.cpp | 1 + - services/include/i_media_service.h | 2 + - services/services/BUILD.gn | 9 +- - .../server/lpp_video_streamer_server.h | 2 +- - .../services/sa_media/client/media_client.cpp | 10 + - .../services/sa_media/client/media_client.h | 1 + - .../sa_media/ipc/i_standard_media_service.h | 5 + - .../sa_media/ipc/media_service_proxy.cpp | 18 ++ - .../sa_media/ipc/media_service_proxy.h | 1 + - .../sa_media/ipc/media_service_stub.cpp | 27 +++ - .../sa_media/ipc/media_service_stub.h | 2 + - .../server_manager/media_server_manager.cpp | 16 ++ - .../server_manager/media_server_manager.h | 7 +- - test/unittest/avmetadatahelper_test/BUILD.gn | 6 + - .../avmetadatahelper_impl_unit_test.cpp | 6 + - .../lpp_video_streamer_unit_test/BUILD.gn | 8 +- - .../media_server_manager_test/BUILD.gn | 6 + - .../media_service_helper_test/BUILD.gn | 6 + - .../player_service_stub_test/BUILD.gn | 6 + - .../sa_media_client_unit_test/BUILD.gn | 6 + - test/unittest/timeout_test/BUILD.gn | 6 + - .../timeout_test/mock/mock_i_media_service.h | 1 + - 36 files changed, 472 insertions(+), 11 deletions(-) - create mode 100644 interfaces/inner_api/native/lpp_capability.h + .../lppplayer/native_lpp_video_streamer.cpp | 12 ++++++++++ + .../video_streamer_impl.cpp | 10 ++++++++ + .../lpp_video_streamer/video_streamer_impl.h | 2 ++ + .../inner_api/native/lpp_video_streamer.h | 2 ++ + interfaces/kits/c/lowpower_video_sink.h | 14 +++++++++++ + .../lpp/lpp_sync_manager/lpp_sync_manager.h | 1 + + .../lpp_sync_manager_adapter.h | 2 ++ + .../lpp_sync_manager/src/lpp_sync_manager.cpp | 10 ++++++++ + .../src/lpp_sync_manager_adapter.cpp | 8 +++++++ + .../lpp_video_streamer/hilpp_vstreamer_impl.h | 1 + + .../src/hilpp_vstreamer_impl.cpp | 7 ++++++ + .../include/i_lpp_video_streamer_service.h | 2 ++ + .../services/engine_intf/i_lpp_sync_manager.h | 1 + + .../engine_intf/i_lpp_video_streamer.h | 1 + + .../client/lpp_video_streamer_client.cpp | 10 ++++++++ + .../client/lpp_video_streamer_client.h | 2 ++ + .../i_standard_lpp_video_streamer_service.h | 3 +++ + .../ipc/lpp_video_streamer_service_proxy.cpp | 19 +++++++++++++++ + .../ipc/lpp_video_streamer_service_proxy.h | 2 ++ + .../ipc/lpp_video_streamer_service_stub.cpp | 24 +++++++++++++++++++ + .../ipc/lpp_video_streamer_service_stub.h | 4 ++++ + .../server/lpp_video_streamer_server.cpp | 9 +++++++ + .../server/lpp_video_streamer_server.h | 2 ++ + .../mock/i_lpp_sync_manager.h | 1 + + .../mock/hilpp_vstreamer_impl.h | 1 + + .../mock/lpp_sync_manager.h | 1 + + .../mock/lpp_sync_manager_adapter.h | 1 + + .../mock/v1_0/ilpp_sync_manager_adapter.h | 1 + + .../mock/lpp_sync_manager.h | 2 +- + .../mock/lpp_sync_manager_adapter.h | 1 + + .../mock/lpp_sync_manager.h | 1 + + 31 files changed, 156 insertions(+), 1 deletion(-) -diff --git a/frameworks/native/capi/common/native_player_magic.h b/frameworks/native/capi/common/native_player_magic.h -index 83a1344c7..fea52bdea 100644 ---- a/frameworks/native/capi/common/native_player_magic.h -+++ b/frameworks/native/capi/common/native_player_magic.h -@@ -90,4 +90,8 @@ struct OH_AVTranscoder_Config : public OHOS::RefBase { - virtual ~OH_AVTranscoder_Config() = default; - }; - -+struct OH_LowPowerAVSink_Capability : public OHOS::RefBase { -+ OH_LowPowerAVSink_Capability() = default; -+ virtual ~OH_LowPowerAVSink_Capability() = default; -+}; - #endif // NATIVE_SCREEN_CAPTURE_MAGIC_H -\ No newline at end of file -diff --git a/frameworks/native/capi/lppplayer/native_lpp_common.h b/frameworks/native/capi/lppplayer/native_lpp_common.h -index e72ec635e..4780f568e 100644 ---- a/frameworks/native/capi/lppplayer/native_lpp_common.h -+++ b/frameworks/native/capi/lppplayer/native_lpp_common.h -@@ -35,6 +35,7 @@ - #include "lpp_video_streamer.h" - #include "lpp_common.h" - #include "native_window.h" -+#include "lpp_capability.h" - - namespace OHOS { - namespace Media { -@@ -93,6 +94,15 @@ struct LowPowerVideoSinkObject : public OH_LowPowerVideoSink { - const std::shared_ptr videoStreamer_ = nullptr; - AVSamplesBufferObject *framePacket_ = nullptr; - }; -+ -+struct LowPowerAVSinkCapabilityObject : public OH_LowPowerAVSink_Capability { -+ explicit LowPowerAVSinkCapabilityObject(std::shared_ptr lppCapibility) -+ : lppCapibility_(lppCapibility) -+ {} -+ ~LowPowerAVSinkCapabilityObject() = default; -+ -+ std::shared_ptr lppCapibility_ = nullptr; -+}; - } // namespace Media - } // namespace OHOS - #endif // NATIVE_LPP_COMMON_H -\ No newline at end of file diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp -index 2147b2427..94c60dfe5 100644 +index 2147b2427..5ed1622b2 100644 --- a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +++ b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp @@ -634,6 +634,7 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetStreamChangedListener( @@ -101,968 +51,524 @@ index 2147b2427..94c60dfe5 100644 OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPowerVideoSinkCallback *callback, OH_LowPowerVideoSink_OnFirstFrameDecoded onFirstFrameDecoded, void *userData) { -@@ -643,3 +644,18 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow +@@ -643,3 +644,14 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow int32_t res = callback->SetFirstFrameReadyListener(onFirstFrameDecoded, userData); return LppMsErrToOHAvErr(res); } + -+OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *streamer, int64_t *pts) +{ -+ MEDIA_LOGD("OH_LowPowerAVSink_GetCapability"); -+ LppAvCapabilityInfo *info = VideoStreamerFactory::GetLppCapacity(); -+ CHECK_AND_RETURN_RET_LOG(info != nullptr, nullptr, "info is nullptr!"); -+ std::shared_ptr sharedPtr(info); -+ info = nullptr; -+ CHECK_AND_RETURN_RET_LOG(sharedPtr != nullptr, nullptr, "sharedPtr is nullptr!"); -+ LowPowerAVSinkCapabilityObject *object = new(std::nothrow) LowPowerAVSinkCapabilityObject(sharedPtr); -+ CHECK_AND_RETURN_RET_LOG(object != nullptr, nullptr, "object is nullptr!"); -+ MEDIA_LOGI("OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() %{public}zu %{public}zu", -+ object->lppCapibility_->videoCap_.size(), object->lppCapibility_->audioCap_.size()); -+ return object; ++ MEDIA_LOGD("OH_LowPowerVideoSink_GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamer != nullptr, AV_ERR_INVALID_VAL, "streamer is nullptr!"); ++ LowPowerVideoSinkObject *streamerObj = reinterpret_cast(streamer); ++ CHECK_AND_RETURN_RET_LOG(streamerObj != nullptr, AV_ERR_INVALID_VAL, "streamerObj is nullptr"); ++ CHECK_AND_RETURN_RET_LOG(streamerObj->videoStreamer_ != nullptr, AV_ERR_INVALID_VAL, "videoStreamer_ is nullptr"); ++ int32_t res = streamerObj->videoStreamer_->GetLatestPts(*pts); ++ return LppMsErrToOHAvErr(res); +} diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp -index f7adadd72..d7bf73f3f 100644 +index f7adadd72..414b33325 100644 --- a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp -@@ -34,6 +34,13 @@ std::shared_ptr VideoStreamerFactory::CreateByMime(const std::str - return impl; +@@ -262,5 +262,15 @@ std::string VideoStreamerImpl::GetStreamerId() + CHECK_AND_RETURN_RET_LOG(streamerService_ != nullptr, "", "player service does not exist.."); + return streamerService_->GetStreamerId(); } - -+LppAvCapabilityInfo *VideoStreamerFactory::GetLppCapacity() ++ ++int32_t VideoStreamerImpl::GetLatestPts(int64_t &pts) +{ -+ LppAvCapabilityInfo *lppAvCapability = MediaServiceFactory::GetInstance().GetLppCapacity(); -+ CHECK_AND_RETURN_RET_LOG(lppAvCapability != nullptr, nullptr, "VideoStreamerFactory::failed to GetLppCapacity"); -+ return lppAvCapability; ++ MEDIA_LOGI("VideoStreamerImpl GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamerService_ != nullptr, MSERR_SERVICE_DIED, ++ "GetLatestPts player service does not exist.."); ++ int32_t ret = streamerService_->GetLatestPts(pts); ++ pts = (ret == MSERR_OK) ? pts : 0; ++ return ret; +} -+ - int32_t VideoStreamerImpl::Init(const std::string &mime) - { - MEDIA_LOGI("VideoStreamerImpl Init, mime %{public}s", mime.c_str()); -diff --git a/frameworks/native/media_service_helper/BUILD.gn b/frameworks/native/media_service_helper/BUILD.gn -index a4124df86..357530135 100644 ---- a/frameworks/native/media_service_helper/BUILD.gn -+++ b/frameworks/native/media_service_helper/BUILD.gn -@@ -100,9 +100,15 @@ ohos_shared_library("media_helper_client") { - "hilog:libhilog", - "image_framework:image_native", - "ipc:ipc_single", -- "media_foundation:media_foundation" -+ "media_foundation:media_foundation", - ] + } // namespace Media + } // namespace OHOS +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.h b/frameworks/native/lpp_video_streamer/video_streamer_impl.h +index 16015c442..1a0b1e3e9 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.h ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.h +@@ -76,6 +76,8 @@ public: -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - innerapi_tags = [ "platformsdk" ] - subsystem_name = "multimedia" - part_name = "player_framework" -diff --git a/interfaces/inner_api/native/BUILD.gn b/interfaces/inner_api/native/BUILD.gn -index 10b2a4ae0..a89225c8c 100644 ---- a/interfaces/inner_api/native/BUILD.gn -+++ b/interfaces/inner_api/native/BUILD.gn -@@ -218,8 +218,15 @@ ohos_shared_library("media_client") { - "ipc:ipc_single", - "qos_manager:qos", - "samgr:samgr_proxy", -+ "hdf_core:libhdi", - ] + std::string GetStreamerId() override; -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - public_external_deps = [ - "graphic_2d:color_manager", - "media_foundation:media_foundation", -diff --git a/interfaces/inner_api/native/lpp_capability.h b/interfaces/inner_api/native/lpp_capability.h -new file mode 100644 -index 000000000..b78d734de ---- /dev/null -+++ b/interfaces/inner_api/native/lpp_capability.h -@@ -0,0 +1,195 @@ -+/* -+ * Copyright (C) 2025 Huawei Device Co., Ltd. -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#ifndef LPP_CAPABILITY_H -+#define LPP_CAPABILITY_H -+ -+#include "media_log.h" -+#include -+#ifdef SUPPORT_LPP_VIDEO_STRAMER -+#include "v1_0/ilow_power_player_factory.h" -+namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; -+#endif -+ -+namespace OHOS { -+namespace Media { -+struct VideoMimeCapIpc : public Parcelable { -+public: -+ std::string mime_ = ""; /** video/avc, video/hevc */ -+ uint32_t minWidth_ = 0; -+ uint32_t minHeight_ = 0; -+ uint32_t maxWidth_ = 0; -+ uint32_t maxHeight_ = 0; -+ uint32_t maxPixelPerSecond_ = 0; -+ uint32_t maxInstance_ = 0; -+ bool isSupportDRM_ = false; -+ std::vector supportHDRTypes_ = {}; /** HDR10, HDR10+, HDRVivid */ -+#ifdef SUPPORT_LPP_VIDEO_STRAMER -+ VideoMimeCapIpc(const PlayerHDI::VideoMimeCap &videoMimeCap) -+ { -+ mime_ = videoMimeCap.mime; -+ minWidth_ = videoMimeCap.minWidth; -+ minHeight_ = videoMimeCap.minHeight; -+ maxWidth_ = videoMimeCap.maxWidth; -+ maxHeight_ = videoMimeCap.maxHeight; -+ maxPixelPerSecond_ = videoMimeCap.maxPixelPerSecond; -+ maxInstance_ = videoMimeCap.maxInstance; -+ isSupportDRM_ = videoMimeCap.isSupportDRM; -+ for (uint32_t i = 0; i < videoMimeCap.supportHDRTypes.size(); i++) { -+ supportHDRTypes_.push_back(videoMimeCap.supportHDRTypes[i]); -+ } -+ } -+#endif -+ -+ VideoMimeCapIpc() {} ++ int32_t GetLatestPts(int64_t &pts) override; + -+ bool Marshalling(Parcel &parcel) const override -+ { -+ parcel.WriteString(mime_); -+ parcel.WriteUint32(minWidth_); -+ parcel.WriteUint32(minHeight_); -+ parcel.WriteUint32(maxWidth_); -+ parcel.WriteUint32(maxHeight_); -+ parcel.WriteUint32(maxPixelPerSecond_); -+ parcel.WriteUint32(maxInstance_); -+ parcel.WriteBool(isSupportDRM_); -+ uint32_t typeSize = supportHDRTypes_.size(); -+ parcel.WriteUint32(typeSize); -+ for (uint32_t i = 0; i < typeSize; i++) { -+ parcel.WriteUint32(supportHDRTypes_[i]); -+ } -+ return true; -+ } -+ -+ void UnmarshallingSelf(Parcel &parcel) -+ { -+ mime_ = parcel.ReadString(); -+ minWidth_ = parcel.ReadUint32(); -+ minHeight_ = parcel.ReadUint32(); -+ maxWidth_ = parcel.ReadUint32(); -+ maxHeight_ = parcel.ReadUint32(); -+ maxPixelPerSecond_ = parcel.ReadUint32(); -+ maxInstance_ = parcel.ReadUint32(); -+ isSupportDRM_ = parcel.ReadBool(); -+ uint32_t typeSize = parcel.ReadUint32(); -+ for (uint32_t i = 0; i < typeSize; i++) { -+ supportHDRTypes_.push_back(parcel.ReadUint32()); -+ } -+ } -+}; -+ -+struct AudioMimeCapIpc : public Parcelable { -+public: -+ std::string mime_ = ""; /** AAC, Flac, Vorbis, MPEG, G711mu, AMR(amrnb, amrwb), APE */ -+ uint32_t sampleRate_ = 0; -+ uint32_t channelCount_ = 0; -+#ifdef SUPPORT_LPP_VIDEO_STRAMER -+ AudioMimeCapIpc(const PlayerHDI::AudioMimeCap &audioMimeCap) -+ { -+ mime_ = audioMimeCap.mime; -+ sampleRate_ = audioMimeCap.sampleRate; -+ channelCount_ = audioMimeCap.channelCount; -+ } -+#endif -+ -+ AudioMimeCapIpc() {} -+ -+ bool Marshalling(Parcel &parcel) const override -+ { -+ parcel.WriteString(mime_); -+ parcel.WriteUint32(sampleRate_); -+ parcel.WriteUint32(channelCount_); -+ return true; -+ } -+ -+ void UnmarshallingSelf(Parcel &parcel) -+ { -+ mime_ = parcel.ReadString(); -+ sampleRate_ = parcel.ReadUint32(); -+ channelCount_ = parcel.ReadUint32(); -+ } -+}; -+ -+struct LppAvCapabilityInfo : public Parcelable { -+public: -+ uint32_t maxInstance_ = 0; -+ std::vector videoCap_ = {}; /** videoCap */ -+ std::vector audioCap_ = {}; -+ -+ LppAvCapabilityInfo() {} -+ -+#ifdef SUPPORT_LPP_VIDEO_STRAMER -+ void SetLppAvCapabilityInfo(PlayerHDI::LppAVCap &lppAVCap) -+ { -+ maxInstance_ = lppAVCap.maxInstance; -+ for (uint32_t i = 0; i < lppAVCap.videoCap.size(); i++) { -+ VideoMimeCapIpc videoMimeCapIpc(lppAVCap.videoCap[i]); -+ videoCap_.push_back(videoMimeCapIpc); -+ } -+ -+ for (uint32_t i = 0; i < lppAVCap.audioCap.size(); i++) { -+ AudioMimeCapIpc audioMimeCapIpc(lppAVCap.audioCap[i]); -+ audioCap_.push_back(audioMimeCapIpc); -+ } -+ } -+#endif -+ -+ bool Marshalling(Parcel &parcel) const override -+ { -+ parcel.WriteUint32(maxInstance_); -+ -+ parcel.WriteUint32(videoCap_.size()); -+ for (uint32_t i = 0; i< videoCap_.size(); i++) { -+ videoCap_[i].Marshalling(parcel); -+ } -+ -+ parcel.WriteUint32(audioCap_.size()); -+ for (uint32_t i = 0; i< audioCap_.size(); i++) { -+ audioCap_[i].Marshalling(parcel); -+ } -+ return true; -+ } -+ -+ static LppAvCapabilityInfo Unmarshalling(Parcel &parcel) -+ { -+ const uint32_t MAX_SIZE = 65535; -+ LppAvCapabilityInfo info; -+ info.maxInstance_ = parcel.ReadUint32(); -+ -+ uint32_t videoCapSize = parcel.ReadUint32(); -+ if (videoCapSize > MAX_SIZE) { -+ return info; -+ } -+ for (uint32_t i = 0; i< videoCapSize; i++) { -+ VideoMimeCapIpc videoCap; -+ videoCap.UnmarshallingSelf(parcel); -+ info.videoCap_.push_back(videoCap); -+ } -+ -+ uint32_t audioCapSize = parcel.ReadUint32(); -+ if (audioCapSize > MAX_SIZE) { -+ return info; -+ } -+ for (uint32_t i = 0; i< audioCapSize; i++) { -+ AudioMimeCapIpc audioCap; -+ audioCap.UnmarshallingSelf(parcel); -+ info.audioCap_.push_back(audioCap); -+ } -+ return info; -+ } -+}; -+} -+} -+#endif // LPP_CAPABILITY_H -\ No newline at end of file -diff --git a/interfaces/inner_api/native/lpp_common.h b/interfaces/inner_api/native/lpp_common.h -index 17f2ecac2..f42e2448e 100644 ---- a/interfaces/inner_api/native/lpp_common.h -+++ b/interfaces/inner_api/native/lpp_common.h -@@ -27,7 +27,7 @@ enum LppErrCode : int32_t { - LPP_ERROR_OK = 0, - LPP_ERROR_UNKONWN, - }; -- -+ - class LppDataPacket : public OHOS::RefBase { - public: - + private: + std::shared_ptr callback_; + std::shared_ptr streamerService_ = nullptr; diff --git a/interfaces/inner_api/native/lpp_video_streamer.h b/interfaces/inner_api/native/lpp_video_streamer.h -index d29cd78a0..ac6a72fac 100644 +index d29cd78a0..34de7d154 100644 --- a/interfaces/inner_api/native/lpp_video_streamer.h +++ b/interfaces/inner_api/native/lpp_video_streamer.h -@@ -22,10 +22,9 @@ - #include "meta/format.h" - #include "lpp_audio_streamer.h" - #include "lpp_common.h" -- -+#include "lpp_capability.h" - namespace OHOS { - namespace Media { -- - class VideoStreamerKeys { - public: - static constexpr std::string_view LPP_CURRENT_POSITION = "current_position"; -@@ -113,9 +112,15 @@ public: - (void)mime; - return nullptr; - } -+ static LppAvCapabilityInfo *GetLppCapacity() -+ { -+ return nullptr; -+ } - #else - static std::shared_ptr CreateByMime(const std::string &mime); -+ static LppAvCapabilityInfo *GetLppCapacity(); - #endif -+ - private: - VideoStreamerFactory() = default; - ~VideoStreamerFactory() = default; -diff --git a/interfaces/inner_api/native/player_framework.versionscript b/interfaces/inner_api/native/player_framework.versionscript -index e6a712c86..7dc3297e6 100644 ---- a/interfaces/inner_api/native/player_framework.versionscript -+++ b/interfaces/inner_api/native/player_framework.versionscript -@@ -28,6 +28,8 @@ - *OHOS::Media::ScreenCaptureFactory::CreateScreenCaptureMonitor*; - *OHOS::Media::ScreenCaptureControllerFactory::CreateScreenCaptureController*; - *OHOS::Media::AudioStreamerFactory::CreateByMime*; -+ *OHOS::Media::VideoStreamerFactory::CreatePlayer*; -+ *OHOS::Media::VideoStreamerFactory::GetLppCapacity*; - *OHOS::Media::VideoStreamerFactory::CreateByMime*; - *OHOS::Media::Format::*; - *OHOS::Media::VideoCaps::*; -diff --git a/interfaces/kits/c/BUILD.gn b/interfaces/kits/c/BUILD.gn -index 3e308f4a6..3d533721d 100644 ---- a/interfaces/kits/c/BUILD.gn -+++ b/interfaces/kits/c/BUILD.gn -@@ -93,6 +93,13 @@ ohos_shared_library("native_avscreen_capture") { - "qos_manager:qos", - "window_manager:libdm", - ] -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - output_extension = "so" - subsystem_name = "multimedia" - part_name = "player_framework" -@@ -133,6 +140,13 @@ ohos_shared_library("avplayer") { - "samgr:samgr_proxy", - "window_manager:libdm", - ] -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - if (player_framework_support_drm) { - public_external_deps = [ - "drm_framework:drm_framework", -@@ -187,6 +201,12 @@ ohos_shared_library("avrecorder") { - "window_manager:libdm", - ] - -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - if (player_framework_support_auto_create_file) { - external_deps += [ - "media_library:media_library", -@@ -240,6 +260,12 @@ ohos_shared_library("avimage_generator") { - "window_manager:libdm", - ] - -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - innerapi_tags = [ "ndk" ] - - output_extension = "so" -@@ -287,6 +313,13 @@ ohos_shared_library("avmetadata_extractor") { - "samgr:samgr_proxy", - "window_manager:libdm", - ] -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - if (player_framework_support_drm) { - public_external_deps = [ - "drm_framework:drm_framework", -@@ -341,6 +374,13 @@ ohos_shared_library("lowpower_avsink") { - "image_framework:pixelmap", - "hisysevent:libhisysevent", - ] -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - innerapi_tags = [ "ndk" ] - - output_extension = "so" -@@ -388,6 +428,12 @@ ohos_shared_library("avtranscoder") { - "window_manager:libdm", - ] +@@ -103,6 +103,8 @@ public: + virtual int32_t RenderFirstFrame() = 0; -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } + virtual std::string GetStreamerId() = 0; + - innerapi_tags = [ "ndk" ] ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; - defines = [] -diff --git a/interfaces/kits/c/lowpower_audio_sink_base.h b/interfaces/kits/c/lowpower_audio_sink_base.h -index 51fea73d2..93589ce6f 100644 ---- a/interfaces/kits/c/lowpower_audio_sink_base.h -+++ b/interfaces/kits/c/lowpower_audio_sink_base.h -@@ -59,7 +59,7 @@ typedef struct OH_LowPowerAudioSink OH_LowPowerAudioSink; - * @since 20 - */ - typedef struct OH_LowPowerAudioSinkCallback OH_LowPowerAudioSinkCallback; -- -+ - /** - * @brief When an error occurs in the running of the OH_LowPowerAudioSink instance, the function pointer will be called - * to report specific error information. -diff --git a/interfaces/kits/c/lowpower_avsink_base.h b/interfaces/kits/c/lowpower_avsink_base.h -index 27483c91d..1f5fdeb2e 100644 ---- a/interfaces/kits/c/lowpower_avsink_base.h -+++ b/interfaces/kits/c/lowpower_avsink_base.h -@@ -52,7 +52,14 @@ extern "C" { - * @since 20 - */ - typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; -- -+ + class __attribute__((visibility("default"))) VideoStreamerFactory { +diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h +index d1c11f7e3..f74db9821 100644 +--- a/interfaces/kits/c/lowpower_video_sink.h ++++ b/interfaces/kits/c/lowpower_video_sink.h +@@ -314,6 +314,20 @@ OH_AVErrCode OH_LowPowerVideoSink_SetTargetStartFrame( + const int64_t timeoutMs, + void* userData); + +/** -+ * @brief Forward declaration of OH_LowPowerAVSink_Capability. ++ * @brief Get the latest presentation timestamp (PTS) from lowpower video sink. + * ++ * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance. ++ * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds). ++ * @return Returns AV_ERR_OK if the timestamp is obtained successfully; ++ * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}: ++ * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid. ++ * {@link AV_ERR_SERVICE_DIED} media service is died. ++ * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted. + * @since 21 + */ -+typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *streamer, int64_t *pts); + /** - * @brief Append one OH_AVBuffer data to framePacketBuffer instance. - * -@@ -76,7 +83,20 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe - * @since 20 - */ - int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); -+ -+/** -+ * @brief Query the supported capabilities of a lowpower audio/video sink. -+ * -+ * This function queries and returns the capability set supported by the current -+ * lowpower audio/video sink, including but not limited to supported media formats, etc. -+ * -+ * @return {OH_LowPowerAVSink_Capability*} -+ * - A pointer to the capability structure if the sink supports capability queries and the query is successful. -+ * - nullptr if the sink does not support capability queries or the query fails. - -+ * @since 21 -+ */ -+OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); - #ifdef __cplusplus + * @brief Set playback speed for the lowpower video sink + * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h +index 229bbb003..52029e9a6 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h +@@ -50,6 +50,7 @@ public: + int32_t SetTunnelId(uint64_t tunnelId) override; + int32_t SetAudioIsLpp(bool isLpp) override; + void SetEventReceiver(std::shared_ptr eventReceiver) override; ++ int32_t GetLatestPts(int64_t &pts) override; + + private: + void ResetTimeAnchor(); +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h +index c602d662d..a78c947e6 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h +@@ -56,6 +56,8 @@ public: + int32_t UnbindOutputBuffers(); + int32_t GetShareBuffer(int32_t &fd); + int32_t SetTunnelId(uint64_t tunnelId); ++ int32_t GetLatestPts(int64_t &pts); ++ + void OnError(const int32_t errorCode, const std::string &errorMsg); + void OnTargetArrived(const int64_t targetPts, const bool isTimeout); + void OnRenderStarted(); +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp +index c6b7cdf88..392286602 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp +@@ -263,6 +263,16 @@ int32_t LppSyncManager::SetTunnelId(uint64_t tunnelId) + return MSERR_OK; } - #endif -diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h -index d1c11f7e3..f363d3aa9 100644 ---- a/interfaces/kits/c/lowpower_video_sink.h -+++ b/interfaces/kits/c/lowpower_video_sink.h -@@ -470,7 +470,6 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener( - */ - OH_AVErrCode OH_LowPowerVideoSinkCallback_SetEosListener(OH_LowPowerVideoSinkCallback* callback, - OH_LowPowerVideoSink_OnEos onEos, void* userData); -- - #ifdef __cplusplus + ++int32_t LppSyncManager::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOG_I("LppSyncManager::GetLatestPts"); ++ FALSE_RETURN_V_NOLOG(videoIsLpp_, MSERR_UNKNOWN); ++ FALSE_RETURN_V_MSG_E(adapter_ != nullptr, MSERR_INVALID_OPERATION, "adapter_ is nullptr"); ++ auto ret = adapter_->GetLatestPts(pts); ++ FALSE_RETURN_V_MSG_E(ret == MSERR_OK, ret, "adapter_ GetLatestPts failed"); ++ return MSERR_OK; ++} ++ + int32_t LppSyncManager::SetAudioIsLpp(bool isLpp) + { + audioIsLpp_ = isLpp; +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp +index 87b1d5615..dc5aa9195 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp +@@ -321,6 +321,14 @@ int32_t LppSyncManagerAdapter::SetTunnelId(uint64_t tunnelId) + return MSERR_OK; } - #endif -diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp -index 782c14678..78becd0f9 100644 ---- a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp -+++ b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp -@@ -85,6 +85,7 @@ int32_t HiLppVideoStreamerImpl::Init(const std::string &mime) - vdec_ = std::make_shared(streamerId_, isLpp_); - bool switchToCommon = false; - auto ret = vdec_->Init(mime, switchToCommon); -+ FALSE_RETURN_V_MSG(switchToCommon == false, AV_ERR_UNSUPPORT, "lpp is not support"); - FALSE_RETURN_V_MSG(ret == MSERR_OK, ret, "vdec_ init failed"); - FALSE_LOG_MSG_W(!switchToCommon, "switch isLpp_ to false"); - isLpp_ = isLpp_ ? !switchToCommon : isLpp_; -diff --git a/services/include/i_media_service.h b/services/include/i_media_service.h -index 9eed996ec..1c010933d 100644 ---- a/services/include/i_media_service.h -+++ b/services/include/i_media_service.h -@@ -234,6 +234,8 @@ public: - virtual std::shared_ptr CreateLppVideoStreamerService() = 0; - virtual int32_t DestroyLppVideoStreamerService(std::shared_ptr lppVideoPlayer) = 0; ++int32_t LppSyncManagerAdapter::GetLatestPts(int64_t &pts) ++{ ++ MediaTrace trace("LppSyncManagerAdapter::GetLatestPts"); ++ MEDIA_LOG_I("GetLatestPts enter"); ++ FALSE_RETURN_V_MSG_E(syncMgrAdapter_ != nullptr, MSERR_INVALID_OPERATION, "syncMgrAdapter_ is nullptr"); ++ return syncMgrAdapter_->GetLatestPts(pts); ++} + -+ virtual LppAvCapabilityInfo *GetLppCapacity() = 0; - #endif + void LppSyncManagerAdapter::SetEventReceiver(std::shared_ptr eventReceiver) + { + eventReceiver_ = eventReceiver; +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h b/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h +index f39780d21..dd95907cc 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h +@@ -55,6 +55,7 @@ public: + std::string GetStreamerId() override; + std::shared_ptr GetLppSyncManager() override; + int32_t RenderFirstFrame() override; ++ int32_t GetLatestPts(int64_t &pts) override; + void OnEvent(const Event &event); - /** -diff --git a/services/services/BUILD.gn b/services/services/BUILD.gn -index 84494960d..e90102cd1 100644 ---- a/services/services/BUILD.gn -+++ b/services/services/BUILD.gn -@@ -318,7 +318,14 @@ ohos_shared_library("media_service") { - "window_manager:session_manager_lite", - ] - } -- -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ "hdf_core:libhdi", -+ ] -+ } -+ - if (player_framework_support_avsession_background) { - sources += [ "player/avsession_background/avsession_background.cpp" ] - external_deps += [ -diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h -index beec97728..1544d4297 100644 ---- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h -+++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h -@@ -102,7 +102,7 @@ public: - void OnTargetArrived(const int64_t targetPts, const bool isTimeout) override; - void OnFirstFrameReady() override; - void OnStreamChanged(Format &format) override; -- -+ private: - int32_t CreateStreamerEngine(); - bool StateEnter(VideoState targetState, const std::string funcName = ""); -diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp -index 8252b1744..beab36136 100644 ---- a/services/services/sa_media/client/media_client.cpp -+++ b/services/services/sa_media/client/media_client.cpp -@@ -399,6 +399,16 @@ int32_t MediaClient::DestroyLppAudioStreamerService(std::shared_ptrGetLppCapacity(*lppAvCapabilityInfo); -+ CHECK_AND_RETURN_RET_LOG(ret == 0, nullptr, "MediaClient::GetLppCapacityfailed"); -+ return lppAvCapabilityInfo; ++ MEDIA_LOG_I("HiLppVideoStreamerImpl::GetLatestPts"); ++ FALSE_RETURN_V_MSG(vdec_ != nullptr, MSERR_INVALID_OPERATION, "vdec_ nullptr"); ++ return syncMgr_->GetLatestPts(pts); +} + - std::shared_ptr MediaClient::CreateLppVideoStreamerService() + int32_t HiLppVideoStreamerImpl::Configure(const Format ¶m) { - MEDIA_LOGI("CreateLppVideoStreamerService start"); -diff --git a/services/services/sa_media/client/media_client.h b/services/services/sa_media/client/media_client.h -index 92e597c70..bad6945f6 100644 ---- a/services/services/sa_media/client/media_client.h -+++ b/services/services/sa_media/client/media_client.h -@@ -94,6 +94,7 @@ public: - #ifdef SUPPORT_LPP_VIDEO_STRAMER - std::shared_ptr CreateLppVideoStreamerService() override; - int32_t DestroyLppVideoStreamerService(std::shared_ptr lppAudioPlayer) override; -+ LppAvCapabilityInfo *GetLppCapacity() override; - #endif - std::vector GetPlayerPids() override; + FALSE_RETURN_V_MSG(vdec_ != nullptr, MSERR_INVALID_OPERATION, "vdec_ nullptr"); +diff --git a/services/include/i_lpp_video_streamer_service.h b/services/include/i_lpp_video_streamer_service.h +index ffdc2c52f..770d1470e 100644 +--- a/services/include/i_lpp_video_streamer_service.h ++++ b/services/include/i_lpp_video_streamer_service.h +@@ -75,6 +75,8 @@ public: + virtual std::string GetStreamerId() = 0; -diff --git a/services/services/sa_media/ipc/i_standard_media_service.h b/services/services/sa_media/ipc/i_standard_media_service.h -index 80f81713f..f387decaa 100644 ---- a/services/services/sa_media/ipc/i_standard_media_service.h -+++ b/services/services/sa_media/ipc/i_standard_media_service.h -@@ -20,6 +20,7 @@ - #include "iremote_broker.h" - #include "iremote_proxy.h" - #include "iremote_stub.h" -+#include "lpp_capability.h" - #include + virtual int32_t RenderFirstFrame() = 0; ++ ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + } // namespace Media + } // namespace OHOS +diff --git a/services/services/engine_intf/i_lpp_sync_manager.h b/services/services/engine_intf/i_lpp_sync_manager.h +index 2edba8cee..38f9bf540 100644 +--- a/services/services/engine_intf/i_lpp_sync_manager.h ++++ b/services/services/engine_intf/i_lpp_sync_manager.h +@@ -50,6 +50,7 @@ public: + virtual int32_t SetTunnelId(uint64_t tunnelId) = 0; + virtual int32_t SetAudioIsLpp(bool isLpp) = 0; + virtual void SetEventReceiver(std::shared_ptr eventReceiver) = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; - namespace OHOS { -@@ -81,6 +82,8 @@ public: + } +diff --git a/services/services/engine_intf/i_lpp_video_streamer.h b/services/services/engine_intf/i_lpp_video_streamer.h +index 507230511..c411b1c94 100644 +--- a/services/services/engine_intf/i_lpp_video_streamer.h ++++ b/services/services/engine_intf/i_lpp_video_streamer.h +@@ -66,6 +66,7 @@ public: + virtual std::string GetStreamerId() = 0; + virtual std::shared_ptr GetLppSyncManager() = 0; + virtual int32_t RenderFirstFrame() = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp +index 952fda07b..dae58d353 100644 +--- a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp ++++ b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp +@@ -243,5 +243,15 @@ void LppVideoStreamerClient::MediaServerDied() + "mediaserver is died, please create a new video sink instance again"); + } + } ++ ++int32_t LppVideoStreamerClient::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerClient GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(playerProxy_ != nullptr, MSERR_SERVICE_DIED, ++ "LppVideoStreamerClient GetLatestPts player service does not exist.."); ++ int32_t ret = playerProxy_->GetLatestPts(pts); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "LppVideoStreamerClient GetLatestPts failed."); ++ return MSERR_OK; ++} + } // namespace Media + } // namespace OHOS +\ No newline at end of file +diff --git a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h +index 7b5a6885d..325f8e4a1 100644 +--- a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h ++++ b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h +@@ -76,6 +76,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + void MediaServerDied(); + + private: +diff --git a/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h b/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h +index 32982afbf..c9928ef1d 100644 +--- a/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h ++++ b/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h +@@ -80,6 +80,8 @@ public: - virtual int32_t ResetAllProxy() = 0; + virtual int32_t RenderFirstFrame() = 0; -+ virtual int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + /** * IPC code ID */ -@@ -92,6 +95,8 @@ public: - GET_PLAYER_PIDS = 4, - FREEZE = 5, - RESET_ALL_PROXY = 6, -+ GET_RAMAINED_CAPACITY = 7, -+ GET_LPP_CAPABILITY = 8, +@@ -109,6 +111,7 @@ public: + GET_STREAM_ID, + SET_AUDIO_STREAMER_ID, + RENDER_FIRST_FRAME, ++ GET_LATEST_PTS, + MAX_IPC_ID, // all IPC codes should be added before MAX_IPC_ID }; - DECLARE_INTERFACE_DESCRIPTOR(u"IStandardMediaService"); -diff --git a/services/services/sa_media/ipc/media_service_proxy.cpp b/services/services/sa_media/ipc/media_service_proxy.cpp -index c91e6ab56..595fd4b46 100644 ---- a/services/services/sa_media/ipc/media_service_proxy.cpp -+++ b/services/services/sa_media/ipc/media_service_proxy.cpp -@@ -76,6 +76,24 @@ std::vector MediaServiceProxy::GetPlayerPids() - return res; +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp +index c4556605e..898d65663 100644 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp +@@ -429,5 +429,24 @@ int32_t LppVideoStreamerServiceProxy::RenderFirstFrame() + return reply.ReadInt32(); } -+int32_t MediaServiceProxy::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { -+ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity"); ++int32_t LppVideoStreamerServiceProxy::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServiceProxy GetLatestPts"); + MessageParcel data; + MessageParcel reply; + MessageOption option; -+ int32_t error = -1; -+ bool token = data.WriteInterfaceToken(MediaServiceProxy::GetDescriptor()); -+ CHECK_AND_RETURN_RET_LOG(token, error, "Failed to write descriptor!"); -+ error = Remote()->SendRequest(MediaServiceMsg::GET_LPP_CAPABILITY, data, reply, option); -+ CHECK_AND_RETURN_RET_LOG(error == MSERR_OK, error, "Failed to SendRequest"); ++ ++ bool token = data.WriteInterfaceToken(LppVideoStreamerServiceProxy::GetDescriptor()); ++ CHECK_AND_RETURN_RET_LOG(token, MSERR_INVALID_OPERATION, "Failed to write descriptor!"); ++ ++ int32_t error = Remote()->SendRequest(GET_LATEST_PTS, data, reply, option); ++ CHECK_AND_RETURN_RET_LOG( ++ error == MSERR_OK, MSERR_INVALID_OPERATION, "GetLatestPts SendRequest failed, error: %{public}d", error); + int32_t ret = reply.ReadInt32(); -+ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "Fail to MediaServiceProxy::GetLppCapacity"); -+ lppAvCapability = LppAvCapabilityInfo::Unmarshalling(reply); -+ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity %{public}zu %{public}zu", -+ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ pts = reply.ReadInt64(); ++ CHECK_AND_RETURN_RET_LOG( ++ ret == MSERR_OK, MSERR_INVALID_OPERATION, "GetLatestPts failed, error: %{public}d", ret); + return ret; +} -+ - sptr MediaServiceProxy::GetSubSystemAbility(IStandardMediaService::MediaSystemAbility subSystemId, - const sptr &listener) - { -diff --git a/services/services/sa_media/ipc/media_service_proxy.h b/services/services/sa_media/ipc/media_service_proxy.h -index d43cf9827..3ce5b8619 100644 ---- a/services/services/sa_media/ipc/media_service_proxy.h -+++ b/services/services/sa_media/ipc/media_service_proxy.h -@@ -41,6 +41,7 @@ public: + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h +index efc84e5a7..3ba478a87 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h +@@ -74,6 +74,8 @@ public: - int32_t ResetAllProxy() override; + std::string GetStreamerId() override; -+ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; ++ int32_t GetLatestPts(int64_t &pts) override; ++ + int32_t RenderFirstFrame() override; private: - bool IsGetSubSystemAbilityASync() const; - static inline BrokerDelegator delegator_; -diff --git a/services/services/sa_media/ipc/media_service_stub.cpp b/services/services/sa_media/ipc/media_service_stub.cpp -index 0c701f82c..8955b126e 100644 ---- a/services/services/sa_media/ipc/media_service_stub.cpp -+++ b/services/services/sa_media/ipc/media_service_stub.cpp -@@ -58,6 +58,8 @@ void MediaServiceStub::Init() - [this](MessageParcel &data, MessageParcel &reply) { return HandleFreezeStubForPids(data, reply); }; - mediaFuncs_[RESET_ALL_PROXY] = - [this](MessageParcel &data, MessageParcel &reply) { return HandleResetAllProxy(data, reply); }; -+ mediaFuncs_[GET_LPP_CAPABILITY] = -+ [this] (MessageParcel &data, MessageParcel &reply) { return GetLppCapacityStub(data, reply); }; + static inline BrokerDelegator delegator_; +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp +index a3c2b2974..3c2caa459 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp +@@ -82,6 +82,7 @@ int32_t LppVideoStreamerServiceStub::Init() + void LppVideoStreamerServiceStub::SetPlayerFuncs() + { + FillPlayerFuncPart1(); ++ FillPlayerFuncPart2(); } - int32_t MediaServiceStub::HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply) -@@ -199,6 +201,17 @@ int32_t MediaServiceStub::ReleaseClientListenerStub(MessageParcel &data, Message - return MSERR_OK; + void LppVideoStreamerServiceStub::FillPlayerFuncPart1() +@@ -136,6 +137,12 @@ void LppVideoStreamerServiceStub::FillPlayerFuncPart1() + [this](MessageParcel &data, MessageParcel &reply) { return RenderFirstFrame(data, reply); }}; } -+int32_t MediaServiceStub::GetLppCapacityStub(MessageParcel &data, MessageParcel &reply) ++void LppVideoStreamerServiceStub::FillPlayerFuncPart2() +{ -+ (void)data; -+ LppAvCapabilityInfo info; -+ int32_t ret = GetLppCapacity(info); -+ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "Failed to write descriptor!"); -+ reply.WriteInt32(ret); -+ info.Marshalling(reply); -+ return MSERR_OK; ++ playerFuncs_[GET_LATEST_PTS] = {"Player::GetLatestPts", ++ [this](MessageParcel &data, MessageParcel &reply) { return GetLatestPts(data, reply); }}; +} + - int32_t MediaServiceStub::GetPlayerPidsStub(MessageParcel &data, MessageParcel &reply) + int LppVideoStreamerServiceStub::OnRemoteRequest( + uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - (void)data; -@@ -222,6 +235,20 @@ std::vector MediaServiceStub::GetPlayerPids() - return MediaServerManager::GetInstance().GetPlayerPids(); +@@ -532,5 +539,22 @@ int32_t LppVideoStreamerServiceStub::RenderFirstFrame(MessageParcel &data, Messa + return MSERR_OK; } -+int32_t MediaServiceStub::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) ++int32_t LppVideoStreamerServiceStub::GetLatestPts(int64_t &pts) +{ -+ MEDIA_LOGI("MediaServiceStub::GetLppCapacity"); -+ #ifdef SUPPORT_LPP_VIDEO_STRAMER -+ int32_t ret = MediaServerManager::GetInstance().GetLppCapacity(lppAvCapability); -+ #else -+ int32_t ret = MSERR_UNKNOWN; -+ #endif -+ MEDIA_LOGI("MediaServiceStub::GetLppCapacity %{public}lu %{public}lu", -+ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); -+ CHECK_AND_RETURN_RET_LOG(ret == 0, MSERR_UNKNOWN, "MediaServiceStub::GetLppCapacity GetLppCapacity"); -+ return ret; ++ MEDIA_LOGI("LppVideoStreamerServiceStub::GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(lppVideoPlayerServer_ != nullptr, MSERR_INVALID_OPERATION, "player server is nullptr"); ++ return lppVideoPlayerServer_->GetLatestPts(pts); +} + - int32_t MediaServiceStub::GetSystemAbility(MessageParcel &data, MessageParcel &reply) - { - int32_t mediaSystemAbility = data.ReadInt32(); -diff --git a/services/services/sa_media/ipc/media_service_stub.h b/services/services/sa_media/ipc/media_service_stub.h -index 46dbe0648..52e01926e 100644 ---- a/services/services/sa_media/ipc/media_service_stub.h -+++ b/services/services/sa_media/ipc/media_service_stub.h -@@ -44,6 +44,8 @@ private: - int32_t HandleKillMediaService(MessageParcel &data, MessageParcel &reply); - void ReleaseClientListener() override; - std::vector GetPlayerPids() override; -+ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; -+ int32_t GetLppCapacityStub(MessageParcel &data, MessageParcel &reply); - int32_t HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply); - int32_t HandleResetAllProxy(MessageParcel &data, MessageParcel &reply); - void ClientDied(pid_t pid); -diff --git a/services/services/sa_media/server_manager/media_server_manager.cpp b/services/services/sa_media/server_manager/media_server_manager.cpp -index 800e338f1..8579f7162 100644 ---- a/services/services/sa_media/server_manager/media_server_manager.cpp -+++ b/services/services/sa_media/server_manager/media_server_manager.cpp -@@ -50,6 +50,10 @@ - #include "player_xcollie.h" - #include "client/memory_collector_client.h" - #include -+#ifdef SUPPORT_LPP_VIDEO_STRAMER -+#include "v1_0/ilow_power_player_factory.h" -+namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; -+#endif - - namespace { - constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_PLAYER, "MediaServerManager"}; -@@ -530,6 +534,18 @@ sptr MediaServerManager::CreateLppAudioPlayerStubObject() - #endif - - #ifdef SUPPORT_LPP_VIDEO_STRAMER -+int32_t MediaServerManager::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { -+ auto factory = PlayerHDI::ILowPowerPlayerFactory::Get(true); -+ CHECK_AND_RETURN_RET_LOG(factory != nullptr, UNKNOWN_ERROR, "MediaServerManager::GetLppCapacity is failed"); -+ PlayerHDI::LppAVCap lppAVCap; -+ int32_t ret = factory->GetAVCapability(lppAVCap); -+ MEDIA_LOGI("MediaServerManager::GetLppCapacity %{public}lu %{public}lu", -+ lppAVCap.videoCap.size(), lppAVCap.audioCap.size()); -+ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "FAILED MediaServerManager::GetLppCapacity"); -+ lppAvCapability.SetLppAvCapabilityInfo(lppAVCap); -+ return ret; ++int32_t LppVideoStreamerServiceStub::GetLatestPts(MessageParcel &data, MessageParcel &reply) ++{ ++ (void)data; ++ int64_t pts = 0; ++ int32_t ret = GetLatestPts(pts); ++ MEDIA_LOGI("LppVideoStreamerServiceStub::GetLatestPts %{public}d %{public}ld", ret, pts); ++ reply.WriteInt32(ret); ++ reply.WriteInt64(pts); ++ return MSERR_OK; +} -+ - sptr MediaServerManager::CreateLppVideoPlayerStubObject() - { - MEDIA_LOGI("CreateLppVideoPlayerStubObject start"); -diff --git a/services/services/sa_media/server_manager/media_server_manager.h b/services/services/sa_media/server_manager/media_server_manager.h -index ddc10e4bd..cf1f13ef2 100644 ---- a/services/services/sa_media/server_manager/media_server_manager.h -+++ b/services/services/sa_media/server_manager/media_server_manager.h -@@ -25,10 +25,11 @@ - #include "nocopyable.h" - #include "osal/task/task.h" - #include -- -+#include "lpp_capability.h" - namespace OHOS { - namespace Media { - using DumperEntry = std::function; -+ - struct Dumper { - pid_t pid_; - pid_t uid_; -@@ -79,6 +80,10 @@ public: - #endif - bool CanKillMediaService(); - std::vector GetPlayerPids(); -+#ifdef SUPPORT_LPP_VIDEO_STRAMER -+ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability); -+#endif -+ - private: - MediaServerManager(); - #ifdef SUPPORT_PLAYER -diff --git a/test/unittest/avmetadatahelper_test/BUILD.gn b/test/unittest/avmetadatahelper_test/BUILD.gn -index fc9a6f0b2..fa8d2d30b 100644 ---- a/test/unittest/avmetadatahelper_test/BUILD.gn -+++ b/test/unittest/avmetadatahelper_test/BUILD.gn -@@ -176,6 +176,12 @@ ohos_unittest("avmetadatahelper_unit_test") { - "samgr:samgr_proxy", - "window_manager:libwm", - ] -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h +index eca927564..e708a8e14 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h +@@ -81,9 +81,12 @@ public: - if (player_framework_support_video) { - external_deps += [ "graphic_surface:surface" ] -diff --git a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp -index 8d4166ebe..e5d703a2b 100644 ---- a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp -+++ b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp -@@ -114,6 +114,12 @@ int32_t MediaClient::ResetAllProxy() - return 0; - } + int32_t RenderFirstFrame() override; -+LppAvCapabilityInfo* MediaClient::GetLppCapacity() -+{ -+ LppAvCapabilityInfo *lppAvCapabilityInfo = new LppAvCapabilityInfo(); -+ return lppAvCapabilityInfo; -+} ++ int32_t GetLatestPts(int64_t &pts) override; + - namespace Test { - void AVMetadtahelperImplUnitTest::SetUpTestCase(void) {} + int32_t Init(); + void SetPlayerFuncs(); + void FillPlayerFuncPart1(); ++ void FillPlayerFuncPart2(); -diff --git a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn -index 172487a43..d0b1cc797 100644 ---- a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn -+++ b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn -@@ -48,6 +48,12 @@ ohos_unittest("lpp_video_streamer_unit_test") { - "media_foundation:media_foundation" - ] + private: + LppVideoStreamerServiceStub(); +@@ -114,6 +117,7 @@ public: + int32_t SetLppAudioStreamerId(MessageParcel &data, MessageParcel &reply); + int32_t GetStreamerId(MessageParcel &data, MessageParcel &reply); + int32_t RenderFirstFrame(MessageParcel &data, MessageParcel &reply); ++ int32_t GetLatestPts(MessageParcel &data, MessageParcel &reply); + + std::shared_ptr lppVideoPlayerServer_ = nullptr; + std::map> playerFuncs_; +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp +index aed5713f7..d1e3a1b1b 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp +@@ -287,6 +287,15 @@ int32_t LppVideoStreamerServer::SetLppVideoStreamerCallback(const std::shared_pt + return MSERR_OK; + } -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - resource_config_file = - "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" --} -\ No newline at end of file ++int32_t LppVideoStreamerServer::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServer GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamerEngine_ != nullptr, MSERR_INVALID_OPERATION, "streamerEngine_ is nullptr"); ++ auto ret = streamerEngine_->GetLatestPts(pts); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "GetLatestPts Failed!"); ++ return ret; +} -diff --git a/test/unittest/media_server_manager_test/BUILD.gn b/test/unittest/media_server_manager_test/BUILD.gn -index 833753a60..cc4174ef8 100644 ---- a/test/unittest/media_server_manager_test/BUILD.gn -+++ b/test/unittest/media_server_manager_test/BUILD.gn -@@ -125,6 +125,12 @@ ohos_unittest("media_server_manager_test") { - "samgr:samgr_proxy", - ] - -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } + - if (player_framework_support_video) { - external_deps += [ "graphic_surface:surface" ] - } -diff --git a/test/unittest/media_service_helper_test/BUILD.gn b/test/unittest/media_service_helper_test/BUILD.gn -index 292d28380..fd91a2a29 100644 ---- a/test/unittest/media_service_helper_test/BUILD.gn -+++ b/test/unittest/media_service_helper_test/BUILD.gn -@@ -67,6 +67,12 @@ ohos_unittest("media_service_helper_unit_test") { - "ipc:ipc_single", - ] - -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - if (defined(global_parts_info) && - defined(global_parts_info.multimedia_histreamer_ext)) { - defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] -diff --git a/test/unittest/player_service_stub_test/BUILD.gn b/test/unittest/player_service_stub_test/BUILD.gn -index bd0938811..374bb3469 100644 ---- a/test/unittest/player_service_stub_test/BUILD.gn -+++ b/test/unittest/player_service_stub_test/BUILD.gn -@@ -117,6 +117,12 @@ ohos_unittest("player_service_stub_test") { - external_deps += [ "graphic_surface:surface" ] - } - -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - if (player_framework_support_screen_capture_stopbycall) { - external_deps += [ - "call_manager:tel_call_manager_api", -diff --git a/test/unittest/sa_media_client_unit_test/BUILD.gn b/test/unittest/sa_media_client_unit_test/BUILD.gn -index 475525407..354aca6d0 100644 ---- a/test/unittest/sa_media_client_unit_test/BUILD.gn -+++ b/test/unittest/sa_media_client_unit_test/BUILD.gn -@@ -145,6 +145,12 @@ include_dirs = [ - "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service", - "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", - ] -+ -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } + int32_t LppVideoStreamerServer::SetLppAudioStreamerId(const std::string audioStreamId) + { + MEDIA_LOGI("LppVideoStreamerServer SetLppAudioStreamerId"); +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +index beec97728..0fbf7b171 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +@@ -94,6 +94,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + void OnDataNeeded(const int32_t maxBufferSize, const int32_t maxFrameNum) override; + bool OnAnchorUpdateNeeded(int64_t &anchorPts, int64_t &anchorClk) override; + void OnError(const MediaServiceErrCode errCode, const std::string &errMsg) override; +diff --git a/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h b/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h +index 25e1a4f3a..be06f4c77 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h +@@ -49,6 +49,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + } + } +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h +index 59dd5614a..22cb8bee1 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h +@@ -52,6 +52,7 @@ public: + std::string GetStreamerId() override; + std::shared_ptr GetLppSyncManager() override; + int32_t RenderFirstFrame() override; ++ int32_t GetLatestPts(int64_t &pts) override; + void OnEvent(const Event &event); - resource_config_file = - "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" -diff --git a/test/unittest/timeout_test/BUILD.gn b/test/unittest/timeout_test/BUILD.gn -index 33812ec07..272035ee1 100644 ---- a/test/unittest/timeout_test/BUILD.gn -+++ b/test/unittest/timeout_test/BUILD.gn -@@ -76,6 +76,12 @@ ohos_unittest("player_timeout_unit_test") { - "window_manager:libwm", - ] + private: +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h +index 73382ddfc..759e78384 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h +@@ -53,6 +53,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId), (override)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp), (override)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver), (override)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts), (override)); + }; + } // namespace Media + } // namespace OHOS +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h +index ffeb753ab..22c25138f 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h +@@ -51,6 +51,7 @@ public: + MOCK_METHOD(int32_t, GetShareBuffer, (int32_t& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; -+ if (player_framework_support_lowpower_av_sink) { -+ external_deps += [ -+ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", -+ ] -+ } -+ - if (defined(global_parts_info) && - defined(global_parts_info.multimedia_histreamer_ext)) { - defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] -diff --git a/test/unittest/timeout_test/mock/mock_i_media_service.h b/test/unittest/timeout_test/mock/mock_i_media_service.h -index d95abad8c..4e3284a56 100644 ---- a/test/unittest/timeout_test/mock/mock_i_media_service.h -+++ b/test/unittest/timeout_test/mock/mock_i_media_service.h -@@ -71,6 +71,7 @@ public: - MOCK_METHOD(std::shared_ptr, CreateLppVideoStreamerService, (), (override)); - MOCK_METHOD(int32_t, - DestroyLppVideoStreamerService, (std::shared_ptr lppAudioPlayer), (override)); -+ MOCK_METHOD(LppAvCapabilityInfo*, GetLppCapacity, (), (override)); - #endif + class LowPowerPlayerFactory { +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h +index b522cb9dd..9c6e41ca8 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h +@@ -51,6 +51,7 @@ public: + MOCK_METHOD(int32_t, UnbindOutputBuffers, ()); + MOCK_METHOD(int32_t, GetShareBuffer, (int& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + } // V1_0 + } // LowPowerPlayer +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h +index 2bb991ea2..ef1f08996 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h +@@ -49,7 +49,7 @@ public: + int32_t SetTunnelId(uint64_t tunnelId); + int32_t SetAudioIsLpp(bool isLpp); + void SetEventReceiver(std::shared_ptr eventReceiver); +- ++ int32_t GetLatestPts(int64_t &pts); + private: + void ResetTimeAnchor(); + +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h +index 8c9532f45..341b27ab2 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h +@@ -52,6 +52,7 @@ public: + MOCK_METHOD(int32_t, GetShareBuffer, (int32_t& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; - MOCK_METHOD(sptr, GetMonitorProxy, (), (override)); + class LowPowerPlayerFactory { +diff --git a/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h +index f7b3c55f1..6f4f09db0 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h +@@ -52,6 +52,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId), (override)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp), (override)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver), (override)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts), (override)); + }; + } // namespace Media + } // namespace OHOS -- 2.45.2.huawei.10 - - -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -ability_runtime_path = "//foundation/ability/ability_runtime" -graphic_2d_path = "//foundation/graphic/graphic_2d" -multimedia_audio_framework_path = "//foundation/multimedia/audio_framework" -multimedia_media_library_path = "//foundation/multimedia/media_library" -multimedia_player_framework_path = "//foundation/multimedia/player_framework" -av_codec_root_path = "//foundation/multimedia/av_codec" -- Gitee From 0f6f48aa6e883d014a991dbf823b434d6e2b7f1d Mon Sep 17 00:00:00 2001 From: zpf Date: Fri, 29 Aug 2025 10:51:45 +0000 Subject: [PATCH 08/11] update config.gni. Signed-off-by: zpf --- config.gni | 822 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 573 insertions(+), 249 deletions(-) diff --git a/config.gni b/config.gni index ac9359b09..5460947aa 100644 --- a/config.gni +++ b/config.gni @@ -1,250 +1,574 @@ -# Copyright (C) 2022-2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +From 33b8f932d957909ccce2c668cc1bbf0a65fd9c07 Mon Sep 17 00:00:00 2001 +From: z00654174 +Date: Thu, 28 Aug 2025 09:55:56 +0800 +Subject: [PATCH] TicketNo:DTS2022071803909 Description: pts Team:OTHERS + Feature or Bugfix:Bugfix Binary Source:NA PrivateCode(Yes/No):No + +Change-Id: Ic56a08bf0e57af135fe5d42d8c021fdd0250cf41 +--- + .../lppplayer/native_lpp_video_streamer.cpp | 12 ++++++++++ + .../video_streamer_impl.cpp | 10 ++++++++ + .../lpp_video_streamer/video_streamer_impl.h | 2 ++ + .../inner_api/native/lpp_video_streamer.h | 2 ++ + interfaces/kits/c/lowpower_video_sink.h | 14 +++++++++++ + .../lpp/lpp_sync_manager/lpp_sync_manager.h | 1 + + .../lpp_sync_manager_adapter.h | 2 ++ + .../lpp_sync_manager/src/lpp_sync_manager.cpp | 10 ++++++++ + .../src/lpp_sync_manager_adapter.cpp | 8 +++++++ + .../lpp_video_streamer/hilpp_vstreamer_impl.h | 1 + + .../src/hilpp_vstreamer_impl.cpp | 7 ++++++ + .../include/i_lpp_video_streamer_service.h | 2 ++ + .../services/engine_intf/i_lpp_sync_manager.h | 1 + + .../engine_intf/i_lpp_video_streamer.h | 1 + + .../client/lpp_video_streamer_client.cpp | 10 ++++++++ + .../client/lpp_video_streamer_client.h | 2 ++ + .../i_standard_lpp_video_streamer_service.h | 3 +++ + .../ipc/lpp_video_streamer_service_proxy.cpp | 19 +++++++++++++++ + .../ipc/lpp_video_streamer_service_proxy.h | 2 ++ + .../ipc/lpp_video_streamer_service_stub.cpp | 24 +++++++++++++++++++ + .../ipc/lpp_video_streamer_service_stub.h | 4 ++++ + .../server/lpp_video_streamer_server.cpp | 9 +++++++ + .../server/lpp_video_streamer_server.h | 2 ++ + .../mock/i_lpp_sync_manager.h | 1 + + .../mock/hilpp_vstreamer_impl.h | 1 + + .../mock/lpp_sync_manager.h | 1 + + .../mock/lpp_sync_manager_adapter.h | 1 + + .../mock/v1_0/ilpp_sync_manager_adapter.h | 1 + + .../mock/lpp_sync_manager.h | 2 +- + .../mock/lpp_sync_manager_adapter.h | 1 + + .../mock/lpp_sync_manager.h | 1 + + 31 files changed, 156 insertions(+), 1 deletion(-) + +diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +index 2147b2427..5ed1622b2 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp ++++ b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +@@ -634,6 +634,7 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetStreamChangedListener( + int32_t res = callback->SetStreamChangedListener(onStreamChanged, userData); + return LppMsErrToOHAvErr(res); + } ++ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPowerVideoSinkCallback *callback, + OH_LowPowerVideoSink_OnFirstFrameDecoded onFirstFrameDecoded, void *userData) + { +@@ -643,3 +644,14 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow + int32_t res = callback->SetFirstFrameReadyListener(onFirstFrameDecoded, userData); + return LppMsErrToOHAvErr(res); + } ++ ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *streamer, int64_t *pts) ++{ ++ MEDIA_LOGD("OH_LowPowerVideoSink_GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamer != nullptr, AV_ERR_INVALID_VAL, "streamer is nullptr!"); ++ LowPowerVideoSinkObject *streamerObj = reinterpret_cast(streamer); ++ CHECK_AND_RETURN_RET_LOG(streamerObj != nullptr, AV_ERR_INVALID_VAL, "streamerObj is nullptr"); ++ CHECK_AND_RETURN_RET_LOG(streamerObj->videoStreamer_ != nullptr, AV_ERR_INVALID_VAL, "videoStreamer_ is nullptr"); ++ int32_t res = streamerObj->videoStreamer_->GetLatestPts(*pts); ++ return LppMsErrToOHAvErr(res); ++} +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +index f7adadd72..414b33325 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +@@ -262,5 +262,15 @@ std::string VideoStreamerImpl::GetStreamerId() + CHECK_AND_RETURN_RET_LOG(streamerService_ != nullptr, "", "player service does not exist.."); + return streamerService_->GetStreamerId(); + } ++ ++int32_t VideoStreamerImpl::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("VideoStreamerImpl GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamerService_ != nullptr, MSERR_SERVICE_DIED, ++ "GetLatestPts player service does not exist.."); ++ int32_t ret = streamerService_->GetLatestPts(pts); ++ pts = (ret == MSERR_OK) ? pts : 0; ++ return ret; ++} + } // namespace Media + } // namespace OHOS +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.h b/frameworks/native/lpp_video_streamer/video_streamer_impl.h +index 16015c442..1a0b1e3e9 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.h ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.h +@@ -76,6 +76,8 @@ public: + + std::string GetStreamerId() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + private: + std::shared_ptr callback_; + std::shared_ptr streamerService_ = nullptr; +diff --git a/interfaces/inner_api/native/lpp_video_streamer.h b/interfaces/inner_api/native/lpp_video_streamer.h +index d29cd78a0..34de7d154 100644 +--- a/interfaces/inner_api/native/lpp_video_streamer.h ++++ b/interfaces/inner_api/native/lpp_video_streamer.h +@@ -103,6 +103,8 @@ public: + virtual int32_t RenderFirstFrame() = 0; + + virtual std::string GetStreamerId() = 0; ++ ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + + class __attribute__((visibility("default"))) VideoStreamerFactory { +diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h +index d1c11f7e3..f74db9821 100644 +--- a/interfaces/kits/c/lowpower_video_sink.h ++++ b/interfaces/kits/c/lowpower_video_sink.h +@@ -314,6 +314,20 @@ OH_AVErrCode OH_LowPowerVideoSink_SetTargetStartFrame( + const int64_t timeoutMs, + void* userData); + ++/** ++ * @brief Get the latest presentation timestamp (PTS) from lowpower video sink. ++ * ++ * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance. ++ * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds). ++ * @return Returns AV_ERR_OK if the timestamp is obtained successfully; ++ * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}: ++ * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid. ++ * {@link AV_ERR_SERVICE_DIED} media service is died. ++ * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted. ++ * @since 21 ++ */ ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *streamer, int64_t *pts); ++ + /** + * @brief Set playback speed for the lowpower video sink + * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h +index 229bbb003..52029e9a6 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager.h +@@ -50,6 +50,7 @@ public: + int32_t SetTunnelId(uint64_t tunnelId) override; + int32_t SetAudioIsLpp(bool isLpp) override; + void SetEventReceiver(std::shared_ptr eventReceiver) override; ++ int32_t GetLatestPts(int64_t &pts) override; + + private: + void ResetTimeAnchor(); +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h +index c602d662d..a78c947e6 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/lpp_sync_manager_adapter.h +@@ -56,6 +56,8 @@ public: + int32_t UnbindOutputBuffers(); + int32_t GetShareBuffer(int32_t &fd); + int32_t SetTunnelId(uint64_t tunnelId); ++ int32_t GetLatestPts(int64_t &pts); ++ + void OnError(const int32_t errorCode, const std::string &errorMsg); + void OnTargetArrived(const int64_t targetPts, const bool isTimeout); + void OnRenderStarted(); +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp +index c6b7cdf88..392286602 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager.cpp +@@ -263,6 +263,16 @@ int32_t LppSyncManager::SetTunnelId(uint64_t tunnelId) + return MSERR_OK; + } + ++int32_t LppSyncManager::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOG_I("LppSyncManager::GetLatestPts"); ++ FALSE_RETURN_V_NOLOG(videoIsLpp_, MSERR_UNKNOWN); ++ FALSE_RETURN_V_MSG_E(adapter_ != nullptr, MSERR_INVALID_OPERATION, "adapter_ is nullptr"); ++ auto ret = adapter_->GetLatestPts(pts); ++ FALSE_RETURN_V_MSG_E(ret == MSERR_OK, ret, "adapter_ GetLatestPts failed"); ++ return MSERR_OK; ++} ++ + int32_t LppSyncManager::SetAudioIsLpp(bool isLpp) + { + audioIsLpp_ = isLpp; +diff --git a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp +index 87b1d5615..dc5aa9195 100644 +--- a/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp ++++ b/services/engine/histreamer/lpp/lpp_sync_manager/src/lpp_sync_manager_adapter.cpp +@@ -321,6 +321,14 @@ int32_t LppSyncManagerAdapter::SetTunnelId(uint64_t tunnelId) + return MSERR_OK; + } + ++int32_t LppSyncManagerAdapter::GetLatestPts(int64_t &pts) ++{ ++ MediaTrace trace("LppSyncManagerAdapter::GetLatestPts"); ++ MEDIA_LOG_I("GetLatestPts enter"); ++ FALSE_RETURN_V_MSG_E(syncMgrAdapter_ != nullptr, MSERR_INVALID_OPERATION, "syncMgrAdapter_ is nullptr"); ++ return syncMgrAdapter_->GetLatestPts(pts); ++} ++ + void LppSyncManagerAdapter::SetEventReceiver(std::shared_ptr eventReceiver) + { + eventReceiver_ = eventReceiver; +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h b/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h +index f39780d21..dd95907cc 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/hilpp_vstreamer_impl.h +@@ -55,6 +55,7 @@ public: + std::string GetStreamerId() override; + std::shared_ptr GetLppSyncManager() override; + int32_t RenderFirstFrame() override; ++ int32_t GetLatestPts(int64_t &pts) override; + void OnEvent(const Event &event); + + private: +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +index 782c14678..3de63dc00 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +@@ -130,6 +130,13 @@ int32_t HiLppVideoStreamerImpl::SetParameter(const Format ¶m) + return MSERR_OK; + } + ++int32_t HiLppVideoStreamerImpl::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOG_I("HiLppVideoStreamerImpl::GetLatestPts"); ++ FALSE_RETURN_V_MSG(vdec_ != nullptr, MSERR_INVALID_OPERATION, "vdec_ nullptr"); ++ return syncMgr_->GetLatestPts(pts); ++} ++ + int32_t HiLppVideoStreamerImpl::Configure(const Format ¶m) + { + FALSE_RETURN_V_MSG(vdec_ != nullptr, MSERR_INVALID_OPERATION, "vdec_ nullptr"); +diff --git a/services/include/i_lpp_video_streamer_service.h b/services/include/i_lpp_video_streamer_service.h +index ffdc2c52f..770d1470e 100644 +--- a/services/include/i_lpp_video_streamer_service.h ++++ b/services/include/i_lpp_video_streamer_service.h +@@ -75,6 +75,8 @@ public: + virtual std::string GetStreamerId() = 0; + + virtual int32_t RenderFirstFrame() = 0; ++ ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + } // namespace Media + } // namespace OHOS +diff --git a/services/services/engine_intf/i_lpp_sync_manager.h b/services/services/engine_intf/i_lpp_sync_manager.h +index 2edba8cee..38f9bf540 100644 +--- a/services/services/engine_intf/i_lpp_sync_manager.h ++++ b/services/services/engine_intf/i_lpp_sync_manager.h +@@ -50,6 +50,7 @@ public: + virtual int32_t SetTunnelId(uint64_t tunnelId) = 0; + virtual int32_t SetAudioIsLpp(bool isLpp) = 0; + virtual void SetEventReceiver(std::shared_ptr eventReceiver) = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + + } +diff --git a/services/services/engine_intf/i_lpp_video_streamer.h b/services/services/engine_intf/i_lpp_video_streamer.h +index 507230511..c411b1c94 100644 +--- a/services/services/engine_intf/i_lpp_video_streamer.h ++++ b/services/services/engine_intf/i_lpp_video_streamer.h +@@ -66,6 +66,7 @@ public: + virtual std::string GetStreamerId() = 0; + virtual std::shared_ptr GetLppSyncManager() = 0; + virtual int32_t RenderFirstFrame() = 0; ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; + }; + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp +index 952fda07b..dae58d353 100644 +--- a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp ++++ b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.cpp +@@ -243,5 +243,15 @@ void LppVideoStreamerClient::MediaServerDied() + "mediaserver is died, please create a new video sink instance again"); + } + } ++ ++int32_t LppVideoStreamerClient::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerClient GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(playerProxy_ != nullptr, MSERR_SERVICE_DIED, ++ "LppVideoStreamerClient GetLatestPts player service does not exist.."); ++ int32_t ret = playerProxy_->GetLatestPts(pts); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "LppVideoStreamerClient GetLatestPts failed."); ++ return MSERR_OK; ++} + } // namespace Media + } // namespace OHOS +\ No newline at end of file +diff --git a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h +index 7b5a6885d..325f8e4a1 100644 +--- a/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h ++++ b/services/services/lpp_video_streamer/client/lpp_video_streamer_client.h +@@ -76,6 +76,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + void MediaServerDied(); + + private: +diff --git a/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h b/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h +index 32982afbf..c9928ef1d 100644 +--- a/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h ++++ b/services/services/lpp_video_streamer/ipc/i_standard_lpp_video_streamer_service.h +@@ -80,6 +80,8 @@ public: + + virtual int32_t RenderFirstFrame() = 0; + ++ virtual int32_t GetLatestPts(int64_t &pts) = 0; ++ + /** + * IPC code ID + */ +@@ -109,6 +111,7 @@ public: + GET_STREAM_ID, + SET_AUDIO_STREAMER_ID, + RENDER_FIRST_FRAME, ++ GET_LATEST_PTS, + MAX_IPC_ID, // all IPC codes should be added before MAX_IPC_ID + }; + +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp +index c4556605e..898d65663 100644 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.cpp +@@ -429,5 +429,24 @@ int32_t LppVideoStreamerServiceProxy::RenderFirstFrame() + return reply.ReadInt32(); + } + ++int32_t LppVideoStreamerServiceProxy::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServiceProxy GetLatestPts"); ++ MessageParcel data; ++ MessageParcel reply; ++ MessageOption option; ++ ++ bool token = data.WriteInterfaceToken(LppVideoStreamerServiceProxy::GetDescriptor()); ++ CHECK_AND_RETURN_RET_LOG(token, MSERR_INVALID_OPERATION, "Failed to write descriptor!"); ++ ++ int32_t error = Remote()->SendRequest(GET_LATEST_PTS, data, reply, option); ++ CHECK_AND_RETURN_RET_LOG( ++ error == MSERR_OK, MSERR_INVALID_OPERATION, "GetLatestPts SendRequest failed, error: %{public}d", error); ++ int32_t ret = reply.ReadInt32(); ++ pts = reply.ReadInt64(); ++ CHECK_AND_RETURN_RET_LOG( ++ ret == MSERR_OK, MSERR_INVALID_OPERATION, "GetLatestPts failed, error: %{public}d", ret); ++ return ret; ++} + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h +index efc84e5a7..3ba478a87 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_proxy.h +@@ -74,6 +74,8 @@ public: + + std::string GetStreamerId() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + int32_t RenderFirstFrame() override; + private: + static inline BrokerDelegator delegator_; +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp +index a3c2b2974..3c2caa459 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.cpp +@@ -82,6 +82,7 @@ int32_t LppVideoStreamerServiceStub::Init() + void LppVideoStreamerServiceStub::SetPlayerFuncs() + { + FillPlayerFuncPart1(); ++ FillPlayerFuncPart2(); + } + + void LppVideoStreamerServiceStub::FillPlayerFuncPart1() +@@ -136,6 +137,12 @@ void LppVideoStreamerServiceStub::FillPlayerFuncPart1() + [this](MessageParcel &data, MessageParcel &reply) { return RenderFirstFrame(data, reply); }}; + } + ++void LppVideoStreamerServiceStub::FillPlayerFuncPart2() ++{ ++ playerFuncs_[GET_LATEST_PTS] = {"Player::GetLatestPts", ++ [this](MessageParcel &data, MessageParcel &reply) { return GetLatestPts(data, reply); }}; ++} ++ + int LppVideoStreamerServiceStub::OnRemoteRequest( + uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) + { +@@ -532,5 +539,22 @@ int32_t LppVideoStreamerServiceStub::RenderFirstFrame(MessageParcel &data, Messa + return MSERR_OK; + } + ++int32_t LppVideoStreamerServiceStub::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServiceStub::GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(lppVideoPlayerServer_ != nullptr, MSERR_INVALID_OPERATION, "player server is nullptr"); ++ return lppVideoPlayerServer_->GetLatestPts(pts); ++} ++ ++int32_t LppVideoStreamerServiceStub::GetLatestPts(MessageParcel &data, MessageParcel &reply) ++{ ++ (void)data; ++ int64_t pts = 0; ++ int32_t ret = GetLatestPts(pts); ++ MEDIA_LOGI("LppVideoStreamerServiceStub::GetLatestPts %{public}d %{public}ld", ret, pts); ++ reply.WriteInt32(ret); ++ reply.WriteInt64(pts); ++ return MSERR_OK; ++} + } // namespace Media + } // namespace OHOS +diff --git a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h +index eca927564..e708a8e14 100755 +--- a/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h ++++ b/services/services/lpp_video_streamer/ipc/lpp_video_streamer_service_stub.h +@@ -81,9 +81,12 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + int32_t Init(); + void SetPlayerFuncs(); + void FillPlayerFuncPart1(); ++ void FillPlayerFuncPart2(); + + private: + LppVideoStreamerServiceStub(); +@@ -114,6 +117,7 @@ public: + int32_t SetLppAudioStreamerId(MessageParcel &data, MessageParcel &reply); + int32_t GetStreamerId(MessageParcel &data, MessageParcel &reply); + int32_t RenderFirstFrame(MessageParcel &data, MessageParcel &reply); ++ int32_t GetLatestPts(MessageParcel &data, MessageParcel &reply); + + std::shared_ptr lppVideoPlayerServer_ = nullptr; + std::map> playerFuncs_; +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp +index aed5713f7..d1e3a1b1b 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.cpp +@@ -287,6 +287,15 @@ int32_t LppVideoStreamerServer::SetLppVideoStreamerCallback(const std::shared_pt + return MSERR_OK; + } + ++int32_t LppVideoStreamerServer::GetLatestPts(int64_t &pts) ++{ ++ MEDIA_LOGI("LppVideoStreamerServer GetLatestPts"); ++ CHECK_AND_RETURN_RET_LOG(streamerEngine_ != nullptr, MSERR_INVALID_OPERATION, "streamerEngine_ is nullptr"); ++ auto ret = streamerEngine_->GetLatestPts(pts); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "GetLatestPts Failed!"); ++ return ret; ++} ++ + int32_t LppVideoStreamerServer::SetLppAudioStreamerId(const std::string audioStreamId) + { + MEDIA_LOGI("LppVideoStreamerServer SetLppAudioStreamerId"); +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +index beec97728..0fbf7b171 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +@@ -94,6 +94,8 @@ public: + + int32_t RenderFirstFrame() override; + ++ int32_t GetLatestPts(int64_t &pts) override; ++ + void OnDataNeeded(const int32_t maxBufferSize, const int32_t maxFrameNum) override; + bool OnAnchorUpdateNeeded(int64_t &anchorPts, int64_t &anchorClk) override; + void OnError(const MediaServiceErrCode errCode, const std::string &errMsg) override; +diff --git a/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h b/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h +index 25e1a4f3a..be06f4c77 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_astream_impl_unit_test/mock/i_lpp_sync_manager.h +@@ -49,6 +49,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + } + } +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h +index 59dd5614a..22cb8bee1 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/hilpp_vstreamer_impl.h +@@ -52,6 +52,7 @@ public: + std::string GetStreamerId() override; + std::shared_ptr GetLppSyncManager() override; + int32_t RenderFirstFrame() override; ++ int32_t GetLatestPts(int64_t &pts) override; + void OnEvent(const Event &event); + + private: +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h +index 73382ddfc..759e78384 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager.h +@@ -53,6 +53,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId), (override)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp), (override)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver), (override)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts), (override)); + }; + } // namespace Media + } // namespace OHOS +diff --git a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h +index ffeb753ab..22c25138f 100644 +--- a/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/engine/lpp_video_stream_unit_test/mock/lpp_sync_manager_adapter.h +@@ -51,6 +51,7 @@ public: + MOCK_METHOD(int32_t, GetShareBuffer, (int32_t& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + + class LowPowerPlayerFactory { +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h +index b522cb9dd..9c6e41ca8 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_adapter_unit_test/mock/v1_0/ilpp_sync_manager_adapter.h +@@ -51,6 +51,7 @@ public: + MOCK_METHOD(int32_t, UnbindOutputBuffers, ()); + MOCK_METHOD(int32_t, GetShareBuffer, (int& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + } // V1_0 + } // LowPowerPlayer +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h +index 2bb991ea2..ef1f08996 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager.h +@@ -49,7 +49,7 @@ public: + int32_t SetTunnelId(uint64_t tunnelId); + int32_t SetAudioIsLpp(bool isLpp); + void SetEventReceiver(std::shared_ptr eventReceiver); +- ++ int32_t GetLatestPts(int64_t &pts); + private: + void ResetTimeAnchor(); + +diff --git a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h +index 8c9532f45..341b27ab2 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h ++++ b/test/unittest/lpp_unit_test/module/lpp_sync_mgr_unit_test/mock/lpp_sync_manager_adapter.h +@@ -52,6 +52,7 @@ public: + MOCK_METHOD(int32_t, GetShareBuffer, (int32_t& fd)); + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts)); + }; + + class LowPowerPlayerFactory { +diff --git a/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h b/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h +index f7b3c55f1..6f4f09db0 100644 +--- a/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h ++++ b/test/unittest/lpp_unit_test/module/lpp_video_dec_adapter_unit_test/mock/lpp_sync_manager.h +@@ -52,6 +52,7 @@ public: + MOCK_METHOD(int32_t, SetTunnelId, (uint64_t tunnelId), (override)); + MOCK_METHOD(int32_t, SetAudioIsLpp, (bool isLpp), (override)); + MOCK_METHOD(void, SetEventReceiver, (std::shared_ptr eventReceiver), (override)); ++ MOCK_METHOD(int32_t, GetLatestPts, (int64_t &pts), (override)); + }; + } // namespace Media + } // namespace OHOS +-- +2.45.2.huawei.10 -declare_args() { - player_framework_support_player = true - player_framework_support_recorder = true - player_framework_support_transcoder = true - player_framework_support_player_js_api9 = true - player_framework_support_recorder_js_api9 = true - player_framework_support_metadata = true - player_framework_support_histreamer = true - player_framework_support_video = true - player_framework_support_jsapi = true - player_framework_support_capi = true - player_framework_support_test = true - player_framework_support_xcollie = true - player_framework_support_jsstack = true - player_framework_support_seccomp = false - player_framework_support_screen_capture = true - player_framework_support_screen_capture_stopbycall = false - player_framework_support_screen_capture_controller = false - player_framework_feature_pc_select_window = false - player_framework_support_jssoundpool = true - player_framework_support_mediasource = true - player_framework_support_auto_create_file = false - player_framework_check_video_is_hdr_vivid = false - player_framework_enable_start_stop_on_demand = false - player_framework_support_lowpower_av_sink = false - if (defined(build_seccomp) && build_seccomp) { - player_framework_support_seccomp = true - } - if (defined(global_parts_info) && - defined(global_parts_info.telephony_core_service)) { - player_framework_support_screen_capture_stopbycall = true - } - if (defined(global_parts_info) && - defined(global_parts_info.multimedia_camera_framework) && - defined(global_parts_info.multimedia_media_library)) { - player_framework_support_auto_create_file = true - } - player_framework_support_monitor = true - use_memmgr_plugin = false - if (defined(global_parts_info) && - defined(global_parts_info.resourceschedule_memmgr_override)) { - use_memmgr_plugin = true - } - use_memmgr = false - if (defined(global_parts_info) && - defined(global_parts_info.resourceschedule_memmgr)) { - use_memmgr = true - } - player_framework_support_avsession_background = false - if (defined(global_parts_info) && - defined(global_parts_info.multimedia_av_session)) { - player_framework_support_avsession_background = true - } - player_framework_support_drm = false - if (defined(global_parts_info) && - defined(global_parts_info.multimedia_drm_framework)) { - player_framework_support_drm = true - } - player_framework_support_vibrator = false - if (defined(global_parts_info) && - defined(global_parts_info.sensors_miscdevice)) { - player_framework_support_vibrator = true - } - player_framework_support_power_manager = false - if (defined(global_parts_info) && - defined(global_parts_info.powermgr_power_manager)) { - player_framework_support_power_manager = true - } - player_framework_support_json = false - if (defined(global_parts_info) && - defined(global_parts_info.third_party_json)) { - player_framework_support_json = true - } - player_framework_support_efficiency_manager = false - if (defined(global_parts_info) && - defined(global_parts_info.resourceschedule_efficiency_manager)) { - player_framework_support_efficiency_manager = true - } - player_framework_support_hiappevent = false - if (defined(global_parts_info) && - defined(global_parts_info.hiviewdfx_hiappevent)) { - player_framework_support_hiappevent = true - } - player_framework_support_drivers_interface_camera = false - if (defined(global_parts_info) && - defined(global_parts_info.drivers_interface_camera)) { - player_framework_support_drivers_interface_camera = true - } -} - -player_framework_defines = [] - -if (player_framework_support_player) { - player_framework_defines += [ "SUPPORT_PLAYER" ] -} else { - player_framework_defines += [ "UNSUPPORT_PLAYER" ] -} - -if (player_framework_support_lowpower_av_sink) { - player_framework_defines += [ "SUPPORT_LPP" ] - player_framework_defines += [ "SUPPORT_LPP_AUDIO_STRAMER" ] - player_framework_defines += [ "SUPPORT_LPP_VIDEO_STRAMER" ] -} else { - player_framework_defines += [ "UNSUPPORT_LPP_AUDIO_STRAMER" ] - player_framework_defines += [ "UNSUPPORT_LPP_VIDEO_STRAMER" ] - player_framework_defines += [ "UNSUPPORT_LPP" ] -} - -if (player_framework_support_player_js_api9) { - player_framework_defines += [ "SUPPORT_PLAYER_API9" ] -} - -if (player_framework_support_avsession_background) { - player_framework_defines += [ "SUPPORT_AVSESSION" ] -} - -if (player_framework_support_recorder_js_api9) { - player_framework_defines += [ "SUPPORT_RECORDER_API9" ] -} - -if (player_framework_support_recorder) { - player_framework_defines += [ "SUPPORT_RECORDER" ] -} else { - player_framework_defines += [ "UNSUPPORT_RECORDER" ] -} - -if (player_framework_support_transcoder) { - player_framework_defines += [ "SUPPORT_TRANSCODER" ] -} else { - player_framework_defines += [ "UNSUPPORT_TRANSCODER" ] -} - -if (player_framework_support_metadata) { - player_framework_defines += [ "SUPPORT_METADATA" ] -} else { - player_framework_defines += [ "UNSUPPORT_METADATA" ] -} - -if (player_framework_support_video) { - player_framework_defines += [ "SUPPORT_VIDEO" ] -} else { - player_framework_defines += [ "SUPPORT_AUDIO_ONLY" ] -} - -if (player_framework_support_xcollie) { - player_framework_defines += [ "HICOLLIE_ENABLE" ] -} - -if (player_framework_support_jsstack) { - player_framework_defines += [ "SUPPORT_JSSTACK" ] -} - -if (use_memmgr_plugin || use_memmgr) { - player_framework_defines += [ "PLAYER_USE_MEMORY_MANAGE" ] -} - -if (player_framework_support_monitor) { - player_framework_defines += [ "USE_MONITOR" ] -} - -if (player_framework_support_screen_capture) { - player_framework_defines += [ "SUPPORT_SCREEN_CAPTURE" ] -} else { - player_framework_defines += [ "UNSUPPORT_SCREEN_CAPTURE" ] -} - -if (player_framework_support_screen_capture_controller) { - player_framework_defines += [ "SUPPORT_SCREEN_CAPTURE_WINDOW_NOTIFICATION" ] -} - -if (player_framework_support_jssoundpool) { - player_framework_defines += [ "SUPPORT_SOUND_POOL" ] -} else { - player_framework_defines += [ "UNSUPPORT_SOUND_POOL" ] -} - -if (player_framework_support_drm) { - player_framework_defines += [ "SUPPORT_AVPLAYER_DRM" ] -} else { - player_framework_defines += [ "UNSUPPORT_AVPLAYER_DRM" ] -} - -if (player_framework_support_vibrator) { - player_framework_defines += [ "SUPPORT_VIBRATOR" ] -} else { - player_framework_defines += [ "UNSUPPORT_VIBRATOR" ] -} - -if (player_framework_support_power_manager) { - player_framework_defines += [ "SUPPORT_POWER_MANAGER" ] -} - -if (player_framework_support_efficiency_manager) { - player_framework_defines += [ "USE_EFFICIENCY_MANAGER" ] -} - -if (player_framework_support_mediasource) { - player_framework_defines += [ "SUPPORT_MEDIA_SOURCE" ] -} - -if (player_framework_support_auto_create_file) { - player_framework_defines += [ "SUPPORT_RECORDER_CREATE_FILE" ] -} - -if (player_framework_support_json) { - player_framework_defines += [ "SUPPORT_JSON" ] -} - -if (player_framework_enable_start_stop_on_demand) { - player_framework_defines += [ "SUPPORT_START_STOP_ON_DEMAND" ] -} - -if (player_framework_support_screen_capture_stopbycall) { - player_framework_defines += [ "SUPPORT_CALL" ] -} - -if (player_framework_support_hiappevent) { - player_framework_defines += [ "SUPPORT_HIAPPEVENT" ] -} - -if (player_framework_support_drivers_interface_camera) { - player_framework_defines += [ "SUPPORT_DRIVER_INTERFACE_CAMERA" ] -} - -# Config path -MEDIA_PLAYER_ROOT_DIR = "//foundation/multimedia/player_framework" -MEDIA_PLAYER_AVCODEC = "//foundation/multimedia/av_codec" -MEDIA_PLAYER_HISTREAMER = "//foundation/multimedia/media_foundation" - -MEDIA_PLAYER_C_UTILS = "//commonlibrary/c_utils" -MEDIA_PLAYER_GRAPHIC = "//foundation/graphic/graphic_2d" -MEDIA_PLAYER_GRAPHIC_SURFACE = "//foundation/graphic/graphic_surface" -MEDIA_DRM_ROOT_DIR = "//foundation/multimedia/drm_framework" - -# Fuzz test output path. -MODULE_OUTPUT_PATH = "player_framework/player_framework" -MODULE_SCREENCAPTURE_OUTPUT_PATH = "player_framework/ScreenCapture" -- Gitee From f96d6e70ce651e69fffbcdfa623f60488d0ec47d Mon Sep 17 00:00:00 2001 From: zpf Date: Fri, 29 Aug 2025 13:17:31 +0000 Subject: [PATCH 09/11] 212 Signed-off-by: zpf --- config.gni | 53 +++++++++++------------------------------------------ 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/config.gni b/config.gni index 5460947aa..bdfdd4114 100644 --- a/config.gni +++ b/config.gni @@ -1,43 +1,15 @@ -From 33b8f932d957909ccce2c668cc1bbf0a65fd9c07 Mon Sep 17 00:00:00 2001 -From: z00654174 -Date: Thu, 28 Aug 2025 09:55:56 +0800 -Subject: [PATCH] TicketNo:DTS2022071803909 Description: pts Team:OTHERS - Feature or Bugfix:Bugfix Binary Source:NA PrivateCode(Yes/No):No +commit 33b8f932d957909ccce2c668cc1bbf0a65fd9c07 +Author: z00654174 +Date: Thu Aug 28 09:55:56 2025 +0800 -Change-Id: Ic56a08bf0e57af135fe5d42d8c021fdd0250cf41 ---- - .../lppplayer/native_lpp_video_streamer.cpp | 12 ++++++++++ - .../video_streamer_impl.cpp | 10 ++++++++ - .../lpp_video_streamer/video_streamer_impl.h | 2 ++ - .../inner_api/native/lpp_video_streamer.h | 2 ++ - interfaces/kits/c/lowpower_video_sink.h | 14 +++++++++++ - .../lpp/lpp_sync_manager/lpp_sync_manager.h | 1 + - .../lpp_sync_manager_adapter.h | 2 ++ - .../lpp_sync_manager/src/lpp_sync_manager.cpp | 10 ++++++++ - .../src/lpp_sync_manager_adapter.cpp | 8 +++++++ - .../lpp_video_streamer/hilpp_vstreamer_impl.h | 1 + - .../src/hilpp_vstreamer_impl.cpp | 7 ++++++ - .../include/i_lpp_video_streamer_service.h | 2 ++ - .../services/engine_intf/i_lpp_sync_manager.h | 1 + - .../engine_intf/i_lpp_video_streamer.h | 1 + - .../client/lpp_video_streamer_client.cpp | 10 ++++++++ - .../client/lpp_video_streamer_client.h | 2 ++ - .../i_standard_lpp_video_streamer_service.h | 3 +++ - .../ipc/lpp_video_streamer_service_proxy.cpp | 19 +++++++++++++++ - .../ipc/lpp_video_streamer_service_proxy.h | 2 ++ - .../ipc/lpp_video_streamer_service_stub.cpp | 24 +++++++++++++++++++ - .../ipc/lpp_video_streamer_service_stub.h | 4 ++++ - .../server/lpp_video_streamer_server.cpp | 9 +++++++ - .../server/lpp_video_streamer_server.h | 2 ++ - .../mock/i_lpp_sync_manager.h | 1 + - .../mock/hilpp_vstreamer_impl.h | 1 + - .../mock/lpp_sync_manager.h | 1 + - .../mock/lpp_sync_manager_adapter.h | 1 + - .../mock/v1_0/ilpp_sync_manager_adapter.h | 1 + - .../mock/lpp_sync_manager.h | 2 +- - .../mock/lpp_sync_manager_adapter.h | 1 + - .../mock/lpp_sync_manager.h | 1 + - 31 files changed, 156 insertions(+), 1 deletion(-) + TicketNo:DTS2022071803909 + Description: pts + Team:OTHERS + Feature or Bugfix:Bugfix + Binary Source:NA + PrivateCode(Yes/No):No + + Change-Id: Ic56a08bf0e57af135fe5d42d8c021fdd0250cf41 diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp index 2147b2427..5ed1622b2 100644 @@ -569,6 +541,3 @@ index f7b3c55f1..6f4f09db0 100644 }; } // namespace Media } // namespace OHOS --- -2.45.2.huawei.10 - -- Gitee From ba1f0b957b42a390ac33bb616d6bf084e981ee70 Mon Sep 17 00:00:00 2001 From: zpf Date: Sat, 30 Aug 2025 06:11:14 +0000 Subject: [PATCH 10/11] 11 Signed-off-by: zpf --- cfi_blocklist.txt | 1327 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1326 insertions(+), 1 deletion(-) diff --git a/cfi_blocklist.txt b/cfi_blocklist.txt index 4ef834228..7b5b26c2f 100644 --- a/cfi_blocklist.txt +++ b/cfi_blocklist.txt @@ -1 +1,1326 @@ -src:*frameworks/native/capi/* +From 075cb42554c855f05aeff3c25141f281e8cf766b Mon Sep 17 00:00:00 2001 +From: z00654174 +Date: Sun, 24 Aug 2025 18:46:13 +0800 +Subject: [PATCH] TicketNo:DTS2022071803909 Description: lppbug Team:OTHERS + Feature or Bugfix:Bugfix Binary Source:NA PrivateCode(Yes/No):No + +Change-Id: I7abc64d758de105c85d3613b9b9fcb0881fe4175 +--- + .../native/capi/common/native_player_magic.h | 4 + + .../native/capi/lppplayer/native_lpp_common.h | 10 + + .../lppplayer/native_lpp_video_streamer.cpp | 16 ++ + .../video_streamer_impl.cpp | 7 + + .../native/media_service_helper/BUILD.gn | 8 +- + interfaces/inner_api/native/BUILD.gn | 7 + + interfaces/inner_api/native/lpp_capability.h | 195 ++++++++++++++++++ + interfaces/inner_api/native/lpp_common.h | 2 +- + .../inner_api/native/lpp_video_streamer.h | 9 +- + .../native/player_framework.versionscript | 2 + + interfaces/kits/c/BUILD.gn | 46 +++++ + interfaces/kits/c/lowpower_audio_sink_base.h | 2 +- + interfaces/kits/c/lowpower_avsink_base.h | 22 +- + interfaces/kits/c/lowpower_video_sink.h | 1 - + .../src/hilpp_vstreamer_impl.cpp | 1 + + services/include/i_media_service.h | 2 + + services/services/BUILD.gn | 9 +- + .../server/lpp_video_streamer_server.h | 2 +- + .../services/sa_media/client/media_client.cpp | 10 + + .../services/sa_media/client/media_client.h | 1 + + .../sa_media/ipc/i_standard_media_service.h | 5 + + .../sa_media/ipc/media_service_proxy.cpp | 18 ++ + .../sa_media/ipc/media_service_proxy.h | 1 + + .../sa_media/ipc/media_service_stub.cpp | 27 +++ + .../sa_media/ipc/media_service_stub.h | 2 + + .../server_manager/media_server_manager.cpp | 16 ++ + .../server_manager/media_server_manager.h | 7 +- + test/BUILD.gn | 2 - + .../avmetadatahelper_fuzzer/BUILD.gn | 6 + + .../avmetadatahelperdatasrc_fuzzer/BUILD.gn | 12 ++ + .../avmetadatastub_fuzzer/BUILD.gn | 6 + + .../avmetadatastublocal_fuzzer/BUILD.gn | 6 + + test/fuzztest/common/stub_common.cpp | 6 + + test/fuzztest/common/stub_common.h | 1 + + .../lowpoweraudiosink_fuzzer/BUILD.gn | 6 + + .../lowpowervideosink_fuzzer/BUILD.gn | 6 + + .../player_fuzztest/playerapi_fuzzer/BUILD.gn | 6 + + .../playerdatasrc_fuzzer/BUILD.gn | 6 + + .../player_fuzztest/playermp4_fuzzer/BUILD.gn | 6 + + .../player_fuzztest/playersei_fuzzer/BUILD.gn | 6 + + .../playerservicestub_fuzzer/BUILD.gn | 6 + + .../playerservicestub_fuzzer.cpp | 5 + + .../playerstub_fuzzer/BUILD.gn | 6 + + .../screencaptureservicestub_fuzzer/BUILD.gn | 6 + + test/unittest/avmetadatahelper_test/BUILD.gn | 6 + + .../avmetadatahelper_impl_unit_test.cpp | 6 + + .../lpp_video_streamer_unit_test/BUILD.gn | 8 +- + .../media_server_manager_test/BUILD.gn | 6 + + .../media_service_helper_test/BUILD.gn | 6 + + .../player_service_stub_test/BUILD.gn | 6 + + .../sa_media_client_unit_test/BUILD.gn | 6 + + test/unittest/timeout_test/BUILD.gn | 6 + + .../timeout_test/mock/mock_i_media_service.h | 1 + + 53 files changed, 568 insertions(+), 13 deletions(-) + create mode 100644 interfaces/inner_api/native/lpp_capability.h + +diff --git a/frameworks/native/capi/common/native_player_magic.h b/frameworks/native/capi/common/native_player_magic.h +index 83a1344c7..fea52bdea 100644 +--- a/frameworks/native/capi/common/native_player_magic.h ++++ b/frameworks/native/capi/common/native_player_magic.h +@@ -90,4 +90,8 @@ struct OH_AVTranscoder_Config : public OHOS::RefBase { + virtual ~OH_AVTranscoder_Config() = default; + }; + ++struct OH_LowPowerAVSink_Capability : public OHOS::RefBase { ++ OH_LowPowerAVSink_Capability() = default; ++ virtual ~OH_LowPowerAVSink_Capability() = default; ++}; + #endif // NATIVE_SCREEN_CAPTURE_MAGIC_H +\ No newline at end of file +diff --git a/frameworks/native/capi/lppplayer/native_lpp_common.h b/frameworks/native/capi/lppplayer/native_lpp_common.h +index e72ec635e..4780f568e 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_common.h ++++ b/frameworks/native/capi/lppplayer/native_lpp_common.h +@@ -35,6 +35,7 @@ + #include "lpp_video_streamer.h" + #include "lpp_common.h" + #include "native_window.h" ++#include "lpp_capability.h" + + namespace OHOS { + namespace Media { +@@ -93,6 +94,15 @@ struct LowPowerVideoSinkObject : public OH_LowPowerVideoSink { + const std::shared_ptr videoStreamer_ = nullptr; + AVSamplesBufferObject *framePacket_ = nullptr; + }; ++ ++struct LowPowerAVSinkCapabilityObject : public OH_LowPowerAVSink_Capability { ++ explicit LowPowerAVSinkCapabilityObject(std::shared_ptr lppCapibility) ++ : lppCapibility_(lppCapibility) ++ {} ++ ~LowPowerAVSinkCapabilityObject() = default; ++ ++ std::shared_ptr lppCapibility_ = nullptr; ++}; + } // namespace Media + } // namespace OHOS + #endif // NATIVE_LPP_COMMON_H +\ No newline at end of file +diff --git a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +index 2147b2427..94c60dfe5 100644 +--- a/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp ++++ b/frameworks/native/capi/lppplayer/native_lpp_video_streamer.cpp +@@ -634,6 +634,7 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetStreamChangedListener( + int32_t res = callback->SetStreamChangedListener(onStreamChanged, userData); + return LppMsErrToOHAvErr(res); + } ++ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPowerVideoSinkCallback *callback, + OH_LowPowerVideoSink_OnFirstFrameDecoded onFirstFrameDecoded, void *userData) + { +@@ -643,3 +644,18 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener(OH_LowPow + int32_t res = callback->SetFirstFrameReadyListener(onFirstFrameDecoded, userData); + return LppMsErrToOHAvErr(res); + } ++ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() ++{ ++ MEDIA_LOGD("OH_LowPowerAVSink_GetCapability"); ++ LppAvCapabilityInfo *info = VideoStreamerFactory::GetLppCapacity(); ++ CHECK_AND_RETURN_RET_LOG(info != nullptr, nullptr, "info is nullptr!"); ++ std::shared_ptr sharedPtr(info); ++ info = nullptr; ++ CHECK_AND_RETURN_RET_LOG(sharedPtr != nullptr, nullptr, "sharedPtr is nullptr!"); ++ LowPowerAVSinkCapabilityObject *object = new(std::nothrow) LowPowerAVSinkCapabilityObject(sharedPtr); ++ CHECK_AND_RETURN_RET_LOG(object != nullptr, nullptr, "object is nullptr!"); ++ MEDIA_LOGI("OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability() %{public}zu %{public}zu", ++ object->lppCapibility_->videoCap_.size(), object->lppCapibility_->audioCap_.size()); ++ return object; ++} +diff --git a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +index f7adadd72..d7bf73f3f 100644 +--- a/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp ++++ b/frameworks/native/lpp_video_streamer/video_streamer_impl.cpp +@@ -34,6 +34,13 @@ std::shared_ptr VideoStreamerFactory::CreateByMime(const std::str + return impl; + } + ++LppAvCapabilityInfo *VideoStreamerFactory::GetLppCapacity() ++{ ++ LppAvCapabilityInfo *lppAvCapability = MediaServiceFactory::GetInstance().GetLppCapacity(); ++ CHECK_AND_RETURN_RET_LOG(lppAvCapability != nullptr, nullptr, "VideoStreamerFactory::failed to GetLppCapacity"); ++ return lppAvCapability; ++} ++ + int32_t VideoStreamerImpl::Init(const std::string &mime) + { + MEDIA_LOGI("VideoStreamerImpl Init, mime %{public}s", mime.c_str()); +diff --git a/frameworks/native/media_service_helper/BUILD.gn b/frameworks/native/media_service_helper/BUILD.gn +index a4124df86..357530135 100644 +--- a/frameworks/native/media_service_helper/BUILD.gn ++++ b/frameworks/native/media_service_helper/BUILD.gn +@@ -100,9 +100,15 @@ ohos_shared_library("media_helper_client") { + "hilog:libhilog", + "image_framework:image_native", + "ipc:ipc_single", +- "media_foundation:media_foundation" ++ "media_foundation:media_foundation", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "platformsdk" ] + subsystem_name = "multimedia" + part_name = "player_framework" +diff --git a/interfaces/inner_api/native/BUILD.gn b/interfaces/inner_api/native/BUILD.gn +index 10b2a4ae0..a89225c8c 100644 +--- a/interfaces/inner_api/native/BUILD.gn ++++ b/interfaces/inner_api/native/BUILD.gn +@@ -218,8 +218,15 @@ ohos_shared_library("media_client") { + "ipc:ipc_single", + "qos_manager:qos", + "samgr:samgr_proxy", ++ "hdf_core:libhdi", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + public_external_deps = [ + "graphic_2d:color_manager", + "media_foundation:media_foundation", +diff --git a/interfaces/inner_api/native/lpp_capability.h b/interfaces/inner_api/native/lpp_capability.h +new file mode 100644 +index 000000000..b78d734de +--- /dev/null ++++ b/interfaces/inner_api/native/lpp_capability.h +@@ -0,0 +1,195 @@ ++/* ++ * Copyright (C) 2025 Huawei Device Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef LPP_CAPABILITY_H ++#define LPP_CAPABILITY_H ++ ++#include "media_log.h" ++#include ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++#include "v1_0/ilow_power_player_factory.h" ++namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; ++#endif ++ ++namespace OHOS { ++namespace Media { ++struct VideoMimeCapIpc : public Parcelable { ++public: ++ std::string mime_ = ""; /** video/avc, video/hevc */ ++ uint32_t minWidth_ = 0; ++ uint32_t minHeight_ = 0; ++ uint32_t maxWidth_ = 0; ++ uint32_t maxHeight_ = 0; ++ uint32_t maxPixelPerSecond_ = 0; ++ uint32_t maxInstance_ = 0; ++ bool isSupportDRM_ = false; ++ std::vector supportHDRTypes_ = {}; /** HDR10, HDR10+, HDRVivid */ ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ VideoMimeCapIpc(const PlayerHDI::VideoMimeCap &videoMimeCap) ++ { ++ mime_ = videoMimeCap.mime; ++ minWidth_ = videoMimeCap.minWidth; ++ minHeight_ = videoMimeCap.minHeight; ++ maxWidth_ = videoMimeCap.maxWidth; ++ maxHeight_ = videoMimeCap.maxHeight; ++ maxPixelPerSecond_ = videoMimeCap.maxPixelPerSecond; ++ maxInstance_ = videoMimeCap.maxInstance; ++ isSupportDRM_ = videoMimeCap.isSupportDRM; ++ for (uint32_t i = 0; i < videoMimeCap.supportHDRTypes.size(); i++) { ++ supportHDRTypes_.push_back(videoMimeCap.supportHDRTypes[i]); ++ } ++ } ++#endif ++ ++ VideoMimeCapIpc() {} ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteString(mime_); ++ parcel.WriteUint32(minWidth_); ++ parcel.WriteUint32(minHeight_); ++ parcel.WriteUint32(maxWidth_); ++ parcel.WriteUint32(maxHeight_); ++ parcel.WriteUint32(maxPixelPerSecond_); ++ parcel.WriteUint32(maxInstance_); ++ parcel.WriteBool(isSupportDRM_); ++ uint32_t typeSize = supportHDRTypes_.size(); ++ parcel.WriteUint32(typeSize); ++ for (uint32_t i = 0; i < typeSize; i++) { ++ parcel.WriteUint32(supportHDRTypes_[i]); ++ } ++ return true; ++ } ++ ++ void UnmarshallingSelf(Parcel &parcel) ++ { ++ mime_ = parcel.ReadString(); ++ minWidth_ = parcel.ReadUint32(); ++ minHeight_ = parcel.ReadUint32(); ++ maxWidth_ = parcel.ReadUint32(); ++ maxHeight_ = parcel.ReadUint32(); ++ maxPixelPerSecond_ = parcel.ReadUint32(); ++ maxInstance_ = parcel.ReadUint32(); ++ isSupportDRM_ = parcel.ReadBool(); ++ uint32_t typeSize = parcel.ReadUint32(); ++ for (uint32_t i = 0; i < typeSize; i++) { ++ supportHDRTypes_.push_back(parcel.ReadUint32()); ++ } ++ } ++}; ++ ++struct AudioMimeCapIpc : public Parcelable { ++public: ++ std::string mime_ = ""; /** AAC, Flac, Vorbis, MPEG, G711mu, AMR(amrnb, amrwb), APE */ ++ uint32_t sampleRate_ = 0; ++ uint32_t channelCount_ = 0; ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ AudioMimeCapIpc(const PlayerHDI::AudioMimeCap &audioMimeCap) ++ { ++ mime_ = audioMimeCap.mime; ++ sampleRate_ = audioMimeCap.sampleRate; ++ channelCount_ = audioMimeCap.channelCount; ++ } ++#endif ++ ++ AudioMimeCapIpc() {} ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteString(mime_); ++ parcel.WriteUint32(sampleRate_); ++ parcel.WriteUint32(channelCount_); ++ return true; ++ } ++ ++ void UnmarshallingSelf(Parcel &parcel) ++ { ++ mime_ = parcel.ReadString(); ++ sampleRate_ = parcel.ReadUint32(); ++ channelCount_ = parcel.ReadUint32(); ++ } ++}; ++ ++struct LppAvCapabilityInfo : public Parcelable { ++public: ++ uint32_t maxInstance_ = 0; ++ std::vector videoCap_ = {}; /** videoCap */ ++ std::vector audioCap_ = {}; ++ ++ LppAvCapabilityInfo() {} ++ ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ void SetLppAvCapabilityInfo(PlayerHDI::LppAVCap &lppAVCap) ++ { ++ maxInstance_ = lppAVCap.maxInstance; ++ for (uint32_t i = 0; i < lppAVCap.videoCap.size(); i++) { ++ VideoMimeCapIpc videoMimeCapIpc(lppAVCap.videoCap[i]); ++ videoCap_.push_back(videoMimeCapIpc); ++ } ++ ++ for (uint32_t i = 0; i < lppAVCap.audioCap.size(); i++) { ++ AudioMimeCapIpc audioMimeCapIpc(lppAVCap.audioCap[i]); ++ audioCap_.push_back(audioMimeCapIpc); ++ } ++ } ++#endif ++ ++ bool Marshalling(Parcel &parcel) const override ++ { ++ parcel.WriteUint32(maxInstance_); ++ ++ parcel.WriteUint32(videoCap_.size()); ++ for (uint32_t i = 0; i< videoCap_.size(); i++) { ++ videoCap_[i].Marshalling(parcel); ++ } ++ ++ parcel.WriteUint32(audioCap_.size()); ++ for (uint32_t i = 0; i< audioCap_.size(); i++) { ++ audioCap_[i].Marshalling(parcel); ++ } ++ return true; ++ } ++ ++ static LppAvCapabilityInfo Unmarshalling(Parcel &parcel) ++ { ++ const uint32_t MAX_SIZE = 65535; ++ LppAvCapabilityInfo info; ++ info.maxInstance_ = parcel.ReadUint32(); ++ ++ uint32_t videoCapSize = parcel.ReadUint32(); ++ if (videoCapSize > MAX_SIZE) { ++ return info; ++ } ++ for (uint32_t i = 0; i< videoCapSize; i++) { ++ VideoMimeCapIpc videoCap; ++ videoCap.UnmarshallingSelf(parcel); ++ info.videoCap_.push_back(videoCap); ++ } ++ ++ uint32_t audioCapSize = parcel.ReadUint32(); ++ if (audioCapSize > MAX_SIZE) { ++ return info; ++ } ++ for (uint32_t i = 0; i< audioCapSize; i++) { ++ AudioMimeCapIpc audioCap; ++ audioCap.UnmarshallingSelf(parcel); ++ info.audioCap_.push_back(audioCap); ++ } ++ return info; ++ } ++}; ++} ++} ++#endif // LPP_CAPABILITY_H +\ No newline at end of file +diff --git a/interfaces/inner_api/native/lpp_common.h b/interfaces/inner_api/native/lpp_common.h +index 17f2ecac2..f42e2448e 100644 +--- a/interfaces/inner_api/native/lpp_common.h ++++ b/interfaces/inner_api/native/lpp_common.h +@@ -27,7 +27,7 @@ enum LppErrCode : int32_t { + LPP_ERROR_OK = 0, + LPP_ERROR_UNKONWN, + }; +- ++ + class LppDataPacket : public OHOS::RefBase { + public: + +diff --git a/interfaces/inner_api/native/lpp_video_streamer.h b/interfaces/inner_api/native/lpp_video_streamer.h +index d29cd78a0..ac6a72fac 100644 +--- a/interfaces/inner_api/native/lpp_video_streamer.h ++++ b/interfaces/inner_api/native/lpp_video_streamer.h +@@ -22,10 +22,9 @@ + #include "meta/format.h" + #include "lpp_audio_streamer.h" + #include "lpp_common.h" +- ++#include "lpp_capability.h" + namespace OHOS { + namespace Media { +- + class VideoStreamerKeys { + public: + static constexpr std::string_view LPP_CURRENT_POSITION = "current_position"; +@@ -113,9 +112,15 @@ public: + (void)mime; + return nullptr; + } ++ static LppAvCapabilityInfo *GetLppCapacity() ++ { ++ return nullptr; ++ } + #else + static std::shared_ptr CreateByMime(const std::string &mime); ++ static LppAvCapabilityInfo *GetLppCapacity(); + #endif ++ + private: + VideoStreamerFactory() = default; + ~VideoStreamerFactory() = default; +diff --git a/interfaces/inner_api/native/player_framework.versionscript b/interfaces/inner_api/native/player_framework.versionscript +index e6a712c86..7dc3297e6 100644 +--- a/interfaces/inner_api/native/player_framework.versionscript ++++ b/interfaces/inner_api/native/player_framework.versionscript +@@ -28,6 +28,8 @@ + *OHOS::Media::ScreenCaptureFactory::CreateScreenCaptureMonitor*; + *OHOS::Media::ScreenCaptureControllerFactory::CreateScreenCaptureController*; + *OHOS::Media::AudioStreamerFactory::CreateByMime*; ++ *OHOS::Media::VideoStreamerFactory::CreatePlayer*; ++ *OHOS::Media::VideoStreamerFactory::GetLppCapacity*; + *OHOS::Media::VideoStreamerFactory::CreateByMime*; + *OHOS::Media::Format::*; + *OHOS::Media::VideoCaps::*; +diff --git a/interfaces/kits/c/BUILD.gn b/interfaces/kits/c/BUILD.gn +index 3e308f4a6..3d533721d 100644 +--- a/interfaces/kits/c/BUILD.gn ++++ b/interfaces/kits/c/BUILD.gn +@@ -93,6 +93,13 @@ ohos_shared_library("native_avscreen_capture") { + "qos_manager:qos", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + output_extension = "so" + subsystem_name = "multimedia" + part_name = "player_framework" +@@ -133,6 +140,13 @@ ohos_shared_library("avplayer") { + "samgr:samgr_proxy", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_drm) { + public_external_deps = [ + "drm_framework:drm_framework", +@@ -187,6 +201,12 @@ ohos_shared_library("avrecorder") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_auto_create_file) { + external_deps += [ + "media_library:media_library", +@@ -240,6 +260,12 @@ ohos_shared_library("avimage_generator") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + output_extension = "so" +@@ -287,6 +313,13 @@ ohos_shared_library("avmetadata_extractor") { + "samgr:samgr_proxy", + "window_manager:libdm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_drm) { + public_external_deps = [ + "drm_framework:drm_framework", +@@ -341,6 +374,13 @@ ohos_shared_library("lowpower_avsink") { + "image_framework:pixelmap", + "hisysevent:libhisysevent", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + output_extension = "so" +@@ -388,6 +428,12 @@ ohos_shared_library("avtranscoder") { + "window_manager:libdm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + innerapi_tags = [ "ndk" ] + + defines = [] +diff --git a/interfaces/kits/c/lowpower_audio_sink_base.h b/interfaces/kits/c/lowpower_audio_sink_base.h +index 51fea73d2..93589ce6f 100644 +--- a/interfaces/kits/c/lowpower_audio_sink_base.h ++++ b/interfaces/kits/c/lowpower_audio_sink_base.h +@@ -59,7 +59,7 @@ typedef struct OH_LowPowerAudioSink OH_LowPowerAudioSink; + * @since 20 + */ + typedef struct OH_LowPowerAudioSinkCallback OH_LowPowerAudioSinkCallback; +- ++ + /** + * @brief When an error occurs in the running of the OH_LowPowerAudioSink instance, the function pointer will be called + * to report specific error information. +diff --git a/interfaces/kits/c/lowpower_avsink_base.h b/interfaces/kits/c/lowpower_avsink_base.h +index 27483c91d..1f5fdeb2e 100644 +--- a/interfaces/kits/c/lowpower_avsink_base.h ++++ b/interfaces/kits/c/lowpower_avsink_base.h +@@ -52,7 +52,14 @@ extern "C" { + * @since 20 + */ + typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; +- ++ ++/** ++ * @brief Forward declaration of OH_LowPowerAVSink_Capability. ++ * ++ * @since 21 ++ */ ++typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; ++ + /** + * @brief Append one OH_AVBuffer data to framePacketBuffer instance. + * +@@ -76,7 +83,20 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe + * @since 20 + */ + int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); ++ ++/** ++ * @brief Query the supported capabilities of a lowpower audio/video sink. ++ * ++ * This function queries and returns the capability set supported by the current ++ * lowpower audio/video sink, including but not limited to supported media formats, etc. ++ * ++ * @return {OH_LowPowerAVSink_Capability*} ++ * - A pointer to the capability structure if the sink supports capability queries and the query is successful. ++ * - nullptr if the sink does not support capability queries or the query fails. + ++ * @since 21 ++ */ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); + #ifdef __cplusplus + } + #endif +diff --git a/interfaces/kits/c/lowpower_video_sink.h b/interfaces/kits/c/lowpower_video_sink.h +index d1c11f7e3..f363d3aa9 100644 +--- a/interfaces/kits/c/lowpower_video_sink.h ++++ b/interfaces/kits/c/lowpower_video_sink.h +@@ -470,7 +470,6 @@ OH_AVErrCode OH_LowPowerVideoSinkCallback_SetFirstFrameDecodedListener( + */ + OH_AVErrCode OH_LowPowerVideoSinkCallback_SetEosListener(OH_LowPowerVideoSinkCallback* callback, + OH_LowPowerVideoSink_OnEos onEos, void* userData); +- + #ifdef __cplusplus + } + #endif +diff --git a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +index 782c14678..78becd0f9 100644 +--- a/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp ++++ b/services/engine/histreamer/lpp/lpp_video_streamer/src/hilpp_vstreamer_impl.cpp +@@ -85,6 +85,7 @@ int32_t HiLppVideoStreamerImpl::Init(const std::string &mime) + vdec_ = std::make_shared(streamerId_, isLpp_); + bool switchToCommon = false; + auto ret = vdec_->Init(mime, switchToCommon); ++ FALSE_RETURN_V_MSG(switchToCommon == false, AV_ERR_UNSUPPORT, "lpp is not support"); + FALSE_RETURN_V_MSG(ret == MSERR_OK, ret, "vdec_ init failed"); + FALSE_LOG_MSG_W(!switchToCommon, "switch isLpp_ to false"); + isLpp_ = isLpp_ ? !switchToCommon : isLpp_; +diff --git a/services/include/i_media_service.h b/services/include/i_media_service.h +index 9eed996ec..1c010933d 100644 +--- a/services/include/i_media_service.h ++++ b/services/include/i_media_service.h +@@ -234,6 +234,8 @@ public: + virtual std::shared_ptr CreateLppVideoStreamerService() = 0; + + virtual int32_t DestroyLppVideoStreamerService(std::shared_ptr lppVideoPlayer) = 0; ++ ++ virtual LppAvCapabilityInfo *GetLppCapacity() = 0; + #endif + + /** +diff --git a/services/services/BUILD.gn b/services/services/BUILD.gn +index 84494960d..e90102cd1 100644 +--- a/services/services/BUILD.gn ++++ b/services/services/BUILD.gn +@@ -318,7 +318,14 @@ ohos_shared_library("media_service") { + "window_manager:session_manager_lite", + ] + } +- ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ "hdf_core:libhdi", ++ ] ++ } ++ + if (player_framework_support_avsession_background) { + sources += [ "player/avsession_background/avsession_background.cpp" ] + external_deps += [ +diff --git a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +index beec97728..1544d4297 100644 +--- a/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h ++++ b/services/services/lpp_video_streamer/server/lpp_video_streamer_server.h +@@ -102,7 +102,7 @@ public: + void OnTargetArrived(const int64_t targetPts, const bool isTimeout) override; + void OnFirstFrameReady() override; + void OnStreamChanged(Format &format) override; +- ++ + private: + int32_t CreateStreamerEngine(); + bool StateEnter(VideoState targetState, const std::string funcName = ""); +diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp +index 8252b1744..beab36136 100644 +--- a/services/services/sa_media/client/media_client.cpp ++++ b/services/services/sa_media/client/media_client.cpp +@@ -399,6 +399,16 @@ int32_t MediaClient::DestroyLppAudioStreamerService(std::shared_ptrGetLppCapacity(*lppAvCapabilityInfo); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, nullptr, "MediaClient::GetLppCapacityfailed"); ++ return lppAvCapabilityInfo; ++} ++ + std::shared_ptr MediaClient::CreateLppVideoStreamerService() + { + MEDIA_LOGI("CreateLppVideoStreamerService start"); +diff --git a/services/services/sa_media/client/media_client.h b/services/services/sa_media/client/media_client.h +index 92e597c70..bad6945f6 100644 +--- a/services/services/sa_media/client/media_client.h ++++ b/services/services/sa_media/client/media_client.h +@@ -94,6 +94,7 @@ public: + #ifdef SUPPORT_LPP_VIDEO_STRAMER + std::shared_ptr CreateLppVideoStreamerService() override; + int32_t DestroyLppVideoStreamerService(std::shared_ptr lppAudioPlayer) override; ++ LppAvCapabilityInfo *GetLppCapacity() override; + #endif + std::vector GetPlayerPids() override; + +diff --git a/services/services/sa_media/ipc/i_standard_media_service.h b/services/services/sa_media/ipc/i_standard_media_service.h +index 80f81713f..f387decaa 100644 +--- a/services/services/sa_media/ipc/i_standard_media_service.h ++++ b/services/services/sa_media/ipc/i_standard_media_service.h +@@ -20,6 +20,7 @@ + #include "iremote_broker.h" + #include "iremote_proxy.h" + #include "iremote_stub.h" ++#include "lpp_capability.h" + #include + + namespace OHOS { +@@ -81,6 +82,8 @@ public: + + virtual int32_t ResetAllProxy() = 0; + ++ virtual int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) = 0; ++ + /** + * IPC code ID + */ +@@ -92,6 +95,8 @@ public: + GET_PLAYER_PIDS = 4, + FREEZE = 5, + RESET_ALL_PROXY = 6, ++ GET_RAMAINED_CAPACITY = 7, ++ GET_LPP_CAPABILITY = 8, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"IStandardMediaService"); +diff --git a/services/services/sa_media/ipc/media_service_proxy.cpp b/services/services/sa_media/ipc/media_service_proxy.cpp +index c91e6ab56..595fd4b46 100644 +--- a/services/services/sa_media/ipc/media_service_proxy.cpp ++++ b/services/services/sa_media/ipc/media_service_proxy.cpp +@@ -76,6 +76,24 @@ std::vector MediaServiceProxy::GetPlayerPids() + return res; + } + ++int32_t MediaServiceProxy::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { ++ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity"); ++ MessageParcel data; ++ MessageParcel reply; ++ MessageOption option; ++ int32_t error = -1; ++ bool token = data.WriteInterfaceToken(MediaServiceProxy::GetDescriptor()); ++ CHECK_AND_RETURN_RET_LOG(token, error, "Failed to write descriptor!"); ++ error = Remote()->SendRequest(MediaServiceMsg::GET_LPP_CAPABILITY, data, reply, option); ++ CHECK_AND_RETURN_RET_LOG(error == MSERR_OK, error, "Failed to SendRequest"); ++ int32_t ret = reply.ReadInt32(); ++ CHECK_AND_RETURN_RET_LOG(ret == MSERR_OK, ret, "Fail to MediaServiceProxy::GetLppCapacity"); ++ lppAvCapability = LppAvCapabilityInfo::Unmarshalling(reply); ++ MEDIA_LOGI("MediaServiceProxy::GetLppCapacity %{public}zu %{public}zu", ++ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ return ret; ++} ++ + sptr MediaServiceProxy::GetSubSystemAbility(IStandardMediaService::MediaSystemAbility subSystemId, + const sptr &listener) + { +diff --git a/services/services/sa_media/ipc/media_service_proxy.h b/services/services/sa_media/ipc/media_service_proxy.h +index d43cf9827..3ce5b8619 100644 +--- a/services/services/sa_media/ipc/media_service_proxy.h ++++ b/services/services/sa_media/ipc/media_service_proxy.h +@@ -41,6 +41,7 @@ public: + + int32_t ResetAllProxy() override; + ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; + private: + bool IsGetSubSystemAbilityASync() const; + static inline BrokerDelegator delegator_; +diff --git a/services/services/sa_media/ipc/media_service_stub.cpp b/services/services/sa_media/ipc/media_service_stub.cpp +index 0c701f82c..8955b126e 100644 +--- a/services/services/sa_media/ipc/media_service_stub.cpp ++++ b/services/services/sa_media/ipc/media_service_stub.cpp +@@ -58,6 +58,8 @@ void MediaServiceStub::Init() + [this](MessageParcel &data, MessageParcel &reply) { return HandleFreezeStubForPids(data, reply); }; + mediaFuncs_[RESET_ALL_PROXY] = + [this](MessageParcel &data, MessageParcel &reply) { return HandleResetAllProxy(data, reply); }; ++ mediaFuncs_[GET_LPP_CAPABILITY] = ++ [this] (MessageParcel &data, MessageParcel &reply) { return GetLppCapacityStub(data, reply); }; + } + + int32_t MediaServiceStub::HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply) +@@ -199,6 +201,17 @@ int32_t MediaServiceStub::ReleaseClientListenerStub(MessageParcel &data, Message + return MSERR_OK; + } + ++int32_t MediaServiceStub::GetLppCapacityStub(MessageParcel &data, MessageParcel &reply) ++{ ++ (void)data; ++ LppAvCapabilityInfo info; ++ int32_t ret = GetLppCapacity(info); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "Failed to write descriptor!"); ++ reply.WriteInt32(ret); ++ info.Marshalling(reply); ++ return MSERR_OK; ++} ++ + int32_t MediaServiceStub::GetPlayerPidsStub(MessageParcel &data, MessageParcel &reply) + { + (void)data; +@@ -222,6 +235,20 @@ std::vector MediaServiceStub::GetPlayerPids() + return MediaServerManager::GetInstance().GetPlayerPids(); + } + ++int32_t MediaServiceStub::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) ++{ ++ MEDIA_LOGI("MediaServiceStub::GetLppCapacity"); ++ #ifdef SUPPORT_LPP_VIDEO_STRAMER ++ int32_t ret = MediaServerManager::GetInstance().GetLppCapacity(lppAvCapability); ++ #else ++ int32_t ret = MSERR_UNKNOWN; ++ #endif ++ MEDIA_LOGI("MediaServiceStub::GetLppCapacity %{public}lu %{public}lu", ++ lppAvCapability.videoCap_.size(), lppAvCapability.audioCap_.size()); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, MSERR_UNKNOWN, "MediaServiceStub::GetLppCapacity GetLppCapacity"); ++ return ret; ++} ++ + int32_t MediaServiceStub::GetSystemAbility(MessageParcel &data, MessageParcel &reply) + { + int32_t mediaSystemAbility = data.ReadInt32(); +diff --git a/services/services/sa_media/ipc/media_service_stub.h b/services/services/sa_media/ipc/media_service_stub.h +index 46dbe0648..52e01926e 100644 +--- a/services/services/sa_media/ipc/media_service_stub.h ++++ b/services/services/sa_media/ipc/media_service_stub.h +@@ -44,6 +44,8 @@ private: + int32_t HandleKillMediaService(MessageParcel &data, MessageParcel &reply); + void ReleaseClientListener() override; + std::vector GetPlayerPids() override; ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) override; ++ int32_t GetLppCapacityStub(MessageParcel &data, MessageParcel &reply); + int32_t HandleFreezeStubForPids(MessageParcel &data, MessageParcel &reply); + int32_t HandleResetAllProxy(MessageParcel &data, MessageParcel &reply); + void ClientDied(pid_t pid); +diff --git a/services/services/sa_media/server_manager/media_server_manager.cpp b/services/services/sa_media/server_manager/media_server_manager.cpp +index 800e338f1..8579f7162 100644 +--- a/services/services/sa_media/server_manager/media_server_manager.cpp ++++ b/services/services/sa_media/server_manager/media_server_manager.cpp +@@ -50,6 +50,10 @@ + #include "player_xcollie.h" + #include "client/memory_collector_client.h" + #include ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++#include "v1_0/ilow_power_player_factory.h" ++namespace PlayerHDI = OHOS::HDI::LowPowerPlayer::V1_0; ++#endif + + namespace { + constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_PLAYER, "MediaServerManager"}; +@@ -530,6 +534,18 @@ sptr MediaServerManager::CreateLppAudioPlayerStubObject() + #endif + + #ifdef SUPPORT_LPP_VIDEO_STRAMER ++int32_t MediaServerManager::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) { ++ auto factory = PlayerHDI::ILowPowerPlayerFactory::Get(true); ++ CHECK_AND_RETURN_RET_LOG(factory != nullptr, UNKNOWN_ERROR, "MediaServerManager::GetLppCapacity is failed"); ++ PlayerHDI::LppAVCap lppAVCap; ++ int32_t ret = factory->GetAVCapability(lppAVCap); ++ MEDIA_LOGI("MediaServerManager::GetLppCapacity %{public}lu %{public}lu", ++ lppAVCap.videoCap.size(), lppAVCap.audioCap.size()); ++ CHECK_AND_RETURN_RET_LOG(ret == 0, ret, "FAILED MediaServerManager::GetLppCapacity"); ++ lppAvCapability.SetLppAvCapabilityInfo(lppAVCap); ++ return ret; ++} ++ + sptr MediaServerManager::CreateLppVideoPlayerStubObject() + { + MEDIA_LOGI("CreateLppVideoPlayerStubObject start"); +diff --git a/services/services/sa_media/server_manager/media_server_manager.h b/services/services/sa_media/server_manager/media_server_manager.h +index ddc10e4bd..cf1f13ef2 100644 +--- a/services/services/sa_media/server_manager/media_server_manager.h ++++ b/services/services/sa_media/server_manager/media_server_manager.h +@@ -25,10 +25,11 @@ + #include "nocopyable.h" + #include "osal/task/task.h" + #include +- ++#include "lpp_capability.h" + namespace OHOS { + namespace Media { + using DumperEntry = std::function; ++ + struct Dumper { + pid_t pid_; + pid_t uid_; +@@ -79,6 +80,10 @@ public: + #endif + bool CanKillMediaService(); + std::vector GetPlayerPids(); ++#ifdef SUPPORT_LPP_VIDEO_STRAMER ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability); ++#endif ++ + private: + MediaServerManager(); + #ifdef SUPPORT_PLAYER +diff --git a/test/BUILD.gn b/test/BUILD.gn +index b77ddfe3e..5026df271 100644 +--- a/test/BUILD.gn ++++ b/test/BUILD.gn +@@ -106,7 +106,5 @@ group("media_unit_test") { + group("media_fuzz_test") { + testonly = true + deps = [] +- if (player_framework_support_test) { + deps += [ "fuzztest:fuzztest" ] +- } + } +diff --git a/test/fuzztest/avmetadata_fuzztest/avmetadatahelper_fuzzer/BUILD.gn b/test/fuzztest/avmetadata_fuzztest/avmetadatahelper_fuzzer/BUILD.gn +index f56f5c51f..c28ba3a1e 100644 +--- a/test/fuzztest/avmetadata_fuzztest/avmetadatahelper_fuzzer/BUILD.gn ++++ b/test/fuzztest/avmetadata_fuzztest/avmetadatahelper_fuzzer/BUILD.gn +@@ -51,4 +51,10 @@ ohos_fuzztest("AVmetadataHelperFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/avmetadata_fuzztest/avmetadatahelperdatasrc_fuzzer/BUILD.gn b/test/fuzztest/avmetadata_fuzztest/avmetadatahelperdatasrc_fuzzer/BUILD.gn +index c10fb043f..a13ed5c15 100644 +--- a/test/fuzztest/avmetadata_fuzztest/avmetadatahelperdatasrc_fuzzer/BUILD.gn ++++ b/test/fuzztest/avmetadata_fuzztest/avmetadatahelperdatasrc_fuzzer/BUILD.gn +@@ -62,4 +62,16 @@ ohos_fuzztest("AVmetadataHelperDataSrcFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/avmetadata_fuzztest/avmetadatastub_fuzzer/BUILD.gn b/test/fuzztest/avmetadata_fuzztest/avmetadatastub_fuzzer/BUILD.gn +index e9cc035a6..792000b20 100644 +--- a/test/fuzztest/avmetadata_fuzztest/avmetadatastub_fuzzer/BUILD.gn ++++ b/test/fuzztest/avmetadata_fuzztest/avmetadatastub_fuzzer/BUILD.gn +@@ -72,4 +72,10 @@ ohos_fuzztest("AVmetadataStubFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/avmetadata_fuzztest/avmetadatastublocal_fuzzer/BUILD.gn b/test/fuzztest/avmetadata_fuzztest/avmetadatastublocal_fuzzer/BUILD.gn +index 75f52dfe9..5b51b1603 100644 +--- a/test/fuzztest/avmetadata_fuzztest/avmetadatastublocal_fuzzer/BUILD.gn ++++ b/test/fuzztest/avmetadata_fuzztest/avmetadatastublocal_fuzzer/BUILD.gn +@@ -72,4 +72,10 @@ ohos_fuzztest("AVmetadataStubLocalFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/common/stub_common.cpp b/test/fuzztest/common/stub_common.cpp +index dbe61db79..9d37ef03e 100644 +--- a/test/fuzztest/common/stub_common.cpp ++++ b/test/fuzztest/common/stub_common.cpp +@@ -84,5 +84,11 @@ int32_t MediaServiceProxyFuzzer::ResetAllProxy() + { + return 0; + } ++ ++int32_t MediaServiceProxyFuzzer::GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) ++{ ++ (void)lppAvCapability; ++ return 0; ++} + } + } +\ No newline at end of file +diff --git a/test/fuzztest/common/stub_common.h b/test/fuzztest/common/stub_common.h +index d4d0d8465..fbec84cc6 100644 +--- a/test/fuzztest/common/stub_common.h ++++ b/test/fuzztest/common/stub_common.h +@@ -42,6 +42,7 @@ public: + std::vector GetPlayerPids(); + int32_t FreezeStubForPids(const std::set &pidList, bool isProxy); + int32_t ResetAllProxy(); ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability); + private: + static inline BrokerDelegator delegator_; + }; +diff --git a/test/fuzztest/lowpoweravsink_fuzztest/lowpoweraudiosink_fuzzer/BUILD.gn b/test/fuzztest/lowpoweravsink_fuzztest/lowpoweraudiosink_fuzzer/BUILD.gn +index 741d4c9e6..0b013668d 100644 +--- a/test/fuzztest/lowpoweravsink_fuzztest/lowpoweraudiosink_fuzzer/BUILD.gn ++++ b/test/fuzztest/lowpoweravsink_fuzztest/lowpoweraudiosink_fuzzer/BUILD.gn +@@ -88,4 +88,10 @@ ohos_fuzztest("LowPowerAudioSinkFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +\ No newline at end of file +diff --git a/test/fuzztest/lowpoweravsink_fuzztest/lowpowervideosink_fuzzer/BUILD.gn b/test/fuzztest/lowpoweravsink_fuzztest/lowpowervideosink_fuzzer/BUILD.gn +index c04d02a17..6549162fd 100644 +--- a/test/fuzztest/lowpoweravsink_fuzztest/lowpowervideosink_fuzzer/BUILD.gn ++++ b/test/fuzztest/lowpoweravsink_fuzztest/lowpowervideosink_fuzzer/BUILD.gn +@@ -87,4 +87,10 @@ ohos_fuzztest("LowPowerVideoSinkFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +\ No newline at end of file +diff --git a/test/fuzztest/player_fuzztest/playerapi_fuzzer/BUILD.gn b/test/fuzztest/player_fuzztest/playerapi_fuzzer/BUILD.gn +index 1e1c412f4..5d11c1e30 100644 +--- a/test/fuzztest/player_fuzztest/playerapi_fuzzer/BUILD.gn ++++ b/test/fuzztest/player_fuzztest/playerapi_fuzzer/BUILD.gn +@@ -86,4 +86,10 @@ ohos_fuzztest("PlayerApiFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +\ No newline at end of file +diff --git a/test/fuzztest/player_fuzztest/playerdatasrc_fuzzer/BUILD.gn b/test/fuzztest/player_fuzztest/playerdatasrc_fuzzer/BUILD.gn +index 679781a6f..6e7cd6556 100644 +--- a/test/fuzztest/player_fuzztest/playerdatasrc_fuzzer/BUILD.gn ++++ b/test/fuzztest/player_fuzztest/playerdatasrc_fuzzer/BUILD.gn +@@ -86,4 +86,10 @@ ohos_fuzztest("PlayerDataSrcFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/player_fuzztest/playermp4_fuzzer/BUILD.gn b/test/fuzztest/player_fuzztest/playermp4_fuzzer/BUILD.gn +index 7af6a73db..57250f252 100644 +--- a/test/fuzztest/player_fuzztest/playermp4_fuzzer/BUILD.gn ++++ b/test/fuzztest/player_fuzztest/playermp4_fuzzer/BUILD.gn +@@ -72,4 +72,10 @@ ohos_fuzztest("PlayerMp4FuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/player_fuzztest/playersei_fuzzer/BUILD.gn b/test/fuzztest/player_fuzztest/playersei_fuzzer/BUILD.gn +index 92bfc0496..5beb67f81 100644 +--- a/test/fuzztest/player_fuzztest/playersei_fuzzer/BUILD.gn ++++ b/test/fuzztest/player_fuzztest/playersei_fuzzer/BUILD.gn +@@ -88,4 +88,10 @@ ohos_fuzztest("PlayerSeiFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/BUILD.gn b/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/BUILD.gn +index 3f5c3455a..842919407 100644 +--- a/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/BUILD.gn ++++ b/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/BUILD.gn +@@ -65,4 +65,10 @@ ohos_fuzztest("PlayerServiceStubFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/playerservicestub_fuzzer.cpp b/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/playerservicestub_fuzzer.cpp +index 5375ce0fc..2adbafc08 100644 +--- a/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/playerservicestub_fuzzer.cpp ++++ b/test/fuzztest/player_fuzztest/playerservicestub_fuzzer/playerservicestub_fuzzer.cpp +@@ -100,6 +100,11 @@ public: + return 0; + } + ++ int32_t GetLppCapacity(LppAvCapabilityInfo &lppAvCapability) ++ { ++ (void)lppAvCapability; ++ return 0; ++ } + private: + static inline BrokerDelegator delegator_; + }; +diff --git a/test/fuzztest/player_fuzztest/playerstub_fuzzer/BUILD.gn b/test/fuzztest/player_fuzztest/playerstub_fuzzer/BUILD.gn +index 7f2a5f875..9f5d404e6 100644 +--- a/test/fuzztest/player_fuzztest/playerstub_fuzzer/BUILD.gn ++++ b/test/fuzztest/player_fuzztest/playerstub_fuzzer/BUILD.gn +@@ -72,4 +72,10 @@ ohos_fuzztest("PlayerStubFuzzTest") { + "safwk:system_ability_fwk", + "samgr:samgr_proxy", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + } +diff --git a/test/fuzztest/screen_capture_fuzztest/screencaptureservicestub_fuzzer/BUILD.gn b/test/fuzztest/screen_capture_fuzztest/screencaptureservicestub_fuzzer/BUILD.gn +index 6259df197..2a09ec0dc 100644 +--- a/test/fuzztest/screen_capture_fuzztest/screencaptureservicestub_fuzzer/BUILD.gn ++++ b/test/fuzztest/screen_capture_fuzztest/screencaptureservicestub_fuzzer/BUILD.gn +@@ -78,5 +78,11 @@ ohos_fuzztest("ScreenCaptureServiceStubFuzzTest") { + "samgr:samgr_proxy", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + part_name = "player_framework" + } +diff --git a/test/unittest/avmetadatahelper_test/BUILD.gn b/test/unittest/avmetadatahelper_test/BUILD.gn +index fc9a6f0b2..fa8d2d30b 100644 +--- a/test/unittest/avmetadatahelper_test/BUILD.gn ++++ b/test/unittest/avmetadatahelper_test/BUILD.gn +@@ -176,6 +176,12 @@ ohos_unittest("avmetadatahelper_unit_test") { + "samgr:samgr_proxy", + "window_manager:libwm", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + + if (player_framework_support_video) { + external_deps += [ "graphic_surface:surface" ] +diff --git a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp +index 8d4166ebe..e5d703a2b 100644 +--- a/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp ++++ b/test/unittest/avmetadatahelper_test/avmetadatahelper_impl_unit_test.cpp +@@ -114,6 +114,12 @@ int32_t MediaClient::ResetAllProxy() + return 0; + } + ++LppAvCapabilityInfo* MediaClient::GetLppCapacity() ++{ ++ LppAvCapabilityInfo *lppAvCapabilityInfo = new LppAvCapabilityInfo(); ++ return lppAvCapabilityInfo; ++} ++ + namespace Test { + void AVMetadtahelperImplUnitTest::SetUpTestCase(void) {} + +diff --git a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn +index 172487a43..d0b1cc797 100644 +--- a/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn ++++ b/test/unittest/lpp_unit_test/inner/lpp_video_streamer_unit_test/BUILD.gn +@@ -48,6 +48,12 @@ ohos_unittest("lpp_video_streamer_unit_test") { + "media_foundation:media_foundation" + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + resource_config_file = + "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" +-} +\ No newline at end of file ++} +diff --git a/test/unittest/media_server_manager_test/BUILD.gn b/test/unittest/media_server_manager_test/BUILD.gn +index 833753a60..cc4174ef8 100644 +--- a/test/unittest/media_server_manager_test/BUILD.gn ++++ b/test/unittest/media_server_manager_test/BUILD.gn +@@ -125,6 +125,12 @@ ohos_unittest("media_server_manager_test") { + "samgr:samgr_proxy", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_video) { + external_deps += [ "graphic_surface:surface" ] + } +diff --git a/test/unittest/media_service_helper_test/BUILD.gn b/test/unittest/media_service_helper_test/BUILD.gn +index 292d28380..fd91a2a29 100644 +--- a/test/unittest/media_service_helper_test/BUILD.gn ++++ b/test/unittest/media_service_helper_test/BUILD.gn +@@ -67,6 +67,12 @@ ohos_unittest("media_service_helper_unit_test") { + "ipc:ipc_single", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (defined(global_parts_info) && + defined(global_parts_info.multimedia_histreamer_ext)) { + defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] +diff --git a/test/unittest/player_service_stub_test/BUILD.gn b/test/unittest/player_service_stub_test/BUILD.gn +index bd0938811..374bb3469 100644 +--- a/test/unittest/player_service_stub_test/BUILD.gn ++++ b/test/unittest/player_service_stub_test/BUILD.gn +@@ -117,6 +117,12 @@ ohos_unittest("player_service_stub_test") { + external_deps += [ "graphic_surface:surface" ] + } + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (player_framework_support_screen_capture_stopbycall) { + external_deps += [ + "call_manager:tel_call_manager_api", +diff --git a/test/unittest/sa_media_client_unit_test/BUILD.gn b/test/unittest/sa_media_client_unit_test/BUILD.gn +index 475525407..354aca6d0 100644 +--- a/test/unittest/sa_media_client_unit_test/BUILD.gn ++++ b/test/unittest/sa_media_client_unit_test/BUILD.gn +@@ -145,6 +145,12 @@ include_dirs = [ + "$MEDIA_PLAYER_ROOT_DIR/services/services:media_service", + "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", + ] ++ ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } + + resource_config_file = + "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml" +diff --git a/test/unittest/timeout_test/BUILD.gn b/test/unittest/timeout_test/BUILD.gn +index 33812ec07..272035ee1 100644 +--- a/test/unittest/timeout_test/BUILD.gn ++++ b/test/unittest/timeout_test/BUILD.gn +@@ -76,6 +76,12 @@ ohos_unittest("player_timeout_unit_test") { + "window_manager:libwm", + ] + ++ if (player_framework_support_lowpower_av_sink) { ++ external_deps += [ ++ "drivers_interface_lpplayer:liblow_power_player_proxy_1.0", ++ ] ++ } ++ + if (defined(global_parts_info) && + defined(global_parts_info.multimedia_histreamer_ext)) { + defines = [ "SUBSCRIBE_HISTREAMER_EXT" ] +diff --git a/test/unittest/timeout_test/mock/mock_i_media_service.h b/test/unittest/timeout_test/mock/mock_i_media_service.h +index d95abad8c..4e3284a56 100644 +--- a/test/unittest/timeout_test/mock/mock_i_media_service.h ++++ b/test/unittest/timeout_test/mock/mock_i_media_service.h +@@ -71,6 +71,7 @@ public: + MOCK_METHOD(std::shared_ptr, CreateLppVideoStreamerService, (), (override)); + MOCK_METHOD(int32_t, + DestroyLppVideoStreamerService, (std::shared_ptr lppAudioPlayer), (override)); ++ MOCK_METHOD(LppAvCapabilityInfo*, GetLppCapacity, (), (override)); + #endif + + MOCK_METHOD(sptr, GetMonitorProxy, (), (override)); +-- +2.45.2.huawei.10 + -- Gitee From 14db50c5793e3ca90cbef04e7e05735906c5e86f Mon Sep 17 00:00:00 2001 From: zpf Date: Tue, 2 Sep 2025 04:50:00 +0000 Subject: [PATCH 11/11] update bundle.json. Signed-off-by: zpf --- bundle.json | 467 ++++++++++++++++------------------------------------ 1 file changed, 144 insertions(+), 323 deletions(-) diff --git a/bundle.json b/bundle.json index 6b35d622f..2202b6b0f 100644 --- a/bundle.json +++ b/bundle.json @@ -1,323 +1,144 @@ -{ - "name": "@ohos/player_framework", - "description": "Media standard provides atomic capabilities", - "version": "3.1", - "license": "Apache License 2.0", - "publishAs": "code-segment", - "segment": { - "destPath": "foundation/multimedia/player_framework" - }, - "dirs": {}, - "scripts": {}, - "component": { - "name": "player_framework", - "subsystem": "multimedia", - "syscap": [ - "SystemCapability.Multimedia.Media.AVTranscoder", - "SystemCapability.Multimedia.Media.AVMetadataExtractor", - "SystemCapability.Multimedia.Media.AVImageGenerator", - "SystemCapability.Multimedia.SystemSound.Core", - "SystemCapability.Multimedia.AudioHaptic.Core", - "SystemCapability.Multimedia.Media.SoundPool", - "SystemCapability.Multimedia.Media.AVScreenCapture", - "SystemCapability.Multimedia.Media.AudioPlayer", - "SystemCapability.Multimedia.Media.VideoPlayer", - "SystemCapability.Multimedia.Media.AudioRecorder", - "SystemCapability.Multimedia.Media.VideoRecorder", - "SystemCapability.Multimedia.Media.AVPlayer", - "SystemCapability.Multimedia.Media.AVRecorder", - "SystemCapability.Multimedia.Media.LowPowerAVSink = false" - ], - "features": [ - "player_framework_support_player", - "player_framework_support_recorder", - "player_framework_support_player_js_api9", - "player_framework_support_recorder_js_api9", - "player_framework_support_metadata", - "player_framework_support_histreamer", - "player_framework_support_video", - "player_framework_support_jsapi", - "player_framework_support_capi", - "player_framework_support_test", - "player_framework_support_xcollie", - "player_framework_support_jsstack", - "player_framework_support_seccomp", - "player_framework_support_screen_capture", - "player_framework_support_screen_capture_stopbycall", - "player_framework_support_screen_capture_controller", - "player_framework_support_jssoundpool", - "player_framework_support_mediasource", - "player_framework_check_video_is_hdr_vivid", - "player_framework_support_monitor", - "player_framework_support_avsession_background", - "player_framework_support_drm", - "player_framework_support_vibrator", - "player_framework_support_power_manager", - "player_framework_support_json", - "player_framework_feature_pc_select_window", - "player_framework_enable_start_stop_on_demand", - "player_framework_support_lowpower_av_sink" - ], - "adapted_system_type": [ "standard" ], - "rom": "10000KB", - "ram": "10000KB", - "hisysevent_config": [ - "//foundation/multimedia/player_framework/hisysevent.yaml" - ], - "deps": { - "components": [ - "av_session", - "ets_runtime", - "safwk", - "hilog", - "window_manager", - "napi", - "samgr", - "hitrace", - "audio_framework", - "ipc", - "graphic_2d", - "graphic_surface", - "hisysevent", - "c_utils", - "access_token", - "image_framework", - "hiview", - "eventhandler", - "ffrt", - "init", - "input", - "memmgr_override", - "hicollie", - "media_foundation", - "drivers_interface_display", - "openmax", - "hdf_core", - "ability_base", - "ability_runtime", - "bundle_framework", - "distributed_notification_service", - "relational_store", - "resource_management", - "av_codec", - "miscdevice", - "drm_framework", - "qos_manager", - "config_policy", - "power_manager", - "media_library", - "memmgr", - "common_event_service", - "call_manager", - "core_service", - "state_registry", - "resource_schedule_service", - "ffmpeg", - "bounds_checking_function", - "libxml2", - "libuv", - "data_share", - "ringtone_library", - "os_account", - "i18n", - "skia", - "camera_framework", - "drivers_interface_camera", - "image_effect", - "jsoncpp", - "memmgr", - "memmgr_override", - "efficiency_manager", - "hiappevent" - ], - "third_party": [ - "bounds_checking_function" - ] - }, - "build": { - "group_type": { - "base_group": [], - "fwk_group": [ - "//foundation/multimedia/player_framework/interfaces/kits/js:napi_packages", - "//foundation/multimedia/player_framework/interfaces/kits/c:capi_packages", - "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client" - ], - "service_group": [ - "//foundation/multimedia/player_framework/services:media_services_package", - "//foundation/multimedia/player_framework/services/etc:media_service_etc" - ] - }, - "inner_kits": [ - { - "type": "so", - "name": "//foundation/multimedia/player_framework/services/utils:media_service_utils", - "header": { - "header_files": [ - ], - "header_base": "//foundation/multimedia/player_framework/services/utils/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", - "header": { - "header_files": [ - "player.h", - "recorder.h", - "screen_capture.h", - "media_errors.h", - "lpp_audio_streamer.h", - "lpp_video_streamer.h" - ], - "header_base": "//foundation/multimedia/player_framework/interfaces/inner_api/native" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/native/media_service_helper:media_helper_client", - "header": { - "header_files": [ - "media_service_helper.h" - ], - "header_base": "//foundation/multimedia/player_framework/interfaces/inner_api/native/media_service_helper" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/native/video_editor:video_editor", - "header": { - "header_files": [ - "video_editor.h" - ], - "header_base": "//foundation/multimedia/player_framework/interfaces/inner_api/native/video_editor/include" - } - }, - { - "type": "none", - "name": "//foundation/multimedia/player_framework/interfaces/kits/js:napi_packages", - "header": { - "header_files": [ - "native_module_ohos_media.h" - ], - "header_base": "//foundation/multimedia/player_framework/interfaces/kits/js" - } - }, - { - "type": "none", - "name": "//foundation/multimedia/player_framework/frameworks/native/system_sound_manager:system_sound_client", - "header": { - "header_files": [ - "ringtone_player.h", - "system_sound_manager.h", - "system_tone_plyaer.h" - ], - "header_base": "//foundation/multimedia/player_framework/interfaces/inner_api/native/system_sound_manager/include" - } - }, - { - "type": "none", - "name": "//foundation/multimedia/player_framework/frameworks/native/audio_haptic:audio_haptic", - "header": { - "header_files": [ - "audio_haptic_manager.h", - "audio_haptic_player.h" - ], - "header_base": "//foundation/multimedia/player_framework/interfaces/inner_api/native/audio_haptic/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/avplayer:cj_avplayer_ffi", - "header": { - "header_files": [ - "cj_avplayer_ffi.h", - "cj_avplayer_callback.h", - "cj_avplayer_utils.h", - "cj_avplayer.h", - "cj_media_data_source_callback.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/avplayer" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/soundpool:cj_soundpool_ffi", - "header": { - "header_files": [ - "soundpool_ffi.h", - "cj_soundpool_callback.h", - "cj_soundpool.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/soundpool/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/metadatahelper:cj_metadatahelper_ffi", - "header": { - "header_files": [ - "cj_avimagegenerator.h", - "cj_avmetadataextractor.h", - "cj_helperdatasourcecallback.h", - "metadatahelper_ffi.h", - "metadatahelper_util.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/metadatahelper/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/audio_haptic:cj_audiohaptic_ffi", - "header": { - "header_files": [ - "cj_audio_haptic_ffi.h", - "cj_audio_haptic_manager.h", - "cj_audio_haptic_player.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/audio_haptic/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/avscreen_capture:cj_avscreen_capture_ffi", - "header": { - "header_files": [ - "avscreen_capture_ffi.h", - "cj_avscreen_capture_callback.h", - "cj_avscreen_capture.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/avscreen_capture/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/avtranscoder:cj_avtranscoder_ffi", - "header": { - "header_files": [ - "avtranscoder_ffi.h", - "cj_avtranscoder_callback.h", - "cj_avtranscoder.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/avtranscoder/include" - } - }, - { - "type": "so", - "name": "//foundation/multimedia/player_framework/frameworks/cj/avrecorder:cj_media_avrecorder_ffi", - "header": { - "header_files": [ - "avrecorder_ffi.h", - "cj_avrecorder_callback.h", - "cj_avrecorder.h" - ], - "header_base": "//foundation/multimedia/player_framework/frameworks/cj/avrecorder" - } - } - ], - "test": [ - "//foundation/multimedia/player_framework/test:media_fuzz_test", - "//foundation/multimedia/player_framework/test:media_unit_test" - ] - } - } - } +From 6701fcd44304d51185015aed86278f9df7c874d6 Mon Sep 17 00:00:00 2001 +From: h00916961 +Date: Fri, 18 Jul 2025 19:55:51 +0800 +Subject: [PATCH] LppNewInterface Description: + SetLoudnessGain&GetCapability&GetLatestPts Team:EMUI Feature or Bugfix:Bugfix + Binary Source: No PrivateCode(Yes/No):No + +Change-Id: I1be3f044ed23caff8a78aa68ed2d4e4460e5118a +--- + .../player_framework/lowpower_audio_sink.h | 14 +++++++++++++ + .../liblowpower_avsink.ndk.json | 12 +++++++++++ + .../player_framework/lowpower_avsink_base.h | 21 +++++++++++++++++++ + .../player_framework/lowpower_video_sink.h | 14 +++++++++++++ + 4 files changed, 61 insertions(+) + +diff --git a/multimedia/player_framework/lowpower_audio_sink.h b/multimedia/player_framework/lowpower_audio_sink.h +index 9d7c7b4f1..e717b93cd 100644 +--- a/multimedia/player_framework/lowpower_audio_sink.h ++++ b/multimedia/player_framework/lowpower_audio_sink.h +@@ -258,6 +258,20 @@ OH_AVErrCode OH_LowPowerAudioSink_SetPlaybackSpeed(OH_LowPowerAudioSink* sink, c + */ + OH_AVErrCode OH_LowPowerAudioSink_ReturnSamples(OH_LowPowerAudioSink* sink, OH_AVSamplesBuffer* samples); + ++/** ++ * @brief Set the loudness gain for lowpower audio sink. ++ * ++ * @param {OH_LowPowerAudioSink*} sink Pointer to an OH_LowPowerAudioSink instance. ++ * @param {float} loudnessGain Loudness gain to set which changes from -90.0 to 24.0, expressing in dB. ++ * The default loudness gain is 0.0dB. ++ * @return Returns AV_ERR_OK if the gain is set successfully; ++ * otherwise, returns a specific error code as defined in {@link OH_AVErrCode} ++ * {@link AV_ERR_INVALID_VAL} the sink is nullptr or loudnessGain is out of valid range. ++ * {@link AV_ERR_SERVICE_DIED} media service is died. ++ * @since 20 ++ */ ++OH_AVErrCode OH_LowPowerAudioSink_SetLoudnessGain(OH_LowPowerAudioSink* sink, float loudnessGain); ++ + /** + * @brief Regsister callback instance for lowpower audio sink. + * +diff --git a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json +index 1c624517d..05675b021 100644 +--- a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json ++++ b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json +@@ -7,6 +7,10 @@ + "first_introduced": "20", + "name": "OH_AVSamplesBuffer_GetRemainedCapacity" + }, ++ { ++ "first_introduced": "20", ++ "name": "OH_LowPowerAVSink_GetCapability" ++ }, + { + "first_introduced": "20", + "name": "OH_LowPowerAudioSink_CreateByMime" +@@ -67,6 +71,10 @@ + "first_introduced": "20", + "name": "OH_LowPowerAudioSink_ReturnSamples" + }, ++ { ++ "first_introduced": "20", ++ "name": "OH_LowPowerAudioSink_SetLoudnessGain" ++ }, + { + "first_introduced": "20", + "name": "OH_LowPowerAudioSink_RegisterCallback" +@@ -179,6 +187,10 @@ + "first_introduced": "20", + "name": "OH_LowPowerVideoSink_ReturnSamples" + }, ++ { ++ "first_introduced": "20", ++ "name": "OH_LowPowerVideoSink_GetLatestPts" ++ }, + { + "first_introduced": "20", + "name": "OH_LowPowerVideoSink_RegisterCallback" +diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h +index b6171f4bb..60086fa33 100644 +--- a/multimedia/player_framework/lowpower_avsink_base.h ++++ b/multimedia/player_framework/lowpower_avsink_base.h +@@ -53,6 +53,13 @@ extern "C" { + */ + typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; + ++/** ++ * @brief Forward declaration of OH_LowPowerAVSink_Capability. ++ * ++ * @since 20 ++ */ ++typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; ++ + /** + * @brief Append one OH_AVBuffer data to framePacketBuffer instance. + * +@@ -77,6 +84,20 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe + */ + int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); + ++/** ++ * @brief Query the supported capabilities of a lowpower audio/video sink. ++ * ++ * This function queries and returns the capability set supported by the current ++ * lowpower audio/video sink, including but not limited to supported media formats, etc. ++ * ++ * @return {OH_LowPowerAVSink_Capability*} ++ * - A pointer to the capability structure if the sink supports capability queries and the query is successful. ++ * - nullptr if the sink does not support capability queries or the query fails. ++ ++ * @since 20 ++ */ ++OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); ++ + #ifdef __cplusplus + } + #endif +diff --git a/multimedia/player_framework/lowpower_video_sink.h b/multimedia/player_framework/lowpower_video_sink.h +index 6cb076203..f814ab9cc 100644 +--- a/multimedia/player_framework/lowpower_video_sink.h ++++ b/multimedia/player_framework/lowpower_video_sink.h +@@ -341,6 +341,20 @@ OH_AVErrCode OH_LowPowerVideoSink_ReturnSamples(OH_LowPowerVideoSink* sink, OH_A + */ + OH_AVErrCode OH_LowPowerVideoSink_RegisterCallback(OH_LowPowerVideoSink* sink, OH_LowPowerVideoSinkCallback* callback); + ++/** ++ * @brief Get the latest presentation timestamp (PTS) from lowpower video sink. ++ * ++ * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance. ++ * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds). ++ * @return Returns AV_ERR_OK if the timestamp is obtained successfully; ++ * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}: ++ * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid. ++ * {@link AV_ERR_SERVICE_DIED} media service is died. ++ * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted. ++ * @since 20 ++ */ ++OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *sink, int64_t *pts); ++ + /** + * @brief Creates a lowpower video sink callback instance. + * +-- +2.45.2.huawei.10 + -- Gitee