diff --git a/bundle.json b/bundle.json index 0c85061098ab683ee06b990780947501d5b5a3b3..b88693d7a3cff1b3e75eb501488834e0c6a215c3 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 0000000000000000000000000000000000000000..9a0092b61204b8935b480b13de8cbac5f3e4bdee --- /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 fb320ff3dffc8fa3c9b27e307192111aa34e9725..39bb3d2f623bcbd940849f61163f7580d2fe55b8 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 0000000000000000000000000000000000000000..6e50196495b1636602adf233d519a09755ecb7dc --- /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 8c6e7746240492cbafd5fe8cb5d46c1550895a30..6a1a4ddfe72bdb6a42f56f2995416fe7790d2bf0 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 ea281255c7672c99825e921b8a265154e1c3879a..390858148d255af9b4f02e507ff2dda07b28bb55 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 670d9144c6e3415434e29b86a835c3bb8d246aa1..7f97d9dab6650be32d1b2f8d56447a45543db94e 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 fc9be4192976e4d90d0deb5d1242ce93109141c4..91c1b82045f459cd1ac821481af9955be3b25b07 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 65b455d80b3a82d4178a21a7f47fe1701ced2e75..587d6a8db2631b29f5433d9d36d2c9b3c7428e2a 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 07942cad78e029193b5d004d60f01279aad89b64..48c3137067d61ad5090e9a01c6f09e98ecaadac9 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 9dafe3d18d2f1e451f3aeb4348e4d5e54b7411a9..30224448970672430305c83115f9e1df4d3aad04 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 a5613ca949ef21d96cba13d17fdebb65cc2cc299..d9f24c818478f5757b21ff7b5765fc24e78e0f00 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 763fb4fd63fbc1c26febf0b6a577ab5afbfe2865..70be8921e24cdb240438a4a91b8da0ac1edbf657 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 18472986bf281877ccc2948f98d090be4895159c..4b7a967cdebe75ad592be8ff6fa4e0ba09318b04 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 6ca9e887a8345fd7ef111bfed955eff4ea500aeb..a4af75327296054ba0f99065aad0f1cf8b1833c8 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 5ca786bf41257074fd58ab031de5cdc2a825b290..d8eb3027e299130a524001217473b2af41bece0c 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 e27b3d1b9f98e114b19ce4dc1d80d8b84c03c681..5d4b166a5ad0a1b78acc70b09527c2fb9ce36e2b 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 d53a1b4ed6e48f5a151e1c30d531370b948bdb3b..46b9dc33eb9951df590e1c5961f9a065ea6110eb 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 47ef9ff67d7b554bc77c728b14ac02b217d93cea..e1f7094639da4d98447e367e15ef1b9f10fb4004 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 a8006033982418447cb9811a96672eb650aed221..9e9bc39e52fbe9cfd03ab3f185e33721c0056168 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 b4a771d398dcdfc9d5964307b3cac768a6b7daca..10e04604f41533f2ab91e88ecf7486e0d7a9f5e1 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 d9a5977cf6c17203076a1160750c112cf53c7aad..a8fb99fd58f4d865d12f956396f266ef7b2a4833 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)