Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if(WIN32)
list(APPEND DEPLIBS ${dlfcn-win32_LIBRARIES})
include_directories(${dlfcn-win32_INCLUDE_DIRS})
else()
list(APPEND DEPLIBS ${CMAKE_DL_LIBS})
# Required on some old linux platforms to use macro like PRIu64
add_definitions(-D__STDC_FORMAT_MACROS)
# Force symbol visibility hidden by default for operative systems different than Windows,
Expand Down Expand Up @@ -94,16 +93,6 @@ endforeach()
get_property(DEPS_NAMES_LIST GLOBAL PROPERTY GlobalDepsNamesList)
list(APPEND DEPLIBS ${DEPS_NAMES_LIST})

# Add additional shared dependencies
get_property(DEPS_FOLDERS_LIST GLOBAL PROPERTY GlobalSharedDepsFoldersList)
foreach(DEP_FOLDER ${DEPS_FOLDERS_LIST})
add_subdirectory(${DEP_FOLDER})
endforeach()
get_property(DEPS_NAMES_LIST GLOBAL PROPERTY GlobalSharedDepsNamesList)
foreach(DEP_NAME ${DEPS_NAMES_LIST})
list(APPEND ADP_ADDITIONAL_BINARY $<TARGET_FILE:${DEP_NAME}>)
endforeach()

build_addon(inputstream.adaptive ADP DEPLIBS)

if(NOT CMAKE_CROSSCOMPILING AND BUILD_TESTING)
Expand Down
6 changes: 0 additions & 6 deletions Helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,3 @@ function(add_dependency project_name folder)
set_property(GLOBAL APPEND PROPERTY GlobalDepsNamesList "${project_name}")
set_property(GLOBAL APPEND PROPERTY GlobalDepsFoldersList "${folder}")
endfunction(add_dependency)

# Function to add an additional shared dependency to global properties GlobalSharedDepsNamesList/GlobalSharedDepsFoldersList
function(add_shared_dependency project_name folder)
set_property(GLOBAL APPEND PROPERTY GlobalSharedDepsNamesList "${project_name}")
set_property(GLOBAL APPEND PROPERTY GlobalSharedDepsFoldersList "${folder}")
endfunction(add_shared_dependency)
8 changes: 0 additions & 8 deletions lib/cdm_aarch64/CMakeLists.txt

This file was deleted.

31 changes: 0 additions & 31 deletions lib/cdm_aarch64/cdm_loader.cpp

This file was deleted.

7 changes: 0 additions & 7 deletions src/decrypters/widevine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,3 @@ add_dir_sources(SOURCES HEADERS)

# Native CDM library
add_dependency(cdm_library lib/cdm)

# Patch to load CDM library on aarch64 platforms
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^arm64")
add_shared_dependency(cdm_aarch64_loader lib/cdm_aarch64)
endif()
endif()
37 changes: 0 additions & 37 deletions src/decrypters/widevine/WVDecrypter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,12 @@
#include "utils/StringUtils.h"
#include "utils/log.h"

#if defined(__linux__) && (defined(__aarch64__) || defined(__arm64__))
#include <dlfcn.h>
#endif

using namespace DRM;
using namespace UTILS;

CWVDecrypter::~CWVDecrypter()
{
m_WVCdmAdapter.reset();

#if defined(__linux__) && (defined(__aarch64__) || defined(__arm64__))
if (m_hdlLibLoader)
dlclose(m_hdlLibLoader);
#endif
}

bool CWVDecrypter::Initialize()
{
#if defined(__linux__) && (defined(__aarch64__) || defined(__arm64__))
// On linux arm64, libwidevinecdm.so depends on two dynamic symbols:
// __aarch64_ldadd4_acq_rel
// __aarch64_swp4_acq_rel
// These are defined from a separate library cdm_aarch64_loader,
// but to make them available in the main binary's PLT, we need RTLD_GLOBAL.
// Kodi kodi::tools::CDllHelper LoadDll() cannot be used because use RTLD_LOCAL,
// and we need the RTLD_GLOBAL flag.
std::string binaryPath;
if (!FILESYS::FindFilePath(FILESYS::GetAddonPath(), "libcdm_aarch64_loader.so", binaryPath))
{
LOG::Log(LOGERROR, "Cannot find the libcdm_aarch64_loader.so file");
return false;
}

m_hdlLibLoader = dlopen(binaryPath.c_str(), RTLD_GLOBAL | RTLD_LAZY);
if (!m_hdlLibLoader)
{
LOG::LogF(LOGERROR, "Failed to load CDM aarch64 loader from path \"%s\", error: %s",
binaryPath.c_str(), dlerror());
return false;
}
#endif
return true;
}

bool CWVDecrypter::IsKeySystemSupported(std::string_view keySystem)
Expand Down
5 changes: 0 additions & 5 deletions src/decrypters/widevine/WVDecrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class ATTR_DLL_LOCAL CWVDecrypter : public DRM::IDecrypter

virtual const std::string GetName() const override { return "Widevine-CDM"; }

virtual bool Initialize() override;

virtual bool IsKeySystemSupported(std::string_view keySystem) override;

virtual std::shared_ptr<Adaptive_CencSingleSampleDecrypter> CreateSingleSampleDecrypter(
Expand Down Expand Up @@ -62,7 +60,4 @@ class ATTR_DLL_LOCAL CWVDecrypter : public DRM::IDecrypter
std::shared_ptr<CWVCdmAdapter> m_WVCdmAdapter;
std::shared_ptr<CWVCencSingleSampleDecrypter> m_decodingDecrypter;
std::string m_libraryPath;
#if defined(__linux__) && (defined(__aarch64__) || defined(__arm64__))
void* m_hdlLibLoader{nullptr}; // Aarch64 loader library handle
#endif
};