From 160e11076f48b35996e20b513b42eac3a42f5a23 Mon Sep 17 00:00:00 2001 From: qwj Date: Wed, 10 Sep 2025 15:15:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Einner=20api=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E8=A7=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qwj --- bundle.json | 3 +- frameworks/native/avcodec/avcodec_monitor.cpp | 32 +++++++++++++++ interfaces/inner_api/native/BUILD.gn | 1 + interfaces/inner_api/native/avcodec_monitor.h | 41 +++++++++++++++++++ services/include/i_avcodec_service.h | 9 ++++ .../common/event_manager/event_manager.cpp | 1 + services/services/common/instance_info.h | 1 + .../sa_avcodec/client/avcodec_client.cpp | 8 ++++ .../sa_avcodec/client/avcodec_client.h | 1 + .../ipc/av_codec_service_ipc_interface_code.h | 3 +- .../sa_avcodec/ipc/avcodec_service_proxy.cpp | 18 ++++++++ .../sa_avcodec/ipc/avcodec_service_proxy.h | 1 + .../sa_avcodec/ipc/avcodec_service_stub.cpp | 13 ++++++ .../sa_avcodec/ipc/avcodec_service_stub.h | 1 + .../ipc/i_standard_avcodec_service.h | 1 + .../sa_avcodec/server/avcodec_server.cpp | 6 +++ .../server/avcodec_server_manager.cpp | 15 +++++++ .../server/include/avcodec_server.h | 1 + .../server/include/avcodec_server_manager.h | 2 + .../mock/avcodec_service_stub_mock.cpp | 8 ++++ .../mock/include/avcodec_service_stub.h | 3 ++ .../videodec_func_unit_test.cpp | 21 ++++++++++ 22 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 frameworks/native/avcodec/avcodec_monitor.cpp create mode 100644 interfaces/inner_api/native/avcodec_monitor.h diff --git a/bundle.json b/bundle.json index 0c8506109..b88693d7a 100644 --- a/bundle.json +++ b/bundle.json @@ -140,7 +140,8 @@ "avcodec_common.h", "avcodec_info.h", "avcodec_list.h", - "avcodec_mime_type.h" + "avcodec_mime_type.h", + "avcodec_monitor.h" ], "header_base": "//foundation/multimedia/av_codec/interfaces/inner_api/native" } diff --git a/frameworks/native/avcodec/avcodec_monitor.cpp b/frameworks/native/avcodec/avcodec_monitor.cpp new file mode 100644 index 000000000..9a0092b61 --- /dev/null +++ b/frameworks/native/avcodec/avcodec_monitor.cpp @@ -0,0 +1,32 @@ +/* + * 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. + */ + +#include "avcodec_monitor.h" +#include "avcodec_log.h" +#include "i_avcodec_service.h" + +namespace { +constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_FRAMEWORK, "AVCodecMonitor"}; +} + +namespace OHOS { +namespace MediaAVCodec { +int32_t AVCodecMonitor::GetActiveSecureDecoderPids(std::vector &pidList) +{ + AVCODEC_LOGD("GetActiveSecureDecoderPids entry"); + return AVCodecServiceFactory::GetInstance().GetActiveSecureDecoderPids(pidList); +} +} // namespace MediaAVCodec +} // namespace OHOS diff --git a/interfaces/inner_api/native/BUILD.gn b/interfaces/inner_api/native/BUILD.gn index fb320ff3d..39bb3d2f6 100644 --- a/interfaces/inner_api/native/BUILD.gn +++ b/interfaces/inner_api/native/BUILD.gn @@ -216,6 +216,7 @@ ohos_shared_library("av_codec_client") { sources = [ "$av_codec_root_dir/frameworks/native/avcodec/avcodec_suspend.cpp", + "$av_codec_root_dir/frameworks/native/avcodec/avcodec_monitor.cpp", "$av_codec_root_dir/frameworks/native/common/avcodec_errors.cpp", "$av_codec_root_dir/services/dfx/avcodec_dfx_component.cpp", "$av_codec_root_dir/services/services/sa_avcodec/client/avcodec_client.cpp", diff --git a/interfaces/inner_api/native/avcodec_monitor.h b/interfaces/inner_api/native/avcodec_monitor.h new file mode 100644 index 000000000..6e5019649 --- /dev/null +++ b/interfaces/inner_api/native/avcodec_monitor.h @@ -0,0 +1,41 @@ +/* + * 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 MEDIA_AVCODEC_MONITOR_H +#define MEDIA_AVCODEC_MONITOR_H + +#include +#include + +namespace OHOS { +namespace MediaAVCodec { +class AVCodecMonitor { +public: + /** + * @brief Get active secure decoder pids. + * + * @param pidList The list of pids + * @return Returns {@link AVCS_ERR_OK} if success; returns an error code otherwise. + * @since 5.1 + */ + static int32_t GetActiveSecureDecoderPids(std::vector &pidList); + +private: + AVCodecMonitor() = default; + ~AVCodecMonitor() = default; +}; +} // namespace MediaAVCodec +} // namespace OHOS +#endif // MEDIA_AVCODEC_MONITOR_H diff --git a/services/include/i_avcodec_service.h b/services/include/i_avcodec_service.h index 8c6e77462..6a1a4ddfe 100644 --- a/services/include/i_avcodec_service.h +++ b/services/include/i_avcodec_service.h @@ -59,6 +59,15 @@ public: */ virtual int32_t SuspendActiveAll() = 0; + /** + * @brief Get active secure decoder pids. + * + * @param pidList The list of pids + * @return Returns {@link AVCS_ERR_OK} if success; returns an error code otherwise. + * @since 5.1 + */ + virtual int32_t GetActiveSecureDecoderPids(std::vector &pidList) = 0; + #ifdef SUPPORT_CODECLIST /** * @brief Create a codeclist service. diff --git a/services/services/common/event_manager/event_manager.cpp b/services/services/common/event_manager/event_manager.cpp index ea281255c..390858148 100644 --- a/services/services/common/event_manager/event_manager.cpp +++ b/services/services/common/event_manager/event_manager.cpp @@ -73,6 +73,7 @@ void EventManager::OnInstanceInitEvent(Media::Meta &meta) meta.GetData(Media::Tag::AV_CODEC_FORWARD_CALLER_UID, instanceInfo.forwardCaller.uid); meta.GetData(Media::Tag::AV_CODEC_FORWARD_CALLER_PROCESS_NAME, instanceInfo.forwardCaller.processName); meta.GetData(EventInfoExtentedKey::CODEC_TYPE.data(), instanceInfo.codecType); + meta.GetData(Media::Tag::MEDIA_CODEC_NAME, instanceInfo.codecName); AVCodecServerManager::GetInstance().SetInstanceInfoByInstanceId(instanceId, instanceInfo); } diff --git a/services/services/common/instance_info.h b/services/services/common/instance_info.h index 670d9144c..7f97d9dab 100644 --- a/services/services/common/instance_info.h +++ b/services/services/common/instance_info.h @@ -58,6 +58,7 @@ struct InstanceInfo { CallerInfo forwardCaller; AVCodecType codecType; uint32_t memoryUsage = 0; + std::string codecName = ""; void Print() { diff --git a/services/services/sa_avcodec/client/avcodec_client.cpp b/services/services/sa_avcodec/client/avcodec_client.cpp index fc9be4192..91c1b8204 100644 --- a/services/services/sa_avcodec/client/avcodec_client.cpp +++ b/services/services/sa_avcodec/client/avcodec_client.cpp @@ -112,6 +112,14 @@ int32_t AVCodecClient::SuspendActiveAll() return avCodecProxy->SuspendActiveAll(); } +int32_t AVCodecClient::GetActiveSecureDecoderPids(std::vector &pidList) +{ + std::lock_guard lock(mutex_); + auto avCodecProxy = GetTemporaryAVCodecProxy(); + CHECK_AND_RETURN_RET_LOG(avCodecProxy != nullptr, AVCS_ERR_SERVICE_DIED, "AVCodec proxy does not exist"); + return avCodecProxy->GetActiveSecureDecoderPids(pidList); +} + #ifdef SUPPORT_CODEC int32_t AVCodecClient::CreateCodecService(std::shared_ptr &codecClient) { diff --git a/services/services/sa_avcodec/client/avcodec_client.h b/services/services/sa_avcodec/client/avcodec_client.h index 65b455d80..587d6a8db 100644 --- a/services/services/sa_avcodec/client/avcodec_client.h +++ b/services/services/sa_avcodec/client/avcodec_client.h @@ -39,6 +39,7 @@ public: int32_t SuspendFreeze(const std::vector &pidList) override; int32_t SuspendActive(const std::vector &pidList) override; int32_t SuspendActiveAll() override; + int32_t GetActiveSecureDecoderPids(std::vector &pidList) override; #ifdef SUPPORT_CODEC int32_t CreateCodecService(std::shared_ptr &codecClient) override; diff --git a/services/services/sa_avcodec/ipc/av_codec_service_ipc_interface_code.h b/services/services/sa_avcodec/ipc/av_codec_service_ipc_interface_code.h index 07942cad7..48c313706 100644 --- a/services/services/sa_avcodec/ipc/av_codec_service_ipc_interface_code.h +++ b/services/services/sa_avcodec/ipc/av_codec_service_ipc_interface_code.h @@ -75,7 +75,8 @@ enum class AVCodecServiceInterfaceCode { GET_SUBSYSTEM = 0, FREEZE, ACTIVE, - ACTIVEALL + ACTIVEALL, + GET_ACTIVE_SECURE_DECODER_PIDS }; } // namespace MediaAVCodec } // namespace OHOS diff --git a/services/services/sa_avcodec/ipc/avcodec_service_proxy.cpp b/services/services/sa_avcodec/ipc/avcodec_service_proxy.cpp index 9dafe3d18..302244489 100644 --- a/services/services/sa_avcodec/ipc/avcodec_service_proxy.cpp +++ b/services/services/sa_avcodec/ipc/avcodec_service_proxy.cpp @@ -106,5 +106,23 @@ int32_t AVCodecServiceProxy::SuspendActiveAll() "Create av_codec proxy failed, error: %{public}d", error); return reply.ReadInt32(); } + +int32_t AVCodecServiceProxy::GetActiveSecureDecoderPids(std::vector &pidList) +{ + MessageParcel data; + MessageParcel reply; + MessageOption option; + + bool ret = data.WriteInterfaceToken(AVCodecServiceProxy::GetDescriptor()); + CHECK_AND_RETURN_RET_LOG(ret, AVCS_ERR_IPC_GET_SUB_SYSTEM_ABILITY_FAILED, "Failed to write descriptor"); + + int error = Remote()->SendRequest(static_cast( + AVCodecServiceInterfaceCode::GET_ACTIVE_SECURE_DECODER_PIDS), data, reply, option); + CHECK_AND_RETURN_RET_LOG(error == 0, AVCS_ERR_IPC_GET_SUB_SYSTEM_ABILITY_FAILED, + "Create av_codec proxy failed, error: %{public}d", error); + + (void)reply.ReadInt32Vector(&pidList); + return reply.ReadInt32(); +} } // namespace MediaAVCodec } // namespace OHOS diff --git a/services/services/sa_avcodec/ipc/avcodec_service_proxy.h b/services/services/sa_avcodec/ipc/avcodec_service_proxy.h index a5613ca94..d9f24c818 100644 --- a/services/services/sa_avcodec/ipc/avcodec_service_proxy.h +++ b/services/services/sa_avcodec/ipc/avcodec_service_proxy.h @@ -30,6 +30,7 @@ public: int32_t SuspendFreeze(const std::vector &pidList) override; int32_t SuspendActive(const std::vector &pidList) override; int32_t SuspendActiveAll() override; + int32_t GetActiveSecureDecoderPids(std::vector &pidList) override; private: static inline BrokerDelegator delegator_; diff --git a/services/services/sa_avcodec/ipc/avcodec_service_stub.cpp b/services/services/sa_avcodec/ipc/avcodec_service_stub.cpp index 763fb4fd6..70be8921e 100644 --- a/services/services/sa_avcodec/ipc/avcodec_service_stub.cpp +++ b/services/services/sa_avcodec/ipc/avcodec_service_stub.cpp @@ -99,6 +99,9 @@ int AVCodecServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Mess case static_cast(AVCodecServiceInterfaceCode::ACTIVEALL): ret = OnSuspendActiveAll(data, reply); break; + case static_cast(AVCodecServiceInterfaceCode::GET_ACTIVE_SECURE_DECODER_PIDS): + ret = OnGetActiveSecureDecoderPids(data, reply); + break; default: AVCODEC_LOGW("AVCodecServiceStub: no member func supporting, applying default process"); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); @@ -186,5 +189,15 @@ int32_t AVCodecServiceStub::OnSuspendActiveAll(MessageParcel &data, MessageParce return AVCS_ERR_OK; } + +int32_t AVCodecServiceStub::OnGetActiveSecureDecoderPids(MessageParcel &data, MessageParcel &reply) +{ + std::vector pidList; + int32_t ret = GetActiveSecureDecoderPids(pidList); + (void)reply.WriteInt32Vector(pidList); + (void)reply.WriteInt32(ret); + + return AVCS_ERR_OK; +} } // namespace MediaAVCodec } // namespace OHOS diff --git a/services/services/sa_avcodec/ipc/avcodec_service_stub.h b/services/services/sa_avcodec/ipc/avcodec_service_stub.h index 18472986b..4b7a967cd 100644 --- a/services/services/sa_avcodec/ipc/avcodec_service_stub.h +++ b/services/services/sa_avcodec/ipc/avcodec_service_stub.h @@ -38,6 +38,7 @@ private: int32_t OnSuspendFreeze(MessageParcel &data, MessageParcel &reply); int32_t OnSuspendActive(MessageParcel &data, MessageParcel &reply); int32_t OnSuspendActiveAll(MessageParcel &data, MessageParcel &reply); + int32_t OnGetActiveSecureDecoderPids(MessageParcel &data, MessageParcel &reply); void ClientDied(pid_t pid); int32_t DestroyStubForPid(pid_t pid); diff --git a/services/services/sa_avcodec/ipc/i_standard_avcodec_service.h b/services/services/sa_avcodec/ipc/i_standard_avcodec_service.h index 6ca9e887a..a4af75327 100644 --- a/services/services/sa_avcodec/ipc/i_standard_avcodec_service.h +++ b/services/services/sa_avcodec/ipc/i_standard_avcodec_service.h @@ -38,6 +38,7 @@ public: virtual int32_t SuspendFreeze(const std::vector &pidList) = 0; virtual int32_t SuspendActive(const std::vector &pidList) = 0; virtual int32_t SuspendActiveAll() = 0; + virtual int32_t GetActiveSecureDecoderPids(std::vector &pidList) = 0; DECLARE_INTERFACE_DESCRIPTOR(u"IStandardAVCodecServiceInterface"); }; diff --git a/services/services/sa_avcodec/server/avcodec_server.cpp b/services/services/sa_avcodec/server/avcodec_server.cpp index 5ca786bf4..d8eb3027e 100644 --- a/services/services/sa_avcodec/server/avcodec_server.cpp +++ b/services/services/sa_avcodec/server/avcodec_server.cpp @@ -155,6 +155,12 @@ int32_t AVCodecServer::SuspendActiveAll() return AVCS_ERR_OK; } +int32_t AVCodecServer::GetActiveSecureDecoderPids(std::vector &pidList) +{ + pidList = AVCodecServerManager::GetInstance().GetActiveSecureDecoderPids(); + return AVCS_ERR_OK; +} + int32_t AVCodecServer::Dump(int32_t fd, const std::vector &args) { if (fd <= 0) { diff --git a/services/services/sa_avcodec/server/avcodec_server_manager.cpp b/services/services/sa_avcodec/server/avcodec_server_manager.cpp index e27b3d1b9..5d4b166a5 100644 --- a/services/services/sa_avcodec/server/avcodec_server_manager.cpp +++ b/services/services/sa_avcodec/server/avcodec_server_manager.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "avcodec_dump_utils.h" #include "avcodec_errors.h" #include "avcodec_log.h" @@ -379,6 +380,20 @@ void AVCodecServerManager::SetInstanceInfoByInstanceId(int32_t instanceId, const } } +std::vector AVCodecServerManager::GetActiveSecureDecoderPids() +{ + std::shared_lock lock(mutex_); + std::unordered_set securePidsSet; + for (auto iter = codecStubMap_.begin(); iter != codecStubMap_.end(); iter++) { + auto codecName = iter->second.second.codecName; + if (codecName.find(SECURE_SUFFIX) != std::string::npos) { + securePidsSet.insert(iter->first); + } + } + AVCODEC_LOGD("GetActiveSecureDecoderPids securePidsSet.size: %{public}lu", securePidsSet.size()); + return std::vector(securePidsSet.begin(), securePidsSet.end()); +} + void AVCodecServerManager::AsyncExecutor::Commit(sptr obj) { std::lock_guard lock(listMutex_); diff --git a/services/services/sa_avcodec/server/include/avcodec_server.h b/services/services/sa_avcodec/server/include/avcodec_server.h index d53a1b4ed..46b9dc33e 100644 --- a/services/services/sa_avcodec/server/include/avcodec_server.h +++ b/services/services/sa_avcodec/server/include/avcodec_server.h @@ -35,6 +35,7 @@ public: int32_t SuspendFreeze(const std::vector &pidList) override; int32_t SuspendActive(const std::vector &pidList) override; int32_t SuspendActiveAll() override; + int32_t GetActiveSecureDecoderPids(std::vector &pidList) override; protected: // SystemAbility override diff --git a/services/services/sa_avcodec/server/include/avcodec_server_manager.h b/services/services/sa_avcodec/server/include/avcodec_server_manager.h index 47ef9ff67..e1f709463 100644 --- a/services/services/sa_avcodec/server/include/avcodec_server_manager.h +++ b/services/services/sa_avcodec/server/include/avcodec_server_manager.h @@ -49,6 +49,7 @@ public: std::optional GetInstanceInfoByInstanceId(int32_t instanceId); std::optional GetCodecInstanceByInstanceId(int32_t instanceId); void SetInstanceInfoByInstanceId(int32_t instanceId, const InstanceInfo &info); + std::vector GetActiveSecureDecoderPids(); private: AVCodecServerManager(); @@ -88,6 +89,7 @@ private: static constexpr char LIB_PATH[] = "libmemmgrclient.z.so"; static constexpr char NOTIFY_STATUS_FUNC_NAME[] = "notify_process_status"; static constexpr char SET_CRITICAL_FUNC_NAME[] = "set_critical"; + static constexpr char SECURE_SUFFIX[] = ".secure"; std::shared_ptr libMemMgrClientHandle_ = nullptr; NotifyProcessStatusFunc notifyProcessStatusFunc_ = nullptr; SetCriticalFunc setCriticalFunc_ = nullptr; diff --git a/test/unittest/video_test/sa_avcodec_test/mock/avcodec_service_stub_mock.cpp b/test/unittest/video_test/sa_avcodec_test/mock/avcodec_service_stub_mock.cpp index a80060339..9e9bc39e5 100644 --- a/test/unittest/video_test/sa_avcodec_test/mock/avcodec_service_stub_mock.cpp +++ b/test/unittest/video_test/sa_avcodec_test/mock/avcodec_service_stub_mock.cpp @@ -99,5 +99,13 @@ int32_t AVCodecServiceStub::SuspendActiveAll() UNITTEST_CHECK_AND_RETURN_RET_LOG(mock != nullptr, AVCS_ERR_UNKNOWN, "mock object is nullptr"); return mock->SuspendActiveAll(); } + +int32_t AVCodecServiceStub::GetActiveSecureDecoderPids(std::vector &pidList) +{ + std::lock_guard lock(g_mutex); + auto mock = g_mockObject.lock(); + UNITTEST_CHECK_AND_RETURN_RET_LOG(mock != nullptr, AVCS_ERR_UNKNOWN, "mock object is nullptr"); + return mock->GetActiveSecureDecoderPids(pidList); +} } // namespace MediaAVCodec } // namespace OHOS diff --git a/test/unittest/video_test/sa_avcodec_test/mock/include/avcodec_service_stub.h b/test/unittest/video_test/sa_avcodec_test/mock/include/avcodec_service_stub.h index b4a771d39..10e04604f 100644 --- a/test/unittest/video_test/sa_avcodec_test/mock/include/avcodec_service_stub.h +++ b/test/unittest/video_test/sa_avcodec_test/mock/include/avcodec_service_stub.h @@ -40,6 +40,7 @@ public: virtual int32_t SuspendFreeze(const std::vector &pidList) = 0; virtual int32_t SuspendActive(const std::vector &pidList) = 0; virtual int32_t SuspendActiveAll() = 0; + virtual int32_t GetActiveSecureDecoderPids(std::vector &pidList) = 0; DECLARE_INTERFACE_DESCRIPTOR(u"IStandardAVCodecServiceInterface"); }; @@ -56,6 +57,7 @@ public: MOCK_METHOD(int32_t, SuspendFreeze, (const std::vector &pidList)); MOCK_METHOD(int32_t, SuspendActive, (const std::vector &pidList)); MOCK_METHOD(int32_t, SuspendActiveAll, ()); + MOCK_METHOD(int32_t, GetActiveSecureDecoderPids, (std::vector &pidList)); MOCK_METHOD(int32_t, SetDeathListener, (const sptr &object)); }; @@ -70,6 +72,7 @@ public: int32_t SuspendFreeze(const std::vector &pidList); int32_t SuspendActive(const std::vector &pidList); int32_t SuspendActiveAll(); + int32_t GetActiveSecureDecoderPids(std::vector &pidList); int32_t SetDeathListener(const sptr &object); }; diff --git a/test/unittest/video_test/vcodec_framework_test/videodec_func_unit_test.cpp b/test/unittest/video_test/vcodec_framework_test/videodec_func_unit_test.cpp index d9a5977cf..a8fb99fd5 100644 --- a/test/unittest/video_test/vcodec_framework_test/videodec_func_unit_test.cpp +++ b/test/unittest/video_test/vcodec_framework_test/videodec_func_unit_test.cpp @@ -17,6 +17,7 @@ #include #include "meta/meta_key.h" #include "unittest_utils.h" +#include "avcodec_monitor.h" #ifdef VIDEODEC_CAPI_UNIT_TEST #include "native_avmagic.h" #include "videodec_capi_mock.h" @@ -549,6 +550,26 @@ HWTEST_P(TEST_SUIT, VideoDecoder_RenderOutputBufferAtTime_001, TestSize.Level1) EXPECT_EQ(AV_ERR_OK, videoDec_->Start()); EXPECT_EQ(AV_ERR_OK, videoDec_->Stop()); } + +/** + * @tc.name: VideoEncoder_GET_SECURE_DECODER_PIDS_001 + * @tc.desc: get secure decoder pids + * @tc.type: FUNC + */ +HWTEST_F(TEST_SUIT, VideoDecoder_GET_SECURE_DECODER_PIDS_001, TestSize.Level1) +{ + ASSERT_TRUE(CreateVideoCodecByName("OMX.hisi.video.decoder.avc.secure")); + std::vector pidList; + auto ret = AVCodecMonitor::GetActiveSecureDecoderPids(pidList); + ASSERT_EQ(AVCS_ERR_OK, ret); + pid_t pid = getpid(); + ASSERT_TRUE(std::find(pidList.begin(), pidList.end(), pid) != pidList.end()); + videoDec_->Release(); + + ret = AVCodecMonitor::GetActiveSecureDecoderPids(pidList); + ASSERT_EQ(AVCS_ERR_OK, ret); + ASSERT_TRUE(std::find(pidList.begin(), pidList.end(), pid) == pidList.end()); +} } // namespace int main(int argc, char **argv) -- Gitee