Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic media session Changes for AML. #31

Draft
wants to merge 17 commits into
base: generic-mediasession
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 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
40 changes: 29 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.3)
project(DRMPlayready)

if (DEFINED MAKE_VERBOSE)
Expand All @@ -24,20 +24,23 @@ endif()

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(DRM_PLUGIN_NAME "PlayReady4")
set(DRM_PLUGIN_NAME "Playready")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -w -Wno-psabi ")

if(NOT CMAKE_CROSSCOMPILING)
set(STAGING_DIR "${CMAKE_INSTALL_PREFIX}")
else()
set(STAGING_DIR "${CMAKE_FIND_ROOT_PATH}")
endif()

add_definitions(-DAML_SVP_PR)
add_definitions(-DPR_4_4)

file(GLOB DRM_PLUGIN_INCLUDES *.h)

set(DRM_PLUGIN_LIBS
${PLAYREADY4_LIBRARIES})
${PLAYREADY_LIBRARIES})

set(DRM_PLUGIN_SOURCES
MediaSession.cpp
Expand All @@ -46,14 +49,22 @@ set(DRM_PLUGIN_SOURCES

# add the library
add_library(${DRM_PLUGIN_NAME} SHARED ${DRM_PLUGIN_SOURCES})
target_compile_definitions(${DRM_PLUGIN_NAME} PRIVATE ${PLAYREADY4_FLAGS})
target_include_directories(${DRM_PLUGIN_NAME} PRIVATE ${PLAYREADY4_INCLUDE_DIRS})
target_include_directories(${DRM_PLUGIN_NAME} PRIVATE source/curl_prebuilt/include/curl source/inc source/modules/contentspecific/h264/real source/oem/ansi/inc source/oem/common/broker/pkImpl source/oem/common/crypto/aes source/oem/common/inc source/oem/common/trustedexec source/results source/securecore/trustedexec/base source/tools/devicedevcert/bcertdump source/tools/pseudotee/dll source/tools/shared/common source/tools/shared/netio source/tools/shared/oem source/tools/shared/remoteprovisioningmock source/trustedexec/base source/trustedexec/debug source/trustedexec/decrypt source/trustedexec/inc source/trustedexec/licprep source/trustedexec/rprov source/trustedexec/teeproxystub/common source/trustedexec/teeproxystub/proxy/common source/trustedexec/teeproxystub/stub/common)
add_compile_definitions(DRM_BUILD_PROFILE=900)
target_link_libraries(${DRM_PLUGIN_NAME} PRIVATE libplayreadypk.so)
target_compile_definitions(${DRM_PLUGIN_NAME} PRIVATE ${PLAYREADY_FLAGS})

set_target_properties(${DRM_PLUGIN_NAME} PROPERTIES SUFFIX ".drm")
set_target_properties(${DRM_PLUGIN_NAME} PROPERTIES PREFIX "")

find_package(PlayReady REQUIRED)
if(PLAYREADY_FOUND)
message(STATUS "PlayReady found!")
# message(STATUS "${PLAYREADY_INCLUDE_DIRS}")
include_directories(${PLAYREADY_INCLUDE_DIRS})
include_directories(${PLAYREADY_LIBRARIES})
target_link_libraries(${DRM_PLUGIN_NAME} playready-4.4)
else()
message(FATAL_ERROR "PlayReady not found. Please install the required libraries.")
endif()

find_package(OpenSSL REQUIRED)
target_link_libraries(${DRM_PLUGIN_NAME} OpenSSL::SSL)

Expand All @@ -64,8 +75,8 @@ target_link_libraries(${DRM_PLUGIN_NAME} OpenSSL::SSL)
target_include_directories(${DRM_PLUGIN_NAME} PRIVATE ${CMAKE_SYSROOT}/usr/include/gstreamer-1.0)
target_include_directories(${DRM_PLUGIN_NAME} PRIVATE ${CMAKE_SYSROOT}/usr/include/glib-2.0)
target_include_directories(${DRM_PLUGIN_NAME} PRIVATE ${CMAKE_SYSROOT}/usr/lib/glib-2.0/include)
target_include_directories(${DRM_PLUGIN_NAME} PRIVATE ${CMAKE_SYSROOT}/usr/include/realtek/genericLinux/include)
target_link_libraries(${DRM_PLUGIN_NAME} gstsvpext)
#target_link_libraries(${DRM_PLUGIN_NAME} gstsvpext)
target_link_libraries(${DRM_PLUGIN_NAME} gstamlsvpext)
#endif()

if("${DYNAMIC_SVP_DECRYPTION}" STREQUAL "ON")
Expand All @@ -90,3 +101,10 @@ else()
endif()

install(TARGETS ${DRM_PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/WPEFramework/OCDM)

if(NOT "${CMAKE_FIND_ROOT_PATH}" STREQUAL "")
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink /etc/playready ${CMAKE_CURRENT_BINARY_DIR}/playready)")
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/../${PERSISTENT_PATH}/OCDM)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/playready DESTINATION ${CMAKE_INSTALL_PREFIX}/../${PERSISTENT_PATH}/OCDM/)
endif()

Loading