Skip to content

Commit a384ffc

Browse files
committed
Align plugins with Dolby Encoding Engine 6.4 release
1 parent d9b53f0 commit a384ffc

File tree

8 files changed

+66
-28
lines changed

8 files changed

+66
-28
lines changed

plugins/BUILDING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ Specifying an option that is unsupported on a given platform will simply be igno
2525
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -DCMAKE_POSITION_INDEPENDENT_CODE=ON
2626
```
2727

28+
To specify custom installation folder, please pass `-DCMAKE_INSTALL_PREFIX=<install_dir>` to the command above.
29+
2830
Please refer to [CMakeLists.txt](CMakeLists.txt) for more build options.
2931

30-
## Build
32+
## Build and install
3133

32-
To build the project, run:
34+
To build and install the project, run:
3335

3436
```bash
3537
cmake --build build --config Release -j
38+
cmake --install build --config Release
3639
```

plugins/code/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
if(APPLE)
2+
set(CMAKE_INSTALL_RPATH "@loader_path")
3+
set(CMAKE_INSTALL_NAME_DIR "@loader_path")
4+
elseif(UNIX)
5+
set(CMAKE_INSTALL_RPATH "$ORIGIN")
6+
endif()
7+
18
add_subdirectory(api)
29
add_subdirectory(common)
310
add_subdirectory(hevc_enc)

plugins/code/hevc_enc/beamr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ The build uses files in following folders:
3838

3939
Extract the kit folder from the archive and set the `BEAMR_SDK` environment variable.
4040

41-
Build the plugin (see [BUILDING.md](../../../BUILDING.md)), then copy `libdee_plugin_hevc_enc_beamr.so` or `libdee_plugin_hevc_enc_beamr.dll` (depending on your operating system) to the DEE installation folder. The file can be renamed, but the extension must remain unchanged.
41+
Build and install the plugin (see [BUILDING.md](../../../BUILDING.md)), then copy `libdee_plugin_hevc_enc_beamr.so` or `libdee_plugin_hevc_enc_beamr.dll` (depending on your operating system) to the DEE installation folder. The file can be renamed, but the extension must remain unchanged.

plugins/code/hevc_enc/x265/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ The provided source code was built and tested using the x265 library version 4.1
66
- Windows:
77
- Visual Studio 2022
88
- [NASM](https://nasm.us/pub/nasm/releasebuilds/?C=M;O=D)
9-
- [CMake](https://github.com/Kitware/CMake/releases/tag/v3.31.8)
9+
- [CMake](https://github.com/Kitware/CMake/releases/tag/v3.31.8)
1010
- Linux:
1111
- gcc 11.5
1212
- [NASM](https://nasm.us/pub/nasm/releasebuilds/?C=M;O=D)
13-
- [CMake](https://github.com/Kitware/CMake/releases/tag/v3.31.8)
13+
- [CMake](https://github.com/Kitware/CMake/releases/tag/v3.31.8)
1414

1515
## Building x265 library
16-
The x265 library has to be build with multi-bitdepth (8/10/12-bit) support and in shared format.
16+
The x265 library has to be build with multi-bitdepth (8/10/12-bit) support and in shared format.
1717
- Navigate to [x265 git repository](https://bitbucket.org/multicoreware/x265_git/src/4.1/build/) and locate `multilib` file for your platform.
1818
- Execute `multilib` file to build `x265` library.
1919
- Multi-bitdepth library will be located in newly created `8bit` directory
@@ -30,6 +30,6 @@ The provided source code was built and tested using the x265 library version 4.1
3030
```
3131

3232
- Set `X265ROOT` environment variable pointing to `x265_root`.
33-
- Build the plugin (see [BUILDING.md](../../../BUILDING.md))
33+
- Build and install the plugin (see [BUILDING.md](../../../BUILDING.md))
3434
- Copy x265 shared library (`libx265.so` or `libx265.dll`)
3535
and plugin library (`libdee_plugin_hevc_enc_x265.so` or `dee_plugin_hevc_enc_x265.dll`) to the DEE installation folder. The plugin library file can be renamed, but the extension must remain unchanged.

plugins/code/j2k_dec/kakadu/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ target_link_libraries(dee_plugin_j2k_dec_kakadu
3636
dee_plugins::dee_plugin_j2k_dec_kakadu_base
3737
)
3838

39+
if(COMMAND kakadu_fix_install_name)
40+
# Changes kakadu relative path reference to @loader_path/<libname> in the plugin library on macOS
41+
kakadu_fix_install_name(dee_plugin_j2k_dec_kakadu)
42+
endif()
43+
3944
install(TARGETS dee_plugin_j2k_dec_kakadu
4045
EXPORT dee_plugin_j2k_dec_kakaduTargets
4146
)

plugins/code/j2k_dec/kakadu/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Kakadu JPEG2000 decoder plugin for Dolby Encoding Engine
22

3-
The provided source code was built and tested using the Kakadu SDK version 8.4.
3+
The provided source code was built and tested using the Kakadu SDK version 8.6.0.
44

55
## Build tools:
66
- Visual Studio 2022
@@ -64,19 +64,19 @@ A typical Kakadu SDK directory structure is shown below. Note that, in addition
6464
│ │ └── ...
6565
│ ├── lib
6666
│ │ ├── Linux-x86-64-gcc
67-
│ │ │   └── libkdu_v84R.so
67+
│ │ │   └── libkdu_v86R.so
6868
│ │ ├── Mac-x86-64-gcc
69-
│ │ │ └── libkdu_v84R.so
69+
│ │ │ └── libkdu_v86R.so
7070
│ │ └── ...
7171
│ └── ...
7272
├── bin_x64
73-
│ └── kdu_v84R.dll
73+
│ └── kdu_v86R.dll
7474
└── lib_x64
75-
└── kdu_v84R.lib
75+
└── kdu_v86R.lib
7676
```
7777

7878
## Build instructions
7979

8080
Set up the Kakadu directory as described above, and set the `KDUROOT` environment variable to point to that folder. Note that on Windows, the binaries are located outside the `KDUROOT` folder, as this is where Kakadu build files place them by default.
8181

82-
Build the plugin (see [BUILDING.md](../../../BUILDING.md)), then copy the Kakadu shared libraries (e.g., `libkdu_v84R.so` or `kdu_v84R.dll`) and the plugin library (e.g., `libdee_plugin_j2k_dec_kakadu.so` or `dee_plugin_j2k_dec_kakadu.dll`) to the DEE installation folder. The plugin library file may be renamed, but its file extension must remain unchanged.
82+
Build and install the plugin (see [BUILDING.md](../../../BUILDING.md)), then copy the Kakadu shared libraries (e.g., `libkdu_v86R.so` or `kdu_v86R.dll`) and the plugin library (e.g., `libdee_plugin_j2k_dec_kakadu.so` or `dee_plugin_j2k_dec_kakadu.dll`) to the DEE installation folder. The plugin library file may be renamed, but its file extension must remain unchanged.

plugins/code/j2k_dec/kakadu/cmake/kakaduConfig.cmake

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
1313
set(MACOS_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
1414
endif()
1515

16-
set(KAKADU_LIBNAME "libkdu_v84R.so")
16+
set(KAKADU_LIBNAME "libkdu_v86R.so")
1717
if(MACOS_ARCH STREQUAL "arm64")
1818
set(KAKADU_LIBDIR "lib/Mac-arm-64-gcc")
1919
elseif(MACOS_ARCH STREQUAL "x86_64")
@@ -23,9 +23,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
2323
endif()
2424
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
2525
set(KAKADU_LIBDIR "../bin_x64")
26-
set(KAKADU_LIBNAME "kdu_v84R.dll")
26+
set(KAKADU_LIBNAME "kdu_v86R.dll")
2727
set(KAKADU_IMPLIBDIR "../lib_x64")
28-
set(KAKADU_IMPLIBNAME "kdu_v84R.lib")
28+
set(KAKADU_IMPLIBNAME "kdu_v86R.lib")
2929
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
3030
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm|aarch64)")
3131
set(KAKADU_LIBDIR "lib/Linux-arm-64-gcc")
@@ -34,22 +34,26 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
3434
else()
3535
message(FATAL_ERROR "Unsupported Linux architecture")
3636
endif()
37-
set(KAKADU_LIBNAME "libkdu_v84R.so")
37+
set(KAKADU_LIBNAME "libkdu_v86R.so")
3838
else()
3939
message(FATAL_ERROR "Not supported OS/architecture")
4040
endif()
4141

42-
add_library(kakadu::kdu SHARED IMPORTED)
43-
set_target_properties(kakadu::kdu
44-
PROPERTIES
45-
IMPORTED_LOCATION "$ENV{KDUROOT}/${KAKADU_LIBDIR}/${KAKADU_LIBNAME}"
46-
INTERFACE_INCLUDE_DIRECTORIES "$ENV{KDUROOT}/coresys/common"
47-
)
48-
49-
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
42+
if (UNIX)
43+
add_library(kakadu::kdu INTERFACE IMPORTED)
44+
set_target_properties(kakadu::kdu
45+
PROPERTIES
46+
INTERFACE_LINK_DIRECTORIES "$ENV{KDUROOT}/${KAKADU_LIBDIR}"
47+
INTERFACE_LINK_LIBRARIES "${KAKADU_LIBNAME}"
48+
INTERFACE_INCLUDE_DIRECTORIES "$ENV{KDUROOT}/coresys/common"
49+
)
50+
else()
51+
add_library(kakadu::kdu SHARED IMPORTED)
5052
set_target_properties(kakadu::kdu
5153
PROPERTIES
54+
IMPORTED_LOCATION "$ENV{KDUROOT}/${KAKADU_LIBDIR}/${KAKADU_LIBNAME}"
5255
IMPORTED_IMPLIB "$ENV{KDUROOT}/${KAKADU_IMPLIBDIR}/${KAKADU_IMPLIBNAME}"
56+
INTERFACE_INCLUDE_DIRECTORIES "$ENV{KDUROOT}/coresys/common"
5357
)
5458
endif()
5559

@@ -77,4 +81,23 @@ target_link_libraries(kakadu::kakadu
7781
INTERFACE
7882
kakadu::kdu
7983
kakadu::support
80-
)
84+
)
85+
86+
# Function to fix Kakadu library references in a target on macOS
87+
function(kakadu_fix_install_name target)
88+
if(NOT APPLE OR NOT KAKADU_LIBNAME OR NOT KAKADU_LIBDIR)
89+
return()
90+
endif()
91+
92+
set(_libdir "${KAKADU_LIBDIR}")
93+
set(_libname "${KAKADU_LIBNAME}")
94+
95+
add_custom_command(TARGET ${target} POST_BUILD
96+
COMMAND install_name_tool -change
97+
"../../${_libdir}/${_libname}"
98+
"@loader_path/${_libname}"
99+
"$<TARGET_FILE:${target}>"
100+
COMMENT "Fixing Kakadu library reference in ${target}"
101+
VERBATIM
102+
)
103+
endfunction()

plugins/code/tiff_dec/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The provided source code was built and tested using the libtiff version 4.7.0.
1111
To build the plugin, you must first build and install the [libtiff 4.7.0](https://gitlab.com/libtiff/libtiff/-/releases/v4.7.0) `tiff` shared library.
1212
Use `cmake` to build and install libtiff libraries. Navigate to the extracted directory in terminal and invoke:
1313
- See all available configuration options:
14-
- `cmake -h`
14+
- `cmake -h`
1515
- Generate project with specific install prefix (and other options):
1616
- `cmake -B build -S . --install-prefix <INSTALL_PATH> [other options]`
1717
- Build project:
@@ -45,7 +45,7 @@ LIBTIFFROOT
4545

4646
## Build instructions
4747

48-
Build the plugin (see [BUILDING.md](../../BUILDING.md)), then copy the `tiff` shared library and plugin library:
48+
Build and install the plugin (see [BUILDING.md](../../BUILDING.md)), then copy the `tiff` shared library and plugin library:
4949
- on Linux: `LIBTIFFROOT/lib/libtiff.so` and `libdee_plugin_tiff_dec_libtiff.so`
5050
- on Windows: `LIBTIFFROOT/bin/tiff.dll` and `libdee_plugin_tiff_dec_libtiff.dll`
5151

0 commit comments

Comments
 (0)