This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
executable file
·680 lines (591 loc) · 27.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# If not stated otherwise in this file or this component's license file the
# following copyright and licenses apply:
#
# Copyright 2018 RDK Management
#
# 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.
if(APPLE)
set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
endif()
project (AAMP)
cmake_minimum_required (VERSION 2.6)
#find_package(GStreamer 1.4 REQUIRED)
#add_subdirectory(jsbindings)
find_package(PkgConfig REQUIRED)
if( CMAKE_USE_GST_0.10 )
message( FATAL_ERROR "gstreamer-0.10 not supported" )
else()
message("using gstreamer-1.0")
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GSTREAMERBASE REQUIRED gstreamer-app-1.0)
endif()
pkg_check_modules(CURL REQUIRED libcurl)
pkg_check_modules(LibXml2 REQUIRED libxml-2.0)
pkg_check_modules(LIBDASH REQUIRED libdash)
pkg_check_modules(OPENSSL REQUIRED openssl)
pkg_check_modules(LIBCJSON REQUIRED libcjson)
include(test/mocks/mocks.cmake NO_POLICY_SCOPE)
if (CMAKE_WPEFRAMEWORK_REQUIRED)
message("CMAKE_WPEFRAMEWORK_REQUIRED set")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")
find_package(WPEFramework REQUIRED)
if (WPEFRAMEWORK_FOUND)
message("WPEFRAMEWORK_FOUND = ${WPEFRAMEWORK_FOUND}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${WPEFRAMEWORK_INCLUDE_DIRS})
else()
message(FATAL_ERROR "WPEFrameworkProtocols not found")
endif()
endif()
if(CMAKE_QT5WEBKIT_JSBINDINGS)
message("CMAKE_QT5WEBKIT_JSBINDINGS set, require Qt5WebKit")
pkg_check_modules(Qt5WebKit REQUIRED Qt5WebKit)
find_path (STAGING_INCDIR webkit-apis/ForwardingHeaders)
include_directories(${STAGING_INCDIR}/webkit-apis/ForwardingHeaders)
elseif(CMAKE_WPEWEBKIT_JSBINDINGS)
message("CMAKE_QT5WEBKIT_JSBINDINGS not set, CMAKE_WPEWEBKIT_JSBINDINGS is set, Finding JavaScriptCore")
find_path (STAGING_INCDIR JavaScriptCore)
include_directories(${STAGING_INCDIR}/JavaScriptCore)
else()
message("CMAKE_QT5WEBKIT_JSBINDINGS not set, CMAKE_WPEWEBKIT_JSBINDINGS not set")
endif()
if (CMAKE_PLATFORM_UBUNTU OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(OPENGL_LIBRARIES "-framework OpenGL -framework GLUT")
else()
pkg_check_modules(OPENGL REQUIRED gl)
set(OPENGL_LIBRARIES "${OPENGL_LIBRARIES} -lglut")
pkg_check_modules(GLEW REQUIRED glew)
endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
endif()
# Mac OS X
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
execute_process (
COMMAND bash -c "xcrun --show-sdk-path" OUTPUT_VARIABLE osxSdkPath OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -g -x objective-c++ -Wno-inconsistent-missing-override -F${osxSdkPath}/System/Library/Frameworks")
set(OS_LD_FLAGS "${OS_LD_FLAGS} -F${osxSdkPath}/System/Library/Frameworks -framework Cocoa -L${osxSdkPath}/../MacOSX.sdk/usr/lib -L/usr/local/lib/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isysroot ${osxSdkPath}/../MacOSX.sdk -I/usr/local/include")
string(STRIP ${OS_LD_FLAGS} OS_LD_FLAGS)
set(AAMP_CLI_LD_FLAGS "${AAMP_CLI_LD_FLAGS} -lgstvideo-1.0")
string(STRIP ${AAMP_CLI_LD_FLAGS} AAMP_CLI_LD_FLAGS)
set(AAMP_OS_SOURCES cocoa_window.mm)
link_directories(${OPENSSL_LIBRARY_DIRS})
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
pkg_check_modules(GLIB REQUIRED GLib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DCONTENT_4K_SUPPORTED")
else()
set(USE_MAC_FOR_RANDOM_GEN "-DUSE_MAC_FOR_RANDOM_GEN")
endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
if(CMAKE_RDK_CC_ENABLED)
pkg_check_modules(DIRECTFB REQUIRED directfb)
endif()
find_package (Threads REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} drm drm/ave drm/aes drm/helper subtitle isobmff)
include_directories(${GSTREAMER_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${GSTREAMERBASE_INCLUDE_DIRS})
include_directories(${LIBDASH_INCLUDE_DIRS})
include_directories(${LibXml2_INCLUDE_DIRS})
include_directories(${OPENSSL_INCLUDE_DIRS})
include_directories(${OPENGL_INCLUDE_DIRS})
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(${LIBCJSON_INCLUDE_DIRS})
set(LIBAAMP_SOURCES iso639map.cpp
base16.cpp
_base64.cpp
AampMemoryUtils.cpp
AampCacheHandler.cpp
AampScheduler.cpp
AampUtils.cpp
AampJsonObject.cpp
AampProfiler.cpp
AampEvent.cpp
AampEventListener.cpp
ota_shim.cpp
hdmiin_shim.cpp
videoin_shim.cpp
compositein_shim.cpp
rmf_shim.cpp
fragmentcollector_progressive.cpp
fragmentcollector_hls.cpp
fragmentcollector_mpd.cpp
admanager_mpd.cpp
streamabstraction.cpp
drm/ave/drm.cpp
priv_aamp.cpp
main_aamp.cpp
aampgstplayer.cpp
tsprocessor.cpp
drm/aes/aamp_aes.cpp
aamplogging.cpp
AampConfig.cpp
AampEventManager.cpp
subtitle/webvttParser.cpp
isobmff/isobmffbox.cpp
isobmff/isobmffbuffer.cpp
isobmff/isobmffprocessor.cpp
drm/helper/AampDrmHelper.cpp
AampGstUtils.cpp
MediaStreamContext.cpp
AampCurlStore.cpp
)
if (CMAKE_WPEFRAMEWORK_REQUIRED)
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} ThunderAccess.cpp Module.cpp)
endif()
if(CMAKE_USE_SECCLIENT)
if (CMAKE_USE_SECCLIENT_MOCKS)
copy_staging_header_file(sec_client.h)
copy_staging_header_file(sec_security_datatype.h)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/mocks/secClientMocks.cpp)
else()
set(SEC_CLIENT_LIB -lSecClient )
endif()
endif()
if(CMAKE_USE_SECMANAGER)
if (NOT CMAKE_WPEFRAMEWORK_REQUIRED)
message(FATAL_ERROR "CMAKE_USE_SECMANAGER set but CMAKE_WPEFRAMEWORK_REQUIRED not set")
else()
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} drm/AampSecManager.cpp)
endif()
endif()
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_VANILLA_AES_SUPPORT ${USE_MAC_FOR_RANDOM_GEN}")
if (CMAKE_PLATFORM_UBUNTU)
message("CMAKE_PLATFORM_UBUNTU set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUBUNTU=1 -DNO_NATIVE_AV=1 -DCONTENT_4K_SUPPORTED")
endif()
if (CMAKE_PLATFORM_UBUNTU OR CMAKE_SYSTEM_NAME STREQUAL Darwin )
message("AAMP_SIMULATOR_BUILD set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_SIMULATOR_BUILD=1")
endif()
if (CMAKE_USE_OPENCDM_ADAPTER)
if (NOT CMAKE_USE_OPENCDM)
message("Forcing CMAKE_USE_OPENCDM due to CMAKE_USE_OPENCDM_ADAPTER")
set(CMAKE_USE_OPENCDM TRUE)
endif()
endif()
if(CMAKE_USE_RDK_PLUGINS)
message("CMAKE_USE_RDK_PLUGINS set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_PLAYERSINKBIN -DREAD_ESTB_IFACE_FROM_DEVICE_PROPERTIES -DCREATE_PIPE_SESSION_TO_XRE")
endif()
if (CMAKE_CUSTOM_QTDEMUX_PLUGIN_ENABLED)
#Macro should be enabled only when the qtdemux plugin with AAMP patches are available in the platform.
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DENABLE_AAMP_QTDEMUX_OVERRIDE=1")
endif()
set(LIBAAMP_DEPENDS ${OS_LD_FLAGS} ${GSTREAMERBASE_LIBRARIES} ${GSTREAMER_LIBRARIES} ${CURL_LIBRARIES} ${LIBDASH_LIBRARIES} ${LibXml2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${AAMP_CLI_LD_FLAGS} -ldl -labr -luuid ${SEC_CLIENT_LIB} -lcjson)
set(PLAYBINTEST_DEPENDS ${OS_LD_FLAGS} ${CMAKE_THREAD_LIBS_INIT} ${GSTREAMER_LIBRARIES})
if (CMAKE_AMLOGIC_SOC)
message("CMAKE_AMLOGIC_SOC set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DNO_NATIVE_AV=1 -DAMLOGIC -DCONTENT_4K_SUPPORTED")
# For extracting SEI timecode
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lgstvideo-1.0")
endif()
if(CMAKE_FLEX2_RDK)
message("CMAKE_FLEX2_RDK set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DFLEX2_RDK")
endif()
if(CMAKE_QT5WEBKIT_JSBINDINGS)
message("CMAKE_QT5WEBKIT_JSBINDINGS set, adding sources to libaamp")
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} jsbindings/jsbindings.cpp jsbindings/jsutils.cpp jsbindings/jsmediaplayer.cpp jsbindings/jseventlistener.cpp jsbindings/jsevent.cpp)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DSUPPORT_JS_EVENTS")
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -l${Qt5WebKit_LIBRARIES}")
elseif(CMAKE_WPEWEBKIT_JSBINDINGS)
message("CMAKE_WPEWEBKIT_JSBINDINGS set, just setting flags")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DSUPPORT_JS_EVENTS")
else()
message("CMAKE_WPEWEBKIT_JSBINDINGS and CMAKE_WPEWEBKIT_JSBINDINGS not set")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -std=c++11 -Wno-non-virtual-dtor -Werror=effc++ -Wno-psabi")
if(CMAKE_IARM_MGR)
message("CMAKE_IARM_MGR set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DIARM_MGR=1")
if (CMAKE_IARM_MGR_MOCKS)
message("CMAKE_IARM_MGR_MOCKS set, building IARM stubs")
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/mocks/iarmMgrMocks.cpp)
set(LIBAAMP_MOCK_DEPENDS -lgmock -lgtest)
find_path(STAGING_INCDIR rdk/iarmbus)
include_directories(${STAGING_INCDIR}/rdk/iarmbus)
find_path(STAGING_INCDIR rdk/tr69hostif)
include_directories(${STAGING_INCDIR}/rdk/tr69hostif)
find_path(STAGING_INCDIR rdk/ds)
include_directories(${STAGING_INCDIR}/rdk/ds
${STAGING_INCDIR}/rdk/ds-hal
${STAGING_INCDIR}/rdk/ds-rpc)
find_path(STAGING_INCDIR rdk/iarmmgrs/ir)
include_directories(${STAGING_INCDIR}/rdk/iarmmgrs/ir)
endif()
endif()
if(CMAKE_PLATFORM_UBUNTU)
message("AAMP_SIMULATOR_BUILD set")
link_directories(${CMAKE_LIBRARY_PATH})
STRING(REPLACE " -Werror=effc++" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
set(AAMP_CLI_HEADERS test/aampcli/Aampcli.h
test/aampcli/AampcliPlaybackCommand.h
test/aampcli/AampcliCommandHandler.h
test/aampcli/AampcliGet.h
test/aampcli/AampcliSet.h
test/aampcli/AampcliVirtualChannelMap.h
test/aampcli/AampcliShader.h
test/aampcli/AampcliHarvestor.h
${AAMP_OS_SOURCES})
set(AAMP_CLI_SOURCES test/aampcli/Aampcli.cpp
test/aampcli/AampcliPlaybackCommand.cpp
test/aampcli/AampcliCommandHandler.cpp
test/aampcli/AampcliGet.cpp
test/aampcli/AampcliSet.cpp
test/aampcli/AampcliVirtualChannelMap.cpp
test/aampcli/AampcliShader.cpp
test/aampcli/AampcliHarvestor.cpp
${AAMP_OS_SOURCES})
# Session based stats for latency histogram
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lmetrics")
if(CMAKE_AVE_DRM)
message("CMAKE_AVE_DRM set, adding stubs")
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -laveadapter -lAVEPlayer -lmetrics")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAVE_DRM")
set(AAMP_CLI_SOURCES ${AAMP_CLI_HEADERS} ${AAMP_CLI_SOURCES} drm/ave/StubsForAVEPlayer.cpp)
#Linking QT libraries to libaamp will make local stubs obsolete for aamp-cli
if(NOT CMAKE_QT5WEBKIT_JSBINDINGS AND CMAKE_WPEWEBKIT_JSBINDINGS)
set(AAMP_CLI_EXTRA_DEFINES "${AAMP_CLI_EXTRA_DEFINES} -DAAMP_STUBS_FOR_JS")
endif()
else()
message("CMAKE_AVE_DRM not set, not adding stubs?")
endif()
if(CMAKE_USE_OPENCDM OR CMAKE_USE_OPENCDM_ADAPTER OR CMAKE_CDM_DRM)
# Sources common to all forms of OpenCDM and CDM
message("Using some form of OpenCDM or CDM")
set(LIBAAMP_DRM_SOURCES drm/AampDRMSessionManager.cpp
drm/AampDrmSession.cpp
drm/aampdrmsessionfactory.cpp
drm/aampoutputprotection.cpp
drm/helper/AampDrmHelperFactory.cpp
drm/AampDRMutils.cpp
)
if(CMAKE_USE_THUNDER_OCDM_API_0_2)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_THUNDER_OCDM_API_0_2")
endif()
endif()
if(CMAKE_CDM_DRM)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_MPD_DRM=1")
endif()
if(CMAKE_USE_OPENCDM OR CMAKE_USE_OPENCDM_ADAPTER)
message("OpenCDM support enabled")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_OPENCDM -DAAMP_HLS_DRM=1")
set(LIBAAMP_DRM_SOURCES "${LIBAAMP_DRM_SOURCES}" drm/AampHlsDrmSessionManager.cpp
drm/AampHlsOcdmBridge.cpp
drm/processProtectionHls.cpp
)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DDRM_BUILD_PROFILE=DRM_BUILD_PROFILE_OEM -DTARGET_LITTLE_ENDIAN=1 -DTARGET_SUPPORTS_UNALIGNED_DWORD_POINTERS=0")
if(CMAKE_IARM_MGR AND NOT CMAKE_IARM_MGR_MOCKS)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lIARMBus -lds -ldshalcli")
endif()
# DRM Helpers
if(CMAKE_USE_WIDEVINE)
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampWidevineDrmHelper.cpp)
endif()
if(CMAKE_USE_VGDRM)
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampVgdrmHelper.cpp)
if(CMAKE_USE_ION_MEMORY)
# Needed for ION Secure Memory
find_path (REALTEK_INCDIR realtek)
include_directories(${REALTEK_INCDIR}/realtek)
include_directories(${REALTEK_INCDIR}/realtek/system/core/include)
include_directories(${REALTEK_INCDIR}/realtek/bionic/libc/kernel/common)
message("Looking in ${CMAKE_LIB_SYSROOT} for RTK ION libraries")
find_library(REALTEK_ION_LIBRARY NAMES ion rtk_ion PATHS "${CMAKE_LIB_SYSROOT}/usr/lib" )
if (NOT REALTEK_ION_LIBRARY)
set(REALTEK_ION_LIBRARY "${CMAKE_LIB_SYSROOT}/usr/lib/realtek")
message("Forced RTK ION libraries to ${REALTEK_ION_LIBRARY}")
endif()
link_directories(${REALTEK_ION_LIBRARY})
if (CMAKE_USE_ION_MEMORY_MOCKS)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/mocks/ionMemoryMocks.cpp)
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lion -lrtk_ion")
endif()
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_ION_MEMORY")
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/AampIonMemorySystem.cpp)
else()
# Needed for Shared Memory
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lrt")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SHARED_MEMORY")
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/AampSharedMemorySystem.cpp)
endif()
endif()
if(CMAKE_USE_CLEARKEY)
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampClearKeyHelper.cpp)
endif()
if(CMAKE_USE_PLAYREADY)
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampPlayReadyHelper.cpp)
endif()
if(CMAKE_USE_VERIMATRIX)
message("CMAKE_USE_VERIMATRIX set")
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampVerimatrixHelper.cpp)
endif()
else()
message("No OpenCDM support enabled")
endif()
# Always include Adobe Access Helper
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampAveDrmHelper.cpp)
if(CMAKE_USE_CLEARKEY)
set(LIBAAMP_DRM_SOURCES "${LIBAAMP_DRM_SOURCES}" drm/ClearKeyDrmSession.cpp)
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampClearKeyHelper.cpp)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_CLEARKEY")
endif()
if(CMAKE_USE_OPENCDM_ADAPTER)
message("Using OPEN CDM ADAPTER")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_OPENCDM_ADAPTER -DUSE_OPENCDM")
set(LIBAAMP_DRM_SOURCES "${LIBAAMP_DRM_SOURCES}" drm/opencdmsessionadapter.cpp
drm/AampOcdmBasicSessionAdapter.cpp
drm/AampOcdmGstSessionAdapter.cpp
)
if(DEFINED SAGE_SVP)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DCONTENT_4K_SUPPORTED")
endif()
if(CMAKE_USE_OPENCDM_ADAPTER_MOCKS)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/mocks/opencdmMocks.cpp)
set(LIBAAMP_MOCK_DEPENDS -lgmock -lgtest)
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -locdm")
endif()
find_path (STAGING_INCDIR opencdm)
include_directories(${STAGING_INCDIR}/opencdm)
find_path (STAGING_INCDIR gstreamer-1.0)
include_directories(${STAGING_INCDIR}/gstreamer-1.0)
elseif(CMAKE_USE_OPENCDM)
message("Using OPEN CDM")
set(LIBAAMP_DRM_SOURCES "${LIBAAMP_DRM_SOURCES}" drm/opencdmsession.cpp)
if (DEFINED SECAPI_ENGINE_BROADCOM_SAGE)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECAPI_BRCMHW=1")
if(DEFINED SAGE_SVP)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SAGE_SVP -DCONTENT_4K_SUPPORTED")
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -locdm -lb_secbuf -lnexus -lbrcmsvpmeta -lsec_api")
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -locdm -lsec_api")
endif()
elseif(DEFINED SECAPI_ENGINE_BROADCOM_RAAGA)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECAPI_BRCMHW=1")
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -locdm -lsec_api")
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -locdm -lsec_api_crypto")
endif()
find_path (STAGING_INCDIR opencdm)
include_directories(${STAGING_INCDIR}/opencdm)
elseif(CMAKE_CDM_DRM)
message("Not Using OPEN CDM but using CDM")
if(CMAKE_USE_PLAYREADY)
set(LIBAAMP_DRM_SOURCES "${LIBAAMP_DRM_SOURCES}" drm/playreadydrmsession.cpp )
set(LIBAAMP_HELP_SOURCES "${LIBAAMP_HELP_SOURCES}" drm/helper/AampPlayReadyHelper.cpp)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_PLAYREADY -DDRM_BUILD_PROFILE=DRM_BUILD_PROFILE_OEM -DTARGET_LITTLE_ENDIAN=1 -DTARGET_SUPPORTS_UNALIGNED_DWORD_POINTERS=0")
if(CMAKE_USE_PLAYREADY_MOCKS)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/fakes/playreadyFakes.cpp)
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lplayready")
endif()
find_path (STAGING_INCDIR playready)
find_path (STAGING_INCDIR playready/oem/common/inc)
find_path (STAGING_INCDIR playready/oem/ansi/inc)
include_directories(${STAGING_INCDIR}/playready)
include_directories(${STAGING_INCDIR}/playready/oem/common/inc)
include_directories(${STAGING_INCDIR}/playready/oem/ansi/inc)
endif()
if (DEFINED SECAPI_ENGINE_BROADCOM_SAGE)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECAPI_BRCMHW=1")
if(DEFINED SAGE_SVP)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SAGE_SVP -DCONTENT_4K_SUPPORTED")
if (NOT CMAKE_USE_SEC_API_MOCKS)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lsec_api -lb_secbuf -lnexus -lbrcmsvpmeta")
endif()
else()
if (CMAKE_USE_PLAYREADY AND NOT CMAKE_USE_SEC_API_MOCKS)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lsec_api")
endif()
endif()
elseif(DEFINED SECAPI_ENGINE_BROADCOM_RAAGA)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECAPI_BRCMHW=1")
if (CMAKE_USE_PLAYREADY AND NOT CMAKE_USE_SEC_API_MOCKS)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lsec_api")
endif()
else()
if (CMAKE_USE_PLAYREADY AND NOT CMAKE_USE_SEC_API_MOCKS)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lsec_api_crypto")
endif()
endif()
if(CMAKE_IARM_MGR AND NOT CMAKE_IARM_MGR_MOCKS)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lIARMBus -lds -ldshalcli")
endif()
endif()
if (CMAKE_RDK_CC_ENABLED OR CMAKE_SUBTEC_CC_ENABLED)
include_directories(closedcaptions)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_CC_ENABLED")
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} closedcaptions/AampCCManager.cpp)
endif()
if (CMAKE_AAMP_RFC_REQUIRED)
message("AAMP RFC set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_RFC_ENABLED")
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} AampRfc.cpp)
if(CMAKE_USE_RFC_MOCKS)
copy_staging_header_file(tr181api.h)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/mocks/rfcMocks.cpp)
set(LIBAAMP_MOCK_DEPENDS -lgmock -lgtest)
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -ltr181api")
endif()
endif()
if (CMAKE_RDK_CC_ENABLED)
message("CMAKE_RDK_CC_ENABLED set")
include_directories(${DIRECTFB_INCLUDE_DIRS})
include_directories(${DIRECTFB_INCLUDE_DIRS}/fusion)
include_directories(${DIRECTFB_INCLUDE_DIRS}/direct)
include_directories(closedcaptions/rdk)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_RDK_CC_ENABLED")
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} closedcaptions/rdk/AampRDKCCManager.cpp)
if (CMAKE_USE_CC_MANAGER_MOCKS)
find_path(STAGING_INCDIR closedcaption)
include_directories(${STAGING_INCDIR}/closedcaption)
include_directories(${STAGING_INCDIR}/closedcaption/ccGraphics)
include_directories(${STAGING_INCDIR}/closedcaption/ccManager)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/fakes/ccManagerFakes.cpp)
copy_staging_header_file(vlCCConstants.h)
else()
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lrdkCCReader -lrdkCCManager -lrdkCCGfx -l${DIRECTFB_LIBRARIES}")
endif()
endif()
set(AAMP_SUBTEC_CLASS_SOURCES subtec/subtecparser/WebVttSubtecParser.cpp subtec/subtecparser/TtmlSubtecParser.cpp subtec/subtecparser/WebvttSubtecDevParser.cpp subtec/subtecparser/TextStyleAttributes.cpp)
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} ${AAMP_SUBTEC_CLASS_SOURCES})
include_directories(subtec/subtecparser)
message("CMAKE_GST_SUBTEC_ENABLED set")
add_library(subtec SHARED subtec/libsubtec/PacketSender.cpp subtec/libsubtec/SubtecChannel.cpp)
set(AAMP_SUBTEC_PUBLIC_HEADERS subtec/libsubtec/SubtecChannel.hpp subtec/libsubtec/SubtecAttribute.hpp)
set_target_properties(subtec PROPERTIES PUBLIC_HEADER "${AAMP_SUBTEC_PUBLIC_HEADERS}")
set_target_properties(subtec PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -DSUBTEC_PACKET_DEBUG=1")
include_directories(subtec/libsubtec)
install (TARGETS subtec
DESTINATION lib
PUBLIC_HEADER DESTINATION include
)
if (CMAKE_GST_SUBTEC_ENABLED)
message("CMAKE_GST_SUBTEC_ENABLED set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DGST_SUBTEC_ENABLED")
endif()
if (CMAKE_SUBTEC_CC_ENABLED)
message("CMAKE_SUBTEC_CC_ENABLED set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_SUBTEC_CC_ENABLED")
set(LIBSUBTECCONNECTOR_DEFINES "${LIBAAMP_DEFINES}")
if (CMAKE_USE_CC_MANAGER_MOCKS)
find_path(STAGING_INCDIR closedcaption/ccDataReader.h)
include_directories(${STAGING_INCDIR}/closedcaption)
set(LIBAAMP_MOCK_SOURCES ${LIBAAMP_MOCK_SOURCES} test/fakes/ccManagerFakes.cpp)
else()
set(LIBSUBTECCONNECTOR_DEPENDS pthread rdkCCReader subtec)
endif()
set(LIBSUBTECCONNECTOR_SOURCES ${AAMP_SUBTEC_SOURCES}
closedcaptions/subtec/SubtecConnector.cpp
closedcaptions/subtec/CCDataController.cpp
aamplogging.cpp)
add_library(subtec_connector SHARED ${LIBSUBTECCONNECTOR_SOURCES})
target_link_libraries(subtec_connector ${LIBSUBTECCONNECTOR_DEPENDS})
install(TARGETS subtec_connector DESTINATION lib)
link_directories("${CMAKE_BINARY_DIR}")
set(LIBAAMP_SOURCES ${LIBAAMP_SOURCES} closedcaptions/subtec/AampSubtecCCManager.cpp)
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS}" subtec_connector)
endif()
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} ${SEC_CONTENT_METADATA_ENABLED}")
set(LIBAAMP_SOURCES "${LIBAAMP_SOURCES}" "${LIBAAMP_DRM_SOURCES}" "${LIBAAMP_MOCK_SOURCES}")
add_library(aamp SHARED ${LIBAAMP_SOURCES} ${LIBAAMP_HELP_SOURCES})
add_executable(aamp-cli ${AAMP_CLI_HEADERS} ${AAMP_CLI_SOURCES})
target_link_libraries(aamp-cli "-lreadline")
add_executable(playbintest test/playbintest.cpp)
target_link_libraries(playbintest ${PLAYBINTEST_DEPENDS})
if(CMAKE_SOC_PLATFORM_INTEL)
message("CMAKE_SOC_PLATFORM_INTEL set")
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lismd_core -lismd_vidpproc -lismd_vidsink_direct -lismd_vidrend -lismd_viddec -lismd_core -lsysloghelper -lgdl")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DINTELCE=1 -DAAMP_STOP_SINK_ON_SEEK=1 -DUSE_SYSLOG_HELPER_PRINT=1 -DENABLE_AAMP_QTDEMUX_OVERRIDE=1")
endif()
if(CMAKE_SOC_PLATFORM_REALTEK)
message("CMAKE_SOC_PLATFORM_REALTEK set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DREALTEKCE=1 -DENABLE_AAMP_QTDEMUX_OVERRIDE=1 -DCONTENT_4K_SUPPORTED")
endif()
if(CMAKE_SOC_PLATFORM_RPI)
message("CMAKE_SOC_PLATFORM_RPI set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRPI=1 -DENABLE_AAMP_QTDEMUX_OVERRIDE=1")
endif()
if(CMAKE_SYSTEMD_JOURNAL)
message("CMAKE_SYSTEMD_JOURNAL set")
set(LIBAAMP_DEPENDS "${LIBAAMP_DEPENDS} -lsystemd")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SYSTEMD_JOURNAL_PRINT=1 -DSD_JOURNAL_SUPPRESS_LOCATION=1")
set(LIBAAMPJSBINDINGS_DEFINES "${LIBAAMPJSBINDINGS_DEFINES} -DUSE_SYSTEMD_JOURNAL_PRINT=1 -DSD_JOURNAL_SUPPRESS_LOCATION=1")
endif()
if(CMAKE_USE_SECCLIENT)
message("CMAKE_USE_SECCLIENT set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECCLIENT")
endif()
if(CMAKE_USE_SECMANAGER)
message("CMAKE_USE_SECMANAGER set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECMANAGER")
endif()
if(CMAKE_WPEWEBKIT_JSBINDINGS)
message("CMAKE_WPEWEBKIT_JSBINDINGS set, creating jsbinding library")
add_subdirectory(test)
add_library(aampjsbindings SHARED jsbindings/jscontroller-jsbindings.cpp jsbindings/jsbindings.cpp jsbindings/jsutils.cpp jsbindings/jsmediaplayer.cpp jsbindings/jseventlistener.cpp jsbindings/jsevent.cpp)
target_link_libraries(aampjsbindings aamp systemd)
if (CMAKE_RDK_CC_ENABLED OR CMAKE_SUBTEC_CC_ENABLED)
set(LIBAAMPJSBINDINGS_DEFINES "${LIBAAMPJSBINDINGS_DEFINES} -DAAMP_CC_ENABLED")
endif()
set_target_properties(aampjsbindings PROPERTIES COMPILE_FLAGS "${LIBAAMPJSBINDINGS_DEFINES}")
install(TARGETS aampjsbindings DESTINATION lib)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_WPEWEBKIT_JSBINDINGS")
else()
message("CMAKE_WPEWEBKIT_JSBINDINGS not set, not creating jsbinding library")
endif()
if(CMAKE_AUXILIARY_AUDIO_ENABLED)
message("CMAKE_AUXILIARY_AUDIO_ENABLED set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_AUXILIARY_AUDIO_ENABLED")
endif()
message("LIB_AAMP_DEPENDS is ${LIBAAMP_DEPENDS}")
target_link_libraries(aamp ${LIBAAMP_DEPENDS} ${LIBAAMP_MOCK_DEPENDS})
if (CMAKE_WPEFRAMEWORK_REQUIRED)
# Remove compiler flag as it causes compilation issues with wpeframework headers
STRING(REPLACE " -Werror=effc++" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_CPP_THUNDER_PLUGIN_ACCESS")
target_link_libraries(aamp ${WPEFRAMEWORK_LIBRARIES})
endif()
target_link_libraries(aamp-cli aamp ${AAMP_CLI_LD_FLAGS})
set_target_properties(aamp PROPERTIES COMPILE_FLAGS "${LIBAAMP_DEFINES} ${OS_CXX_FLAGS}")
#aamp-cli is not an ideal standalone app. It uses private aamp instance for debugging purposes
set_target_properties(aamp-cli PROPERTIES COMPILE_FLAGS "${LIBAAMP_DEFINES} ${AAMP_CLI_EXTRA_DEFINES} ${OS_CXX_FLAGS}")
set_target_properties(aamp PROPERTIES PUBLIC_HEADER "main_aamp.h")
set_target_properties(aamp PROPERTIES PRIVATE_HEADER "priv_aamp.h")
target_link_libraries(aamp-cli subtec)
target_link_libraries(aamp subtec)
install(TARGETS aamp-cli DESTINATION bin)
install(TARGETS playbintest DESTINATION bin)
install(TARGETS aamp DESTINATION lib PUBLIC_HEADER DESTINATION include PRIVATE_HEADER DESTINATION include)
install(FILES AampEvent.h AampConfig.h AampEventManager.h AampDefine.h AampEventListener.h drm/AampMemorySystem.h drm/AampDRMSessionManager.h AampDrmSystems.h AampMediaType.h
drm/AampDrmData.h drm/AampDrmInfo.h drm/AampDrmMediaFormat.h AampDrmCallbacks.h AampLogManager.h
drm/AampDrmSession.h drm/ClearKeyDrmSession.h drm/AampDRMutils.h drm/aampdrmsessionfactory.h
drm/helper/AampDrmHelper.h subtitle/vttCue.h AampUtils.h
AampMemoryUtils.h AampProfiler.h AampConstants.h iso639map.h AampRfc.h AampGstUtils.h
AampScheduler.h
drm/AampSecManager.h
AampCurlStore.h
DESTINATION include)
if (CMAKE_AAMP_RFC_REQUIRED)
install(FILES AampRfc.h DESTINATION include)
endif()
message("LIBAAMP_DEFINES is ${LIBAAMP_DEFINES}")
message("LIBAAMP_SOURCES is ${LIBAAMP_SOURCES}")
message("LIBAAMP_HELP_SOURCES is ${LIBAAMP_HELP_SOURCES}")