From 6b597ce43d124d6c83d95a3f5e9cbbe1f40d8197 Mon Sep 17 00:00:00 2001 From: tengfan66 Date: Thu, 19 Dec 2024 17:38:16 +0800 Subject: [PATCH 1/5] drm adapter update Signed-off-by: tengfan66 --- BUILD.gn | 2 ++ libcef/common/alloy/alloy_content_client.cc | 12 ++++++++ libcef/common/alloy/alloy_content_client.h | 3 ++ .../alloy_ohos_media_drm_bridge_client.cc | 25 ++++++++++++++++ .../alloy_ohos_media_drm_bridge_client.h | 30 +++++++++++++++++++ .../alloy/alloy_content_renderer_client.cc | 2 ++ 6 files changed, 74 insertions(+) create mode 100644 libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc create mode 100644 libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h diff --git a/BUILD.gn b/BUILD.gn index 767c2656a..d96dcd42b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -875,6 +875,8 @@ source_set("libcef_static") { "libcef/common/alloy/alloy_main_delegate.h", "libcef/common/alloy/alloy_main_runner_delegate.cc", "libcef/common/alloy/alloy_main_runner_delegate.h", + "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc", + "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h", "libcef/common/app_manager.cc", "libcef/common/app_manager.h", "libcef/common/base_impl.cc", diff --git a/libcef/common/alloy/alloy_content_client.cc b/libcef/common/alloy/alloy_content_client.cc index b13637216..5daabd5dd 100644 --- a/libcef/common/alloy/alloy_content_client.cc +++ b/libcef/common/alloy/alloy_content_client.cc @@ -46,6 +46,10 @@ #include "libcef/common/cdm_host_file_path.h" #endif +#if BUILDFLAG(IS_OHOS) +#include "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h" +#endif + namespace { // The following plugin-related methods are from @@ -92,6 +96,7 @@ void AlloyContentClient::AddPlugins( void AlloyContentClient::AddContentDecryptionModules( std::vector* cdms, std::vector* cdm_host_file_paths) { + LOG(INFO) << "[NEU][CDM]" << __func__; if (cdms) { RegisterCdmInfo(cdms); } @@ -186,3 +191,10 @@ gfx::Image& AlloyContentClient::GetNativeImageNamed(int resource_id) { return value; } + +#if BUILDFLAG(IS_OHOS) +::media::OHOSMediaDrmBridgeClient* AlloyContentClient::GetMediaDrmBridgeClient() { + LOG(INFO) << "[NEU][CDM]" << __func__; + return new AlloyOHOSMediaDrmBridgeClient(); +} +#endif // BUILDFLAG(IS_OHOS) \ No newline at end of file diff --git a/libcef/common/alloy/alloy_content_client.h b/libcef/common/alloy/alloy_content_client.h index 968bb32c1..1ce9aedef 100644 --- a/libcef/common/alloy/alloy_content_client.h +++ b/libcef/common/alloy/alloy_content_client.h @@ -28,6 +28,9 @@ class AlloyContentClient : public content::ContentClient { ui::ResourceScaleFactor scale_factor) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; gfx::Image& GetNativeImageNamed(int resource_id) override; +#if BUILDFLAG(IS_OHOS) + ::media::OHOSMediaDrmBridgeClient* GetMediaDrmBridgeClient() override; +#endif // BUILDFLAG(IS_OHOS) }; #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_ diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc new file mode 100644 index 000000000..a4f00f24f --- /dev/null +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc @@ -0,0 +1,25 @@ +// Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h" + +#include "base/logging.h" + +AlloyOHOSMediaDrmBridgeClient::AlloyOHOSMediaDrmBridgeClient() {} + +AlloyOHOSMediaDrmBridgeClient::~AlloyOHOSMediaDrmBridgeClient() {} + +void AlloyOHOSMediaDrmBridgeClient::AddKeySystemUUIDMappings(KeySystemUuidMap* map) {} + +media::OHOSMediaDrmBridgeDelegate* +AlloyOHOSMediaDrmBridgeClient::GetMediaDrmBridgeDelegate( + const media::UUID& scheme_uuid) { + LOG(INFO) << "[NEU][CDM]" << __func__; + if (scheme_uuid == widevine_delegate_.GetUUID()) { + LOG(INFO) << "[NEU][CDM]" << __func__; + return &widevine_delegate_; + } + LOG(INFO) << "[NEU][CDM]" << __func__; + return nullptr; +} \ No newline at end of file diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h new file mode 100644 index 000000000..eab9e1ea7 --- /dev/null +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h @@ -0,0 +1,30 @@ +// Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ +#define CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ + +#include "components/cdm/common/widevine_drm_delegate_ohos.h" +#include "media/base/ohos/ohos_media_drm_bridge_client.h" + +class AlloyOHOSMediaDrmBridgeClient : public media::OHOSMediaDrmBridgeClient { + public: + + explicit AlloyOHOSMediaDrmBridgeClient(); + + AlloyOHOSMediaDrmBridgeClient(const AlloyOHOSMediaDrmBridgeClient&) = delete; + AlloyOHOSMediaDrmBridgeClient& operator=(const AlloyOHOSMediaDrmBridgeClient&) = delete; + + ~AlloyOHOSMediaDrmBridgeClient() override; + + private: + void AddKeySystemUUIDMappings(KeySystemUuidMap* map) override; + media::OHOSMediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate( + const media::UUID& scheme_uuid) override; + + std::vector key_system_uuid_mappings_; + cdm::WidevineDrmDelegateOHOS widevine_delegate_; +}; + +#endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index af221e55c..223eecaec 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -608,7 +608,9 @@ bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin( void AlloyContentRendererClient::GetSupportedKeySystems( media::GetSupportedKeySystemsCB cb) { + LOG(INFO) << "[NEU][CDM]" << __func__; GetChromeKeySystems(std::move(cb)); + LOG(INFO) << "[NEU][CDM]" << __func__; } void AlloyContentRendererClient::RunScriptsAtDocumentStart( -- Gitee From 40c2bd15917e616ec83c8048e8cb9626a0f5d910 Mon Sep 17 00:00:00 2001 From: tengfan66 Date: Sat, 21 Dec 2024 18:15:53 +0800 Subject: [PATCH 2/5] drm update Signed-off-by: tengfan66 --- .../alloy/alloy_content_browser_client.cc | 20 +++++++++++++++++++ .../alloy/alloy_content_browser_client.h | 6 ++++++ libcef/browser/prefs/browser_prefs.cc | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 2f08388d1..1146d4ab0 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -193,6 +193,11 @@ #include "libcef/browser/report_manager.h" #endif +//#if BUILDFLAG(ENABLE_MOJO_CDM) && BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) +#include "chrome/browser/media/ohos/cdm/media_drm_storage_factory.h" +#endif + #ifdef OHOS_NETWORK_PROXY #include "net/proxy_resolution/proxy_config_service_ohos.h" #include "net/proxy_resolution/proxy_resolution_service.h" @@ -1999,6 +2004,21 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer( #endif } +#if BUILDFLAG(IS_OHOS) +void AlloyContentBrowserClient::BindMediaServiceReceiver( + content::RenderFrameHost* render_frame_host, + mojo::GenericPendingReceiver receiver) { + LOG(INFO) << "[NEU][CDM]" << __func__; + if (auto r = receiver.As()) { + LOG(INFO) << "[NEU][CDM]" << __func__; + CreateMediaDrmStorage(render_frame_host, std::move(r)); + LOG(INFO) << "[NEU][CDM]" << __func__; + return; + } + LOG(INFO) << "[NEU][CDM]" << __func__; +} +#endif + #if !BUILDFLAG(IS_OHOS) std::unique_ptr AlloyContentBrowserClient::CreateClientCertStore( diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 6f7f6ecb0..9c01e1c83 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -161,6 +161,12 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { service_manager::BinderRegistry* registry, blink::AssociatedInterfaceRegistry* associated_registry, content::RenderProcessHost* render_process_host) override; +#if BUILDFLAG(IS_OHOS) + void BindMediaServiceReceiver( + content::RenderFrameHost* render_frame_host, + mojo::GenericPendingReceiver receiver) override; +#endif + #if !BUILDFLAG(IS_OHOS) std::unique_ptr CreateClientCertStore( content::BrowserContext* browser_context) override; diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index f7c468ea4..eb5e3efda 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -100,6 +100,10 @@ #include "extensions/browser/permissions_manager.h" #endif +#if BUILDFLAG(IS_OHOS) +#include "components/cdm/browser/media_drm_storage_impl.h" +#endif // BUILDFLAG(IS_OHOS) + #include "libcef/browser/ohos_safe_browsing/ohos_sb_prefs.h" #ifdef OHOS_ARKWEB_ADBLOCK @@ -345,6 +349,8 @@ std::unique_ptr CreatePrefService(Profile* profile, #endif #if BUILDFLAG(IS_OHOS) ohos_safe_browsing::RegisterProfilePrefs(registry.get()); + LOG(INFO) << "[NEU][CDM]" << __func__; + cdm::MediaDrmStorageImpl::RegisterProfilePrefs(registry.get()); #endif HostContentSettingsMap::RegisterProfilePrefs(registry.get()); language::LanguagePrefs::RegisterProfilePrefs(registry.get()); -- Gitee From 829bbd4ae9db352fdb1db2d58ed3e91de67f6127 Mon Sep 17 00:00:00 2001 From: tengfan66 Date: Thu, 26 Dec 2024 16:15:03 +0800 Subject: [PATCH 3/5] drm update Signed-off-by: tengfan66 --- BUILD.gn | 9 +++++++-- libcef/browser/alloy/alloy_content_browser_client.cc | 5 ++--- libcef/browser/alloy/alloy_content_browser_client.h | 2 +- libcef/browser/prefs/browser_prefs.cc | 8 +++++--- libcef/common/alloy/alloy_content_client.cc | 6 +++--- libcef/common/alloy/alloy_content_client.h | 2 +- .../common/alloy/alloy_ohos_media_drm_bridge_client.cc | 2 ++ libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h | 2 ++ 8 files changed, 23 insertions(+), 13 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index d96dcd42b..e8e2229ff 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -875,8 +875,6 @@ source_set("libcef_static") { "libcef/common/alloy/alloy_main_delegate.h", "libcef/common/alloy/alloy_main_runner_delegate.cc", "libcef/common/alloy/alloy_main_runner_delegate.h", - "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc", - "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h", "libcef/common/app_manager.cc", "libcef/common/app_manager.h", "libcef/common/base_impl.cc", @@ -1062,6 +1060,13 @@ source_set("libcef_static") { "libcef/renderer/alloy/alloy_content_settings_client.cc", "libcef/renderer/alloy/alloy_content_settings_client.h", ] + + if (defined(ohos_enable_cdm) && ohos_enable_cdm) { + sources += [ + "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc", + "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h", + ] + } } #ifdef OHOS_ITP diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 1146d4ab0..73baa853f 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -193,8 +193,7 @@ #include "libcef/browser/report_manager.h" #endif -//#if BUILDFLAG(ENABLE_MOJO_CDM) && BUILDFLAG(IS_OHOS) -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) #include "chrome/browser/media/ohos/cdm/media_drm_storage_factory.h" #endif @@ -2004,7 +2003,7 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer( #endif } -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) void AlloyContentBrowserClient::BindMediaServiceReceiver( content::RenderFrameHost* render_frame_host, mojo::GenericPendingReceiver receiver) { diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 9c01e1c83..42faa1f0d 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -161,7 +161,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { service_manager::BinderRegistry* registry, blink::AssociatedInterfaceRegistry* associated_registry, content::RenderProcessHost* render_process_host) override; -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) void BindMediaServiceReceiver( content::RenderFrameHost* render_frame_host, mojo::GenericPendingReceiver receiver) override; diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index eb5e3efda..1e6827c44 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -100,9 +100,9 @@ #include "extensions/browser/permissions_manager.h" #endif -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) #include "components/cdm/browser/media_drm_storage_impl.h" -#endif // BUILDFLAG(IS_OHOS) +#endif #include "libcef/browser/ohos_safe_browsing/ohos_sb_prefs.h" @@ -349,9 +349,11 @@ std::unique_ptr CreatePrefService(Profile* profile, #endif #if BUILDFLAG(IS_OHOS) ohos_safe_browsing::RegisterProfilePrefs(registry.get()); +#if defined(OHOS_ENABLE_CDM) LOG(INFO) << "[NEU][CDM]" << __func__; cdm::MediaDrmStorageImpl::RegisterProfilePrefs(registry.get()); - #endif +#endif +#endif HostContentSettingsMap::RegisterProfilePrefs(registry.get()); language::LanguagePrefs::RegisterProfilePrefs(registry.get()); media_router::RegisterProfilePrefs(registry.get()); diff --git a/libcef/common/alloy/alloy_content_client.cc b/libcef/common/alloy/alloy_content_client.cc index 5daabd5dd..865a02ec8 100644 --- a/libcef/common/alloy/alloy_content_client.cc +++ b/libcef/common/alloy/alloy_content_client.cc @@ -46,7 +46,7 @@ #include "libcef/common/cdm_host_file_path.h" #endif -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) #include "libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h" #endif @@ -192,9 +192,9 @@ gfx::Image& AlloyContentClient::GetNativeImageNamed(int resource_id) { return value; } -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) ::media::OHOSMediaDrmBridgeClient* AlloyContentClient::GetMediaDrmBridgeClient() { LOG(INFO) << "[NEU][CDM]" << __func__; return new AlloyOHOSMediaDrmBridgeClient(); } -#endif // BUILDFLAG(IS_OHOS) \ No newline at end of file +#endif \ No newline at end of file diff --git a/libcef/common/alloy/alloy_content_client.h b/libcef/common/alloy/alloy_content_client.h index 1ce9aedef..372ba02d4 100644 --- a/libcef/common/alloy/alloy_content_client.h +++ b/libcef/common/alloy/alloy_content_client.h @@ -28,7 +28,7 @@ class AlloyContentClient : public content::ContentClient { ui::ResourceScaleFactor scale_factor) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; gfx::Image& GetNativeImageNamed(int resource_id) override; -#if BUILDFLAG(IS_OHOS) +#if BUILDFLAG(IS_OHOS) && defined(OHOS_ENABLE_CDM) ::media::OHOSMediaDrmBridgeClient* GetMediaDrmBridgeClient() override; #endif // BUILDFLAG(IS_OHOS) }; diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc index a4f00f24f..aa7ba3e73 100644 --- a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc @@ -16,10 +16,12 @@ media::OHOSMediaDrmBridgeDelegate* AlloyOHOSMediaDrmBridgeClient::GetMediaDrmBridgeDelegate( const media::UUID& scheme_uuid) { LOG(INFO) << "[NEU][CDM]" << __func__; +#if defined(OHOS_ENABLE_WIDEVINE) if (scheme_uuid == widevine_delegate_.GetUUID()) { LOG(INFO) << "[NEU][CDM]" << __func__; return &widevine_delegate_; } +#endif // defined(OHOS_ENABLE_WIDEVINE) LOG(INFO) << "[NEU][CDM]" << __func__; return nullptr; } \ No newline at end of file diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h index eab9e1ea7..7705cd3ce 100644 --- a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h @@ -24,7 +24,9 @@ class AlloyOHOSMediaDrmBridgeClient : public media::OHOSMediaDrmBridgeClient { const media::UUID& scheme_uuid) override; std::vector key_system_uuid_mappings_; +#if defined(OHOS_ENABLE_WIDEVINE) cdm::WidevineDrmDelegateOHOS widevine_delegate_; +#endif // defined(OHOS_ENABLE_WIDEVINE) }; #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ -- Gitee From 8ac783fba644b4e51c897070b35f011b85bf17ac Mon Sep 17 00:00:00 2001 From: tengfan66 Date: Sat, 28 Dec 2024 14:40:41 +0800 Subject: [PATCH 4/5] drm update Signed-off-by: tengfan66 --- libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc | 5 +++-- libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc index aa7ba3e73..3394c0233 100644 --- a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc @@ -10,7 +10,8 @@ AlloyOHOSMediaDrmBridgeClient::AlloyOHOSMediaDrmBridgeClient() {} AlloyOHOSMediaDrmBridgeClient::~AlloyOHOSMediaDrmBridgeClient() {} -void AlloyOHOSMediaDrmBridgeClient::AddKeySystemUUIDMappings(KeySystemUuidMap* map) {} +void AlloyOHOSMediaDrmBridgeClient::AddKeySystemUUIDMappings( + KeySystemUuidMap* map) {} media::OHOSMediaDrmBridgeDelegate* AlloyOHOSMediaDrmBridgeClient::GetMediaDrmBridgeDelegate( @@ -21,7 +22,7 @@ AlloyOHOSMediaDrmBridgeClient::GetMediaDrmBridgeDelegate( LOG(INFO) << "[NEU][CDM]" << __func__; return &widevine_delegate_; } -#endif // defined(OHOS_ENABLE_WIDEVINE) +#endif // defined(OHOS_ENABLE_WIDEVINE) LOG(INFO) << "[NEU][CDM]" << __func__; return nullptr; } \ No newline at end of file diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h index 7705cd3ce..71bc09809 100644 --- a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ +#ifndef CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ #define CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ #include "components/cdm/common/widevine_drm_delegate_ohos.h" @@ -10,11 +10,11 @@ class AlloyOHOSMediaDrmBridgeClient : public media::OHOSMediaDrmBridgeClient { public: - explicit AlloyOHOSMediaDrmBridgeClient(); AlloyOHOSMediaDrmBridgeClient(const AlloyOHOSMediaDrmBridgeClient&) = delete; - AlloyOHOSMediaDrmBridgeClient& operator=(const AlloyOHOSMediaDrmBridgeClient&) = delete; + AlloyOHOSMediaDrmBridgeClient& operator=( + const AlloyOHOSMediaDrmBridgeClient&) = delete; ~AlloyOHOSMediaDrmBridgeClient() override; @@ -26,7 +26,7 @@ class AlloyOHOSMediaDrmBridgeClient : public media::OHOSMediaDrmBridgeClient { std::vector key_system_uuid_mappings_; #if defined(OHOS_ENABLE_WIDEVINE) cdm::WidevineDrmDelegateOHOS widevine_delegate_; -#endif // defined(OHOS_ENABLE_WIDEVINE) +#endif // defined(OHOS_ENABLE_WIDEVINE) }; #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ -- Gitee From 40008e2c11dc1a81b7354c00794e97a8d59c3937 Mon Sep 17 00:00:00 2001 From: tengfan66 Date: Mon, 30 Dec 2024 18:04:29 +0800 Subject: [PATCH 5/5] drm update Signed-off-by: tengfan66 --- libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc | 2 -- libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc index 3394c0233..6f6b131ac 100644 --- a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.cc @@ -17,12 +17,10 @@ media::OHOSMediaDrmBridgeDelegate* AlloyOHOSMediaDrmBridgeClient::GetMediaDrmBridgeDelegate( const media::UUID& scheme_uuid) { LOG(INFO) << "[NEU][CDM]" << __func__; -#if defined(OHOS_ENABLE_WIDEVINE) if (scheme_uuid == widevine_delegate_.GetUUID()) { LOG(INFO) << "[NEU][CDM]" << __func__; return &widevine_delegate_; } -#endif // defined(OHOS_ENABLE_WIDEVINE) LOG(INFO) << "[NEU][CDM]" << __func__; return nullptr; } \ No newline at end of file diff --git a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h index 71bc09809..2a46f35df 100644 --- a/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h +++ b/libcef/common/alloy/alloy_ohos_media_drm_bridge_client.h @@ -24,9 +24,7 @@ class AlloyOHOSMediaDrmBridgeClient : public media::OHOSMediaDrmBridgeClient { const media::UUID& scheme_uuid) override; std::vector key_system_uuid_mappings_; -#if defined(OHOS_ENABLE_WIDEVINE) cdm::WidevineDrmDelegateOHOS widevine_delegate_; -#endif // defined(OHOS_ENABLE_WIDEVINE) }; #endif // CEF_LIBCEF_COMMON_ALLOY_ALLOY_OHOS_MEDIA_DRM_BRIDGE_CLIENT_H_ -- Gitee