Skip to content

Commit 2528311

Browse files
committed
Major refactoring.
New plugin repo, with CMake support. Only plugins compatible with recent DEE versions are kept. Deprecated plugins and plugin types have been removed.
1 parent c2e53ae commit 2528311

206 files changed

Lines changed: 1452 additions & 16286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plugins/BUILDING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Prerequisites
2+
3+
- CMake 3.24 or newer
4+
- gcc 9.4.0 or Visual Studio 2019
5+
6+
# Instructions
7+
8+
## Configure
9+
10+
By default, this CMake project builds all plugins.
11+
12+
For detailed instructions on where each plugin expects its dependent libraries to be located, please refer to the plugin's README file (e.g. x265 HEVC encoder plugin's [README.md](code/hevc_enc/x265/README.md)).
13+
14+
To exclude specific plugins from the build, use the appropriate CMake option during configuration. For example, to disable the Beamr HEVC encoder plugin:
15+
16+
```bash
17+
cmake -B build -S . -DDEE_PLUGINS_ENABLE_BEAMR_HEVC_ENCODER=OFF
18+
```
19+
20+
Depending on the target platform, it may be necessary to specify options such as the MSVC multi-threaded statically linked runtime library using `-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded"`, or position-independent code using `-DCMAKE_POSITION_INDEPENDENT_CODE=ON`.
21+
22+
Specifying an option that is unsupported on a given platform will simply be ignored, so it is fine to provide both settings:
23+
24+
```bash
25+
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -DCMAKE_POSITION_INDEPENDENT_CODE=ON
26+
```
27+
28+
Please refer to [CMakeLists.txt](CMakeLists.txt) for more build options.
29+
30+
## Build
31+
32+
To build the project, run:
33+
34+
```bash
35+
cmake --build build --config Release -j
36+
```

plugins/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 3.24)
2+
3+
project(dee-plugins)
4+
5+
option(DEE_PLUGINS_ENABLE_BEAMR_HEVC_ENCODER "Enables beamr HEVC encoder" ON)
6+
option(DEE_PLUGINS_ENABLE_X265_HEVC_ENCODER "Enables x265 HEVC encoder" ON)
7+
option(DEE_PLUGINS_ENABLE_KAKADU_J2K_DECODER "Enables kakadu J2K decoder" ON)
8+
option(DEE_PLUGINS_ENABLE_LIBTIFF_TIFF_DECODER "Enables libtiff TIFF decoder" ON)
9+
option(DEE_PLUGINS_ENABLE_DUMMY_IMAGE_TRANSFORMER "Enables dummy image transformer" ON)
10+
11+
include(GNUInstallDirs)
12+
13+
add_subdirectory(code)

plugins/code/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
add_subdirectory(api)
2+
add_subdirectory(common)
3+
add_subdirectory(hevc_enc)
4+
add_subdirectory(image_transformer)
5+
add_subdirectory(j2k_dec)
6+
add_subdirectory(tiff_dec)

plugins/code/api/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
add_subdirectory(hevc_enc)
2+
add_subdirectory(image_transformer)
3+
add_subdirectory(j2k_dec)
4+
add_subdirectory(prores_dec)
5+
add_subdirectory(tiff_dec)
6+
add_subdirectory(pcm_watermarker)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
add_library(hevc_enc_api INTERFACE)
2+
add_library(dee_plugins::hevc_enc_api ALIAS hevc_enc_api)
3+
4+
target_sources(hevc_enc_api
5+
INTERFACE
6+
FILE_SET HEADERS
7+
BASE_DIRS .
8+
FILES
9+
hevc_enc_api.h
10+
)
11+
12+
target_link_libraries(hevc_enc_api
13+
INTERFACE
14+
dee_plugins::plugins_common
15+
)
16+
17+
include(GNUInstallDirs)
18+
install(TARGETS hevc_enc_api
19+
EXPORT hevc_enc_apiTargets
20+
FILE_SET HEADERS
21+
)
22+
23+
install(EXPORT hevc_enc_apiTargets
24+
NAMESPACE dee_plugins::
25+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dee_plugins"
26+
)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@
3333
#ifndef __DEE_PLUGINS_HEVC_ENC_API_H__
3434
#define __DEE_PLUGINS_HEVC_ENC_API_H__
3535

36-
#include "common.h"
36+
#include "plugins_common.h"
3737

3838
#define HEVC_ENC_API_VERSION 2
3939

4040
#ifdef __cplusplus
4141
extern "C" {
4242
#endif
4343

44-
/* Framework sets/gets following properties. Each hevc_enc plugin should handle them.
44+
/* Framework sets/gets following properties. Each hevc_enc plugin should handle them.
4545
* PROPERTY : TYPE : VALUES : WHERE : COMMENT
4646
* -----------------------------------------------------------------------------
4747
* width : integer : n/a : hevc_enc_init
4848
* height : integer : n/a : hevc_enc_init
4949
* bit_depth : enum : [8,10] : hevc_enc_init : in DEE it is always '10'
50-
* frame_rate : enum : [23.976,24,25,29.97,30,48,59.94,60] : hevc_enc_init
50+
* frame_rate : enum : [23.976,24,25,29.97,30,48,59.94,60] : hevc_enc_init
5151
* color_space : enum : [i400,i420,i422,i444] : hevc_enc_init : in DEE it is always 'i420'
5252
* data_rate : integer : n/a : hevc_enc_init : value in kbps
5353
* max_vbv_data_rate : integer : n/a : hevc_enc_init : value in kbps
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
add_library(image_transformer_api INTERFACE)
2+
add_library(dee_plugins::image_transformer_api ALIAS image_transformer_api)
3+
4+
target_sources(image_transformer_api
5+
INTERFACE
6+
FILE_SET HEADERS
7+
BASE_DIRS .
8+
FILES
9+
image_transformer_api.h
10+
)
11+
12+
target_link_libraries(image_transformer_api
13+
INTERFACE
14+
dee_plugins::plugins_common
15+
)
16+
17+
include(GNUInstallDirs)
18+
install(TARGETS image_transformer_api
19+
EXPORT image_transformer_apiTargets
20+
FILE_SET HEADERS
21+
)
22+
23+
install(EXPORT image_transformer_apiTargets
24+
NAMESPACE dee_plugins::
25+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dee_plugins"
26+
)
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
/*
2+
* BSD 3-Clause License
3+
*
4+
* Copyright (c) 2017-2019, Dolby Laboratories
5+
* All rights reserved.
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* * Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* * Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
17+
* * Neither the name of the copyright holder nor the names of its
18+
* contributors may be used to endorse or promote products derived from
19+
* this software without specific prior written permission.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
#ifndef __DEE_PLUGINS_IMG_TRANSFORMER_API_H__
34+
#define __DEE_PLUGINS_IMG_TRANSFORMER_API_H__
35+
36+
#include "plugins_common.h"
37+
#include <cstdint>
38+
#define IMG_TRANSFORMER_API_VERSION 1
39+
40+
#ifdef __cplusplus
41+
extern "C" {
42+
#endif
43+
44+
typedef enum {
45+
PLANAR = 0,
46+
INTERLEAVED
47+
}ImgTransformerArrangement;
48+
49+
typedef enum {
50+
FORMAT_UNKNOWN = 0,
51+
FORMAT_RAW,
52+
FORMAT_JPEG2000,
53+
FORMAT_PRORES,
54+
FORMAT_TIFF,
55+
}ImgTransformerFormat;
56+
57+
typedef enum {
58+
CODEC_UNSPECIFIED = 0,
59+
CODEC_JPEG2000,
60+
CODEC_PRORES_APCH,
61+
CODEC_PRORES_APCN,
62+
CODEC_PRORES_APCS,
63+
CODEC_PRORES_APCO,
64+
CODEC_PRORES_AP4H,
65+
CODEC_PRORES_AP4X,
66+
CODEC_TIFF,
67+
CODEC_NONE,
68+
}ImgTransformerCodec;
69+
70+
typedef enum {
71+
CHROMA_UNKNOWN = 0,
72+
CHROMA_ACES, /**< Academy Color Encoding Space primaries */
73+
CHROMA_DCI, /**< DCI P3 primaries with 0.314, 0.351 white */
74+
CHROMA_P3D65, /**< Standard Pulsar display space */
75+
CHROMA_REC709, /**< RGB, primaries / white per Rec. 709 */
76+
CHROMA_REC2020 /**< RGB, primaries / white per Rec. 2020 */
77+
}ImgTransformerChroma;
78+
79+
typedef enum {
80+
COLOR_SPACE_UNKNOWN = 0,
81+
COLOR_SPACE_RGB, /**< RGB */
82+
COLOR_SPACE_REC709_YUV, /**< Y'U'V' per Rec. 709 */
83+
COLOR_SPACE_REC2020_YUV, /**< Y'U'V' per Rec. 2020 */
84+
COLOR_SPACE_IPTc2 /**< Proposed mobile representation */
85+
}ImgTransformerColorspace;
86+
87+
typedef enum {
88+
EOTF_UNKNOWN = 0,
89+
EOTF_PQ, /**< PQ encoding */
90+
EOTF_BT1886, /**< Rec. BT1886 gamma */
91+
EOTF_REC709, /**< Rec. 709 gamma with linear section at bottom */
92+
EOTF_HLG,
93+
}ImgTransformerEotf;
94+
95+
typedef enum {
96+
RANGE_UNKNOWN = 0,
97+
RANGE_COMPUTER, /**< Computer or full range, 0 thru (2^bits - 1)) */
98+
RANGE_SDI, /**< SMPTE SDI valid range (16 thru (2^bits - 17)) */
99+
RANGE_LEGAL /**< SMPTE SDI valid range, scale = 2^(bits - 8), 16*scale thru 235*scale for luma / 240*scale for chroma */
100+
}ImgTransformerRange;
101+
102+
typedef enum {
103+
BIT_DEPTH_UNKNOWN = 0,
104+
BIT_DEPTH_UINT8, /**< 8 bits per color */
105+
BIT_DEPTH_UINT10_LSB, /**< 10 lower bits of 16 (0 - 1023) */
106+
BIT_DEPTH_UINT12_LSB, /**< 12 lower bits of 16 (0 - 4095) */
107+
BIT_DEPTH_UINT14_LSB, /**< 14 lower bits of 16 (0 - 16383) */
108+
BIT_DEPTH_UINT16 /**< 16 bits per color */
109+
}ImgTransformerBitdepth;
110+
111+
typedef enum {
112+
SUBSAMPLING_S444 = 0,
113+
SUBSAMPLING_S422,
114+
SUBSAMPLING_S420,
115+
}ImgTransformerSubsampling;
116+
117+
typedef struct {
118+
int64_t numerator;
119+
int64_t denominator;
120+
}ImgTransformerPts;
121+
122+
typedef struct {
123+
int64_t top;
124+
int64_t bottom;
125+
int64_t left;
126+
int64_t right;
127+
} ImgTransformerLetterbox;
128+
129+
typedef struct {
130+
double cfr;
131+
int64_t start;
132+
int64_t duration;
133+
int64_t preroll;
134+
int64_t postroll;
135+
}ImgTransformerProgram;
136+
137+
typedef struct {
138+
uint8_t* buffer;
139+
// int64_t bufferSize;
140+
int64_t size;
141+
} ImgTransformerData;
142+
143+
typedef struct {
144+
char* metadataFilename;
145+
int64_t metadataPosition;
146+
ImgTransformerFormat format;
147+
ImgTransformerCodec codec;
148+
ImgTransformerProgram program;
149+
int64_t width;
150+
int64_t height;
151+
ImgTransformerSubsampling subsampling;
152+
ImgTransformerBitdepth bitdepth;
153+
ImgTransformerChroma chroma;
154+
ImgTransformerColorspace colorspace;
155+
ImgTransformerEotf eotf;
156+
ImgTransformerRange range;
157+
ImgTransformerLetterbox letterbox;
158+
ImgTransformerPts pts;
159+
ImgTransformerArrangement arrangement;
160+
} ImgTransformerMetadata;
161+
162+
typedef struct {
163+
ImgTransformerMetadata metadata;
164+
ImgTransformerData data;
165+
} ImgTransformerFrame;
166+
167+
typedef struct {
168+
const Property* properties;
169+
size_t count;
170+
} ImgTransformerInitParams;
171+
172+
typedef void* ImgTransformerHandle;
173+
174+
typedef size_t (*ImgTransformerGetInfo)(const PropertyInfo** info);
175+
176+
typedef size_t (*ImgTransformerGetSize)();
177+
178+
typedef Status (*ImgTransformerInit)(ImgTransformerHandle handle, const ImgTransformerInitParams* initParams);
179+
180+
typedef Status (*ImgTransformerClose)(ImgTransformerHandle handle);
181+
182+
typedef Status (*ImgTransformerProcess) (ImgTransformerHandle handle, ImgTransformerFrame* inFrame);
183+
184+
typedef const char* (*ImgTransformerGetMessage)(ImgTransformerHandle handle);
185+
186+
typedef struct {
187+
const char* pluginName;
188+
ImgTransformerGetInfo getInfo;
189+
ImgTransformerGetSize getSize;
190+
ImgTransformerInit init;
191+
ImgTransformerClose close;
192+
ImgTransformerProcess process;
193+
ImgTransformerGetMessage getMessage;
194+
} ImgTransformerApi;
195+
196+
DLB_EXPORT
197+
ImgTransformerApi* imgTransformerGetApi();
198+
199+
typedef ImgTransformerApi* (*ImgTransformerGetApi)();
200+
201+
DLB_EXPORT
202+
int imgTransformerGetApiVersion(void);
203+
204+
typedef int (*ImgTransformerGetApiVersion)(void);
205+
206+
#ifdef __cplusplus
207+
}
208+
#endif
209+
210+
#endif // __DLB_PLUGINS_MP4_MUX_API_H__
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
add_library(j2k_dec_api INTERFACE)
2+
add_library(dee_plugins::j2k_dec_api ALIAS j2k_dec_api)
3+
4+
target_sources(j2k_dec_api
5+
INTERFACE
6+
FILE_SET HEADERS
7+
BASE_DIRS .
8+
FILES
9+
j2k_dec_api.h
10+
)
11+
12+
target_link_libraries(j2k_dec_api
13+
INTERFACE
14+
dee_plugins::plugins_common
15+
)
16+
17+
include(GNUInstallDirs)
18+
install(TARGETS j2k_dec_api
19+
EXPORT j2k_dec_apiTargets
20+
FILE_SET HEADERS
21+
)
22+
23+
install(EXPORT j2k_dec_apiTargets
24+
NAMESPACE dee_plugins::
25+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/dee_plugins"
26+
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#ifndef __DEE_PLUGINS_J2K_DEC_API_H__
3434
#define __DEE_PLUGINS_J2K_DEC_API_H__
3535

36-
#include "common.h"
36+
#include "plugins_common.h"
3737

3838
#define J2K_DEC_API_VERSION 2
3939

0 commit comments

Comments
 (0)