Skip to content

Commit 17968d8

Browse files
committed
Release 2021.2.2
1 parent 77054c3 commit 17968d8

File tree

310 files changed

+53452
-3829
lines changed

Some content is hidden

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

310 files changed

+53452
-3829
lines changed

CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ##############################################################################
2-
# Copyright (C) 2020 Intel Corporation
2+
# Copyright (C) Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ##############################################################################
@@ -8,9 +8,8 @@ cmake_minimum_required(VERSION 3.10.2)
88

99
file(STRINGS "version.txt" version_txt)
1010
project(oneVPL VERSION ${version_txt})
11-
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
12-
message(FATAL_ERROR "Unsupported architecture: only 64-bit supported")
13-
endif()
11+
12+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1413

1514
#
1615
# Project configuration options
@@ -28,7 +27,7 @@ if(NOT CMAKE_BUILD_TYPE)
2827
endif()
2928

3029
# Project options
31-
option(OPTION_BUILD_EXAMPLES "Build examples." OFF)
30+
option(OPTION_COMPILE_PREVIEW_EXAMPLES "Build examples." OFF)
3231

3332
# Set output directories
3433
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
@@ -46,11 +45,8 @@ add_subdirectory(api)
4645
add_subdirectory(dispatcher)
4746
add_subdirectory(env)
4847
add_subdirectory(modulefiles)
49-
add_subdirectory(tools/cli)
50-
add_subdirectory(examples/hello-decode)
51-
add_subdirectory(examples/hello-encode)
52-
add_subdirectory(examples/hello-vpp)
53-
add_subdirectory(examples/hello-transcode)
48+
add_subdirectory(tools)
49+
add_subdirectory(examples)
5450

5551
install(
5652
FILES third-party-programs.txt

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 158 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,42 @@ To build this project you will need:
2525
- A compiler with C++11 support
2626
- CMake 3.10 or newer
2727

28-
## Build and Installation
28+
## Build and Installation of this package
2929

3030
Build the project with the following commands:
3131

3232
```
33+
cd <vpl-repo-clone-location>
34+
3335
mkdir _build
3436
cd _build
3537
cmake .. -DCMAKE_INSTALL_PREFIX=<vpl-install-location>
3638
cmake --build . --config Release
39+
# optional, create a portable zip file from the build
40+
# cmake --build . --config Release --target package
3741
cmake --build . --config Release --target install
3842
```
3943

4044
You can find the build output in `<vpl-install-location>`.
4145

46+
Helper scripts are avalible in the `script` folder.
47+
48+
- bootstrap : builds any dependencies (none at this time). Built dependencies will be placed in the location stored in VPL_BUILD_DEPENDENCIES if the variable is defined.
49+
- clean : removes intermediate build results
50+
- build : builds the package (all but the last step above)
51+
- install : installs the package (the last step above). Package will be installed in the location stored in VPL_INSTALL_DIR if the variable is defined.
52+
- test : run any smoke testing on the installed package
53+
54+
You can build the project using the scripts with the follwoing commands
55+
```
56+
cd <vpl-repo-clone-location>
57+
script/bootstrap
58+
script/build
59+
script/install
60+
```
61+
62+
Optionaly the environment variable VPL_INSTALL_DIR can be set to specify a location for the scripts to install the project.
63+
4264
## Getting an Implementation
4365

4466
To use oneVPL for video processing you need to install at least one
@@ -47,6 +69,141 @@ implementation. Current implementations:
4769
- [oneVPL-cpu](https://github.com/oneapi-src/oneVPL-cpu), the CPU reference
4870
implementation
4971

72+
## Building Base and CPU Implementations
73+
74+
Normally you don't just want to build the base package, which is limited to the dispatcher and samples. You want to
75+
be able to do actual work like decoding video. To do this you need an implemetnation. As described above the CPU
76+
implementation is delivered alongside the Base package.
77+
78+
You can extend the project build commands above as follows to also build the CPU implementation.
79+
80+
```
81+
cd <vpl-repo-clone-location>
82+
83+
mkdir _build
84+
cd _build
85+
cmake .. -DCMAKE_INSTALL_PREFIX=<vpl-install-location>
86+
cmake --build . --config Release
87+
cmake --build . --config Release --target package
88+
cmake --build . --config Release --target install
89+
90+
cd <vpl-cpu-repo-clone-location>
91+
92+
# optional, specify an external cache folder to store dependencies
93+
export VPL_BUILD_DEPENDENCIES=<dependencies-cache>
94+
95+
# Build 3rd party dependencies.
96+
source script/bootstrap
97+
98+
mkdir _build
99+
cd _build
100+
cmake .. -DCMAKE_INSTALL_PREFIX=<vpl-install-location>
101+
cmake --build . --config Release
102+
cmake --build . --config Release --target package
103+
cmake --build . --config Release --target install
104+
```
105+
106+
You can find the build output in `<vpl-install-location>`.
107+
108+
Helper scripts to build Base and CPU implemenation are avalible in the `script/e2e` folder.
109+
110+
- bootstrap : builds any dependencies.
111+
- clean : removes intermediate build results
112+
- build : builds and installs the package
113+
- test : run any smoke testing on the installed package
114+
115+
These scripts assume oneVPL and oneVPL-cpu are cloned into the same parent folder
116+
117+
Note: `.bat` versions are also provided for Windows.
118+
119+
### Using End-To-End Scripts
120+
121+
You can build oneVPL base and CPU implementation with the End-To-End scripts using the following commands:
122+
123+
```
124+
cd <vpl-root>
125+
oneVPL/script/e2e/bootstrap
126+
oneVPL/script/e2e/build
127+
```
128+
129+
Optionaly you may set the environment variables VPL_INSTALL_DIR and
130+
VPL_BUILD_DEPENDENCIES to specify a location to install the project and to
131+
store the built dependencies respectivly.
132+
133+
134+
```
135+
cd <vpl-root>
136+
137+
export VPL_BUILD_DEPENDENCIES=<dependencies-cache>
138+
export VPL_INSTALL_DIR=<vpl-install-location>
139+
140+
oneVPL/script/e2e/bootstrap
141+
oneVPL/script/e2e/build
142+
```
143+
144+
You can also clear build results by calling the clean script.
145+
Note, if VPL_INSTALL_DIR is set it will be cleared too.
146+
147+
148+
```
149+
cd <vpl-root>
150+
151+
oneVPL/script/e2e/clean
152+
```
153+
154+
A complete rebuild can be forced by cleaning and then rebuilding.
155+
156+
```
157+
cd <vpl-root>
158+
159+
export VPL_BUILD_DEPENDENCIES=<dependencies-cache>
160+
export VPL_INSTALL_DIR=<vpl-install-location>
161+
162+
oneVPL/script/e2e/clean
163+
oneVPL/script/e2e/bootstrap
164+
oneVPL/script/e2e/build
165+
```
166+
167+
## Developer Usage
168+
169+
### Configure the Environment
170+
171+
If you did not install to standard system locations, you need to set up the
172+
environment, so tools like CMake and pkg-config can find the library and
173+
headers.
174+
175+
For Linux:
176+
```
177+
source <vpl-install-location>/env/vars.sh
178+
```
179+
180+
For Windows:
181+
```
182+
<vpl-install-location>\env\vars.bat
183+
```
184+
185+
186+
### Link to oneVPL with CMake
187+
188+
Add the following code to your CMakeLists, assuming TARGET is defined as the
189+
component that wants to use oneVPL:
190+
191+
```
192+
find_package(VPL REQUIRED)
193+
target_link_libraries(${TARGET} VPL::dispatcher)
194+
```
195+
196+
197+
### Link to oneVPL from Bash with pkg-config
198+
199+
The following command line illustrates how to link a simple program to oneVPL
200+
using pkg-config.
201+
202+
```
203+
gcc program.cpp `pkg-config --cflags --libs vpl`
204+
```
205+
206+
50207
## Contributing
51208

52209
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

api/CMakeLists.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
# ##############################################################################
2-
# Copyright (C) 2020 Intel Corporation
2+
# Copyright (C) Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ##############################################################################
66
# oneAPI Video Processing Library (oneVPL) API build script
77
cmake_minimum_required(VERSION 3.10.2)
88

9+
set(VPL_API_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
10+
11+
if(DEFINED ENV{ONEVPL_API_HEADER_DIRECTORY})
12+
set(VPL_API_INCLUDE_DIR $ENV{ONEVPL_API_HEADER_DIRECTORY})
13+
message(STATUS "Using custom API header directory: ${VPL_API_INCLUDE_DIR}")
14+
endif()
15+
916
# get API version
10-
file(READ vpl/mfxdefs.h mfxdefs)
17+
file(READ ${VPL_API_INCLUDE_DIR}/vpl/mfxdefs.h mfxdefs)
18+
1119
string(REGEX MATCH "MFX_VERSION_MAJOR ([0-9]*)" _ ${mfxdefs})
20+
set(API_VERSION_MAJOR ${CMAKE_MATCH_1})
1221
set(API_VERSION_MAJOR
13-
${CMAKE_MATCH_1}
22+
${API_VERSION_MAJOR}
23+
PARENT_SCOPE)
24+
25+
string(REGEX MATCH "MFX_VERSION_MINOR ([0-9]*)" _ ${mfxdefs})
26+
set(API_VERSION_MINOR ${CMAKE_MATCH_1})
27+
set(API_VERSION_MINOR
28+
${API_VERSION_MINOR}
1429
PARENT_SCOPE)
1530

31+
message(STATUS "API version: ${API_VERSION_MAJOR}.${API_VERSION_MINOR}")
1632
add_library(vpl-api INTERFACE)
1733

18-
target_include_directories(vpl-api INTERFACE .)
34+
target_include_directories(vpl-api INTERFACE ${VPL_API_INCLUDE_DIR})
1935

2036
install(
21-
DIRECTORY vpl
37+
DIRECTORY ${VPL_API_INCLUDE_DIR}/vpl
2238
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
2339
COMPONENT dev)

api/libmfx.pc.in

Lines changed: 0 additions & 11 deletions
This file was deleted.

api/vpl/mfxadapter.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ extern "C"
2929
@p input_info or adapters pointer is NULL. \n
3030
MFX_ERR_NOT_FOUND No suitable adapters found. \n
3131
MFX_WRN_OUT_OF_RANGE Not enough memory to report back entire list of adapters. In this case as many adapters as possible will be returned.
32+
33+
@since This function is available since API version 1.31.
3234
*/
3335
mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapters);
3436

@@ -45,6 +47,8 @@ mfxStatus MFX_CDECL MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersIn
4547
MFX_ERR_NULL_PTR bitstream or @p adapters pointer is NULL. \n
4648
MFX_ERR_NOT_FOUND No suitable adapters found. \n
4749
MFX_WRN_OUT_OF_RANGE Not enough memory to report back entire list of adapters. In this case as many adapters as possible will be returned.
50+
51+
@since This function is available since API version 1.31.
4852
*/
4953
mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAdaptersInfo* adapters);
5054

@@ -57,6 +61,8 @@ mfxStatus MFX_CDECL MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec
5761
@return
5862
MFX_ERR_NONE The function completed successfully. \n
5963
MFX_ERR_NULL_PTR num_adapters pointer is NULL.
64+
65+
@since This function is available since API version 1.31.
6066
*/
6167
mfxStatus MFX_CDECL MFXQueryAdaptersNumber(mfxU32* num_adapters);
6268
#ifdef __cplusplus

api/vpl/mfxbrc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ enum {
7676
MFX_BRC_PANIC_SMALL_FRAME = 4 /*!< Coded frame is too small, no further recoding possible - required padding to mfxBRCFrameStatus::MinFrameSize. */
7777
};
7878

79-
MFX_PACK_BEGIN_USUAL_STRUCT()
79+
MFX_PACK_BEGIN_STRUCT_W_PTR()
8080
/*!
8181
Specifies instructions for the encoder provided by external BRC after each frame encoding. See the BRCStatus enumerator for details.
8282
*/

0 commit comments

Comments
 (0)