ABI namespace string differs between libraries : GCC libstdc++ and Chromium libc++,
resulting in linker errors [1] during usage of STL classes like std::vector, std::string etc.
[1] ld.lld: error: undefined symbol: eme::IEME::enumerateMediaKeySystems(
std::__Cr::vector<char const*, std::__Cr::allocator<char const*>>*)
This commit introduces a wrapper layer to overcome the abi compatibility issues.
Change-Id: I8457fe67f313ea44e8c66b326fcfc3af06f4363f
Signed-off-by: Gajendra N <gajendra.n@samsung.com>
BuildRequires: pkgconfig(tv-resource-information)
BuildRequires: pkgconfig(vd-win-util)
BuildRequires: pkgconfig(WebProduct)
+BuildRequires: pkgconfig(chromium-efl-platform-api-wrapper)
%if %{tizen_version} >= 60
BuildRequires: pkgconfig(resource-center-api)
%endif
%else
install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-ewk.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/
%endif
+ install -m 0644 "%{_libdir}"/libchromium-efl-platform-api-wrapper.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/
%endif
install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/themes/
%else
%{CHROMIUM_LIB_DIR}/lib/libchromium-ewk.so
%endif
+ %{CHROMIUM_LIB_DIR}/lib/libchromium-efl-platform-api-wrapper.so
%{CHROMIUM_LIB_DIR}/res/images/*.png
%endif
}
}
+tizen_pkg_config("chromium-efl-platform-api-wrapper") {
+ packages = []
+ if (tizen_product_tv) {
+ packages = [ "chromium-efl-platform-api-wrapper" ]
+ }
+}
+
if (enable_wrt_js) {
tizen_pkg_config("appcore-agent") {
packages = [ "appcore-agent" ]
fi
sed -e "s/@PUBLIC_REPO_VERSION@/$PUBLIC_REPO_VERSION/g" \
-e "s/@TIZEN_VERSION@/$DEFAULT_TIZEN_VERSION/g" \
+ -e "s#@RPM_LOCAL_PATH_PREFIX@#$PWD#g" \
tizen_src/build/gbs.conf.in > tizen_src/build/gbs.conf
function getSystemDeps() {
if (ewk_bringup) {
defines += [ "EWK_BRINGUP" ]
}
+ if (platform_api_wrapper) {
+ defines += [ "PLATFORM_API_WRAPPER" ]
+ }
if (tizen_autofill) {
defines += [ "TIZEN_AUTOFILL" ]
}
use_gstreamer_fft = false
ewk_bringup = true
+platform_api_wrapper = true
wayland_bringup = use_wayland
compile_suid_client = true
#
[profile.tztv_9.0_arm-pontusm]
obs = obs.tizen_product_tv
-repos = repo.tv_product_9.0_pontusm, repo.tv_product_9.0_base
+repos = repo.tv_product_9.0_pontusm, repo.tv_product_9.0_base, repo.tv_product_9.0_pontusm_local
buildroot = ~/GBS-ROOT-TZTV_9.0_ARM-PONTUSM
[repo.tv_product_9.0_base]
[repo.tv_product_9.0_pontusm]
url = http://repos.vd.sec.samsung.net/products/tv/official/2025/ONEMAIN/PontusM/latest/repos/product/armv7l/packages/
+[repo.tv_product_9.0_pontusm_local]
+url = @RPM_LOCAL_PATH_PREFIX@/tizen_src/build/local_repository/
+
###############################################
#
# Tizen v8.0 for product tv (PontusM armv7l)
#include "media/filters/ieme_drm_bridge.h"
#include <drmdecrypt_api.h>
+#include <platform-api-wrapper/platform_api_wrapper.h>
#include <algorithm>
#include <limits>
// static
bool IEMEDrmBridge::IsKeySystemSupported(const std::string& key_system) {
CHECK(!key_system.empty());
-#if !defined(EWK_BRINGUP) // FIXME: m126 bringup
- return eme::IEME::isKeySystemSupported(key_system) == eme::kSupported;
+#if defined(PLATFORM_API_WRAPPER)
+ return platform_api_wrapper::isKeySystemSupported(key_system.c_str()) ==
+ eme::kSupported;
+#else
+ return platform_api_wrapper::isKeySystemSupported(key_system) ==
+ eme::kSupported;
#endif
- return false;
}
IEMEDrmBridge::IEMEDrmBridge(
switches::kSingleProcess);
LOG(INFO) << "single process mode:" << std::boolalpha << single_process_mode_;
// TODO(mdebski): what is privacy_mode?
-#if !defined(EWK_BRINGUP) // FIXME: m126 bringup
- cdm_.reset(eme::IEME::create(this, key_system_, false));
+#if defined(PLATFORM_API_WRAPPER)
+ cdm_.reset(
+ platform_api_wrapper::createIEME(this, key_system_.c_str(), false));
+#else
+ cdm_.reset(platform_api_wrapper::createIEME(this, key_system_, false));
#endif
CHECK(cdm_.get());
}
const std::string& message) override;
void onKeyStatusesChange(const std::string& ieme_session_id) override;
void onRemoveComplete(const std::string& ieme_session_id) override;
+ void onHostNetwork(const std::string& session_id,
+ eme::MessageType message_type,
+ const std::string& inMessage,
+ const std::string& inMsgURL,
+ std::string& outMessage) override {}
private:
IEMEDrmBridge(const std::string& key_system,
if (tizen_product_tv) {
configs += [ "//tizen_src/build:WebProduct" ]
configs += [ "//tizen_src/build:drmdecrypt" ]
+ configs += [ "//tizen_src/build:chromium-efl-platform-api-wrapper" ]
}
deps = [
"//base/:base_static",
if (is_clang) {
libs = [ "atomic" ]
- ldflags += [ "-Wl,-rpath=/usr/local/lib/" ]
+ ldflags += [ "-Wl,-rpath=\$ORIGIN/:/usr/local/lib/" ]
}
if (enable_wrt_js) {
#include "renderer/key_systems_tizen.h"
#include <emeCDM/IEME.h>
+#include <platform-api-wrapper/platform_api_wrapper.h>
#include <algorithm>
#include "base/logging.h"
const std::vector<std::string>& key_system_whitelist,
std::vector<std::unique_ptr<media::KeySystemInfo>>* key_systems_info) {
eme::supportedCDMList supportedKeySystems;
-#if !defined(EWK_BRINGUP) // FIXME: m126 bringup
+#if defined(PLATFORM_API_WRAPPER)
+ platform_api_wrapper::vector_wrapper<const char*> supportedKeySystemsCharList;
+ platform_api_wrapper::enumerateMediaKeySystems(&supportedKeySystemsCharList);
+ for (int i = 0; i < supportedKeySystemsCharList.size(); i++) {
+ supportedKeySystems.push_back(supportedKeySystemsCharList[i]);
+ }
+#else
eme::IEME::enumerateMediaKeySystems(&supportedKeySystems);
#endif
+
for (const auto& keySystem : supportedKeySystems) {
if (!key_system_whitelist.empty() &&
std::find(key_system_whitelist.begin(), key_system_whitelist.end(),
--- /dev/null
+cmake_minimum_required(VERSION 3.10)
+project(chromium-efl-platform-api-wrapper)
+
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_COMPILER gcc)
+
+set(CMAKE_CXX_FLAGS "-Wno-error -Wno-unused-variable -Wno-unused-function -Wno-shadow -fPIC -Wno-attributes")
+set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS})
+set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS})
+
+INCLUDE(FindPkgConfig)
+
+pkg_check_modules(PACKAGE_DEPS REQUIRED drmdecrypt)
+
+add_library(chromium-efl-platform-api-wrapper
+ platform_api_wrapper.cc
+ )
+
+target_link_libraries(chromium-efl-platform-api-wrapper ${PACKAGE_DEPS_LIBRARIES})
+target_link_libraries(chromium-efl-platform-api-wrapper stdc++)
+
+target_include_directories(chromium-efl-platform-api-wrapper PUBLIC ${PACKAGE_DEPS_INCLUDE_DIRS})
--- /dev/null
+This directory has to be built in a separate git codebase,
+and the built rpm has to be copied to tizen_src/build/local_repository/
--- /dev/null
+gbs -c ./gbs.conf build -P profile.tztv_9.0_arm-pontusm -A armv7l --include-all $1
--- /dev/null
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: chromium-efl-platform-api-wrapper
+Description: Chromium-Efl Platform Api Wrapper
+Requires: drmdecrypt
+Version: 1.0.0
+
+Libs: -L${libdir} -lchromium-efl-platform-api-wrapper
+Cflags: -I${includedir}/platform-api-wrapper
--- /dev/null
+###############################################
+#
+# Tizen product tv
+#
+[obs.tizen_product_tv]
+url = https://168.219.243.64/api
+
+###############################################
+#
+# Tizen v9.0 for product tv (PontusM armv7l)
+#
+[profile.tztv_9.0_arm-pontusm]
+obs = obs.tizen_product_tv
+repos = repo.tv_product_9.0_pontusm, repo.tv_product_9.0_base
+buildroot = ~/GBS-ROOT-PLATFORM-API-WRAPPER
+
+[repo.tv_product_9.0_base]
+url = http://repos.vd.sec.samsung.net/base/tizen-9.0-base/standard/latest/repos/base/armv7l/packages/
+
+[repo.tv_product_9.0_pontusm]
+url = http://repos.vd.sec.samsung.net/products/tv/official/2025/ONEMAIN/PontusM/latest/repos/product/armv7l/packages/
--- /dev/null
+%define _unpackaged_files_terminate_build 0
+
+Name: chromium-efl-platform-api-wrapper
+Summary: Chromium-Efl Plaform Api Wrapper
+Version: 1.0.0
+Release: 1
+Group: Application
+License: Apache-2.0 and BSD-3-Clause
+Source0: %{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: pkgconfig(drmdecrypt)
+
+%description
+Plaform Api Wrapper
+
+%prep
+%setup -q
+
+%build
+export CXX=/usr/bin/g++
+export CC=/usr/bin/gcc
+export CXXFLAGS="$(echo $CFLAGS | sed 's/-Wl,--as-needed//g')"
+export CXXFLAGS="$(echo $CFLAGS | sed 's/-Wshadow//g')"
+
+%cmake .
+make %{?_smp_mflags}
+
+%install
+
+install -d %{buildroot}/usr/lib/
+install -d %{buildroot}/usr/lib/pkgconfig/
+install -d %{buildroot}/usr/include/platform-api-wrapper/
+
+install -m 0644 ./libchromium-efl-platform-api-wrapper.so %{buildroot}/usr/lib/libchromium-efl-platform-api-wrapper.so
+install -m 0644 ./chromium-efl-platform-api-wrapper.pc %{buildroot}/usr/lib/pkgconfig/chromium-efl-platform-api-wrapper.pc
+install -m 0644 ./platform_api_wrapper.h %{buildroot}/usr/include/platform-api-wrapper/platform_api_wrapper.h
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+/usr/lib/libchromium-efl-platform-api-wrapper.so
+/usr/lib/pkgconfig/chromium-efl-platform-api-wrapper.pc
+/usr/include/platform-api-wrapper/platform_api_wrapper.h
--- /dev/null
+#include "platform_api_wrapper.h"
+
+namespace platform_api_wrapper {
+
+// eme::IEME wrapper impl
+
+void enumerateMediaKeySystems(vector_wrapper<const char*>* list) {
+ eme::supportedCDMList supportedKeySystems;
+ eme::IEME::enumerateMediaKeySystems(&supportedKeySystems);
+ for (auto& it : supportedKeySystems) {
+ list->push_back(it.c_str());
+ }
+}
+
+eme::IEME* createIEME(eme::IEventListener* listener,
+ const char* key_system,
+ bool privacy_mode) {
+ return eme::IEME::create(listener, std::string(key_system), privacy_mode);
+}
+
+eme::Status isKeySystemSupported(const char* key_system) {
+ return eme::IEME::isKeySystemSupported(std::string(key_system));
+}
+
+} // namespace platform_api_wrapper
--- /dev/null
+#include <emeCDM/IEME.h>
+
+namespace platform_api_wrapper {
+
+// Wrapper impl for std::vector
+
+template <typename T>
+class vector_wrapper {
+ public:
+ vector_wrapper() {}
+ ~vector_wrapper() { list_.clear(); }
+ void push_back(T data) { list_.push_back(data); }
+ T& operator[](int index) { return list_[index]; }
+ size_t size() { return list_.size(); }
+
+ private:
+ std::vector<T> list_;
+};
+
+// Wrapper APIs for <emeCDM/IEME.h>
+
+void enumerateMediaKeySystems(vector_wrapper<const char*>* list);
+
+eme::IEME* createIEME(eme::IEventListener* listener,
+ const char* key_system,
+ bool privacy_mode);
+
+eme::Status isKeySystemSupported(const char* key_system);
+
+} // namespace platform_api_wrapper