From b5261b2d7cd3a1e9dfb857ad5a0664766dbd385c Mon Sep 17 00:00:00 2001 From: Hemal Shah Date: Wed, 20 Oct 2021 10:38:15 -0700 Subject: [PATCH] NVIDIA Isaac ROS - EA2 Release release-ea2: 5fd7ed086de471571e4e221d048db069555e1f40 --- .gitattributes | 7 + .gitignore | 5 + README.md | 60 +- docker/Dockerfile.aarch64.base | 112 +- docker/Dockerfile.x86_64.base | 68 +- docker/tensor_rt/trtexec_x86_64 | 3 + .../isaac_ros_common/vpi_utilities.hpp | 2 +- isaac_ros_nvengine/CMakeLists.txt | 110 + isaac_ros_nvengine/config/manifest.yaml | 11 + isaac_ros_nvengine/config/test_tensor.yaml | 63 + isaac_ros_nvengine/gxf/AMENT_IGNORE | 0 isaac_ros_nvengine/gxf/include/core/any.hpp | 29 + .../gxf/include/core/assert.hpp | 124 + isaac_ros_nvengine/gxf/include/core/byte.hpp | 24 + .../gxf/include/core/expected.hpp | 710 +++ .../gxf/include/core/fixed_vector.hpp | 355 ++ .../gxf/include/core/logger.hpp | 82 + .../gxf/include/core/memory_utils.hpp | 160 + .../gxf/include/core/optional.hpp | 29 + .../gxf/include/core/type_name.hpp | 61 + .../gxf/include/core/type_name_gnuc.hpp | 37 + .../gxf/include/core/type_utils.hpp | 162 + .../gxf/include/gxf/core/component.hpp | 102 + .../gxf/include/gxf/core/entity.hpp | 299 + .../gxf/include/gxf/core/expected.hpp | 104 + isaac_ros_nvengine/gxf/include/gxf/core/gxf.h | 820 +++ .../gxf/include/gxf/core/gxf_ext.h | 169 + .../gxf/include/gxf/core/handle.hpp | 190 + .../gxf/include/gxf/core/parameter.hpp | 329 + .../gxf/include/gxf/core/registrar.hpp | 170 + .../gxf/include/gxf/cuda/cuda_stream.hpp | 91 + .../gxf/include/gxf/network/tcp_client.hpp | 59 + .../gxf/include/gxf/network/tcp_server.hpp | 61 + .../gxf/include/gxf/npp/nppi_mul_c.hpp | 44 + .../gxf/include/gxf/npp/nppi_set.hpp | 46 + .../gxf/include/gxf/sample/ping_rx.hpp | 37 + .../gxf/include/gxf/sample/ping_tx.hpp | 39 + .../serialization/component_serializer.hpp | 128 + .../gxf/serialization/entity_recorder.hpp | 57 + .../gxf/serialization/entity_replayer.hpp | 58 + .../std_component_serializer.hpp | 45 + .../gxf/include/gxf/std/allocator.hpp | 48 + .../gxf/include/gxf/std/clock.hpp | 84 + .../gxf/include/gxf/std/codelet.hpp | 96 + .../include/gxf/std/component_allocator.hpp | 51 + .../gxf/include/gxf/std/component_factory.hpp | 52 + .../gxf/include/gxf/std/default_extension.hpp | 127 + .../gxf/std/double_buffer_receiver.hpp | 65 + .../gxf/include/gxf/std/extension.hpp | 77 + .../gxf/std/extension_factory_helper.hpp | 112 + .../std/gems/staging_queue/staging_queue.hpp | 353 ++ .../staging_queue/staging_queue_iterator.hpp | 107 + .../gxf/include/gxf/std/memory_buffer.hpp | 118 + .../gxf/include/gxf/std/metric.hpp | 83 + .../gxf/include/gxf/std/monitor.hpp | 36 + .../gxf/std/new_component_allocator.hpp | 71 + .../gxf/include/gxf/std/parameter_parser.hpp | 223 + .../include/gxf/std/parameter_parser_std.hpp | 140 + .../include/gxf/std/parameter_registrar.hpp | 364 ++ .../gxf/include/gxf/std/parameter_storage.hpp | 212 + .../gxf/include/gxf/std/queue.hpp | 53 + .../gxf/include/gxf/std/receiver.hpp | 51 + .../include/gxf/std/scheduling_condition.hpp | 54 + .../gxf/include/gxf/std/scheduling_term.hpp | 54 + .../gxf/include/gxf/std/scheduling_terms.hpp | 209 + .../gxf/include/gxf/std/system.hpp | 51 + .../gxf/include/gxf/std/tensor.hpp | 311 + .../gxf/include/gxf/std/timestamp.hpp | 31 + .../gxf/include/gxf/std/transmitter.hpp | 49 + .../gxf/include/gxf/std/type_registry.hpp | 52 + .../gxf/include/gxf/test/extensions/LICENSE | 13 + .../gxf/test/extensions/entity_monitor.hpp | 29 + .../gxf/test/extensions/tensor_comparator.hpp | 84 + .../gxf/test/extensions/tensor_generator.hpp | 62 + .../gxf/test/extensions/test_helpers.hpp | 1004 +++ .../gxf/test/extensions/test_metric.hpp | 115 + .../gxf/test/extensions/test_parameters.hpp | 447 ++ .../gxf/include/third_party/LICENSE.txt | 3880 ++++++++++++ .../gxf/lib/gxf_jetpack46/core/libgxf_core.so | 3 + .../gxf/lib/gxf_jetpack46/cuda/libgxf_cuda.so | 3 + .../lib/gxf_jetpack46/libgxf_ros_bridge.so | 3 + .../multimedia/libgxf_multimedia.so | 3 + .../gxf_jetpack46/network/libgxf_network.so | 3 + .../gxf/lib/gxf_jetpack46/npp/libgxf_npp.so | 3 + .../lib/gxf_jetpack46/sample/libgxf_sample.so | 3 + .../serialization/libgxf_serialization.so | 3 + .../gxf/lib/gxf_jetpack46/std/libgxf_std.so | 3 + .../tensor_rt/libgxf_tensor_rt.so | 3 + .../gxf/lib/gxf_jetpack46/triton/LICENSE.txt | 5484 +++++++++++++++++ .../gxf_jetpack46/triton/LicenseAgreement.pdf | Bin 0 -> 131 bytes .../gxf_jetpack46/triton/libgxf_triton_ext.so | 3 + .../triton/libnvbuf_fdmap.so.1.0.0 | 3 + .../gxf_jetpack46/triton/libnvbufsurface.so | 3 + .../triton/libnvbufsurftransform.so | 3 + .../triton/libnvds_infer_server.so | 3 + .../triton/libnvds_inferutils.so | 3 + .../gxf_x86_64_cuda_11_4/core/libgxf_core.so | 3 + .../gxf_x86_64_cuda_11_4/cuda/libgxf_cuda.so | 3 + .../gxf_x86_64_cuda_11_4/libgxf_ros_bridge.so | 3 + .../multimedia/libgxf_multimedia.so | 3 + .../network/libgxf_network.so | 3 + .../gxf_x86_64_cuda_11_4/npp/libgxf_npp.so | 3 + .../sample/libgxf_sample.so | 3 + .../serialization/libgxf_serialization.so | 3 + .../gxf_x86_64_cuda_11_4/std/libgxf_std.so | 3 + .../tensor_rt/libgxf_tensor_rt.so | 3 + .../gxf_x86_64_cuda_11_4/triton/LICENSE.txt | 5484 +++++++++++++++++ .../triton/LicenseAgreement.pdf | Bin 0 -> 131 bytes .../triton/libgxf_triton_ext.so | 3 + .../triton/libnvbuf_fdmap.so | 3 + .../triton/libnvbufsurface.so | 3 + .../triton/libnvbufsurftransform.so | 3 + .../triton/libnvds_infer_server.so | 3 + .../triton/libnvds_inferutils.so | 3 + .../include/isaac_ros_nvengine/gxe_node.hpp | 100 + .../ros_tensor_publisher_node.hpp | 41 + isaac_ros_nvengine/package.xml | 40 + isaac_ros_nvengine/src/gxe_node.cpp | 346 ++ isaac_ros_nvengine/src/nvengine_main.cpp | 33 + .../src/ros_tensor_publisher_node.cpp | 63 + isaac_ros_nvengine/src/tensor_publish.cpp | 33 + .../test/isaac_ros_nvengine_pol.py | 125 + isaac_ros_nvengine_interfaces/CMakeLists.txt | 40 + isaac_ros_nvengine_interfaces/msg/Tensor.msg | 25 + .../msg/TensorList.msg | 4 + .../msg/TensorShape.msg | 5 + isaac_ros_nvengine_interfaces/package.xml | 37 + isaac_ros_test/isaac_ros_test/__init__.py | 6 +- .../isaac_ros_test/json_conversion.py | 26 +- isaac_ros_test/isaac_ros_test/pcd_loader.py | 125 + .../isaac_ros_test/pose_utilities.py | 124 + scripts/README.md | 2 +- scripts/run_dev.sh | 74 +- 133 files changed, 26300 insertions(+), 43 deletions(-) create mode 100755 docker/tensor_rt/trtexec_x86_64 create mode 100644 isaac_ros_nvengine/CMakeLists.txt create mode 100644 isaac_ros_nvengine/config/manifest.yaml create mode 100644 isaac_ros_nvengine/config/test_tensor.yaml create mode 100644 isaac_ros_nvengine/gxf/AMENT_IGNORE create mode 100644 isaac_ros_nvengine/gxf/include/core/any.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/assert.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/byte.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/expected.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/fixed_vector.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/logger.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/memory_utils.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/optional.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/type_name.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/type_name_gnuc.hpp create mode 100644 isaac_ros_nvengine/gxf/include/core/type_utils.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/component.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/entity.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/expected.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/gxf.h create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/gxf_ext.h create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/handle.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/parameter.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/core/registrar.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/cuda/cuda_stream.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/network/tcp_client.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/network/tcp_server.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/npp/nppi_mul_c.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/npp/nppi_set.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/sample/ping_rx.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/sample/ping_tx.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/serialization/component_serializer.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/serialization/entity_recorder.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/serialization/entity_replayer.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/serialization/std_component_serializer.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/allocator.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/clock.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/codelet.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/component_allocator.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/component_factory.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/default_extension.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/double_buffer_receiver.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/extension.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/extension_factory_helper.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue_iterator.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/memory_buffer.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/metric.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/monitor.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/new_component_allocator.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser_std.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/parameter_registrar.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/parameter_storage.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/queue.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/receiver.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/scheduling_condition.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/scheduling_term.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/scheduling_terms.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/system.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/tensor.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/timestamp.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/transmitter.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/std/type_registry.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/LICENSE create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/entity_monitor.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_comparator.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_generator.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_helpers.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_metric.hpp create mode 100644 isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_parameters.hpp create mode 100644 isaac_ros_nvengine/gxf/include/third_party/LICENSE.txt create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/core/libgxf_core.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/cuda/libgxf_cuda.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/libgxf_ros_bridge.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/multimedia/libgxf_multimedia.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/network/libgxf_network.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/npp/libgxf_npp.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/sample/libgxf_sample.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/serialization/libgxf_serialization.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/std/libgxf_std.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/tensor_rt/libgxf_tensor_rt.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LICENSE.txt create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LicenseAgreement.pdf create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libgxf_triton_ext.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbuf_fdmap.so.1.0.0 create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurface.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurftransform.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_infer_server.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_inferutils.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/core/libgxf_core.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/cuda/libgxf_cuda.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/libgxf_ros_bridge.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/multimedia/libgxf_multimedia.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/network/libgxf_network.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/npp/libgxf_npp.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/sample/libgxf_sample.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/serialization/libgxf_serialization.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/std/libgxf_std.so create mode 100755 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/tensor_rt/libgxf_tensor_rt.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LICENSE.txt create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LicenseAgreement.pdf create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libgxf_triton_ext.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbuf_fdmap.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurface.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurftransform.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_infer_server.so create mode 100644 isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_inferutils.so create mode 100644 isaac_ros_nvengine/include/isaac_ros_nvengine/gxe_node.hpp create mode 100644 isaac_ros_nvengine/include/isaac_ros_nvengine/ros_tensor_publisher_node.hpp create mode 100644 isaac_ros_nvengine/package.xml create mode 100644 isaac_ros_nvengine/src/gxe_node.cpp create mode 100644 isaac_ros_nvengine/src/nvengine_main.cpp create mode 100644 isaac_ros_nvengine/src/ros_tensor_publisher_node.cpp create mode 100644 isaac_ros_nvengine/src/tensor_publish.cpp create mode 100644 isaac_ros_nvengine/test/isaac_ros_nvengine_pol.py create mode 100644 isaac_ros_nvengine_interfaces/CMakeLists.txt create mode 100644 isaac_ros_nvengine_interfaces/msg/Tensor.msg create mode 100644 isaac_ros_nvengine_interfaces/msg/TensorList.msg create mode 100644 isaac_ros_nvengine_interfaces/msg/TensorShape.msg create mode 100644 isaac_ros_nvengine_interfaces/package.xml create mode 100644 isaac_ros_test/isaac_ros_test/pcd_loader.py create mode 100644 isaac_ros_test/isaac_ros_test/pose_utilities.py diff --git a/.gitattributes b/.gitattributes index 90698d51..9a2492da 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,3 +14,10 @@ *.npy filter=lfs diff=lfs merge=lfs -text # Debian package *.deb filter=lfs diff=lfs merge=lfs -text +# Shared libraries +*.so.* filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text + +# trtexec +trtexec_x86_64 filter=lfs diff=lfs merge=lfs -text + diff --git a/.gitignore b/.gitignore index b793570b..caca6537 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ # Ignore all pycache files **/__pycache__/** +# Ignore ROS build files +**/build/** +**/install/** +**/cc_internals/** +**/log/** diff --git a/README.md b/README.md index 4dd680a3..4c6fa925 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,60 @@ # Isaac ROS Common -Isaac ROS common utilities for use in conjunction with the Isaac ROS suite of packages. -Note: Please refer to `scripts/README.md` for script used to setup dev environment +Isaac ROS common utilities and scripts for use in conjunction with the Isaac ROS suite of packages. + +## Docker Scripts +`run_dev.sh` creates a dev environment with ROS2 installed and key versions of NVIDIA frameworks prepared for both x86_64 and Jetson. By default, the directory `/workspaces/isaac_ros-dev` in the container is mapped from `~/workspaces/isaac_ros-dev` on the host machine if it exists OR the current working directory from where the script was invoked otherwise. The host directory the container maps to can be explicitly set by running the script with the desired path as the first argument: +``` +scripts/run_dev.sh +``` + +## System Requirements +This script is designed and tested to be compatible with ROS2 Foxy on Jetson hardware in addition to on x86 systems with an Nvidia GPU. + +### Jetson +- AGX Xavier or Xavier NX +- JetPack 4.6 + +### x86_64 +- CUDA 11.1+ supported discrete GPU +- VPI 1.1.11 +- Ubuntu 20.04+ + +You must first install the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) to make use of the Docker container development/runtime environment. + +Configure `nvidia-container-runtime` as the default runtime for Docker by editing `/etc/docker/daemon.json` to include the following: +``` + "runtimes": { + "nvidia": { + "path": "nvidia-container-runtime", + "runtimeArgs": [] + } + }, + "default-runtime": "nvidia" +``` +and then restarting Docker: `sudo systemctl daemon-reload && sudo systemctl restart docker` + +**Note:** For best performance on Jetson, ensure that power settings are configured appropriately ([Power Management for Jetson](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/power_management_jetson_xavier.html#wwpID0EUHA)). + +## Troubleshooting +### `run_dev.sh` on x86 fails with `vpi-lib-1.1.11-cuda11-x86_64-linux.deb` is not a Debian format archive +When building a Docker image, `run_dev.sh` may fail because some files seem to be invalid. Debian packages for VPI on x86 are packaged in Isaac ROS using `git-lfs`. These files need to be fetched in order to install VPI in the Docker image. + +#### Symptoms +``` +dpkg-deb: error: 'vpi-lib-1.1.11-cuda11-x86_64-linux.deb' is not a Debian format archive +dpkg: error processing archive vpi-lib-1.1.11-cuda11-x86_64-linux.deb (--install): + dpkg-deb --control subprocess returned error exit status 2 +Errors were encountered while processing: + vpi-lib-1.1.11-cuda11-x86_64-linux.deb +``` +#### Solution +Run `git lfs pull` in each Isaac ROS repository you have checked out, especially `isaac_ros_common`, to ensure all of the large binary files have been downloaded. + + +# Updates + +| Date | Changes | +| -----| ------- | +| 2021-10-20 | Migrated to [NVIDIA-ISAAC-ROS](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common), added `isaac_ros_nvengine` and `isaac_ros_nvengine_interfaces` packages | +| 2021-08-11 | Initial release to [NVIDIA-AI-IOT](https://github.com/NVIDIA-AI-IOT/isaac_ros_common) | diff --git a/docker/Dockerfile.aarch64.base b/docker/Dockerfile.aarch64.base index 05e454fe..7079766c 100644 --- a/docker/Dockerfile.aarch64.base +++ b/docker/Dockerfile.aarch64.base @@ -6,8 +6,8 @@ # distribution of this software and related documentation without an express # license agreement from NVIDIA CORPORATION is strictly prohibited. -# Dockder file to aarch64 based Jetson device -ARG BASE_IMAGE=dustynv/ros:foxy-ros-base-l4t-r32.6.1 +# Docker file for aarch64 based Jetson device +ARG BASE_IMAGE="dustynv/ros:foxy-ros-base-l4t-r32.6.1" FROM ${BASE_IMAGE} # Disable terminal interaction for apt @@ -19,7 +19,9 @@ RUN apt-get update && apt-get install -y \ cmake \ curl \ git \ + lsb-release \ sudo \ + tar \ unzip \ vim \ wget \ @@ -46,6 +48,7 @@ RUN apt-get update && apt-get install -y \ python3-distutils \ libboost-all-dev \ libboost-dev \ + libpcl-dev \ && rm -rf /var/lib/apt/lists/* # sklearn dependencies @@ -70,13 +73,43 @@ RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.d git-lfs \ && rm -rf /var/lib/apt/lists/* +# Nvidia container runtime mounts cuda libraries from the host into the container, but dpkg still +# thinks that they are not installed. Tell dpkg that these libraries are installed so VPI's +# dependencies will be satisfied. +ARG DPKG_STATUS +RUN echo "$DPKG_STATUS" >> /var/lib/dpkg/status + +# Add nvidia repo/public key and install VPI libraries +RUN curl https://repo.download.nvidia.com/jetson/jetson-ota-public.asc > /etc/apt/trusted.gpg.d/jetson-ota-public.asc \ + && echo "deb https://repo.download.nvidia.com/jetson/common r32.6 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \ + && echo "deb https://repo.download.nvidia.com/jetson/t194 r32.6 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \ + && apt-get update \ + && apt-get install -y \ + libnvvpi1 \ + vpi1-dev + # Install Realsense RUN apt update \ - && apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE \ - && add-apt-repository -y "deb https://librealsense.intel.com/Debian/apt-repo bionic main" -u \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-key \ + F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || \ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key \ + F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE \ + && add-apt-repository -y \ + "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u \ && apt-get install -y rsync librealsense2-utils librealsense2-dev \ && rm -rf /var/lib/apt/lists/* +# Install Tao converter +RUN mkdir -p /opt/nvidia/tao && \ + cd /opt/nvidia/tao && \ + wget https://developer.nvidia.com/jp46-20210820t231431z-001zip && \ + unzip jp46-20210820t231431z-001zip && \ + chmod 755 /opt/nvidia/tao/jp4.6/tao-converter && \ + ln -sf /opt/nvidia/tao/jp4.6/tao-converter /opt/nvidia/tao/tao-converter && \ + rm jp46-20210820t231431z-001zip + +ENV PATH="${PATH}:/opt/nvidia/tao" + # Update environment ENV LD_LIBRARY_PATH="/opt/nvidia/vpi1/lib64:${LD_LIBRARY_PATH}" ENV LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/tegra:${LD_LIBRARY_PATH}" @@ -85,23 +118,84 @@ ENV LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/tegra-egl:${LD_LIBRARY_PATH}" RUN echo "source /opt/ros/foxy/install/setup.bash" > /opt/ros/foxy/setup.bash -# Restore using the default Foxy DDS middleware: FastRTPS +# Restore using the default Foxy DDS middleware: FastRTPS ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp +# Install Triton server 2.13 from https://github.com/triton-inference-server/server/releases/tag/v2.13.0 +RUN apt-get update && apt-get install -y --no-install-recommends \ + autoconf \ + automake \ + libb64-dev \ + libcurl4-openssl-dev \ + libopenblas-dev \ + libre2-dev \ + libssl-dev \ + libtool \ + patchelf \ + rapidjson-dev \ + zlib1g-dev \ +&& rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /opt/tritonserver && cd /opt/tritonserver \ + && wget https://github.com/triton-inference-server/server/releases/download/v2.13.0/tritonserver2.13.0-jetpack4.6.tgz \ + && tar -xzvf tritonserver2.13.0-jetpack4.6.tgz \ + && rm tritonserver2.13.0-jetpack4.6.tgz + +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/tritonserver/lib" + +# Install perception_pcl +RUN mkdir -p /opt/ros/foxy/src && cd /opt/ros/foxy/src \ + && git clone https://github.com/ros-perception/pcl_msgs.git && cd pcl_msgs && git checkout ros2 && cd .. \ + && git clone https://github.com/ros-perception/perception_pcl.git \ + && source /opt/ros/foxy/setup.bash \ + && cd /opt/ros/foxy \ + && rosdep install -y --ignore-src --from-paths src --rosdistro foxy \ + && colcon build --merge-install --packages-up-to pcl_conversions \ + && rm -Rf src logs build + +# Install sensor_msgs_py +RUN mkdir -p /opt/ros/foxy/src && cd /opt/ros/foxy/src \ + && git clone https://github.com/ros2/common_interfaces.git && cd common_interfaces && git checkout 2.2.3 && cd .. \ + && source /opt/ros/foxy/setup.bash \ + && cd /opt/ros/foxy \ + && rosdep install -y --ignore-src --from-paths src --rosdistro foxy \ + && colcon build --merge-install --packages-up-to sensor_msgs_py \ + && rm -Rf src logs build + +# Install gcc8 for cross-compiled binaries from Ubuntu 20.04 +RUN apt-get update -y && add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt-get install -y \ + gcc-8 \ + g++-8 \ + libstdc++6 \ +&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 \ +&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 \ +&& rm -rf /usr/bin/aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-g++ \ + /usr/bin/aarch64-linux-gnu-g++-7 /usr/bin/aarch64-linux-gnu-gcc-7 \ +&& update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc \ + /usr/bin/gcc-8 8 \ +&& update-alternatives --install /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ \ + /usr/bin/g++-8 8 \ +&& rm -rf /var/lib/apt/lists/* + ### ----------------------------- # Setup non-root admin user ARG USERNAME=admin ARG USER_UID=1000 -ARG USER_GID=1001 +ARG USER_GID=1000 # Create the 'admin' user RUN groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME \ - && adduser admin video && adduser admin sudo + && adduser ${USERNAME} video && adduser ${USERNAME} sudo -COPY scripts/workspace-entrypoint.sh /home/$USERNAME/workspace-entrypoint.sh -RUN chmod +x /home/$USERNAME/workspace-entrypoint.sh +# Copy scripts +RUN mkdir -p /usr/local/bin/scripts +COPY scripts/*entrypoint.sh /usr/local/bin/scripts/ +RUN chmod +x /usr/local/bin/scripts/*.sh +ENV USERNAME=${USERNAME} +ENV USER_GID=${USER_GID} +ENV USER_UID=${USER_UID} diff --git a/docker/Dockerfile.x86_64.base b/docker/Dockerfile.x86_64.base index af14d2bd..51e2af68 100644 --- a/docker/Dockerfile.x86_64.base +++ b/docker/Dockerfile.x86_64.base @@ -7,7 +7,8 @@ # license agreement from NVIDIA CORPORATION is strictly prohibited. # # Docker file to build on x86_64 -ARG BASE_IMAGE=nvidia/cuda:11.2.0-devel-ubuntu20.04 +# https://docs.nvidia.com/deeplearning/frameworks/user-guide/index.html +ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:21.08-py3 FROM ${BASE_IMAGE} # disable terminal interaction for apt @@ -28,6 +29,7 @@ RUN apt-get update && apt-get install -y \ software-properties-common \ wget \ vim \ + unzip \ mlocate \ && rm -rf /var/lib/apt/lists/* @@ -56,6 +58,15 @@ RUN apt-get update && apt-get install -y \ libcunit1-dev \ && rm -rf /var/lib/apt/lists/* +# TensorRT 8 +RUN apt-get update && apt-get install -y \ + libnvinfer8 \ + libnvonnxparsers8 \ + libnvparsers8 \ + libnvinfer-plugin8 \ + python3-libnvinfer \ +&& rm -rf /var/lib/apt/lists/* + # Python3 (PIP) RUN python3 -m pip install -U \ argcomplete \ @@ -69,11 +80,14 @@ RUN python3 -m pip install -U \ flake8-docstrings \ flake8-import-order \ flake8-quotes \ + onnx \ pytest-repeat \ pytest-rerunfailures \ pytest \ pydocstyle \ - scikit-learn + scikit-learn \ + torch \ + torchvision # Install Git-LFS RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ @@ -110,6 +124,10 @@ RUN apt-get update && apt-get install -y \ ros-foxy-turtlesim \ ros-foxy-v4l2-camera \ ros-foxy-realsense2-camera \ + ros-foxy-vision-msgs \ + ros-foxy-pcl-conversions \ + ros-foxy-sensor-msgs-py \ + ros-foxy-stereo-image-proc \ && rm -rf /var/lib/apt/lists/* RUN rosdep init @@ -121,21 +139,45 @@ RUN apt update \ && add-apt-repository -y "deb https://librealsense.intel.com/Debian/apt-repo bionic main" -u \ && apt-get install -y librealsense2-utils librealsense2-dev -# Restore using the default Foxy DDS middleware: FastRTPS +# Install Tao converter +RUN mkdir -p /opt/nvidia/tao && \ + cd /opt/nvidia/tao && \ + wget https://developer.nvidia.com/tao-converter-80 && \ + unzip tao-converter-80 && \ + chmod 755 /opt/nvidia/tao/cuda11.3-trt8.0/tao-converter && \ + ln -sf /opt/nvidia/tao/cuda11.3-trt8.0/tao-converter /opt/nvidia/tao/tao-converter && \ + rm tao-converter-80 + +ENV PATH="${PATH}:/opt/nvidia/tao" + +# Install prebuilt trtexec +COPY tensor_rt/trtexec_x86_64 /usr/src/tensorrt/bin/trtexec + +# Update environment +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/tritonserver/lib" + +# Restore using the default Foxy DDS middleware: FastRTPS ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp # Setup non-root admin user ARG USERNAME=admin ARG USER_UID=1000 -ARG USER_GID=1001 +ARG USER_GID=1000 # Create the 'admin' user -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ - && chmod 0440 /etc/sudoers.d/$USERNAME \ - && adduser admin video && adduser admin sudo - -COPY scripts/workspace-entrypoint.sh /home/$USERNAME/workspace-entrypoint.sh -RUN chmod +x /home/$USERNAME/workspace-entrypoint.sh - +RUN groupmod --gid ${USER_GID} -n ${USERNAME} triton-server \ + && usermod -l ${USERNAME} -m -d /home/${USERNAME} triton-server \ + && mkdir -p /home/${USERNAME} \ + && sudo chown ${USERNAME}:${USERNAME} /home/${USERNAME} \ + && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \ + && chmod 0440 /etc/sudoers.d/${USERNAME} \ + && adduser ${USERNAME} video && adduser ${USERNAME} sudo + +# Copy scripts +RUN mkdir -p /usr/local/bin/scripts +COPY scripts/*entrypoint.sh /usr/local/bin/scripts/ +RUN chmod +x /usr/local/bin/scripts/*.sh + +ENV USERNAME=${USERNAME} +ENV USER_GID=${USER_GID} +ENV USER_UID=${USER_UID} diff --git a/docker/tensor_rt/trtexec_x86_64 b/docker/tensor_rt/trtexec_x86_64 new file mode 100755 index 00000000..8c16cb69 --- /dev/null +++ b/docker/tensor_rt/trtexec_x86_64 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:913fbd1a4d3785e9abee93c51065c41bdbe76bad4d26eb8799c4c8b7a0a62b8b +size 1525176 diff --git a/isaac_ros_common/include/isaac_ros_common/vpi_utilities.hpp b/isaac_ros_common/include/isaac_ros_common/vpi_utilities.hpp index 5cf81154..1862bf12 100644 --- a/isaac_ros_common/include/isaac_ros_common/vpi_utilities.hpp +++ b/isaac_ros_common/include/isaac_ros_common/vpi_utilities.hpp @@ -22,7 +22,7 @@ char buffer[VPI_MAX_STATUS_MESSAGE_LENGTH]; \ vpiGetLastStatusMessage(buffer, sizeof(buffer)); \ std::ostringstream ss; \ - ss << vpiStatusGetName(status) << ": " << buffer; \ + ss << __FILE__ << ":" << __LINE__ << ": " << vpiStatusGetName(status) << ": " << buffer; \ throw std::runtime_error(ss.str()); \ } \ } while (0); diff --git a/isaac_ros_nvengine/CMakeLists.txt b/isaac_ros_nvengine/CMakeLists.txt new file mode 100644 index 00000000..9d01b2da --- /dev/null +++ b/isaac_ros_nvengine/CMakeLists.txt @@ -0,0 +1,110 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +cmake_minimum_required(VERSION 3.5) +project(isaac_ros_nvengine LANGUAGES C CXX) + +# Default to C++17 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE) +message( STATUS "Architecture: ${ARCHITECTURE}" ) + +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +# GXF +include_directories(gxf/include) +add_library(gxf SHARED IMPORTED) +if( ${ARCHITECTURE} STREQUAL "x86_64" ) + set_property(TARGET gxf PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_x86_64_cuda_11_4/core/libgxf_core.so) +elseif( ${ARCHITECTURE} STREQUAL "aarch64" ) + set_property(TARGET gxf PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/gxf/lib/gxf_jetpack46/core/libgxf_core.so) +endif() + +# gxe_node +ament_auto_add_library(gxe_node SHARED src/gxe_node.cpp) +target_compile_definitions(gxe_node + PRIVATE "COMPOSITION_BUILDING_DLL" +) +target_link_libraries(gxe_node gxf) +rclcpp_components_register_nodes(gxe_node "isaac_ros::nvengine::GXENode") +set(node_plugins "${node_plugins}isaac_ros::nvengine::GXENode;$\n") + +# ROS tensor publisher node +ament_auto_add_library(ros_tensor_publisher_node SHARED src/ros_tensor_publisher_node.cpp) +target_compile_definitions(ros_tensor_publisher_node + PRIVATE "COMPOSITION_BUILDING_DLL" +) +target_link_libraries(ros_tensor_publisher_node gxf) +rclcpp_components_register_nodes(ros_tensor_publisher_node "isaac_ros::nvengine::ROSTensorPublisherNode") +set(node_plugins "${node_plugins}isaac_ros::nvengine::ROSTensorPublisherNode;$\n") + +# test ping executable +ament_auto_add_executable("test_tensor" + src/nvengine_main.cpp +) + +target_link_libraries("test_tensor" gxe_node) + +# test publish executable +ament_auto_add_executable("test_publish_tensor" + src/tensor_publish.cpp +) + +target_link_libraries("test_publish_tensor" ros_tensor_publisher_node) + +# Install config directory +install( + DIRECTORY config + DESTINATION share/${PROJECT_NAME} +) + +# Install extensions directory +if( ${ARCHITECTURE} STREQUAL "x86_64" ) + install(DIRECTORY gxf/lib/gxf_x86_64_cuda_11_4/ DESTINATION share/${PROJECT_NAME}/gxf) +elseif( ${ARCHITECTURE} STREQUAL "aarch64" ) + install(DIRECTORY gxf/lib/gxf_jetpack46/ DESTINATION share/${PROJECT_NAME}/gxf) +endif() +set_target_properties(gxe_node PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) +set_target_properties(gxe_node PROPERTIES INSTALL_RPATH "$ORIGIN/../share/${PROJECT_NAME}/gxf/core") +set_target_properties(ros_tensor_publisher_node PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) +set_target_properties(ros_tensor_publisher_node PROPERTIES INSTALL_RPATH "$ORIGIN/../share/${PROJECT_NAME}/gxf/core") + +# Install package executable +install(TARGETS "test_tensor" + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(TARGETS "test_publish_tensor" + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + + # Ignore copyright notices since we use custom JetPack EULA + set(ament_cmake_copyright_FOUND TRUE) + + ament_lint_auto_find_test_dependencies() + + find_package(launch_testing_ament_cmake REQUIRED) + add_launch_test(test/isaac_ros_nvengine_pol.py) +endif() + +ament_auto_package() diff --git a/isaac_ros_nvengine/config/manifest.yaml b/isaac_ros_nvengine/config/manifest.yaml new file mode 100644 index 00000000..0bd41d89 --- /dev/null +++ b/isaac_ros_nvengine/config/manifest.yaml @@ -0,0 +1,11 @@ +# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +extensions: +- gxf/std/libgxf_std.so +- gxf/libgxf_ros_bridge.so diff --git a/isaac_ros_nvengine/config/test_tensor.yaml b/isaac_ros_nvengine/config/test_tensor.yaml new file mode 100644 index 00000000..efd46515 --- /dev/null +++ b/isaac_ros_nvengine/config/test_tensor.yaml @@ -0,0 +1,63 @@ +# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. +%YAML 1.2 +--- +name: tx +components: +- name: tensor + type: nvidia::gxf::DoubleBufferTransmitter + parameters: + capacity: 25 +- name: allocator + type: nvidia::gxf::UnboundedAllocator +- type: nvidia::gxf::DownstreamReceptiveSchedulingTerm + parameters: + transmitter: tensor + min_size: 1 +- type: nvidia::isaac_ros::RosBridgeTensorSubscriber + parameters: + signal: tensor + allocator: allocator + topic_name: tensor_pub + storage_type: 1 + qos: 10 +--- +name: rx +components: +- name: tensor + type: nvidia::gxf::DoubleBufferReceiver + parameters: + capacity: 25 +- type: nvidia::gxf::MessageAvailableSchedulingTerm + parameters: + receiver: tensor + min_size: 1 +- type: nvidia::isaac_ros::RosBridgeTensorPublisher + parameters: + signal: tensor + topic_name: ping + qos: 1000 +--- +name: connections +components: +- type: nvidia::gxf::Connection + parameters: + source: tx/tensor + target: rx/tensor +--- +name: scheduler +components: +- name: clock + type: nvidia::gxf::RealtimeClock +- type: nvidia::gxf::GreedyScheduler + parameters: + max_duration_ms: 1000000 + clock: clock +- type: nvidia::gxf::JobStatistics + parameters: + clock: clock diff --git a/isaac_ros_nvengine/gxf/AMENT_IGNORE b/isaac_ros_nvengine/gxf/AMENT_IGNORE new file mode 100644 index 00000000..e69de29b diff --git a/isaac_ros_nvengine/gxf/include/core/any.hpp b/isaac_ros_nvengine/gxf/include/core/any.hpp new file mode 100644 index 00000000..25769010 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/any.hpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_ANY_HPP +#define NVIDIA_CORE_ANY_HPP + +#include + +namespace std { + +using experimental::any; +using experimental::any_cast; +using experimental::bad_any_cast; + +} // namespace std + +#endif diff --git a/isaac_ros_nvengine/gxf/include/core/assert.hpp b/isaac_ros_nvengine/gxf/include/core/assert.hpp new file mode 100644 index 00000000..0d95951b --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/assert.hpp @@ -0,0 +1,124 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_ASSERT_HPP +#define NVIDIA_CORE_ASSERT_HPP + +#include +#include + +#include "core/logger.hpp" + +// Prints a panic message and aborts the program +#define GXF_PANIC(...) \ + { \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::PANIC, __VA_ARGS__); \ + std::exit(1); \ + } + +// Checks if an expression evaluates to true. If not prints a panic message and aborts the program. +#define GXF_ASSERT(expr, ...) \ + if (!(expr)) { \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::PANIC, __VA_ARGS__); \ + std::exit(1); \ + } + +#define GXF_ASSERT_SUCCESS(expr) \ + { \ + const auto _result = (expr); \ + if (_result != 0) { \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::PANIC, \ + "GXF operation failed: %s", GxfResultStr(_result)); \ + std::exit(1); \ + } \ + } \ + +// Asserts that A == true. If not prints a panic message and aborts the program. +#define GXF_ASSERT_TRUE(exp_a) \ + { \ + const auto _va = exp_a; \ + GXF_ASSERT(_va == true, "Assert failed: %s == true.", std::to_string(_va).c_str()); \ + } + +// Asserts that A == false. If not prints a panic message and aborts the program. +#define GXF_ASSERT_FALSE(exp_a) \ + { \ + const auto _va = exp_a; \ + GXF_ASSERT(_va == false, "Assert failed: %s == false.", std::to_string(_va).c_str()); \ + } + +// Asserts that A == B. If not prints a panic message and aborts the program. +#define GXF_ASSERT_EQ(exp_a, exp_b) \ + { \ + const auto _va = exp_a; \ + const auto _vb = exp_b; \ + GXF_ASSERT(_va == _vb, "Assert failed: %s == %s.", std::to_string(_va).c_str(), \ + std::to_string(_vb).c_str()); \ + } + +// Asserts that A == B for two strings. If not prints a panic message and aborts the program. +#define GXF_ASSERT_STREQ(exp_a, exp_b) \ + { \ + const char* _va = (exp_a); \ + const char* _vb = (exp_b); \ + GXF_ASSERT(std::strcmp(_va, _vb) == 0, "Assert failed: %s == %s.", _va, _vb); \ + } + +// Asserts that A != B. If not prints a panic message and aborts the program. +#define GXF_ASSERT_NE(exp_a, exp_b) \ + { \ + const auto _va = exp_a; \ + const auto _vb = exp_b; \ + GXF_ASSERT(_va != _vb, "Assert failed: %s != %s.", std::to_string(_va).c_str(), \ + std::to_string(_vb).c_str()); \ + } + +// Asserts that A > B. If not prints a panic message and aborts the program. +#define GXF_ASSERT_GT(exp_a, exp_b) \ + { \ + const auto _va = exp_a; \ + const auto _vb = exp_b; \ + GXF_ASSERT(_va > _vb, "Assert failed: %s > %s.", std::to_string(_va).c_str(), \ + std::to_string(_vb).c_str()); \ + } + +// Asserts that A >= B. If not prints a panic message and aborts the program. +#define GXF_ASSERT_GE(exp_a, exp_b) \ + { \ + const auto _va = exp_a; \ + const auto _vb = exp_b; \ + GXF_ASSERT(_va >= _vb, "Assert failed: %s >= %s.", std::to_string(_va).c_str(), \ + std::to_string(_vb).c_str()); \ + } + +// Asserts that A > B. If not prints a panic message and aborts the program. +#define GXF_ASSERT_LT(exp_a, exp_b) \ + { \ + const auto _va = exp_a; \ + const auto _vb = exp_b; \ + GXF_ASSERT(_va < _vb, "Assert failed: %s > %s.", std::to_string(_va).c_str(), \ + std::to_string(_vb).c_str()); \ + } + +// Asserts that A <= B. If not prints a panic message and aborts the program. +#define GXF_ASSERT_LE(exp_a, exp_b) \ + { \ + const auto _va = exp_a; \ + const auto _vb = exp_b; \ + GXF_ASSERT(_va <= _vb, "Assert failed: %s <= %s.", std::to_string(_va).c_str(), \ + std::to_string(_vb).c_str()); \ + } + +#endif diff --git a/isaac_ros_nvengine/gxf/include/core/byte.hpp b/isaac_ros_nvengine/gxf/include/core/byte.hpp new file mode 100644 index 00000000..b507fbd5 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/byte.hpp @@ -0,0 +1,24 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#pragma once + +namespace std { + +using byte = unsigned char; + +} // namespace std + +using std::byte; diff --git a/isaac_ros_nvengine/gxf/include/core/expected.hpp b/isaac_ros_nvengine/gxf/include/core/expected.hpp new file mode 100644 index 00000000..2abd610a --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/expected.hpp @@ -0,0 +1,710 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_EXPECTED_HPP_ +#define NVIDIA_CORE_EXPECTED_HPP_ + +#include + +#include "core/assert.hpp" +#include "core/memory_utils.hpp" +#include "core/type_utils.hpp" + +namespace nvidia { + +// Loosely implemented after P0323R7 +template +class Unexpected { + public: + constexpr Unexpected() = delete; + ~Unexpected() = default; + constexpr Unexpected(const Unexpected&) = default; + constexpr Unexpected(Unexpected&&) = default; + + // template + // constexpr explicit Unexpected(in_place_t, Args&&...); + // template + // constexpr explicit Unexpected(in_place_t, initializer_list, Args&&...); + template + constexpr explicit Unexpected(Err&& value) : value_{std::forward(value)} { + // When debugging is enabled we rais a signal when an error is created. +#ifndef NDEBUG + std::abort(); +#endif + } + // template + // constexpr explicit Unexpected(const Unexpected&) : value_{value} {} + // template + // constexpr explicit Unexpected(Unexpected&&) : value_{std::move(value)} {} + + constexpr Unexpected& operator=(const Unexpected&) = default; + constexpr Unexpected& operator=(Unexpected&&) = default; + // template + // constexpr Unexpected& operator=(const Unexpected& other) { value_ = other; } + // template + // constexpr Unexpected& operator=(Unexpected&& other) { value_ = std::move(other); } + + constexpr const E& value() const& noexcept { return value_; } + constexpr E& value() & noexcept { return value_; } + constexpr const E&& value() const&& noexcept { return std::move(value_); } + constexpr E&& value() && noexcept { return std::move(value_); } + + // void swap(Unexpected& other) noexcept(see bellow); + + // template + // friend constexpr bool operator==(const Unexpected& lhs, const Unexpected& rhs) { + // return lhs.value() == rhs.value(); + // } + // template + // friend constexpr bool operator!=(const Unexpected& lhs, const Unexpected& rhs) { + // return lhs.value() != rhs.value(); + // } + + // template + // friend void swap(Unexpected& x, Unexpected& y) noexcept(noexcept(x.swap(y))); + + private: + E value_; +}; + +// Forward delcarations for using with ExpectedBase +template class Expected; + +namespace detail { + +template +struct IsExpected : FalseType {}; + +template +struct IsExpected> : TrueType {}; + +// Extracts the error type from a pack of Expecteds if they all contain the same Error . +template +struct ErrorTypeHelper {}; + +template +struct ErrorTypeHelper...> { using type = E; }; + +template +using ErrorType = typename ErrorTypeHelper...>::type; + +// Finds the result type of invoking a function with the wrapped types of a pack of Expecteds. +template +using ResultType = decltype(Declval()(Declval().value()...)); + +// Empty stuct for representing an object with only one possible value (itself). This can be used +// for speciallizing on void types where void would not compile because it is not a valid type. +struct Unit {}; + +// Maps the values with the given functor. If F returns an Expected, it returns the Expected type +// directly, otherwise it constructs a new Expected. +template +auto FunctorMap(F&& func, Es&&... expected) -> + EnableIf_t>::value, Expected>> { + std::forward(func)(std::forward(expected).value()...); + return Expected>{}; +} + + +template +auto FunctorMap(F&& func, Es&&... expected) -> + EnableIf_t>::value, ResultType> { + return std::forward(func)(std::forward(expected).value()...); +} + +template +auto FunctorMap(F&& func, Es&&... expected) -> + EnableIf_t>::value && !IsExpected>::value, + Expected, ErrorType>> { + return std::forward(func)(std::forward(expected).value()...); +} + +// Base class for all operations of Expected that does not rely on handling of the left type T. +// Loosely specified after P0323R7. +template +class ExpectedBase { + static_assert(!IsVoid::value, "ExpectedBase cannot wrap void types"); + static_assert(!IsVoid::value, "ExpectedBase cannot wrap void types"); + static_assert(!IsReference::value, "ExpectedBase cannot wrap reference types"); + static_assert(!IsReference::value, "ExpectedBase cannot wrap reference types"); + + public: + // template + // using rebind = Expected; + + // x.x.4.1, constructors + constexpr ExpectedBase(const ExpectedBase& other) { constructFrom(other); } + constexpr ExpectedBase(ExpectedBase&& other) { constructFrom(std::forward(other)); } + + // template + // explicit constexpr Expected(const Expected& other) + // : ok_{other.ok_} { + // if (ok_) { + // value_ = other.value_; + // } else { + // error_ = other.error_; + // } + // } + // template + // explicit constexpr Expected(Expected&& other) + // : ok_{other.ok_} { + // if (ok_) { + // value_ = std::move(other.value_); + // } else { + // error_ = std::move(other.error_); + // } + // } + + template + constexpr ExpectedBase(const Unexpected& error) : is_error_{true} { + InplaceConstruct>(buffer_, error); + } + + template + constexpr ExpectedBase(Unexpected&& error) : is_error_{true} { + InplaceConstruct>(buffer_, std::forward>(error)); + } + + // template + // constexpr explicit Expected(in_place_t, Args&&...); + // template + // constexpr explicit Expected(in_place_t, initializer_list, Args&&...); + // template + // constexpr explicit Expected(unexpect_t, Args&&...); + // template + // constexpr explicit Expected(unexpect_t, initializer_list, Args&&...); + + // x.x.4.2, destructor + ~ExpectedBase() { destruct(); } + + // x.x.4.3, assignment + ExpectedBase& operator=(const ExpectedBase& other) { + destruct(); + constructFrom(other); + return *this; + } + + ExpectedBase& operator=(ExpectedBase&& other) { + destruct(); + constructFrom(std::forward(other)); + return *this; + } + + template + ExpectedBase& operator=(const Unexpected& error) { + destruct(); + is_error_ = true; + InplaceConstruct>(buffer_, error); + return *this; + } + + template + ExpectedBase& operator=(Unexpected&& error) { + destruct(); + is_error_ = true; + InplaceConstruct>(buffer_, std::forward>(error)); + return *this; + } + + // x.x.4.4, modifiers + // template + // T& emplace(Args&&...); + // template + // T& emplace(initializer_list, Args&&...); + + // // x.x.4.5, swap + // void swap(Expected&) noexcept(see below); + + // x.x.4.6, observers + // constexpr const T* operator->() const; + // constexpr T* operator->(); + // constexpr const T& operator*() const&; + // constexpr T& operator*() &; + // constexpr const T&& operator*() const&&; + // constexpr T&& operator*() &&; + + constexpr bool has_value() const noexcept { return !is_error_; } + + constexpr explicit operator bool() const noexcept { return has_value(); } + + constexpr const E& error() const& { + GXF_ASSERT(!has_value(), "Expected does not have an error. Check before accessing."); + return ValuePointer>(buffer_)->value(); + } + constexpr E& error() & { + GXF_ASSERT(!has_value(), "Expected does not have an error. Check before accessing."); + return ValuePointer>(buffer_)->value(); + } + + constexpr E&& error() && { + GXF_ASSERT(!has_value(), "Expected does not have an error. Check before accessing."); + return std::move(ValuePointer>(buffer_)->value()); + } + + // // x.x.4.7, Expected equality operators + // template + // friend constexpr bool operator==(const Expected& x, const Expected& y); + // template + // friend constexpr bool operator!=(const Expected& x, const Expected& y); + + // // x.x.4.8, Comparison with T + // template + // friend constexpr bool operator==(const Expected&, const T2&); + // template + // friend constexpr bool operator==(const T2&, const Expected&); + // template + // friend constexpr bool operator!=(const Expected&, const T2&); + // template + // friend constexpr bool operator!=(const T2&, const Expected&); + + // // x.x.4.9, Comparison with Unexpected + // template + // friend constexpr bool operator==(const Expected&, const Unexpected&); + // template + // friend constexpr bool operator==(const Unexpected&, const Expected&); + // template + // friend constexpr bool operator!=(const Expected&, const Unexpected&); + // template + // friend constexpr bool operator!=(const Unexpected&, const Expected&); + + // // x.x.4.10, Specialized algorithms + // template + // friend void swap(Expected&, Expected&) noexcept(see below); + + // When this expected does not contain an error an expected with the given value 'next' is + // created and returned, otherwise an unexpected with the error is returned. + template + constexpr Expected substitute(U next) const { + return has_value() ? Expected{std::forward(next)} : Expected{unexpected()}; + } + + // If in error the error is returned, otherwise the value is mapped with the given functor and + // the result is returned. + template + auto and_then(F&& func) const -> EnableIf_t::value, Expected> { + if (has_value()) { + std::forward(func)(); + return Expected{}; + } else { + return unexpected(); + } + } + + template + auto and_then(F&& func) const -> + EnableIf_t::value, decltype(func())> { + if (has_value()) { + return std::forward(func)(); + } else { + return unexpected(); + } + } + + template + auto and_then(F&& func) const -> + EnableIf_t::value && !IsExpected::value, + Expected> { + if (has_value()) { + return std::forward(func)(); + } else { + return unexpected(); + } + } + + protected: + // Allow other Expecteds access to `unexpected` getters. + template + friend class Expected; + + // Protected default constructor so derived types can write custom initializers. + ExpectedBase() = default; + + // Unexpected accessors to skip extra construction calls when not needed. + constexpr const Unexpected& unexpected() const& { + GXF_ASSERT(!has_value(), "Expected does not have an error. Check before accessing."); + return *ValuePointer>(buffer_); + } + + constexpr Unexpected& unexpected() & { + GXF_ASSERT(!has_value(), "Expected does not have an error. Check before accessing."); + return *ValuePointer>(buffer_); + } + + constexpr Unexpected&& unexpected() && { + GXF_ASSERT(!has_value(), "Expected does not have an error. Check before accessing."); + return std::move(*ValuePointer>(buffer_)); + } + + // Constuct a new object in allocated buffer. + void constructFrom(const ExpectedBase& other) { + is_error_ = other.is_error_; + if (other.has_value()) { + InplaceCopyConstruct(buffer_, *ValuePointer(other.buffer_)); + } else { + InplaceCopyConstruct(buffer_, other.unexpected()); + } + } + + // Move constuct a new object in allocated buffer. + void constructFrom(ExpectedBase&& other) { + is_error_ = other.is_error_; + if (other.has_value()) { + InplaceMoveConstruct(buffer_, std::forward(*ValuePointer(other.buffer_))); + } else { + InplaceMoveConstruct(buffer_, std::forward>(other.unexpected())); + } + } + + // Call the destructor for the current object explicitly + void destruct() { + if (has_value()) { + Destruct(buffer_); + } else { + Destruct>(buffer_); + } + } + + bool is_error_ = true; + static constexpr uint32_t kAlign = + (alignof(Unexpected) < alignof(T)) ? alignof(T) : alignof(Unexpected); + static constexpr uint32_t kSize = + (sizeof(Unexpected) < sizeof(T)) ? sizeof(T) : sizeof(Unexpected); + alignas(kAlign) byte buffer_[kSize] = {0}; +}; +} // namespace detail + +// Default instance for Expected types. +template +class Expected : public detail::ExpectedBase { + public: + using detail::ExpectedBase::ExpectedBase; + template friend class Expected; + + constexpr Expected(T&& value) { + this->is_error_ = false; + InplaceMoveConstruct(this->buffer_, std::forward(value)); + } + + template ::value>> + constexpr Expected(U&& value) { + this->is_error_ = false; + InplaceConstruct(this->buffer_, std::forward(value)); + } + + template ::value>> + Expected& operator=(U&& value) { + this->destruct(); + this->is_error_ = false; + InplaceConstruct(this->buffer_, std::forward(value)); + return *this; + } + + const T* operator->() const { return &value(); } + T* operator->() { return &value(); } + const T& operator*() const& { return value(); } + T& operator*() & { return value(); } + const T&& operator*() const&& { return std::move(value()); } + T&& operator*() && { return std::move(value()); } + + constexpr const T& value() const& { + GXF_ASSERT(this->has_value(), "Expected does not have a value. Check before accessing."); + return *ValuePointer(this->buffer_); + } + + constexpr T& value() & { + GXF_ASSERT(this->has_value(), "Expected does not have a value. Check before accessing."); + return *ValuePointer(this->buffer_); + } + + constexpr const T&& value() const&& { + GXF_ASSERT(this->has_value(), "Expected does not have a value. Check before accessing."); + return std::move(*ValuePointer(this->buffer_)); + } + + constexpr T&& value() && { + GXF_ASSERT(this->has_value(), "Expected does not have a value. Check before accessing."); + return std::move(*ValuePointer(this->buffer_)); + } + + template + constexpr T value_or(U&& default_value) const& { + if (this->has_value()) { + return *ValuePointer(this->buffer_); + } else { + return std::forward(default_value); + } + } + + template + constexpr T value_or(U&& default_value) && { + if (this->has_value()) { + return std::move(*ValuePointer(this->buffer_)); + } else { + return std::forward(default_value); + } + } + + // If in error the error is returned, otherwise the value is mapped with the given functor and + // the result is returned. + template + auto map(F&& func) & { + return this->has_value() ? detail::FunctorMap(std::forward(func), *this) + : this->unexpected(); + } + + template + auto map(F&& func) const& { + return this->has_value() ? detail::FunctorMap(std::forward(func), *this) + : this->unexpected(); + } + + template + auto map(F&& func) && { + return this->has_value() ? detail::FunctorMap(std::forward(func), std::move(*this)) + : this->unexpected(); + } + + template + auto map(F&& func) const&& { + return this->has_value() ? detail::FunctorMap(std::forward(func), std::move(*this)) + : this->unexpected(); + } + + // Assigns the value of an expected directly to a concrete instance with perfect forwarding. + template + Expected assign_to(U& value) const& { + static_assert(IsAssignable_v, + "Argument Type is not assignable with Expected Type (const T&)"); + auto assign = [&](const T& expected_value) { value = expected_value; }; + return this->has_value() ? detail::FunctorMap(assign, std::move(*this)) : this->unexpected(); + } + + template + Expected assign_to(U& value) && { + static_assert(IsAssignable_v, + "Argument Type is not assignable with Expected Type (T&&)"); + auto move_assign = [&](T&& expected_value) { value = std::move(expected_value); }; + return this->has_value() ? detail::FunctorMap(move_assign, std::move(*this)) + : this->unexpected(); + } + + template + Expected assign_to(U& value) const&& { + static_assert(IsAssignable_v, + "Argument Type is not assignable with Expected Type (const T&&)"); + auto move_assign = [&](const T&& expected_value) { value = std::move(expected_value); }; + return this->has_value() ? detail::FunctorMap(move_assign, std::move(*this)) + : this->unexpected(); + } +}; + +// Specialization of Expected for references. +template +class Expected : public detail::ExpectedBase { + public: + using detail::ExpectedBase::ExpectedBase; + + constexpr Expected(T& value) { + this->is_error_ = false; + InplaceCopyConstruct(this->buffer_, &value); + } + + Expected& operator=(T& value) { + this->destruct(); + this->is_error_ = false; + InplaceCopyConstruct(this->buffer_, &value); + return *this; + } + + T* operator->() const { return &value(); } + T& operator*() const { return value(); } + + constexpr T& value() const { + GXF_ASSERT(this->has_value(), "Expected does not have a value. Check before accessing."); + return **ValuePointer(this->buffer_); + } + + constexpr T& value_or(T& default_value) const { + return (this->has_value()) ? value() : default_value; + } + + // If in error the error is returned, otherwise the value is mapped with the given functor and + // the result is returned. + template + auto map(F&& func) const { + return (this->has_value()) ? detail::FunctorMap(std::forward(func), *this) + : this->unexpected(); + } + + // Assigns the value of an expected directly to a concrete instance with perfect forwarding. + template + Expected assign_to(U& value) const { + static_assert(IsAssignable_v, + "Argument Type is not assignable with Expected Type (T&)"); + auto assign = [&](T& expected_value) { value = expected_value; }; + return this->has_value() ? detail::FunctorMap(assign, std::move(*this)) : this->unexpected(); + } +}; + +// Specialization of Expected for void. This is essentially an std::optional. +template +class Expected : public detail::ExpectedBase { + public: + using detail::ExpectedBase::ExpectedBase; + constexpr Expected() { this->is_error_ = false; } + + // Constructor that allows assigning an Expected with the same error type to an Expected + template + explicit constexpr Expected(const Expected& other) { + this->is_error_ = !other.has_value(); + if (!other) { + InplaceConstruct>(this->buffer_, other.unexpected()); + } + } + + // Constructor that allows assigning an Expected with the same error type to an Expected + template + explicit constexpr Expected(Expected&& other) { + this->is_error_ = !other.has_value(); + if (!other) { + InplaceConstruct>(this->buffer_, std::move(other.unexpected())); + } + } + + // Combines two expected value taking the first error. + Expected& operator&=(const Expected& other) { + *this = *this & other; + return *this; + } + + // Combines two expected value taking the last success. + Expected& operator|=(const Expected& other) { + *this = *this | other; + return *this; + } + + // If in error the error is returned, otherwise the value is mapped with the given functor and + // the result is returned. + template + auto map(F&& func) const { return this->and_then(std::forward(func)); } +}; + +// Checks if all Expected values are not in error. If in error, return the first error found. +template +Expected AllOf(const Expected& expected) { + return Expected{expected}; +} + +// Checks if all Expected values are not in error. If in error, return the first error found. +template +Expected AllOf(const Expected& expected, const Expected&... others) { + return expected & AllOf(others...); +} + +// Checks if all the Arguments are of type Expected. If so, unwraps them and calls +// the function object F with the unwrapped arguments. Otherwise, return an Unexpected with +// the first error value found in the argument list. +template +auto Apply(F&& func, Args&&... args) -> EnableIf_t< + Conjunction>...>::value, + decltype(detail::FunctorMap(Declval(), Declval()...)) > { + const auto all_valid = AllOf(args...); + if (!all_valid) { return Unexpected>(all_valid.error()); } + return detail::FunctorMap(std::forward(func), std::forward(args)...); +} + +// Combines two expected value taking the first error. +template +Expected operator&(const Expected& lhs, const Expected& rhs) { + return !lhs ? Expected{lhs} : Expected{rhs}; +} + +// Combines two expected value taking the last success. +template +Expected operator|(const Expected& lhs, const Expected& rhs) { + return rhs ? Expected{rhs} : Expected{lhs}; +} + +// Arithmetic operator+ for values stored in expected values. Returns either the computed value +// or the first unexpected among lhs and rhs. +template +Expected operator+(const Expected& lhs, const Expected& rhs) { + return Apply([](const V& lhs, const V& rhs) { return lhs + rhs; }, lhs, rhs); +} + +template +Expected operator+(const Expected& lhs, const V& rhs) { + return lhs.map([&](const V& value) { return value + rhs; }); +} + +template +Expected operator+(const V& lhs, const Expected& rhs) { + return rhs.map([&](const V& value) { return lhs + value; }); +} + +// Arithmetic operator- for values stored in expected values. Returns either the computed value +// or the first unexpected among lhs and rhs. +template +Expected operator-(const Expected& lhs, const Expected& rhs) { + return Apply([](const V& lhs, const V& rhs) { return lhs - rhs; }, lhs, rhs); +} + +template +Expected operator-(const Expected& lhs, const V& rhs) { + return lhs.map([&](const V& value) { return value - rhs; }); +} + +template +Expected operator-(const V& lhs, const Expected& rhs) { + return rhs.map([&](const V& value) { return lhs - value; }); +} + +// Arithmetic operator* for values stored in expected values. Returns either the computed value +// or the first unexpected among lhs and rhs. +template +Expected operator*(const Expected& lhs, const Expected& rhs) { + return Apply([](const V& lhs, const V& rhs) { return lhs * rhs; }, lhs, rhs); +} + +template +Expected operator*(const Expected& lhs, const V& rhs) { + return lhs.map([&](const V& value) { return value * rhs; }); +} + +template +Expected operator*(const V& lhs, const Expected& rhs) { + return rhs.map([&](const V& value) { return lhs * value; }); +} + +// Arithmetic operator/ for values stored in expected values. Returns either the computed value +// or the first unexpected among lhs and rhs. +template +Expected operator/(const Expected& lhs, const Expected& rhs) { + return Apply([](const V& lhs, const V& rhs) { return lhs / rhs; }, lhs, rhs); +} + +template +Expected operator/(const Expected& lhs, const V& rhs) { + return lhs.map([&](const V& value) { return value / rhs; }); +} + +template +Expected operator/(const V& lhs, const Expected& rhs) { + return rhs.map([&](const V& value) { return lhs / value; }); +} + +} // namespace nvidia + +#endif // NVIDIA_CORE_EXPECTED_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/core/fixed_vector.hpp b/isaac_ros_nvengine/gxf/include/core/fixed_vector.hpp new file mode 100644 index 00000000..92e41404 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/fixed_vector.hpp @@ -0,0 +1,355 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_FIXED_VECTOR_HPP_ +#define NVIDIA_GXF_CORE_FIXED_VECTOR_HPP_ + +#include +#include + +#include "core/byte.hpp" +#include "core/expected.hpp" +#include "core/memory_utils.hpp" + +namespace nvidia { + +// Data structure that provides similar functionality to std::vector but does not dynamically +// reallocate memory and uses Expected type for error handling instead of exceptions. +// This container is not thread-safe. +// +// This container supports allocating memory on the stack or on the heap. If the template argument +// N is specified and greater than 0, a container with a capacity of N will be created on the stack. +// The stack allocated container cannot be resized after it is initialized. The heap allocated +// container must use the reserve function to allocate memory before use. It does not support +// copy assignment or construction. + +// Base implementation +template +class FixedVectorBase { + public: + virtual ~FixedVectorBase() = default; + + // Custom error codes for vector + enum struct Error { + kOutOfMemory, // Memory allocation failed + kArgumentOutOfRange, // Argument is out of valid range + kContainerEmpty, // Container is empty + kContainerFull, // Container is fixed and reached max capacity + }; + + // Expected type which uses class specific errors + template + using Expected = Expected; + // Special value for returning a success + const Expected Success{}; + + bool operator==(const FixedVectorBase& other) const { + if (size_ != other.size_) { + return false; + } + for (size_t i = 0; i < size_; i ++) { + if (data_[i] != other.data_[i]) { + return false; + } + } + return true; + } + bool operator!=(const FixedVectorBase& other) const { return !(*this == other); } + + // Returns a pointer to data + T* data() { return data_; } + // Returns a read-only pointer to data + const T* data() const { return data_; } + // Returns the number of elements the vector can currently hold + virtual size_t capacity() const = 0; + // Returns the number of elements in the vector + size_t size() const { return size_; } + // Returns true if the vector contains no elements + bool empty() const { return size_ == 0; } + // Returns true if the vector reached capacity + bool full() const { return size_ == capacity(); } + + // Returns a reference to the element at the given index + Expected at(size_t index) { + if (index >= size_) { + return Unexpected{Error::kArgumentOutOfRange}; + } + return data_[index]; + } + + // Returns a read-only reference to the element at the given index + Expected at(size_t index) const { + if (index >= size_) { + return Unexpected{Error::kArgumentOutOfRange}; + } + return data_[index]; + } + + // Returns a reference to the first element + Expected front() { + if (empty()) { + return Unexpected{Error::kContainerEmpty}; + } + return data_[0]; + } + + // Returns a read-only reference to the first element + Expected front() const { + if (empty()) { + return Unexpected{Error::kContainerEmpty}; + } + return data_[0]; + } + + // Returns a reference to the last element + Expected back() { + if (empty()) { + return Unexpected{Error::kContainerEmpty}; + } + return data_[size_ - 1]; + } + + // Returns a read-only reference to the last element + Expected back() const { + if (empty()) { + return Unexpected{Error::kContainerEmpty}; + } + return data_[size_ - 1]; + } + + // Creates a new object with the provided arguments and adds it at the specified index + template + Expected emplace(size_t index, Args&&... args) { + if (index > size_) { + return Unexpected{Error::kArgumentOutOfRange}; + } + if (full()) { + return Unexpected{Error::kContainerFull}; + } + if (index < size_) { + ArrayMoveConstruct(BytePointer(&data_[index + 1]), &data_[index], size_ - index); + } + InplaceConstruct(BytePointer(&data_[index]), std::forward(args)...); + size_++; + return Success; + } + + // Creates a new object with the provided arguments and adds it to the end of the vector + template + Expected emplace_back(Args&&... args) { + return emplace(size_, std::forward(args)...); + } + + // Copies the object to the specified index + Expected insert(size_t index, const T& obj) { return emplace(index, obj); } + // Moves the object to the specified index + Expected insert(size_t index, T&& obj) { return emplace(index, std::forward(obj)); } + // Copies the object to the end of the vector + Expected push_back(const T& obj) { return emplace_back(obj); } + // Moves the object to the end of the vector + Expected push_back(T&& obj) { return emplace_back(std::forward(obj)); } + + // Removes the object at the specified index and destroys it + Expected erase(size_t index) { + if (index >= size_) { + return Unexpected{Error::kArgumentOutOfRange}; + } + if (empty()) { + return Unexpected{Error::kContainerEmpty}; + } + Destruct(BytePointer(&data_[index])); + size_--; + if (index < size_) { + ArrayMoveConstruct(BytePointer(&data_[index]), &data_[index + 1], size_ - index); + } + return Success; + } + + // Removes the object at the end of the vector and destroys it + Expected pop_back() { return erase(size_ - 1); } + + // Removes all objects from the vector + void clear() { + while (size_ > 0) { + Destruct(BytePointer(&data_[--size_])); + } + } + + // Resizes the vector by removing objects from the end if shrinking + // or by adding default objects to the end if expanding + Expected resize(size_t count) { + if (count > capacity()) { + return Unexpected{Error::kArgumentOutOfRange}; + } + while (count > size_) { + push_back(T()); + } + while (count < size_) { + pop_back(); + } + return Success; + } + + // Resizes the vector by removing objects from the end if shrinking + // or by adding copies of the given object to the end if expanding + Expected resize(size_t count, const T& obj) { + if (count > capacity()) { + return Unexpected{Error::kArgumentOutOfRange}; + } + while (count > size_) { + push_back(obj); + } + while (count < size_) { + pop_back(); + } + return Success; + } + + protected: + FixedVectorBase() = default; + + // Pointer to an array of objects + T* data_; + // Number of objects stored + size_t size_; +}; + +// Vector with stack memory allocation +template +class FixedVector : public FixedVectorBase { + public: + FixedVector() { + data_ = ValuePointer(pool_); + size_ = 0; + } + FixedVector(const FixedVector& other) { *this = other; } + FixedVector(FixedVector&& other) { *this = std::move(other); } + FixedVector& operator=(const FixedVector& other) { + data_ = ValuePointer(pool_); + size_ = other.size_; + ArrayCopyConstruct(BytePointer(data_), other.data_, size_); + return *this; + } + FixedVector& operator=(FixedVector&& other) { + data_ = ValuePointer(pool_); + size_ = other.size_; + ArrayMoveConstruct(BytePointer(data_), other.data_, size_); + other.size_ = 0; + return *this; + } + ~FixedVector() { FixedVectorBase::clear(); } + + size_t capacity() const override { return N; } + + private: + using FixedVectorBase::data_; + using FixedVectorBase::size_; + + // Size of memory pool for stack allocation + static constexpr size_t kPoolSize = N * sizeof(T); + // Memory pool for storing objects on the stack + byte pool_[kPoolSize]; +}; + +// Vector with heap memory allocation +template +class FixedVector : public FixedVectorBase { + public: + using Error = typename FixedVectorBase::Error; + + template + using Expected = typename FixedVectorBase::template Expected; + using FixedVectorBase::Success; + + FixedVector() { reset(); } + FixedVector(const FixedVector& other) = delete; + FixedVector(FixedVector&& other) { *this = std::move(other); } + FixedVector& operator=(const FixedVector& other) = delete; + FixedVector& operator=(FixedVector&& other) { + data_ = other.data_; + capacity_ = other.capacity_; + size_ = other.size_; + other.reset(); + return *this; + } + ~FixedVector() { + FixedVectorBase::clear(); + DeallocateArray(data_); + reset(); + } + + size_t capacity() const override { return capacity_; } + + // Copies the contents of the given vector + // Current contents are discarded + // Fails if given vector is larger than current capacity + Expected copy_from(const FixedVector& other) { + if (other.size_ > capacity_) { + return Unexpected{Error::kArgumentOutOfRange}; + } + FixedVectorBase::clear(); + size_ = other.size_; + ArrayCopyConstruct(BytePointer(data_), other.data_, size_); + return Success; + } + + // Allocates memory to hold the specified number of elements + Expected reserve(size_t capacity) { + if (capacity > capacity_) { + T* data = AllocateArray(capacity); + if (!data) { + return Unexpected{Error::kOutOfMemory}; + } + ArrayMoveConstruct(BytePointer(data), data_, size_); + DeallocateArray(data_); + data_ = data; + capacity_ = capacity; + } + return Success; + } + + // Shrinks memory allocation to fit current number of elements + Expected shrink_to_fit() { + if (size_ < capacity_) { + T* data = AllocateArray(size_); + if (!data) { + return Unexpected(Error::kOutOfMemory); + } + ArrayMoveConstruct(BytePointer(data), data_, size_); + DeallocateArray(data_); + data_ = data; + capacity_ = size_; + } + return Success; + } + + private: + using FixedVectorBase::data_; + using FixedVectorBase::size_; + + // Resets class members to default values + void reset() { + data_ = nullptr; + capacity_ = 0; + size_ = 0; + } + + // Number of objects that can be stored + size_t capacity_; +}; + +} // namespace nvidia + +#endif // NVIDIA_GXF_CORE_FIXED_VECTOR_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/core/logger.hpp b/isaac_ros_nvengine/gxf/include/core/logger.hpp new file mode 100644 index 00000000..6a10e0a5 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/logger.hpp @@ -0,0 +1,82 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_LOGGER_HPP +#define NVIDIA_CORE_LOGGER_HPP + +#include +#include +#include + +// Logs a debug message +#define GXF_LOG_DEBUG(...) \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::DEBUG, __VA_ARGS__) + +// Logs an informational message +#define GXF_LOG_INFO(...) \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::INFO, __VA_ARGS__) + +// Logs a warning +#define GXF_LOG_WARNING(...) \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::WARNING, __VA_ARGS__) + +// Logs an error +#define GXF_LOG_ERROR(...) \ + ::nvidia::Log(__FILE__, __LINE__, ::nvidia::Severity::ERROR, __VA_ARGS__) + +namespace nvidia { + +// Indicates the level of severity for a log message +enum class Severity { + // A utility case which can be used for 'SetSeverity' to disable all severity levels. + NONE = -2, + // A utility case which can be used for 'Redirect' and 'SetSeverity' + ALL = -1, + // The five different log severities in use from most severe to least severe. + PANIC = 0, // Need to start at 0 + ERROR, + WARNING, + INFO, + DEBUG, + // A utility case representing the number of log levels used internally. + COUNT +}; + +// Function which is used for logging. It can be changed to intercept the logged messages. +extern void (*LoggingFunction)(const char* file, int line, Severity severity, const char* log); + +// Redirects the output for a given log severity. +void Redirect(std::FILE* file, Severity severity = Severity::ALL); + +// Sets global log severity thus effectively disabling all logging with lower severity +void SetSeverity(Severity severity); + +// Converts the message and argument into a string and pass it to LoggingFunction. +template +void Log(const char* file, int line, Severity severity, const char* txt, ...) { + va_list args1; + va_start(args1, txt); + va_list args2; + va_copy(args2, args1); + std::vector buf(1 + std::vsnprintf(NULL, 0, txt, args1)); + va_end(args1); + std::vsnprintf(buf.data(), buf.size(), txt, args2); + va_end(args2); + LoggingFunction(file, line, severity, buf.data()); +} + +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/core/memory_utils.hpp b/isaac_ros_nvengine/gxf/include/core/memory_utils.hpp new file mode 100644 index 00000000..2bbf18ad --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/memory_utils.hpp @@ -0,0 +1,160 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_MEMORY_UTILS_HPP_ +#define NVIDIA_CORE_MEMORY_UTILS_HPP_ + +#include +#include +#include +#include +#include + +#include "core/byte.hpp" + +namespace nvidia { + +// Convert a raw byte pointer `src` to a concrete type T +template +T* ValuePointer(byte* src) { + return reinterpret_cast(src); +} + +// Convert a const raw byte pointer `src` to a concrete type T +template +const T* ValuePointer(const byte* src) { + return reinterpret_cast(src); +} + +// Convert a type T pointer `src` to a raw byte pointer +template +byte* BytePointer(T* src) { + return reinterpret_cast(src); +} + +// Convert a const type T pointer `src` to a raw byte pointer +template +const byte* BytePointer(const T* src) { + return reinterpret_cast(src); +} + +// Call the destructor for type T on the object located at `src`. +template +void Destruct(byte* src) { + reinterpret_cast(src)->~T(); +} + +// Construct an object of type T with the provided arguments into the memory at `dst` with +// placement new operator. +template +T* InplaceConstruct(byte* dst, Args&&... args) { + return new (dst) T{std::forward(args)...}; +} + +// Move construct an object of type T into the memory at `dst` with placement new operator. +template +T* InplaceMoveConstruct(byte* dst, T&& other) { + return new (dst) T{std::forward(other)}; +} + +// Copy construct an object of type T into the memory at `dst` with placement new operator. +template +T* InplaceCopyConstruct(byte* dst, const T& other) { + return new (dst) T{other}; +} + +// Move constructs an array of objects of type T into the memory at `dst` +// Used if object is movable +template ::value>* = nullptr> +void ArrayMoveConstruct(byte* dst, T* src, size_t count) { + // Reverse move direction to handle overlapping memory segments + const bool reverse = dst > BytePointer(src) && dst < BytePointer(src + count); + for (size_t i = 0; i < count; i++) { + const size_t index = reverse ? count - 1 - i : i; + InplaceMoveConstruct(dst + sizeof(T) * index, std::move(src[index])); + } +} + +// Move constructs an array of objects of type T into the memory at `dst` +// Used if object is not movable but trivially copyable +template ::value && + std::is_trivially_copyable::value>* = nullptr> +void ArrayMoveConstruct(byte* dst, T* src, size_t count) { + std::memmove(dst, src, sizeof(T) * count); +} + +// Move constructs an array of objects of type T into the memory at `dst` +// Used if object is not movable and not trivially copyable +template ::value && + !std::is_trivially_copyable::value>* = nullptr> +void ArrayMoveConstruct(byte* dst, T* src, size_t count) { + // Reverse move direction to handle overlapping memory segments + const bool reverse = dst > BytePointer(src) && dst < BytePointer(src + count); + for (size_t i = 0; i < count; i++) { + const size_t index = reverse ? count - 1 - i : i; + InplaceCopyConstruct(dst + sizeof(T) * index, src[index]); + } +} + +// Copy constructs an array of objects of type T into the memory at `dst` +// Used if object is trivially copyable +template ::value>* = nullptr> +void ArrayCopyConstruct(byte* dst, T* src, size_t count) { + std::memmove(dst, src, sizeof(T) * count); +} + +// Copy constructs an array of objects of type T into the memory at `dst` +// Used if object is not trivially copyable +template ::value>* = nullptr> +void ArrayCopyConstruct(byte* dst, T* src, size_t count) { + // Reverse move direction to handle overlapping memory segments + const bool reverse = dst > BytePointer(src) && dst < BytePointer(src + count); + for (size_t i = 0; i < count; i++) { + const size_t index = reverse ? count - 1 - i : i; + InplaceCopyConstruct(dst + sizeof(T) * index, src[index]); + } +} + +// Allocates an array with `size` number of objects of type T +// Does not call object constructor +template +T* AllocateArray(size_t size) { + return static_cast(::operator new(size * sizeof(T), std::nothrow)); +} + +// Deallocates the array `data` of objects of type T +// Does not call object destructor +template +void DeallocateArray(T* data) { + ::operator delete(data); +} + +// Construct an object of type T with the provided arguments and returns a unique pointer to it +// Null pointer is returned on error +template +std::unique_ptr MakeUniqueNoThrow(Args&&... args) { + return std::unique_ptr(new(std::nothrow) T{std::forward(args)...}); +} + +// Construct an object of type T with the provided arguments and returns a shared pointer to it +// Null pointer is returned on error +template +std::shared_ptr MakeSharedNoThrow(Args&&... args) { + return std::shared_ptr(new(std::nothrow) T{std::forward(args)...}); +} + +} // namespace nvidia + +#endif // NVIDIA_CORE_MEMORY_UTILS_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/core/optional.hpp b/isaac_ros_nvengine/gxf/include/core/optional.hpp new file mode 100644 index 00000000..b8d1facb --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/optional.hpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_OPTIONAL_HPP +#define NVIDIA_CORE_OPTIONAL_HPP + +#include + +namespace std { + +using experimental::optional; +using experimental::nullopt_t; +using experimental::nullopt; + +} // namespace std + +#endif diff --git a/isaac_ros_nvengine/gxf/include/core/type_name.hpp b/isaac_ros_nvengine/gxf/include/core/type_name.hpp new file mode 100644 index 00000000..7ee229a6 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/type_name.hpp @@ -0,0 +1,61 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_TYPE_NAME_HPP +#define NVIDIA_CORE_TYPE_NAME_HPP + +#include + +#if defined(__clang__) +// Not yet implemented +#elif defined(__GNUC__) +#include "type_name_gnuc.hpp" +#elif defined(_MSC_VER) +// Not yet implemented +#endif + +namespace nvidia { + +// Gives a string representation of the name of a C++ type. +// +// The function will compute the typename during the first invocation and store it in heap memory. +// Computation of the typename is linear in the length of the typename and does not involve dynamic +// memory allocations. +// +// For example: +// namespace foo { +// struct Bar {}; +// } // namespace +// TyenameAsString(); // returns "foo::Bar" +// +// Note: Only "simple" class types in global namespace or a "normal" namespaces are guaranteed to +// work. Templates, lambdas and anonymous namespaces are not guaranteed to work as expected. +template +const char* TypenameAsString() { + // Ideally the typename string would be computed at compile time, however this does not seem to + // be possible. Thus the typename string is computed the first time this function is evaluated + // and cached for future function evaluations. + constexpr int32_t kMaxNameLength = sizeof(__PRETTY_FUNCTION__); // Use upper bound to be safe. + static char s_name[kMaxNameLength] = {0}; // Initialize with 0 to get a null-terminated string. + static char* result = s_name; + if (s_name[0] == 0 && result != nullptr) { // Check for first invokation of this function. + result = TypenameAsStringImpl(__PRETTY_FUNCTION__, s_name, kMaxNameLength); + } + return result; +} + +} // namespace nvidia + +#endif // NVIDIA_CORE_TYPE_NAME_HPP diff --git a/isaac_ros_nvengine/gxf/include/core/type_name_gnuc.hpp b/isaac_ros_nvengine/gxf/include/core/type_name_gnuc.hpp new file mode 100644 index 00000000..c92d8355 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/type_name_gnuc.hpp @@ -0,0 +1,37 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_CORE_TYPE_NAME_GNUC_HPP +#define NVIDIA_CORE_TYPE_NAME_GNUC_HPP + +#include + +namespace nvidia { + +// For the GNU compiler __PRETTY_FUNCTION__ is a null-terminated string with the following form: +// const char* nvidia::TypenameAsString() [with T = nvidia::gxf::Component] +// We would like to extract the type name as "nvidia::gxf::Component". +// The result is stored in the given string 'output'. If the type name is longer than max_length +// or another error occurs the function returns nullptr; otherwise 'output' is returned. +char* TypenameAsStringGnuC(const char* begin, char* output, int32_t max_length); + +// Compiler-specific implementation of the TypenameAsString function. +inline char* TypenameAsStringImpl(const char* begin, char* output, int32_t max_length) { + return TypenameAsStringGnuC(begin, output, max_length); +} + +} // namespace nvidia + +#endif // NVIDIA_CORE_TYPE_NAME_GNUC_HPP diff --git a/isaac_ros_nvengine/gxf/include/core/type_utils.hpp b/isaac_ros_nvengine/gxf/include/core/type_utils.hpp new file mode 100644 index 00000000..a1453fbd --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/core/type_utils.hpp @@ -0,0 +1,162 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ + +#ifndef NVIDIA_CORE_TYPE_UTILS_HPP_ +#define NVIDIA_CORE_TYPE_UTILS_HPP_ + +// GXF definitions for common class definitions. These should behave identically +// ISO standard definitions. They are defined locally to minimize dependencies of core GXF code +// on any stl implementations. +namespace nvidia { + +// https://en.cppreference.com/w/cpp/types/void_t +template using void_t = void; + +// https://en.cppreference.com/w/cpp/types/type_identity +template struct TypeIdentity { using type = T; }; + +template using TypeIdentity_t = typename TypeIdentity::type; + +// https://en.cppreference.com/w/cpp/types/integral_constant +template struct IntegralConstant { static constexpr T value = v; }; +template struct BoolConstant : IntegralConstant {}; + +struct TrueType : BoolConstant {}; +struct FalseType : BoolConstant {}; + +// https://en.cppreference.com/w/cpp/types/conditional +template struct Conditional : TypeIdentity {}; +template struct Conditional : TypeIdentity {}; + +template using Conditional_t = typename Conditional::type; + +// https://en.cppreference.com/w/cpp/types/conjunction +template +struct Conjunction : TrueType {}; + +template +struct Conjunction : Conditional, B>::type {}; + +template constexpr bool Conjunction_v = Conjunction::value; + +// https://en.cppreference.com/w/cpp/types/disjunction +template +struct Disjunction : FalseType {}; + +template +struct Disjunction : Conditional>::type {}; + +template constexpr bool Disjunction_v = Disjunction::value; + +// https://en.cppreference.com/w/cpp/types/negation +template struct Negation : BoolConstant(B::value)> {}; + +template constexpr bool Negation_v = Negation::value; + +// https://en.cppreference.com/w/cpp/types/remove_reference +template struct RemoveReference : TypeIdentity {}; +template struct RemoveReference : TypeIdentity {}; +template struct RemoveReference : TypeIdentity {}; + +template using RemoveReference_t = typename RemoveReference::type; + +// https://en.cppreference.com/w/cpp/types/remove_cv +template struct RemoveCV : TypeIdentity {}; +template struct RemoveCV : TypeIdentity {}; +template struct RemoveCV : TypeIdentity {}; +template struct RemoveCV : TypeIdentity {}; + +template using RemoveCV_t = typename RemoveCV::type; + +template struct RemoveConst : TypeIdentity {}; +template struct RemoveConst : TypeIdentity {}; + +template using RemoveConst_t = typename RemoveConst::type; + +template struct RemoveVolatile : TypeIdentity {}; +template struct RemoveVolatile : TypeIdentity {}; + +template using RemoveVolatile_t = typename RemoveVolatile::type; + +// https://en.cppreference.com/w/cpp/types/remove_cvref +template struct RemoveCVRef : RemoveCV::type>{}; + +template using RemoveCVRef_t = typename RemoveCVRef::type; + +// https://en.cppreference.com/w/cpp/types/add_reference +template struct AddLvalueReference : TypeIdentity {}; +template struct AddLvalueReference : TypeIdentity {}; +template struct AddLvalueReference : TypeIdentity {}; +template <> struct AddLvalueReference : TypeIdentity {}; + +template struct AddRvalueReference : TypeIdentity {}; +template struct AddRvalueReference : TypeIdentity {}; +template struct AddRvalueReference : TypeIdentity {}; +template <> struct AddRvalueReference : TypeIdentity {}; + +template using AddLvalueReference_t = typename AddLvalueReference::type; +template using AddRvalueReference_t = typename AddRvalueReference::type; + +// https://en.cppreference.com/w/cpp/utility/declval +template +AddRvalueReference_t Declval() { + static_assert([]() { return false; } (), "Declval() cannot be used in an evaluated context."); +} + +// https://en.cppreference.com/w/cpp/types/enable_if +template struct EnableIf {}; +template struct EnableIf : TypeIdentity {}; + +template using EnableIf_t = typename EnableIf::type; + +// https://en.cppreference.com/w/cpp/types/is_same +template struct IsSame : FalseType {}; +template struct IsSame : TrueType {}; + +template constexpr bool IsSame_v = IsSame::value; + +// https://en.cppreference.com/w/cpp/types/is_reference +template struct IsReference : FalseType {}; +template struct IsReference : TrueType {}; +template struct IsReference : TrueType {}; + +template constexpr bool IsReference_v = IsReference::value; + +// https://en.cppreference.com/w/cpp/types/is_constructible +template +struct IsConstructible : FalseType {}; + +template +struct IsConstructible()))>> : TrueType {}; + +template constexpr bool IsConstructible_v = IsConstructible::value; + +// https://en.cppreference.com/w/cpp/types/is_assignable +template +struct IsAssignable : FalseType {}; + +template +struct IsAssignable() = Declval())>> : TrueType{}; + +template constexpr bool IsAssignable_v = IsAssignable::value; + +// https://en.cppreference.com/w/cpp/types/is_void +template struct IsVoid : IsSame::type> {}; + +template constexpr bool IsVoid_v = IsVoid::value; +} // namespace nvidia + +#endif // NVIDIA_CORE_TYPE_UTILS_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/component.hpp b/isaac_ros_nvengine/gxf/include/gxf/core/component.hpp new file mode 100644 index 00000000..1cabe066 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/component.hpp @@ -0,0 +1,102 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_COMPONENT_HPP +#define NVIDIA_GXF_CORE_COMPONENT_HPP + +#include "core/assert.hpp" +#include "gxf/core/entity.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/gxf.h" +#include "gxf/core/handle.hpp" +#include "gxf/core/parameter.hpp" +#include "gxf/core/registrar.hpp" +#include "gxf/std/parameter_storage.hpp" + +namespace nvidia { +namespace gxf { + +// Components are parts of an entity and provide their functionality. The Component class is the +// base class of all GXF components. +class Component { + public: + virtual ~Component() = default; + + Component(const Component& component) = delete; + Component(Component&& component) = delete; + Component& operator=(const Component& component) = delete; + Component& operator=(Component&& component) = delete; + + // Used to register all parameters of the components. Do not use this function for other purposes + // as it might be called at anytime by the runtime. + // + // Example: + // class Foo : public Component { + // public: + // gxf_result_t registerInterface(Registrar* registrar) override { + // GXF_REGISTER_PARAMETER(count, 1); + // } + // GXF_PARAMETER(int, count); + // }; + virtual gxf_result_t registerInterface(Registrar* registrar) { + registrar->registerParameterlessComponent(); + return GXF_SUCCESS; + } + + // Use to start the lifetime of a component and should be used instead of the constructor. + // Called after all components of an entity are created. The order in which components within + // the same entity are initialized is undefined. + virtual gxf_result_t initialize() { return GXF_SUCCESS; } + + // Use to end the lifetime of a component and should be used instead of the deconstructor. + // The order in which components within the same entity are deinitialized is undefined. + virtual gxf_result_t deinitialize() { return GXF_SUCCESS; } + + gxf_context_t context() const noexcept { return context_; } + gxf_uid_t eid() const noexcept { return eid_; } + gxf_uid_t cid() const noexcept { return cid_; } + + // The entity which owns this component + Entity entity() const noexcept { + // FIXME(v1) check that value exists + return Entity::Shared(context(), eid()).value(); + } + + // Gets the name of the component + const char* name() const noexcept { + const char* result; + const gxf_result_t code = GxfComponentName(context(), cid(), &result); + return (code == GXF_SUCCESS) ? result : ""; + } + + // This function shall only be called by GXF and is used to setup the component. + void internalSetup(gxf_context_t context, gxf_uid_t eid, gxf_uid_t cid) { + context_ = context; + eid_ = eid; + cid_ = cid; + } + + protected: + Component() = default; + + gxf_context_t context_ = kNullContext; + gxf_uid_t eid_ = kNullUid; + gxf_uid_t cid_ = kNullUid; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/entity.hpp b/isaac_ros_nvengine/gxf/include/gxf/core/entity.hpp new file mode 100644 index 00000000..02a650e8 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/entity.hpp @@ -0,0 +1,299 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_ENTITY_HPP_ +#define NVIDIA_GXF_CORE_ENTITY_HPP_ + +#include +#include + +#include "core/assert.hpp" +#include "core/fixed_vector.hpp" +#include "core/type_name.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/gxf.h" +#include "gxf/core/handle.hpp" + +namespace nvidia { +namespace gxf { + +// All GXF objects are entities. An entity owns multiple components which define the functionality +// of the entity. Entities themselves are nothing more than a unique identifier. +// FIXME This type is a bit strange as it looks like and entity, but is in face just a handle. +class Entity { + public: + // Creates a new entity + static Expected New(gxf_context_t context) { + gxf_uid_t eid; + const GxfEntityCreateInfo info = {0}; + const gxf_result_t code = GxfCreateEntity(context, &info, &eid); + if (code != GXF_SUCCESS) { + return Unexpected{code}; + } else { + return Shared(context, eid); + } + } + + // Creates an entity handle based on an existing ID and takes ownership. + // Reference count is not increased. + static Expected Own(gxf_context_t context, gxf_uid_t eid) { + Entity result; + result.context_ = context; + result.eid_ = eid; + return result; + } + + // Creates an entity handle based on an existing ID and shares ownership. + // Reference count is increased by one. + static Expected Shared(gxf_context_t context, gxf_uid_t eid) { + Entity result; + result.context_ = context; + result.eid_ = eid; + const gxf_result_t code = GxfEntityRefCountInc(context, eid); + if (code != GXF_SUCCESS) { + return Unexpected{code}; + } else { + return result; + } + } + + Entity() = default; + + Entity(const Entity& other) { + eid_ = other.eid(); + context_ = other.context(); + if (eid_ != kNullUid) { + // FIXME(dweikersdorf) How do we deal with failure? + GxfEntityRefCountInc(context_, eid_); + } + } + + Entity(Entity&& other) { + context_ = other.context_; + eid_ = other.eid_; + other.context_ = kNullContext; + other.eid_ = kNullUid; + } + + Entity& operator=(const Entity& other) { + // In case other point to the same entity, nothing needs to be done. + if (eid_ == other.eid() && context_ == other.context()) { + return *this; + } + if (eid_ != kNullUid) { + release(); + } + context_ = other.context(); + eid_ = other.eid(); + if (eid_ != kNullUid) { + // FIXME(dweikersdorf) How do we deal with failure? + GxfEntityRefCountInc(context_, eid_); + } + return *this; + } + + Entity& operator=(Entity&& other) { + // In case other is this, then nothing should be done. + if (&other == this) { + return *this; + } + if (eid_ != kNullUid) { + release(); + } + context_ = other.context_; + eid_ = other.eid_; + other.context_ = kNullContext; + other.eid_ = kNullUid; + return *this; + } + + ~Entity() { + if (eid_ != kNullUid) { + release(); + } + } + + // See GxfEntityActivate + Expected activate() { + return ExpectedOrCode(GxfEntityActivate(context(), eid())); + } + + // See GxfEntityDectivate + Expected deactivate() { + return ExpectedOrCode(GxfEntityDeactivate(context(), eid())); + } + + Expected clone() const { + return Shared(context(), eid()); + } + + gxf_context_t context() const { return context_; } + gxf_uid_t eid() const { return eid_; } + bool is_null() const { return eid_ == kNullUid; } + + // The name of the entity or empty string if no name has been given to the entity. + const char* name() const { + const char* ptr; + const gxf_result_t result = GxfParameterGetStr(context_, eid_, kInternalNameParameterKey, &ptr); + return (result == GXF_SUCCESS) ? ptr : ""; + } + + // Adds a component with given type ID + Expected add(gxf_tid_t tid, const char* name = nullptr) { + gxf_uid_t cid; + const auto result = GxfComponentAdd(context(), eid(), tid, name, &cid); + if (result != GXF_SUCCESS) { + return Unexpected{result}; + } + return UntypedHandle::Create(context(), cid); + } + + // Adds a component with given type + template + Expected> add(const char* name = nullptr) { + gxf_tid_t tid; + const auto result_1 = GxfComponentTypeId(context(), TypenameAsString(), &tid); + if (result_1 != GXF_SUCCESS) { + return Unexpected{result_1}; + } + gxf_uid_t cid; + const auto result_2 = GxfComponentAdd(context(), eid(), tid, name, &cid); + if (result_2 != GXF_SUCCESS) { + return Unexpected{result_2}; + } + return Handle::Create(context(), cid); + } + + // Gets a component by type ID. Asserts if no such component. + Expected get(gxf_tid_t tid, const char* name = nullptr) const { + gxf_uid_t cid; + const auto result = GxfComponentFind(context(), eid(), tid, name, nullptr, &cid); + if (result != GXF_SUCCESS) { + return Unexpected{result}; + } + return UntypedHandle::Create(context(), cid); + } + + // Gets a component by type. Asserts if no such component. + template + Expected> get(const char* name = nullptr) const { + gxf_tid_t tid; + const auto result_1 = GxfComponentTypeId(context(), TypenameAsString(), &tid); + if (result_1 != GXF_SUCCESS) { + return Unexpected{result_1}; + } + gxf_uid_t cid; + const auto result_2 = GxfComponentFind(context(), eid(), tid, name, nullptr, &cid); + if (result_2 != GXF_SUCCESS) { + return Unexpected{result_2}; + } + return Handle::Create(context(), cid); + } + + // Finds all components. + Expected findAll(FixedVectorBase& components) const { + const gxf_context_t c_context = context(); + const gxf_uid_t c_eid = eid(); + for (int offset = 0; ; offset++) { + gxf_uid_t cid; + const auto code = GxfComponentFind(c_context, c_eid, GxfTidNull(), nullptr, &offset, &cid); + if (code != GXF_SUCCESS) { break; } + const auto handle = UntypedHandle::Create(c_context, cid); + if (!handle) { return ForwardError(handle); } + const auto result = components.push_back(handle.value()); + if (!result) { return Unexpected{GXF_EXCEEDING_PREALLOCATED_SIZE}; } + } + return Success; + } + + // Deprecated + // TODO(ayusmans): Remove for 2.4 release + std::vector findAll() const { + std::vector components; + for (int offset = 0; ; offset++) { + gxf_uid_t cid; + const auto result = GxfComponentFind(context(), eid(), GxfTidNull(), nullptr, &offset, &cid); + if (result != GXF_SUCCESS) { + return components; + } + const auto handle = UntypedHandle::Create(context(), cid); + if (!handle) { + return {}; // FIXME + } + components.push_back(handle.value()); + } + return components; + } + + // Finds all components of given type. + template + Expected findAll(FixedVectorBase>& components) const { + const gxf_context_t c_context = context(); + const gxf_uid_t c_eid = eid(); + gxf_tid_t tid; + const auto code = GxfComponentTypeId(c_context, TypenameAsString(), &tid); + if (code != GXF_SUCCESS) { return Unexpected{code}; } + for (int offset = 0; ; offset++) { + gxf_uid_t cid; + const auto code = GxfComponentFind(c_context, c_eid, tid, nullptr, &offset, &cid); + if (code != GXF_SUCCESS) { break; } + const auto handle = Handle::Create(c_context, cid); + if (!handle) { return ForwardError(handle); } + const auto result = components.push_back(handle.value()); + if (!result) { return Unexpected{GXF_EXCEEDING_PREALLOCATED_SIZE}; } + } + return Success; + } + + // Deprecated + // TODO(ayusmans): Remove for 2.4 release + template + std::vector> findAll() const { + gxf_tid_t tid; + const auto result_1 = GxfComponentTypeId(context(), TypenameAsString(), &tid); + if (result_1 != GXF_SUCCESS) { + return {}; // FIXME + } + std::vector> components; + for (int offset = 0; ; offset++) { + gxf_uid_t cid; + const auto result_2 = GxfComponentFind(context(), eid(), tid, nullptr, &offset, &cid); + if (result_2 != GXF_SUCCESS) { + return components; + } + const auto handle = Handle::Create(context(), cid); + if (!handle) { + return {}; // FIXME + } + components.push_back(handle.value()); + } + return components; + } + + private: + void release() { + GxfEntityRefCountDec(context_, eid_); // TODO(v2) We should use the error code, but we can't + // do anything about it.. + eid_ = kNullUid; + } + + gxf_context_t context_ = kNullContext; + gxf_uid_t eid_ = kNullUid; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_CORE_ENTITY_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/expected.hpp b/isaac_ros_nvengine/gxf/include/gxf/core/expected.hpp new file mode 100644 index 00000000..82a6676b --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/expected.hpp @@ -0,0 +1,104 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_EXPECTED_HPP +#define NVIDIA_GXF_CORE_EXPECTED_HPP + +#include +#include + +#include "core/expected.hpp" +#include "gxf/core/gxf.h" + +namespace nvidia { +namespace gxf { + +// Expected type for GXF which uses gxf_result_t as error code. +template +using Expected = Expected; + +// Unexpected type for GXF which uses gxf_result_t as error code. +using Unexpected = Unexpected; + +// Special value which can be used instead of {} to return from a function which returns an +// Expected. +const Expected Success{}; + +// Extracts the error code as an unexpected. +template +Unexpected ForwardError(const Expected& expected) { + return Unexpected{expected.error()}; +} + +// Extracts the error code as an unexpected. +template +Unexpected ForwardError(Expected&& expected) { + return Unexpected{std::move(expected.error())}; +} + +// Interprets an expected as a result code. Returns GXF_SUCESS if the result has a value and the +// result's error code otherwise. +template +gxf_result_t ToResultCode(const Expected& result) { + return result ? GXF_SUCCESS : result.error(); +} + +// If the result code is GXF_SUCCESS the function returns Success, otherwise it returns an +// unexpected with the given error code. +inline +Expected ExpectedOrCode(gxf_result_t code) { + if (code == GXF_SUCCESS) { + return Success; + } else { + return Unexpected{code}; + } +} + +// If the result code is GXF_SUCCESS the function returns the given value, otherwise it returns an +// unexpected with the given error code. +template +Expected>> +ExpectedOrCode(gxf_result_t code, T&& value) { + if (code == GXF_SUCCESS) { + return std::forward(value); + } else { + return Unexpected{code}; + } +} + +template +Expected>> +ExpectedOrError(const Expected& code, T&& value) { + if (code) { + return std::forward(value); + } else { + return ForwardError(code); + } +} + +inline +gxf_result_t AccumulateError(gxf_result_t previous, gxf_result_t current) { + return current != GXF_SUCCESS ? current : previous; +} + +inline +Expected AccumulateError(Expected previous, Expected current) { + return !current ? current : previous; +} + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/gxf.h b/isaac_ros_nvengine/gxf/include/gxf/core/gxf.h new file mode 100644 index 00000000..c0ea57b9 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/gxf.h @@ -0,0 +1,820 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_GXF_H_ +#define NVIDIA_GXF_CORE_GXF_H_ + +#ifdef __cplusplus +#include +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// -- Result type -------------------------------------------------------------------------------- + +/// @brief GXF error and result codes which are used by allmost all GXF functions. +typedef enum { + GXF_SUCCESS = 0, + GXF_FAILURE = 1, + + GXF_NOT_IMPLEMENTED, + GXF_FILE_NOT_FOUND, + GXF_INVALID_ENUM, + GXF_NULL_POINTER, + GXF_UNINITIALIZED_VALUE, + + GXF_ARGUMENT_NULL, + GXF_ARGUMENT_OUT_OF_RANGE, + GXF_ARGUMENT_INVALID, + + GXF_OUT_OF_MEMORY, + GXF_MEMORY_INVALID_STORAGE_MODE, + + GXF_CONTEXT_INVALID, + + GXF_EXTENSION_NOT_FOUND, + GXF_EXTENSION_FILE_NOT_FOUND, + GXF_EXTENSION_NO_FACTORY, + + GXF_FACTORY_TOO_MANY_COMPONENTS, + GXF_FACTORY_DUPLICATE_TID, + GXF_FACTORY_UNKNOWN_TID, + GXF_FACTORY_ABSTRACT_CLASS, + GXF_FACTORY_UNKNOWN_CLASS_NAME, + GXF_FACTORY_INVALID_INFO, + GXF_FACTORY_INCOMPATIBLE, + + GXF_ENTITY_NOT_FOUND, + GXF_ENTITY_COMPONENT_NOT_FOUND, + GXF_ENTITY_CAN_NOT_ADD_COMPONENT_AFTER_INITIALIZATION, + + GXF_PARAMETER_NOT_FOUND, + GXF_PARAMETER_ALREADY_REGISTERED, + GXF_PARAMETER_INVALID_TYPE, + GXF_PARAMETER_OUT_OF_RANGE, + GXF_PARAMETER_NOT_INITIALIZED, + GXF_PARAMETER_CAN_NOT_MODIFY_CONSTANT, + GXF_PARAMETER_PARSER_ERROR, + GXF_PARAMETER_NOT_NUMERIC, + GXF_PARAMETER_MANDATORY_NOT_SET, + + GXF_CONTRACT_INVALID_SEQUENCE, + GXF_CONTRACT_PARAMETER_NOT_SET, + GXF_CONTRACT_MESSAGE_NOT_AVAILABLE, + + GXF_INVALID_LIFECYCLE_STAGE, + GXF_INVALID_EXECUTION_SEQUENCE, + GXF_REF_COUNT_NEGATIVE, + GXF_RESULT_ARRAY_TOO_SMALL, + + GXF_INVALID_DATA_FORMAT, + + GXF_EXCEEDING_PREALLOCATED_SIZE, + + GXF_QUERY_NOT_ENOUGH_CAPACITY, + GXF_QUERY_NOT_APPLICABLE, + GXF_QUERY_NOT_FOUND, +} gxf_result_t; + +/// @brief Gets a string describing an GXF error code. +/// +/// The caller does not get ownership of the return C string and must not delete it. +/// +/// @param result A GXF error code +/// @return A pointer to a C string with the error code description. +const char* GxfResultStr(gxf_result_t result); + +// -- Unique identifiers ------------------------------------------------------------------------- + +/// @brief Type of unique GXF object identifiers (UID/uid) +/// +/// Uids are used to reference entities and components throughout the GXF API. +typedef int64_t gxf_uid_t; + +/// @brief A GXF UID which can be used to indicate an invalid or unused GXF UID. +#define kNullUid 0L +/// @brief A GXF UID which can be used to indicate an unspecified component during +/// graph load operation. This component should be updated in a subsequent +/// graph/parameters file. Failing to do so will result in an error during graph activation +#define kUnspecifiedUid -1L + +/// @brief Type of unique GXF type identifier (TID/tid) +/// +/// Tids are used to uniquely identify the type of a component, instead of for example using +/// a string with the type name. +typedef struct { + uint64_t hash1; + uint64_t hash2; +} gxf_tid_t; + +/// @brief Gives the null value of a GXF tid +/// +/// The null tid is used to mark a tid as invalid or to indicate that a tid is not set. +/// +/// @return The null tid +inline gxf_tid_t GxfTidNull() { + gxf_tid_t result; + result.hash1 = 0UL; + result.hash2 = 0UL; + return result; +} + +/// @brief Determines if a GXF tid is null +/// +/// @param tid A GXF tid +/// @return Returns 1 if 'tid' is the null tid; and 0 otherwise. +inline uint32_t GxfTidIsNull(gxf_tid_t tid) { + return (tid.hash1 == 0UL && tid.hash2 == 0UL) ? 1 : 0; +} + +// -- Context ------------------------------------------------------------------------------------ + +/// @brief Type for context handle +typedef void* gxf_context_t; + +/// @brief An invalid context +#define kNullContext nullptr + +/// @brief GXF Core Version +#define kGxfCoreVersion "2.3.1" + +/// @brief Creates a new GXF context +/// +/// A GXF context is required for all almost all GXF operations. The context must be destroyed with +/// 'GxfContextDestroy'. Multiple contexts can be created in the same process, however they can not +/// communicate with each other. +/// +/// @param context The new GXF context is written to the given pointer. +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfContextCreate(gxf_context_t* context); + +/// @brief Destroys a GXF context +/// +/// Every GXF context must be destroyed by calling this function. The context must have been +/// previously created with 'GxfContextCreate'. This will also destroy all entities and components +/// which were created as part of the context. +/// +/// @param context A valid GXF context. +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfContextDestroy(gxf_context_t context); + +// -- Extensions --------------------------------------------------------------------------------- + +/// @brief Maximum number of extensions in a context +#define kMaxExtensions 1024 + +/// @deprecated Use 'GxfLoadExtensions' instead +gxf_result_t GxfLoadExtension(gxf_context_t context, const char* filename); + +/// @deprecated Use 'GxfLoadExtensions' instead +gxf_result_t GxfLoadExtensionManifest(gxf_context_t context, const char* manifest_filename); + +/// @brief Registers a component with a GXF extension +/// +/// A GXF extension need to register all of its components in the extension factory function. For +/// convenience the helper macros in gxf/std/extension_factory_helper.hpp can be used. +/// +/// The developer must choose a unique GXF tid with two random 64-bit integers. The developer +/// must ensure that every GXF component has a unique tid. The name of the component must be +/// the fully qualified C++ type name of the component. A component may only have a single base +/// class and that base class must be specified with its fully qualified C++ type name as the +/// parameter 'base_name'. +/// +/// @see gxf/std/extension_factory_helper.hpp +/// @see core/type_name.hpp +/// +/// @param context A valid GXF context +/// @param tid The chosen GXF tid +/// @param name The type name of the component +/// @param base_name The type name of the base class of the component +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfRegisterComponent(gxf_context_t context, gxf_tid_t tid, const char* name, + const char* base_name); + +// -- Entities ----------------------------------------------------------------------------------- + +/// @brief Maximum number of entities in a context +#define kMaxEntities 1024 + +typedef enum { + GXF_ENTITY_STATUS_NOT_STARTED = 0, + GXF_ENTITY_STATUS_START_PENDING = 1, + GXF_ENTITY_STATUS_STARTED = 2, + GXF_ENTITY_STATUS_TICK_PENDING = 3, + GXF_ENTITY_STATUS_STOP_PENDING = 4, +} gxf_entity_status_t; + +/// @deprecated Use 'GxfCreateEntity' instead +gxf_result_t GxfEntityCreate(gxf_context_t context, gxf_uid_t* eid); + +/// @brief Activates a previously created and inactive entity +/// +/// Activating an entity generally marks the official start of its lifetime and has multiple +/// implications: +/// - If mandatory parameters, i.e. parameter which do not hav the flag "optional", are not set +/// the operation will fail. +/// - All components on the entity are initialized. +/// - All codelets on the entity are scheduled for execution. The scheduler will start calling +/// start, tick and stop functions as specified by scheduling terms. +/// - After activation trying to change a dynamic parameters will result in a failure. +/// - Adding or removing components of an entity after activation will result in a failure. +/// +/// @param context A valid GXF context +/// @param eid UID of a valid entity +/// @return GXF error code +gxf_result_t GxfEntityActivate(gxf_context_t context, gxf_uid_t eid); + +/// @brief Deactivates a previously activated entity +/// +/// Deactivating an entity generally marks the official end of its lifetime and has multiple +/// implications: +/// - All codelets are removed from the schedule. Already running entities are run to completion. +/// - All components on the entity are deinitialized. +/// - Components can be added or removed again once the entity was deactivated. +/// - Mandatory and non-dynamic parameters can be changed again. +/// +/// Note: In case that the entity is currently executing this function will wait and block until +/// the current execution is finished. +/// +/// @param context A valid GXF context +/// @param eid UID of a valid entity +/// @return GXF error code +gxf_result_t GxfEntityDeactivate(gxf_context_t context, gxf_uid_t eid); + +/// @brief Destroyes a previously created entity +/// +/// Destroys an entity immediately. The entity is destroyed even if the reference count has not +/// yet reached 0. If the entity is active it is deactivated first. +/// +/// Note: This function can block for the same reasons as 'GxfEntityDeactivate'. +/// +/// @param context A valid GXF context +/// @param eid The returned UID of the created entity +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfEntityDestroy(gxf_context_t context, gxf_uid_t eid); + +/// @brief Finds an entity by its name +/// +/// @param context A valid GXF context +/// @param name A C string with the name of the entity. Ownership is not transferred. +/// @param eid The returned UID of the entity +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfEntityFind(gxf_context_t context, const char* name, gxf_uid_t* eid); + +/// @brief Finds all entities in the current application +/// +/// Finds and returns all entity ids for the current application. If more than `max_entities` exist +/// only `max_entities` will be returned. The order and selection of entities returned is abritrary. +/// +/// @param context A valid GXF context +/// @param num_entities In/Out: the max number of entities that can fit in the buffer/the number of +/// entities that exist in the application +/// @param entities A buffer allocated by the caller for returned UIDs of all entities, with +/// capacity for `num_entities`. +/// @return GXF_SUCCESS if the operation was successful, GXF_QUERY_NOT_ENOUGH_CAPACITY if more +/// entites exist in the application than `max_entities`, or otherwise one of the GXF error codes. +gxf_result_t GxfEntityFindAll(gxf_context_t context, uint64_t* num_entities, gxf_uid_t* entities); + +/// @brief Increases the reference count for an entity by 1. +/// +/// By default reference counting is disabled for an entity. This means that entities created with +/// 'GxfEntityCreate' are not automatically destroyed. If this function is called for an entity +/// with disabled reference count, reference counting is enabled and the reference count is set to +/// 1. Once reference counting is enabled an entity will be automatically destroyed if the reference +/// count reaches zero, or if 'GxfEntityCreate' is called explicitely. +/// +/// @param context A valid GXF context +/// @param eid The UID of a valid entity +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfEntityRefCountInc(gxf_context_t context, gxf_uid_t eid); + +/// @brief Decreases the reference count for an entity by 1. +/// +/// See 'GxfEntityRefCountInc' for more details on reference counting. +/// +/// @param context A valid GXF context +/// @param eid The UID of a valid entity +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfEntityRefCountDec(gxf_context_t context, gxf_uid_t eid); + +/// @brief Gets the status of the entity. +/// +/// See 'gxf_entity_status_t' for the various status. +/// +/// @param context A valid GXF context +/// @param eid The UID of a valid entity +/// @param entity_status output; status of an entity eid +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfEntityGetStatus(gxf_context_t context, gxf_uid_t eid, + gxf_entity_status_t* entity_status); + +/// @brief Notifies the occurrence of an event and inform the scheduler to check the status of the +/// entity +/// +/// The entity must have an 'AsynchronousSchedulingTerm' scheduling term component and it must be in +/// "EVENT_WAITING" state for the notification to be acknowledged. +/// +/// See 'AsynchronousEventState' for various states +/// +/// @param context A valid GXF context +/// @param eid The UID of a valid entity +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. + +gxf_result_t GxfEntityEventNotify(gxf_context_t context, gxf_uid_t eid); + +// -- Components --------------------------------------------------------------------------------- + +/// @brief Maximum number of components in an entity or extension +#define kMaxComponents 1024 + +/// @brief Gets the GXF unique type ID (TID) of a component +/// +/// Get the unique type ID which was used to register the component with GXF. The function expects +/// the fully qualified C++ type name of the component including namespaces. +/// +/// Example of a valid component type name: "nvidia::gxf::test::PingTx" +/// +/// @param context A valid GXF context +/// @param name The fully qualified C++ type name of the component +/// @param tid The returned TID of the component +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentTypeId(gxf_context_t context, const char* name, gxf_tid_t* tid); + +/// @brief Gets the fully qualified C++ type name GXF component typename +/// +/// Get the unique typename of the component with which it was registered using one of +/// the GXF_EXT_FACTORY_ADD*() macros +/// +/// @param context A valid GXF context +/// @param tid The unique type ID (TID) of the component with which the component was registered +/// @param name The returned name of the component +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentTypeName(gxf_context_t context, gxf_tid_t tid, const char** name); + +/// @brief Gets the name of a component +/// +/// Each component has a user-defined name which was used in the call to 'GxfComponentAdd'. +/// Usually the name is specified in the GXF application file. +/// +/// @param context A valid GXF context +/// @param cid The unique object ID (UID) of the component +/// @param name The returned name of the component +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentName(gxf_context_t context, gxf_uid_t cid, const char** name); + +/// @brief Gets the unique object ID of the entity of a component +/// +/// Each component has a unique ID with respect to the context and is stored in one entity. This +/// function can be used to retreive the ID of the entity to which a given component belongs. +/// +/// @param context A valid GXF context +/// @param cid The unique object ID (UID) of the component +/// @param eid The returned UID of the entity +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentEntity(gxf_context_t context, gxf_uid_t cid, gxf_uid_t* eid); + +/// @brief Adds a new component to an entity +/// +/// An entity can contain multiple components and this function can be used to add a new component +/// to an entity. A component must be added before an entity is activated, or after it was +/// deactivated. Components must not be added to active entities. The order of components is stable +/// and identical to the order in which components are added (see 'GxfComponentFind'). +/// +/// @param context A valid GXF context +/// @param eid The unique object ID (UID) of the entity to which the component is added. +/// @param tid The unique type ID (TID) of the component to be added to the entity. +/// @param name The name of the new component. Ownership is not transferred. +/// @param cid The returned UID of the created component +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentAdd(gxf_context_t context, gxf_uid_t eid, gxf_tid_t tid, const char* name, + gxf_uid_t* cid); + +/// @brief Adds an existing component to the interface of an entity +/// +/// An entity can holds references to other components in its interface, so that when finding a +/// component in an entity, both the component this entity holds and those it refers to will be +/// returned. +/// This supports the case when an entity contains a subgraph, then those components that has been +/// declared in the subgraph interface will be put to the interface of the parent entity. +/// +/// @param context A valid GXF context +/// @param eid The unique object ID (UID) of the entity to which the component is added. +/// @param cid The unique object ID of the component +/// @param name The name of the new component. Ownership is not transferred. +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentAddToInterface(gxf_context_t context, gxf_uid_t eid, + gxf_uid_t cid, const char* name); + +/// @brief Finds a component in an entity +/// +/// Searches components in an entity which satisfy certain criteria: component type, component +/// name, and component min index. All three criteria are optional; in case no criteria is given +/// the first component is returned. The main use case for "component min index" is a repeated +/// search which continues at the index which was returned by a previous search. +/// +/// In case no entity with the given criteria was found GXF_ENTITY_NOT_FOUND is returned. +/// +/// @param context A valid GXF context +/// @param eid The unique object ID (UID) of the entity which is searched. +/// @param tid The component type ID (TID) of the component to find (optional) +/// @param name The component name of the component to find (optional). Ownership not transferred. +/// @param offset The index of the first component in the entity to search. Also contains the index +/// of the component which was found. +/// @param cid The returned UID of the searched component +/// @return GXF_SUCCESS if a component matching the criteria was found, GXF_ENTITY_NOT_FOUND if no +/// component matching the criteria was found, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentFind(gxf_context_t context, gxf_uid_t eid, gxf_tid_t tid, const char* name, + int32_t* offset, gxf_uid_t* cid); + +/// @brief Gets the component type ID (TID) of a component +/// +/// @param cid The component object ID (UID) for which the component type is requested. +/// @param tid The returned TID of the component +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentType(gxf_context_t context, gxf_uid_t cid, gxf_tid_t* tid); + +/// @brief Verifies that a component exists, has the given type, gets a pointer to it. +/// +/// @param tid The expected component type ID (TID) of the component +/// @param pointer The returned pointer to the component object. +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfComponentPointer(gxf_context_t context, gxf_uid_t uid, gxf_tid_t tid, + void** pointer); + +// -- Parameter ---------------------------------------------------------------------------------- + +/// @brief [experimental] The name of the parameter which stores the name of a component +#define kInternalNameParameterKey "__name" + +/// @brief Flags describing the behavior of parameter +/// +/// Parameter flags are specified when a parameter is registered as part of the component interface. +/// Multipl flags can be OR combined. +enum gxf_parameter_flags_t_ { + /// No additional flags are set (the default). This means the parameter is mandatory and static. + /// The parameter must be set before entity activation and can not be changed after entity + /// activation. + GXF_PARAMETER_FLAGS_NONE = 0, + /// The parameter value is optional and might not be available after entity activation. + /// This implies that it is not allowed to access the parameter with 'get()' in the C++ API. + /// Instead 'try_get' must be used. + GXF_PARAMETER_FLAGS_OPTIONAL = 1, + /// The parameter is dynamic an might change after entity activation. However it is still + /// guaranteed that parameters do not change during the initialize, deinitialize, start, tick, + /// or stop functions. + GXF_PARAMETER_FLAGS_DYNAMIC = 2 +}; + +/// @brief Type used for parameter flags. +/// +/// @see gxf_parameter_flags_t_ +typedef uint32_t gxf_parameter_flags_t; + +// Sets a 64-bit floating point parameter +gxf_result_t GxfParameterSetFloat64(gxf_context_t context, gxf_uid_t uid, const char* key, + double value); +// Sets a 64-bit signed integer parameter +gxf_result_t GxfParameterSetInt64(gxf_context_t context, gxf_uid_t uid, const char* key, + int64_t value); +// Sets a 64-bit unsigned integer parameter +gxf_result_t GxfParameterSetUInt64(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t value); +// Sets a 32-bit unsigned integer parameter +gxf_result_t GxfParameterSetUInt32(gxf_context_t context, gxf_uid_t uid, const char* key, + uint32_t value); +// Sets a 16-bit unsigned integer parameter +gxf_result_t GxfParameterSetUInt16(gxf_context_t context, gxf_uid_t uid, const char* key, + uint16_t value); +// Sets a string parameter +gxf_result_t GxfParameterSetStr(gxf_context_t context, gxf_uid_t uid, const char* key, + const char* value); +// Sets a handle parameter +gxf_result_t GxfParameterSetHandle(gxf_context_t context, gxf_uid_t uid, const char* key, + gxf_uid_t cid); +// Sets a boolean parameter +gxf_result_t GxfParameterSetBool(gxf_context_t context, gxf_uid_t uid, const char* key, + bool value); +// Sets a 32-bit signed integer parameter +gxf_result_t GxfParameterSetInt32(gxf_context_t context, gxf_uid_t uid, const char* key, + int32_t value); +// Sets a String 1D-Vector parameter. Internally the data is stored in +// a std::vector. The length of the vector should match the length of the registered parameter. +gxf_result_t GxfParameterSet1DStrVector(gxf_context_t context, gxf_uid_t uid, const char* key, + const char* value[], uint64_t length); +// Sets a Float 64 1D-Vector parameter. Internally the data is stored in +// a std::vector. The length of the vector should match the length of the registered parameter. +gxf_result_t GxfParameterSet1DFloat64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + double* value, uint64_t length); +// Sets a Float 64 2D-Vector parameter. Internally the data is stored in a +// std::vector. The height should match the length of the outer std::vector +// and the width should match the length of all the inner std::vectors. Also, these height and +// width should match the shape of the registered parameters. +gxf_result_t GxfParameterSet2DFloat64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + double** value, uint64_t height, uint64_t width); +// Sets a signed 64-bit int 1D-Vector parameter. Internally the data is stored in +// a std::vector. The length of the vector should match the length of the registered parameter. +gxf_result_t GxfParameterSet1DInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int64_t* value, uint64_t length); +// Sets a signed 64-bit int 2D-Vector parameter. Internally the data is stored in a +// std::vector. The height should match the length of the outer std::vector +// and the width should match the length of all the inner std::vectors. Also, these height and +// width should match the shape of the registered parameters. +gxf_result_t GxfParameterSet2DInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int64_t** value, uint64_t height, uint64_t width); +// Sets a unsigned 64-bit unsigned int 1D-Vector parameter. Internally the data is stored in +// a std::vector. The length of the vector should match the length of the registered parameter. +gxf_result_t GxfParameterSet1DUInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* value, uint64_t length); +// Sets a unsigned 64-bit unsigned int 2D-Vector parameter. Internally the data is stored in a +// std::vector. The height should match the length of the outer std::vector +// and the width should match the length of all the inner std::vectors. Also, these height and +// width should match the shape of the registered parameters. +gxf_result_t GxfParameterSet2DUInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t** value, uint64_t height, uint64_t width); +// Sets a signed 32-bit int 1-D Vector parameter. Internally the data is stored in +// a std::vector. The length of the vector should match the length of the registered parameter. +gxf_result_t GxfParameterSet1DInt32Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int32_t* value, uint64_t length); +// Sets a signed 32-bit int 2-D Vector parameter. Internally the data is stored in a +// std::vector. The height should match the length of the outer std::vector +// and the width should match the length of all the inner std::vectors. Also, these height and +// width should match the shape of the registered parameters. +gxf_result_t GxfParameterSet2DInt32Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int32_t** value, uint64_t height, uint64_t width); + +// Gets a 64-bit floating point parameter +gxf_result_t GxfParameterGetFloat64(gxf_context_t context, gxf_uid_t uid, const char* key, + double* value); +// Gets a 64-bit signed integer parameter +gxf_result_t GxfParameterGetInt64(gxf_context_t context, gxf_uid_t uid, const char* key, + int64_t* value); +// Gets a 64-bit unsigned integer parameter +gxf_result_t GxfParameterGetUInt64(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* value); +// Gets a 32-bit unsigned integer parameter +gxf_result_t GxfParameterGetUInt32(gxf_context_t context, gxf_uid_t uid, const char* key, + uint32_t* value); +// Gets a 16-bit unsigned integer parameter +gxf_result_t GxfParameterGetUInt16(gxf_context_t context, gxf_uid_t uid, const char* key, + uint16_t* value); +// Gets a string parameter +gxf_result_t GxfParameterGetStr(gxf_context_t context, gxf_uid_t uid, const char* key, + const char** value); +// Gets a file path parameter +gxf_result_t GxfParameterGetPath(gxf_context_t context, gxf_uid_t uid, const char* key, + const char** value); +// Gets a handle parameter +gxf_result_t GxfParameterGetHandle(gxf_context_t context, gxf_uid_t uid, const char* key, + gxf_uid_t* cid); +// Gets a bool parameter +gxf_result_t GxfParameterGetBool(gxf_context_t context, gxf_uid_t uid, const char* key, + bool* value); +// Gets a 32-bit signed integer parameter +gxf_result_t GxfParameterGetInt32(gxf_context_t context, gxf_uid_t uid, const char* key, + int32_t* value); +// Gets the length of the 1D vector. +// For 1D: rank = 1; shape = [length, ...] +gxf_result_t GxfParameterGet1DFloat64VectorInfo(gxf_context_t context, gxf_uid_t uid, + const char* key, uint64_t* length); +// Gets the height/width of the 2D vector. +// For 2D: rank = 2; shape = [height, width, ...] +gxf_result_t GxfParameterGet2DFloat64VectorInfo(gxf_context_t context, gxf_uid_t uid, + const char* key, uint64_t* height, uint64_t* width); +// Gets the length of the 1D vector. +// For 1D: rank = 1; shape = [length, ...] +gxf_result_t GxfParameterGet1DInt64VectorInfo(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* length); +// Gets the height/width of the 2D vector. +// For 2D: rank = 2; shape = [height, width, ...] +gxf_result_t GxfParameterGet2DInt64VectorInfo(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* height, uint64_t* width); +// Gets the length of the 1D vector. +// For 1D: rank = 1; shape = [length, ...] +gxf_result_t GxfParameterGet1DUInt64VectorInfo(gxf_context_t context, gxf_uid_t uid, + const char* key, uint64_t* length); +// Gets the height/width of the 2D vector. +// For 2D: rank = 2; shape = [height, width, ...] +gxf_result_t GxfParameterGet2DUInt64VectorInfo(gxf_context_t context, gxf_uid_t uid, + const char* key, uint64_t* height, uint64_t* width); +// Gets the length of the 1D vector. +// For 1D: rank = 1; shape = [length, ...] +gxf_result_t GxfParameterGet1DInt32VectorInfo(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* length); +// Gets the height/width of the 2D vector. +// For 2D: rank = 2; shape = [height, width, ...] +gxf_result_t GxfParameterGet2DInt32VectorInfo(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* height, uint64_t* width); +// Gets a 1D-Vector of 64-bit floating point. +// For 1D: rank = 1; shape = [length, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The length can be queried using GxfGetParameterInfo() +gxf_result_t GxfParameterGet1DFloat64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + double* value, uint64_t* length); +// Gets a 1D-Vector of strings. +// The length can be queried using GxfGetParameterInfo() +gxf_result_t GxfParameterGet1DStrVector(gxf_context_t context, gxf_uid_t uid, const char* key, + char* value[], uint64_t* count, uint64_t* min_length); +// Gets a 2D-Vector of 64-bit floating point. +// For 2D: rank = 2; shape = [height, width, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The height and width can be obtained using GxfGetParameterInfo() +gxf_result_t GxfParameterGet2DFloat64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + double** value, uint64_t* height, uint64_t* width); +// Gets a 1D-Vector of signed 64-bit integers. +// For 1D: rank = 1; shape = [length, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The length can be queried using GxfGetParameterInfo() +gxf_result_t GxfParameterGet1DInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int64_t* value, uint64_t* length); +// Gets a 2D-Vector of signed 64-bit integers. +// For 2D: rank = 2; shape = [height, width, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The height and width can be obtained using GxfGetParameterInfo() +gxf_result_t GxfParameterGet2DInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int64_t** value, uint64_t* height, uint64_t* width); +// Gets a 1D-Vector of unsigned 32-bit integers. +// For 1D: rank = 1; shape = [length, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The length can be queried using GxfGetParameterInfo() +gxf_result_t GxfParameterGet1DUInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t* value, uint64_t* length); +// Gets a 2D-Vector of unsigned 32-bit integers. +// For 2D: rank = 2; shape = [height, width, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The height and width can be obtained using GxfGetParameterInfo() +gxf_result_t GxfParameterGet2DUInt64Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + uint64_t** value, uint64_t* height, uint64_t* width); +// Gets a 1D-Vector of signed 32-bit integers. +// For 1D: rank = 1; shape = [length, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The length can be queried using GxfGetParameterInfo() +gxf_result_t GxfParameterGet1DInt32Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int32_t* value, uint64_t* length); +// Gets a 2D-Vector of signed 32-bit integers. +// For 2D: rank = 2; shape = [height, width, ...] +// The rank and shape should match with the internal registered std::vector parameter. +// The height and width can be obtained using GxfGetParameterInfo() +gxf_result_t GxfParameterGet2DInt32Vector(gxf_context_t context, gxf_uid_t uid, const char* key, + int32_t** value, uint64_t* height, uint64_t* width); +// -- Graph execution ---------------------------------------------------------------------------- + +// Loads a list of entities from a YAML file. +gxf_result_t GxfGraphLoadFile(gxf_context_t context, const char* filename); + +// Loads a list of entities from a YAML file. +gxf_result_t GxfGraphParseString(gxf_context_t context, const char* text); + +// Activate all System components +gxf_result_t GxfGraphActivate(gxf_context_t context); + +// Deactivate all System components +gxf_result_t GxfGraphDeactivate(gxf_context_t context); + +// Starts the execution of the graph asynchronously +gxf_result_t GxfGraphRunAsync(gxf_context_t context); + +// Interrupt the execution of the graph +gxf_result_t GxfGraphInterrupt(gxf_context_t context); + +// Waits for the graph to complete execution +gxf_result_t GxfGraphWait(gxf_context_t context); + +// Runs all System components and waits for their completion +gxf_result_t GxfGraphRun(gxf_context_t context); + +// -- Info queries ------------------------------------------------------------------------------- + +// Type to represent version of GXF Runtime and list of loaded Extensions +typedef struct { + const char* version; // GXF Runtime Version + uint64_t num_extensions; // in-out capacity of extensions/Number of extension types + gxf_tid_t* extensions; // List of Extension IDs +} gxf_runtime_info; + +// Gets Meta Data about the GXF Runtime +gxf_result_t GxfRuntimeInfo(gxf_context_t context, gxf_runtime_info* info); + +// Type to represent description and list of components for loaded Extension +typedef struct { + gxf_tid_t id; // (UUID) Extension ID (registered via GXF_EXT_FACTORY_SET_INFO) + const char* name; // (String) Extension Name (registered via GXF_EXT_FACTORY_SET_INFO) + const char* description; // (String) Description (registered via GXF_EXT_FACTORY_SET_INFO) + const char* version; // (String) Extension Version (registered via GXF_EXT_FACTORY_SET_INFO) + const char* runtime_version; + // (String) GXF Core version with which the extension was compiled with + const char* license; // (String) Extension License (registered via GXF_EXT_FACTORY_SET_INFO) + const char* author; // (String) Extension Author (registered via GXF_EXT_FACTORY_SET_INFO) + uint64_t num_components; // in-out capacity of components/Number of components + gxf_tid_t* components; // List of IDs of provided components +} gxf_extension_info_t; + +// Gets description and list of components in loaded Extension +gxf_result_t GxfExtensionInfo(gxf_context_t context, gxf_tid_t tid, gxf_extension_info_t* info); + +// Type to represent description and list of Parameter of Component +typedef struct { + gxf_tid_t cid; // (UUID) Component ID (registered via GXF_EXT_FACTORY_ADD) + const char* base_name; // (String) Base Class Name (registered via GXF_EXT_FACTORY_ADD) + int is_abstract; // (Bool) If the Component is abstract (Can not be instantiated) + const char* type_name; // (String) Component Name (registered via GXF_EXT_FACTORY_ADD) + const char* description; // (String) Description (registered via GXF_EXT_FACTORY_ADD) + uint64_t num_parameters; // in-out capacity of parameters/Number of Parameters + const char** parameters; // List of Names for Parameters +} gxf_component_info_t; + +// Gets description and list of parameters of Component. Parameters are only available after +// at least one instance is created for the Component. +gxf_result_t GxfComponentInfo(gxf_context_t context, gxf_tid_t tid, gxf_component_info_t* info); + +/// @brief The type of a parameter +typedef enum { + GXF_PARAMETER_TYPE_CUSTOM = 0, // A custom type not natively supported by GXF. + GXF_PARAMETER_TYPE_HANDLE = 1, // A GXF handle. The handle type is specified separately. + GXF_PARAMETER_TYPE_STRING = 2, // A null-terminated charcter string (const char*) + GXF_PARAMETER_TYPE_INT64 = 3, // A 64-bit signed integer (int64_t) + GXF_PARAMETER_TYPE_UINT64 = 4, // A 64-bit unsigned integer (uint64_t) + GXF_PARAMETER_TYPE_FLOAT64 = 5, // A 64-bit floating point (double) + GXF_PARAMETER_TYPE_BOOL = 6, // A boolean type (bool) + GXF_PARAMETER_TYPE_INT32 = 7, // A 32-bit signed integer (int32_t) + GXF_PARAMETER_TYPE_FILE = 8, // A 32-bit signed integer (int32_t) +} gxf_parameter_type_t; + +// Holds metadata information about a parameter which was registered as part of the component +// interface. +typedef struct { + const char* key; // The name of the parameter as it appears in the GXF file. + const char* headline; // A short headline used to display the parameter to a human. + const char* description; // A longer text describing the usage of the parameter. + gxf_parameter_flags_t flags; // Parameter flags for example to make a parameter optional. + gxf_parameter_type_t type; // The type of the parameter + gxf_tid_t handle_tid; // In case the parameter is a handle the TID of the component. + const void* default_value; // Default value of parameter, N/A for handle and custom params + const void* numeric_min; // Min value of range for numeric parameters, N/A for other types + const void* numeric_max; // Max value of range for numeric parameters, N/A for other types + const void* numeric_step; // Step value of range for numeric parameters, N/A for other types + const char* platform_information; + // (String) Platforms separated by comma. Empty means all platforms + int32_t rank; // Rank of the parameter. 0-scalar, 1-list etc. Max rank is 8 + int32_t shape[8]; // Sizes of multi dimensional parameters if it is of fixed + // length(array). Shape of a dimension is -1 for scalar and + // variable length arrays(vector) +} gxf_parameter_info_t; + +// Gives a string describing the parameter type +const char* GxfParameterTypeStr(gxf_parameter_type_t param_type); + +// Gives a string describing the flag type +const char* GxfParameterFlagTypeStr(gxf_parameter_flags_t_ flag_type); + +// Gets description of specific parameter. Fail if the component is not instantiated yet. +gxf_result_t GxfParameterInfo(gxf_context_t context, gxf_tid_t cid, const char* key, + gxf_parameter_info_t* info); + +gxf_result_t GxfGetParameterInfo(gxf_context_t context, gxf_tid_t cid, const char* key, + gxf_parameter_info_t* info); + +gxf_result_t GxfRedirectLog(gxf_context_t context, FILE* fp); + +// ------------------------------------------------------------------------------------------------- + +#ifdef __cplusplus +} // extern "C" +#endif + +#ifdef __cplusplus + +inline bool operator==(const gxf_tid_t& lhs, const gxf_tid_t& rhs) noexcept { + return lhs.hash1 == rhs.hash1 && lhs.hash2 == rhs.hash2; +} + +inline bool operator!=(const gxf_tid_t& lhs, const gxf_tid_t& rhs) noexcept { + return lhs.hash1 != rhs.hash1 || lhs.hash2 != rhs.hash2; +} + +inline bool operator<(const gxf_tid_t& lhs, const gxf_tid_t& rhs) noexcept { + return lhs.hash1 < rhs.hash1 || (lhs.hash1 == rhs.hash1 && lhs.hash2 < rhs.hash2); +} + +#endif + +#endif // NVIDIA_GXF_CORE_GXF_H_ + +// Include the extended API functions. +#include "gxf_ext.h" diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/gxf_ext.h b/isaac_ros_nvengine/gxf/include/gxf/core/gxf_ext.h new file mode 100644 index 00000000..822757e7 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/gxf_ext.h @@ -0,0 +1,169 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_GXF_EXT_H_ +#define NVIDIA_GXF_CORE_GXF_EXT_H_ + +#ifdef __cplusplus +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// ------------------------------------------------------------------------------------------------- + +/// @brief GXF bitmasks +typedef uint32_t GxfFlags; + +// ------------------------------------------------------------------------------------------------- + +/// @brief Structure specifing parameters for loading extensions +typedef struct { + // Optional list of extension filenames to load + const char* const* extension_filenames; + // The number of extensions to load + uint32_t extension_filenames_count; + // Optional list of manifest filenames to load + const char* const* manifest_filenames; + // The number of manifests to load + uint32_t manifest_filenames_count; + // An optional base directory which is prepended to all extensions filenames, including those + // loaded via manifests. + const char* base_directory; +} GxfLoadExtensionsInfo; + +/// @brief Loads GXF extension libraries +/// +/// Loads one or more extensions either directly by their filename or indirectly by loading +/// manifest files. Before a component can be added to a GXF entity the GXF extension shared +/// library providing the component must be loaded. An extensions must only be loaded once. +/// +/// To simplify loading multiple extensions at once the developer can create a manifest file which +/// lists all extensions he needs. This function will then load all extensions listed in the +/// manifest file. Multiple manifest may be loaded, however each extensions may still be loaded +/// only a single time. +/// +/// A manifest file is a YAML file with a single top-level entry 'extensions' followed by a +/// list of filenames of GXF extension shared libraries. +/// +/// Example: +/// ----- START OF FILE ----- +/// extensions: +/// - gxf/std/libgxf_std.so +/// - gxf/npp/libgxf_npp.so +/// ----- END OF FILE ----- +/// +/// @param context is the GXF context in which to load extensions +/// @param info is a pointer to a GxfLoadExtensionsInfo structure describing parameters for loading +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfLoadExtensions(gxf_context_t context, const GxfLoadExtensionsInfo* info); + +/// @brief Loads a metadata file generated by the nvgraph_registry +/// +/// The nvgraph_registry tool generates a metadata file of the contents of an extension during +/// registration. These metadata files can be used to resolve typename and TID's of components for +/// other extensions which depend on them. metadata files do not contain the actual implementation +/// of the extension and must be loaded only to run the extension query API's on extension +/// libraries which have the actual implementation and only depend on the metadata for type +/// resolution. +/// +/// If some components of extension B depend on some components in extension A: +/// - Load metadata file for extension A +/// - Load extension library for extension B using 'GxfLoadExtensions' +/// - Run extension query api's on extension B and it's components. +/// +/// @param context A valid GXF context +/// @param filenames absolute paths of metadata files generated by the registry during +/// extension registration +/// @param count The number of metadata files to be loaded +/// @return GXF_SUCCESS if the operation was successful, or otherwise one of the GXF error codes. +gxf_result_t GxfLoadExtensionMetadataFiles(gxf_context_t context, const char* const* filenames, + uint32_t count); + +// ------------------------------------------------------------------------------------------------- + +/// @brief Bitmask specifying storage mode for an entity +typedef enum GxfEntityCreateFlagBits { + // 'GXF_ENTITY_CREATE_PROGRAM_BIT' specifies that the entity will be added to the program + // entities. Program entities are kept alive for the duration of the program. They are activated + // automatically when the program is activated and deactivated when the program is deactivated. + // If the program was already actived when the entity is created the entity must still be + // activated manually. + GXF_ENTITY_CREATE_PROGRAM_BIT = 0x00000001 +} GxfEntityCreateFlagBits; + +/// @brief Bitmask of GxfEntityCreateFlagBits +typedef GxfFlags GxfEntityCreateFlags; + +/// @brief Structure specifing parameters for creating entities +typedef struct { + // 'entity_name' is the name of the entity which is created. If this is a nullptr an undefined + // unique name is chosen. The name must not start with a double underscore. + const char* entity_name; + // 'flags' is a bitmask of GxfEntityCreateFlagsBits indicating storage method and usage behavior + // for the created entity. + GxfEntityCreateFlags flags; +} GxfEntityCreateInfo; + +/// @brief Create a new GXF entity +/// +/// Entities are light-weight containers to hold components and form the basic building blocks +/// of a GXF application. Entities are created when a GXF file is loaded, or they can be created +/// manually using this function. Entities created with this function must be destroyed using +/// 'GxfEntityDestroy'. After the entity was created components can be added to it with +/// 'GxfComponentAdd'. To start execution of codelets on an entity the entity needs to be +/// activated first. This can happen automatically using 'GXF_ENTITY_CREATE_PROGRAM_BIT' or +/// manually using 'GxfEntityActivate'. +/// +/// @param context is the GXF context that creates the entity. +/// @param info is a pointer to a GxfEntityCreateInfo structure containing parameters affecting +/// the creation of the entity. +/// @param eid is a pointer to a gxf_uid_t handle in which the resulting entity is returned. +/// @return On success the function returns GXF_SUCCESS. +gxf_result_t GxfCreateEntity(gxf_context_t context, const GxfEntityCreateInfo* info, + gxf_uid_t* eid); + +// ------------------------------------------------------------------------------------------------- + +/// @brief Severity levels for GXF_LOG_* logging macros +typedef enum { + GXF_SEVERITY_NONE = 0, + GXF_SEVERITY_ERROR = 1, + GXF_SEVERITY_WARNING = 2, + GXF_SEVERITY_INFO = 3, + GXF_SEVERITY_DEBUG = 4, +} gxf_severity_t; + +/// @brief Sets the severity level of the logs (corresponding to GXF_LOG_* logging macros) for the +/// entire application +/// +/// @param context a valid GXF context +/// @param severity a valid severity level as defined in `gxf_severity_t`. Logs corresponding to +/// any level <= severity will be logged. +/// @return On success the function returns GXF_SUCCESS. +/// +gxf_result_t GxfSetSeverity(gxf_context_t context, gxf_severity_t severity); + +// ------------------------------------------------------------------------------------------------- + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // NVIDIA_GXF_CORE_GXF_EXT_H_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/handle.hpp b/isaac_ros_nvengine/gxf/include/gxf/core/handle.hpp new file mode 100644 index 00000000..874ed251 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/handle.hpp @@ -0,0 +1,190 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_HANDLE_HPP +#define NVIDIA_GXF_CORE_HANDLE_HPP + +#include "core/assert.hpp" +#include "core/type_name.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/gxf.h" + +namespace nvidia { +namespace gxf { + +// A handle which gives access to a component without specifying its type. +class UntypedHandle { + public: + UntypedHandle(const UntypedHandle& component) = default; + UntypedHandle(UntypedHandle&& component) = default; + UntypedHandle& operator=(const UntypedHandle& component) = default; + UntypedHandle& operator=(UntypedHandle&& component) = default; + + // Creates a null untyped handle + static UntypedHandle Null() { + return UntypedHandle{kNullContext, kNullUid}; + } + + // Creates a new untyped handle + static Expected Create(gxf_context_t context, gxf_uid_t cid) { + UntypedHandle untyped_handle{context, cid}; + gxf_tid_t tid; + gxf_result_t code = GxfComponentType(context, cid, &tid); + if (code != GXF_SUCCESS) { + return Unexpected{code}; + } + const auto result = untyped_handle.initialize(tid); + if (!result) { + return ForwardError(result); + } + return untyped_handle; + } + + // The context to which the component belongs + gxf_context_t context() const { return context_; } + // The ID of the component. + gxf_uid_t cid() const { return cid_; } + // The type ID describing the component type. + gxf_tid_t tid() const { return tid_; } + // Returns null if the handle is equivalent to a nullptr. + bool is_null() const { + return context_ == kNullContext || cid_ == kNullUid || pointer_ == nullptr; + } + // Same as 'is_null'. + explicit operator bool() const { return !is_null(); } + // The component name + const char* name() const { + const char* result; + const gxf_result_t code = GxfComponentName(context(), cid(), &result); + return (code == GXF_SUCCESS) ? result : ""; + } + + protected: + UntypedHandle(gxf_context_t context, gxf_uid_t cid) + : context_{context}, cid_{cid}, tid_{GxfTidNull()}, pointer_{nullptr} { } + + Expected initialize(gxf_tid_t tid) { + tid_ = tid; + return ExpectedOrCode(GxfComponentPointer(context_, cid_, tid_, &pointer_)); + } + + Expected initialize(const char* type_name) { + gxf_tid_t tid; + gxf_result_t code = GxfComponentTypeId(context_, type_name, &tid); + if (code != GXF_SUCCESS) { + return Unexpected{code}; + } + return initialize(tid); + } + + Expected verifyPointer() const { + if (pointer_ == nullptr) { return Unexpected{GXF_FAILURE}; } + void* raw_pointer; + if (GXF_SUCCESS != GxfComponentPointer(context(), cid(), tid_, &raw_pointer)) { + return Unexpected{GXF_FAILURE}; + } + if (raw_pointer != pointer_) { return Unexpected{GXF_FAILURE}; } + return Success; + } + + gxf_context_t context_; + gxf_uid_t cid_; + gxf_tid_t tid_; + void* pointer_; +}; + +// A handle which gives access to a component with a specific type. +template +class Handle : public UntypedHandle { + public: + // Creates a null handle + static Handle Null() { + return Handle{}; + } + + // An unspecified handle is a unique handle used to denote a component which + // will be created in the future. A parameter of Handle to a type does not consider + // "Unspecified" as a valid parameter value and hence this handle must only be used + // when defining a graph application across different files and the parameters are set + // in a delayed fashion (sub-graphs and parameter yaml files for example) + // Entity activation will fail if any of the mandatory parameters are "Unspecified" + static Handle Unspecified() { + return Handle(kNullContext, kUnspecifiedUid); + } + + // Creates a new handle + static Expected Create(gxf_context_t context, gxf_uid_t cid) { + Handle handle{context, cid}; + const auto result = handle.initialize(TypenameAsString()); + if (!result) { + return ForwardError(result); + } + return handle; + } + + // Creates a new handle from an untyped handle + static Expected Create(const UntypedHandle& untyped_handle) { + return Create(untyped_handle.context(), untyped_handle.cid()); + } + + friend bool operator==(const Handle& lhs, const Handle& rhs) { + return lhs.context() == rhs.context() && lhs.cid() == rhs.cid(); + } + + friend bool operator<(const Handle& lhs, const Handle& rhs) { + return lhs.cid() < rhs.cid(); + } + + Handle(gxf_context_t context = kNullContext, gxf_uid_t uid = kNullUid) + : UntypedHandle{context, uid} {} + + ~Handle() = default; + + Handle(const Handle& component) = default; + Handle(Handle&& component) = default; + Handle& operator=(const Handle& component) = default; + Handle& operator=(Handle&& component) = default; + + template + Handle(const Handle& derived) : UntypedHandle(derived) { + static_assert(std::is_base_of::value, + "Handle convertion is only allowed from derived class to base class"); + } + + // Allow conversion from handle to pointer + operator T*() const { return get(); } + + T* operator->() const { + return get(); + } + + T* get() const { + GXF_ASSERT(verifyPointer(), "Invalid Component Pointer."); + return reinterpret_cast(pointer_); + } + + Expected try_get() const { + if (!verifyPointer()) { return Unexpected{GXF_FAILURE}; } + return reinterpret_cast(pointer_); + } + + private: + using UntypedHandle::UntypedHandle; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/parameter.hpp b/isaac_ros_nvengine/gxf/include/gxf/core/parameter.hpp new file mode 100644 index 00000000..2e1fb3be --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/parameter.hpp @@ -0,0 +1,329 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_PARAMETER_HPP_ +#define NVIDIA_GXF_CORE_PARAMETER_HPP_ + +#include +#include +#include + +#include "core/assert.hpp" +#include "core/optional.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/gxf.h" +#include "gxf/core/handle.hpp" +#include "gxf/std/parameter_parser.hpp" + +namespace YAML { class Node; } + +namespace nvidia { +namespace gxf { + +// Base class for parameters stored in ParameterStorage +class ParameterBackendBase { + public: + virtual ~ParameterBackendBase() = default; + + // The context to which this parameter backend belongs + gxf_context_t context() const { return context_; } + + // The object to which this parameter is attached. + gxf_uid_t uid() const { return uid_; } + + // The name of the parameter + const char* key() const { return key_; } + + // Returns true if the parameter is guaranteed to always have a value set. Only mandatory + // parameters can be accessed direclty with 'get' instead of using 'try_get'. + bool isMandatory() const { return (flags_ & GXF_PARAMETER_FLAGS_OPTIONAL) == 0; } + + // Returns true if the parameter can not be changed after the component has been activated. + bool isConstant() const { return (flags_ & GXF_PARAMETER_FLAGS_DYNAMIC) == 0; } + + // Sets the latest value from the backend to the frontend. + virtual void writeToFrontend() = 0; + + // Parses the parameter from the given YAML object. + virtual Expected parse(const YAML::Node& node, const std::string& prefix) = 0; + + // Returns true if the parameter is set + virtual bool isAvailable() const = 0; + + // Returns true if it is possible to change this parameter + bool isImmutable() const { + if (isConstant()) { + const bool is_active = false; // FIXME(v1) Check that component is not active. + if (is_active) { + return true; + } + } + return false; + } + + // FIXME(v1) make private + gxf_context_t context_; + gxf_uid_t uid_; + gxf_parameter_flags_t flags_; + bool is_dynamic_; + const char* key_; + const char* headline_; + const char* description_; +}; + +template +class Parameter; + +// This class stores a parameter of a specific type in the backend. +template +class ParameterBackend : public ParameterBackendBase { + public: + void writeToFrontend() override; + Expected parse(const YAML::Node& node, const std::string& prefix) override; + bool isAvailable() const override { return value_ != std::nullopt; } + + // Sets the parameter to the given value. + Expected set(T value) { + // Make sure that the new value passes the validator + if (validator_&& !validator_(value)) { return Unexpected{GXF_PARAMETER_OUT_OF_RANGE}; } + // Don't allow modification of a parameter which is currently immutable + if (isImmutable()) { return Unexpected{GXF_PARAMETER_CAN_NOT_MODIFY_CONSTANT}; } + // Update the parameter value + value_ = std::move(value); + return Success; + } + + // Gets the current value of the parameter. + const std::optional& try_get() const { return value_; } + + // FIXME(v1) make private + nvidia::gxf::Parameter* frontend_ = nullptr; + std::function validator_; + std::optional value_; +}; + +// An intermediate base class for parameters which store a handle. +class HandleParameterBackend : public ParameterBackendBase { + public: + virtual ~HandleParameterBackend() = default; + + // Gets the component ID of the handle. + virtual Expected get() const = 0; + + // Sets the handle using just a component ID + virtual Expected set(gxf_uid_t cid) = 0; +}; + +// A specialization of ParameterBackend for handle types. It derives from the intermediate base +// class HandleParameterBackend so that parameter backends of handle types all have a common base +// class. +template +class ParameterBackend> : public HandleParameterBackend { + public: + void writeToFrontend() override; + Expected parse(const YAML::Node& node, const std::string& prefix) override; + bool isAvailable() const override { + if ((value_ == std::nullopt) || (value_ == Handle::Unspecified())) { return false; } + return true; + } + + // Sets the handle using just a component ID + Expected set(gxf_uid_t cid) override { + auto expected = Handle::Create(context(), cid); + if (expected) { + value_ = expected.value(); + return Success; + } else { + return ForwardError(expected); + } + } + + // Gets the component ID of the handle. + Expected get() const override { + if (!value_) {return gxf::Expected{gxf::Unexpected{GXF_FAILURE}}; } + return value_->cid(); + } + + // Sets the parameter to the given value. + Expected set(Handle value) { + if (isImmutable()) { return Unexpected{GXF_PARAMETER_CAN_NOT_MODIFY_CONSTANT}; } + value_ = std::move(value); + return Success; + } + + // Gets the current value of the parameter. + const std::optional>& try_get() const { return value_; } + + // FIXME(v1) make private + nvidia::gxf::Parameter>* frontend_ = nullptr; + std::optional> value_; +}; + + +// Common base class for specializations of Parameter. +class ParameterBase { + public: + virtual ~ParameterBase() = default; +}; + +// This type represents a parameter of a component and can be used in custom components. It +// communicates with the backend to set and get parameters as configured. +template +class Parameter : public ParameterBase { + public: + // Gets the current parameter value. Only valid if the parameter is marked as 'mandatory' in the + // paramater interface. Otherwise an assert will be raised. + const T& get() const { + GXF_ASSERT(backend_ != nullptr, "A parameter with type '%s' was not registered.", + TypenameAsString()); + GXF_ASSERT(backend_->isMandatory(), "Only mandatory parameters can be accessed with get(). " + "'%s' is not marked as mandatory", backend_->key()); + GXF_ASSERT(value_, "Mandatory parameter '%s' was not set.", backend_->key()); + return *value_; + } + + // Convenience function for accessing a mandatory parameter. + operator const T&() const { + return get(); + } + + // Tries to get the parameter value. If the parameter is not set std::nullopt is returned. + const std::optional& try_get() const { return value_; } + + // Sets the parameter to the given value. + Expected set(T value) { + GXF_ASSERT(backend_ != nullptr, "Parameter '%s' was not registered.", backend_->key()); + const auto result = backend_->set(value); + if (!result) { + return result; + } + value_ = std::move(value); + return Success; + } + + // Sets the parameter to the given value, but does not notify the backend about the change. + // This function shall only be used by the ParameterBackend class. + void setWithoutPropagate(const T& value) { + value_ = value; + } + + // Connects this parameter frontend to the corresponding backend. + void connect(ParameterBackend* backend) { + backend_ = backend; + } + + const char* key() { + return backend_ == nullptr ? nullptr : backend_->key(); + } + + private: + std::optional value_; + ParameterBackend* backend_ = nullptr; +}; + +// A specialization of Parameter for handle types. +template +class Parameter> : public ParameterBase { + public: + // Gets the current parameter value. Only valid if the parameter is marked as 'mandatory' in the + // paramater interface. Otherwise an assert will be raised. + const Handle& get() const { + GXF_ASSERT(backend_ != nullptr, "A handle parameter with type '%s' was not registered.", + TypenameAsString()); + GXF_ASSERT(backend_->isMandatory(), "Only mandatory parameters can be accessed with get(). " + "'%s' is not marked as mandatory", backend_->key()); + GXF_ASSERT(value_, "Mandatory parameter '%s' was not set.", backend_->key()); + return *value_; + } + + // Convenience function for accessing a mandatory parameter. + operator const Handle&() const { + return get(); + } + + // Tries to get the parameter value. If the parameter is not set std::nullopt is returned. + const std::optional>& try_get() const { return value_; } + + // Only if T = Handle + S* operator->() const { + return get().get(); + } + + // Sets the parameter to the given value. + Expected set(Handle value) { + GXF_ASSERT(backend_ != nullptr, "Parameter '%s' was not registered.", backend_->key()); + const auto result = backend_->set(value); + if (!result) { + return result; + } + value_ = std::move(value); + return Success; + } + + // Sets the parameter to the given value, but does not notify the backend about the change. + // This function shall only be used by the ParameterBackend class. + void setWithoutPropagate(const Handle& value) { + value_ = value; + } + + // Connects this parameter frontend to the corresponding backend. + void connect(ParameterBackend>* backend) { + backend_ = backend; + } + + const char* key() { + return backend_ == nullptr ? nullptr : backend_->key(); + } + + private: + std::optional> value_; + ParameterBackend>* backend_ = nullptr; +}; + +// ------------------------------------------------------------------------------------------------- + +template +void ParameterBackend::writeToFrontend() { + if (frontend_ && value_) { + frontend_->setWithoutPropagate(*value_); + } +} + +template +Expected ParameterBackend::parse(const YAML::Node& node, const std::string& prefix) { + return ParameterParser::Parse(context(), uid(), key(), node, prefix) + .map([this] (const T& value) { return set(value); }) + .and_then([this] { writeToFrontend(); }); +} + +template +void ParameterBackend>::writeToFrontend() { + if (frontend_ && value_) { + frontend_->setWithoutPropagate(*value_); + } +} + +template +Expected ParameterBackend>::parse(const YAML::Node& node, + const std::string& prefix) { + return ParameterParser>::Parse(context(), uid(), key(), node, prefix) + .map([this] (const Handle& value) { return set(value); }) + .and_then([this] { writeToFrontend(); }); +} + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_CORE_PARAMETER_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/core/registrar.hpp b/isaac_ros_nvengine/gxf/include/gxf/core/registrar.hpp new file mode 100644 index 00000000..7fc95ef6 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/core/registrar.hpp @@ -0,0 +1,170 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_REGISTRAR_HPP_ +#define NVIDIA_GXF_CORE_REGISTRAR_HPP_ + +#include +#include +#include // NOLINT +#include +#include +#include + +#include "core/optional.hpp" +#include "gxf/core/parameter.hpp" +#include "gxf/std/parameter_registrar.hpp" +#include "gxf/std/parameter_storage.hpp" + +namespace nvidia { +namespace gxf { + +// Registers parameters and other information of components +class Registrar { + public: + // Constant for registering an optional parameter with no default value + static constexpr Unexpected NoDefaultParameter() { + return Unexpected{GXF_PARAMETER_NOT_INITIALIZED}; + } + + Registrar() = default; + + // Simplified version of 'parameter'. + template + Expected parameter(Parameter& parameter, const char* key) { + return parameterImpl(parameter, {key, key, "N/A"}); + } + + // Simplified version of 'parameter'. + template + Expected parameter(Parameter& parameter, const char* key, const char* headline) { + return parameterImpl(parameter, {key, headline, "N/A"}); + } + + // Simplified version of 'parameter'. + template + Expected parameter(Parameter& parameter, const char* key, const char* headline, + const char* description) { + return parameterImpl(parameter, {key, headline, description}); + } + + // Simplified version of 'parameter'. + template + Expected parameter(Parameter& parameter, const char* key, const char* headline, + const char* description, const T& default_value) { + ParameterInfo info; + info.key = key; + info.headline = headline; + info.description = description; + info.value_default = default_value; + return parameterImpl(parameter, info); + } + + // Register a component parameter. Every parameter must be registered in the function + // 'registerInterface'. + template + Expected parameter(Parameter& parameter, const char* key, const char* headline, + const char* description, const T& default_value, + gxf_parameter_flags_t flags) { + ParameterInfo info; + info.key = key; + info.headline = headline; + info.description = description; + info.value_default = default_value; + info.flags = flags; + return parameterImpl(parameter, info); + } + + // Deprecated + template + Expected parameter(Parameter& parameter, const char* key, const char* headline, + const char* description, std::nullopt_t, gxf_parameter_flags_t flags) { + GXF_LOG_WARNING("std::nullopt is deprecated, use Registrar::NoDefaultParameter() instead"); + ParameterInfo info; + info.key = key; + info.headline = headline; + info.description = description; + info.flags = flags; + return parameterImpl(parameter, info); + } + + // Register a component parameter. Every parameter must be registered in the function + // 'registerInterface'. + template + Expected parameter(Parameter& parameter, const char* key, const char* headline, + const char* description, Unexpected, gxf_parameter_flags_t flags) { + ParameterInfo info; + info.key = key; + info.headline = headline; + info.description = description; + info.flags = flags; + return parameterImpl(parameter, info); + } + + // Registers with a struct of all info. + template + Expected parameter(nvidia::gxf::Parameter& parameter, + const ParameterInfo& parameter_info) { + return parameterImpl(parameter, parameter_info); + } + + // Implementation for parameter() above that registers parameter in ParameterRegistrar and + // ParameterStorage. + template + Expected parameterImpl(nvidia::gxf::Parameter& parameter, + const ParameterInfo& parameter_info) { + if (parameter_registrar != nullptr) { + Expected result = + parameter_registrar->registerComponentParameter(tid, type_name, parameter_info); + if (!result) { return ForwardError(result); } + } + + if (parameter_storage == nullptr) { return Unexpected{GXF_CONTEXT_INVALID}; } + return parameter_storage->registerParameter( + ¶meter, cid, parameter_info.key, parameter_info.headline, parameter_info.description, + parameter_info.value_default, parameter_info.flags); + } + + // Registers a component with no parameters + Expected registerParameterlessComponent() { + if (parameter_registrar != nullptr) parameter_registrar->addParameterlessType(tid, type_name); + return Success; + } + + // Sets the mandatory parameter storage where parameters loaded from YAML are stored. + void setParameterStorage(ParameterStorage* param_storage) { parameter_storage = param_storage; } + + // Sets parameter registrar + void setParameterRegistrar(ParameterRegistrar* param_registrar) { + parameter_registrar = param_registrar; + } + + ParameterStorage* parameter_storage = nullptr; + + // Stores information about parameter for query + ParameterRegistrar* parameter_registrar = nullptr; + + // The type id of registering component + gxf_tid_t tid; + // The instance uid of registering component + gxf_uid_t cid = 0; + // The typename of the registering component + std::string type_name; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_CORE_REGISTRAR_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/cuda/cuda_stream.hpp b/isaac_ros_nvengine/gxf/include/gxf/cuda/cuda_stream.hpp new file mode 100644 index 00000000..dc183ae4 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/cuda/cuda_stream.hpp @@ -0,0 +1,91 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_CUDA_CUDA_STREAM_HPP_ +#define NVIDIA_GXF_CUDA_CUDA_STREAM_HPP_ + +#include + +#include +#include +#include +#include + +#include "gxf/core/component.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/handle.hpp" +#include "gxf/cuda/cuda_event.hpp" + + +namespace nvidia { +namespace gxf { + +class CudaStreamPool; + +// Holds and provides access to cudaStream_t. CudaStream is allocated and +// recycled by CudaStreamPool +class CudaStream { + public: + CudaStream() = default; + ~CudaStream(); + + CudaStream(const CudaStream&) = delete; + CudaStream(CudaStream&&) = delete; + void operator=(const CudaStream&) = delete; + + using EventDestroy = std::function; + using SyncedCallback = std::function; + + // Retrieves cudaSteam_t + Expected stream() const; + // Get device id which owns this stream + int dev_id() const { return dev_id_; } + + // Record event to extend Entity life until event synchronized. + Expected record(Handle event, Entity input_entity, + SyncedCallback synced_cb = nullptr); + // Record event on the stream for an async callback. + // The callback would be delayed untill CudaStreamSync ticks. + // The Callback usually is used to recyle dependent resources. + // If record failed, callback would not be called. User need to check return results. + Expected record(cudaEvent_t event, EventDestroy cb); + + // Reset all events and callback all the hook functions to release resource. + Expected resetEvents(); + + // Sync all streams, meanwhile clean all recorded events and callback recycle functions + Expected syncStream(); + + private: + friend class CudaStreamPool; + // Initialize new cuda stream if was not set by external + Expected initialize(uint32_t flags = 0, int dev_id = -1, int32_t priority = 0); + Expected deinitialize(); + + Expected prepareResourceInternal(int dev_id); + + Expected recordEventInternal(cudaEvent_t e); + Expected syncEventInternal(cudaEvent_t e); + + Expected resetEventsInternal(std::queue& q); + + mutable std::shared_timed_mutex mutex_; + int dev_id_ = 0; + cudaStream_t stream_ = 0; + + // store all recorded event with destory functions. + std::queue recorded_event_queue_; + // event is defined for for synchronization of stream + CudaEvent::EventPtr sync_event_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_CUDA_CUDA_STREAM_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/network/tcp_client.hpp b/isaac_ros_nvengine/gxf/include/gxf/network/tcp_client.hpp new file mode 100644 index 00000000..43a17830 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/network/tcp_client.hpp @@ -0,0 +1,59 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_NETWORK_TCP_CLIENT_HPP_ +#define NVIDIA_GXF_NETWORK_TCP_CLIENT_HPP_ + +#include +#include +#include + +#include "gxf/network/tcp_client_socket.hpp" +#include "gxf/serialization/entity_serializer.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/receiver.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// Codelet that functions as a client in a TCP connection +class TcpClient : public Codelet { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override { return ToResultCode(client_socket_.close()); } + + gxf_result_t start() override; + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter>> receivers_; + Parameter>> transmitters_; + Parameter>> serializers_; + Parameter address_; + Parameter port_; + Parameter timeout_ms_; + Parameter maximum_attempts_; + + // Maps channel IDs to transmitters + std::unordered_map> channel_map_; + // Entity serializer + EntitySerializer entity_serializer_; + // TCP client socket + TcpClientSocket client_socket_; + // Execution timestamp for measuring connection timeout + int64_t timestamp_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_NETWORK_TCP_CLIENT_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/network/tcp_server.hpp b/isaac_ros_nvengine/gxf/include/gxf/network/tcp_server.hpp new file mode 100644 index 00000000..0f3adef1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/network/tcp_server.hpp @@ -0,0 +1,61 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_NETWORK_TCP_SERVER_HPP_ +#define NVIDIA_GXF_NETWORK_TCP_SERVER_HPP_ + +#include +#include +#include + +#include "gxf/network/tcp_server_socket.hpp" +#include "gxf/serialization/entity_serializer.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/receiver.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// Codelet that functions as a server in a TCP connection +class TcpServer : public Codelet { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override { return ToResultCode(server_socket_.close()); } + + gxf_result_t start() override; + gxf_result_t tick() override; + gxf_result_t stop() override; + + private: + Parameter>> receivers_; + Parameter>> transmitters_; + Parameter>> serializers_; + Parameter address_; + Parameter port_; + Parameter timeout_ms_; + Parameter maximum_attempts_; + + // Maps channel IDs to transmitters + std::unordered_map> channel_map_; + // Entity serializer + EntitySerializer entity_serializer_; + // TCP server socket + TcpServerSocket server_socket_; + // TCP client socket + TcpClientSocket client_socket_; + // Execution timestamp for measuring connection timeout + int64_t timestamp_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_NETWORK_TCP_SERVER_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/npp/nppi_mul_c.hpp b/isaac_ros_nvengine/gxf/include/gxf/npp/nppi_mul_c.hpp new file mode 100644 index 00000000..b52d1b67 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/npp/nppi_mul_c.hpp @@ -0,0 +1,44 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_NPP_NPPI_MUL_C_HPP +#define NVIDIA_GXF_NPP_NPPI_MUL_C_HPP + +#include + +#include "gxf/std/allocator.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/parameter_parser_std.hpp" +#include "gxf/std/receiver.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// Multiplies a CUDA tensor with a constant factor using NPP. +class NppiMulC : public Codelet { + public: + virtual ~NppiMulC() = default; + + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter> in_; + Parameter> factor_; + Parameter> pool_; + Parameter> out_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/npp/nppi_set.hpp b/isaac_ros_nvengine/gxf/include/gxf/npp/nppi_set.hpp new file mode 100644 index 00000000..27f084f1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/npp/nppi_set.hpp @@ -0,0 +1,46 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_NPP_NPPI_SET_HPP +#define NVIDIA_GXF_NPP_NPPI_SET_HPP + +#include +#include + +#include "gxf/std/allocator.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/parameter_parser_std.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// Creates a CUDA tensor with constant values using NPP. +class NppiSet : public Codelet { + public: + virtual ~NppiSet() = default; + + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter rows_; + Parameter columns_; + Parameter channels_; + Parameter> pool_; + Parameter> value_; + Parameter> out_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/sample/ping_rx.hpp b/isaac_ros_nvengine/gxf/include/gxf/sample/ping_rx.hpp new file mode 100644 index 00000000..52dcf547 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/sample/ping_rx.hpp @@ -0,0 +1,37 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_SAMPLE_PING_RX_HPP_ +#define NVIDIA_GXF_SAMPLE_PING_RX_HPP_ + +#include "gxf/std/codelet.hpp" +#include "gxf/std/receiver.hpp" + +namespace nvidia { +namespace gxf { + +// Sample codelet implementation to receive an entity +class PingRx : public Codelet { + public: + virtual ~PingRx() = default; + + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter> signal_; + int count = 1; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_SAMPLE_PING_RX_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/sample/ping_tx.hpp b/isaac_ros_nvengine/gxf/include/gxf/sample/ping_tx.hpp new file mode 100644 index 00000000..d2c07cd1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/sample/ping_tx.hpp @@ -0,0 +1,39 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_SAMPLE_PING_TX_HPP_ +#define NVIDIA_GXF_SAMPLE_PING_TX_HPP_ + +#include "gxf/std/clock.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// Sample codelet implementation to send an entity +class PingTx : public Codelet { + public: + virtual ~PingTx() = default; + + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter> signal_; + Parameter> clock_; + int count = 1; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_SAMPLE_PING_TX_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/serialization/component_serializer.hpp b/isaac_ros_nvengine/gxf/include/gxf/serialization/component_serializer.hpp new file mode 100644 index 00000000..0e50a6f0 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/serialization/component_serializer.hpp @@ -0,0 +1,128 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_SERIALIZATION_COMPONENT_SERIALIZER_HPP_ +#define NVIDIA_GXF_SERIALIZATION_COMPONENT_SERIALIZER_HPP_ + +#include +#include // NOLINT +#include + +#include "gxf/core/component.hpp" +#include "gxf/serialization/endpoint.hpp" +#include "gxf/serialization/tid_hash.hpp" + +namespace nvidia { +namespace gxf { + +// Interface for serializing components +class ComponentSerializer : public Component { + public: + virtual ~ComponentSerializer() = default; + + // Checks if the serializer supports the given component type + // Searches serializer map by default + virtual gxf_result_t is_supported_abi(gxf_tid_t tid) { + return getSerializer(tid) ? GXF_SUCCESS : GXF_FAILURE; + } + // Serializes component and writes to endpoint + // Returns the size of the serialized component in bytes + // Uses functions in serializer map by default + virtual gxf_result_t serialize_component_abi(gxf_uid_t cid, Endpoint* endpoint, uint64_t* size); + // Reads from endpoint and deserializes component + // Uses functions in serializer map by default + virtual gxf_result_t deserialize_component_abi(gxf_uid_t cid, Endpoint* endpoint); + + // C++ API wrappers + bool isSupported(gxf_tid_t tid) { return is_supported_abi(tid) == GXF_SUCCESS; } + Expected serializeComponent(UntypedHandle component, Endpoint* endpoint); + Expected deserializeComponent(UntypedHandle component, Endpoint* endpoint); + + protected: + // Serializer function handle + // Takes a component pointer and an endpoint pointer as input + // Returns the size of the serialized component in bytes + using Serializer = std::function(void*, Endpoint*)>; + // Deserializer function handle + // Takes a component pointer and an endpoint pointer as input + using Deserializer = std::function(void*, Endpoint*)>; + + // Returns a serializer for the given type ID + Expected getSerializer(gxf_tid_t tid) const; + // Returns a deserializer for the given type ID + Expected getDeserializer(gxf_tid_t tid) const; + // Adds a serializer for the given type ID + Expected setSerializer(gxf_tid_t tid, Serializer serializer); + // Adds a deserializer for the given type ID + Expected setDeserializer(gxf_tid_t tid, Deserializer deserializer); + // Removes a serializer for the given type ID + Expected clearSerializer(gxf_tid_t tid) { return setSerializer(tid, nullptr); } + // Removes a deserializer for the given type ID + Expected clearDeserializer(gxf_tid_t tid) { return setDeserializer(tid, nullptr); } + + // Returns a serializer for the given type + template + Expected getSerializer() const { + gxf_tid_t tid; + return ExpectedOrCode(GxfComponentTypeId(context(), TypenameAsString(), &tid)) + .and_then([&](){ return getSerializer(tid); }); + } + // Returns a deserializer for the given type + template + Expected getDeserializer() const { + gxf_tid_t tid; + return ExpectedOrCode(GxfComponentTypeId(context(), TypenameAsString(), &tid)) + .and_then([&](){ return getDeserializer(tid); }); + } + // Adds a serializer for the given type + template + Expected setSerializer(Serializer serializer) { + gxf_tid_t tid; + return ExpectedOrCode(GxfComponentTypeId(context(), TypenameAsString(), &tid)) + .and_then([&](){ return setSerializer(tid, serializer); }); + } + // Adds a deserializer for the given type + template + Expected setDeserializer(Deserializer deserializer) { + gxf_tid_t tid; + return ExpectedOrCode(GxfComponentTypeId(context(), TypenameAsString(), &tid)) + .and_then([&](){ return setDeserializer(tid, deserializer); }); + } + // Removes a serializer for the given type + template + Expected clearSerializer(Serializer serializer) { + gxf_tid_t tid; + return ExpectedOrCode(GxfComponentTypeId(context(), TypenameAsString(), &tid)) + .and_then([&](){ return clearSerializer(tid); }); + } + // Removes a deserializer for the given type + template + Expected clearDeserializer(Deserializer deserializer) { + gxf_tid_t tid; + return ExpectedOrCode(GxfComponentTypeId(context(), TypenameAsString(), &tid)) + .and_then([&](){ return clearDeserializer(tid); }); + } + + private: + // Structure for organizing serialize-deserialize function pairs + struct SerializerFunctions { + Serializer serializer; + Deserializer deserializer; + }; + + // Table that maps component type ID to serializer functions + std::unordered_map serializer_map_; + // Mutex to guard concurrent access to serializer map + mutable std::shared_timed_mutex mutex_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_SERIALIZATION_COMPONENT_SERIALIZER_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/serialization/entity_recorder.hpp b/isaac_ros_nvengine/gxf/include/gxf/serialization/entity_recorder.hpp new file mode 100644 index 00000000..28889fe6 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/serialization/entity_recorder.hpp @@ -0,0 +1,57 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_SERIALIZATION_ENTITY_RECORDER_HPP_ +#define NVIDIA_GXF_SERIALIZATION_ENTITY_RECORDER_HPP_ + +#include +#include + +#include "gxf/serialization/component_serializer.hpp" +#include "gxf/serialization/entity_serializer.hpp" +#include "gxf/serialization/file_stream.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/receiver.hpp" + +namespace nvidia { +namespace gxf { + +// Records incoming entities by serializaing and writing to a file. +// Uses one file to store binary data and a second file as an index to enable random-access. +class EntityRecorder : public Codelet { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override; + + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter> receiver_; + Parameter>> serializers_; + Parameter directory_; + Parameter basename_; + Parameter flush_on_tick_; + + // Entity serializer + EntitySerializer entity_serializer_; + // File stream for data index + FileStream index_file_stream_; + // File stream for binary data + FileStream binary_file_stream_; + // Offset into binary file + size_t binary_file_offset_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/serialization/entity_replayer.hpp b/isaac_ros_nvengine/gxf/include/gxf/serialization/entity_replayer.hpp new file mode 100644 index 00000000..aa8f001d --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/serialization/entity_replayer.hpp @@ -0,0 +1,58 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_SERIALIZATION_ENTITY_REPLAYER_HPP_ +#define NVIDIA_GXF_SERIALIZATION_ENTITY_REPLAYER_HPP_ + +#include +#include + +#include "gxf/serialization/component_serializer.hpp" +#include "gxf/serialization/entity_serializer.hpp" +#include "gxf/serialization/file_stream.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// Replays entities by reading and deserializing from a file. +// The file is processed sequentially and a single entity is published per tick. +class EntityReplayer : public Codelet { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override; + + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + Parameter> transmitter_; + Parameter>> serializers_; + Parameter directory_; + Parameter basename_; + Parameter batch_size_; + Parameter ignore_corrupted_entities_; + + // Entity serializer + EntitySerializer entity_serializer_; + // File stream for entities + FileStream entity_file_stream_; + // File stream for index + FileStream index_file_stream_; + // Set to true once the whole log was read + bool end_of_file_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/serialization/std_component_serializer.hpp b/isaac_ros_nvengine/gxf/include/gxf/serialization/std_component_serializer.hpp new file mode 100644 index 00000000..168b538f --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/serialization/std_component_serializer.hpp @@ -0,0 +1,45 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_SERIALIZATION_STD_COMPONENT_SERIALIZER_HPP_ +#define NVIDIA_GXF_SERIALIZATION_STD_COMPONENT_SERIALIZER_HPP_ + +#include "gxf/serialization/component_serializer.hpp" +#include "gxf/std/allocator.hpp" +#include "gxf/std/tensor.hpp" +#include "gxf/std/timestamp.hpp" + +namespace nvidia { +namespace gxf { + +// Serializer that supports Timestamp and Tensor components +// Valid for sharing data between devices with the same endianness +class StdComponentSerializer : public ComponentSerializer { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override { return GXF_SUCCESS; } + + private: + // Serializes a nvidia::gxf::Timestamp + Expected serializeTimestamp(Timestamp timestamp, Endpoint* endpoint); + // Deserializes a nvidia::gxf::Timestamp + Expected deserializeTimestamp(Endpoint* endpoint); + // Serializes a nvidia::gxf::Tensor + Expected serializeTensor(const Tensor& tensor, Endpoint* endpoint); + // Deserializes a nvidia::gxf::Tensor + Expected deserializeTensor(Endpoint* endpoint); + + Parameter> allocator_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_SERIALIZATION_STD_COMPONENT_SERIALIZER_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/allocator.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/allocator.hpp new file mode 100644 index 00000000..0c8a31b5 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/allocator.hpp @@ -0,0 +1,48 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_ALLOCATOR_HPP +#define NVIDIA_GXF_STD_ALLOCATOR_HPP + +#include "core/byte.hpp" +#include "gxf/core/component.hpp" + +namespace nvidia { +namespace gxf { + +enum struct MemoryStorageType { kHost = 0, kDevice = 1, kSystem = 2 }; + +// Provides allocation and deallocation of memory. +struct Allocator : public Component { + virtual ~Allocator() = default; + + virtual gxf_result_t is_available_abi(uint64_t size) = 0; + virtual gxf_result_t allocate_abi(uint64_t size, int32_t type, void** pointer) = 0; + virtual gxf_result_t free_abi(void* pointer) = 0; + + // Returns true if the allocator can provide a memory block with the given size. + bool is_available(uint64_t size); + + // Allocates a memory block with the given size. + Expected allocate(uint64_t size, MemoryStorageType type); + + // Frees the given memory block. + Expected free(byte* pointer); +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/clock.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/clock.hpp new file mode 100644 index 00000000..d2509c5b --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/clock.hpp @@ -0,0 +1,84 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_CLOCK_HPP_ +#define NVIDIA_GXF_STD_CLOCK_HPP_ + +#include + +#include "gxf/core/component.hpp" + +namespace nvidia { +namespace gxf { + +/// @brief Keeps track of time +// +// This clock is based on a steady clock however time can be scaled to run slower or faster. +class Clock : public Component { + public: + virtual ~Clock() = default; + + /// @brief The current time of the clock. Time is measured in seconds. + virtual double time() const = 0; + + /// @brief The current timestamp of the clock. Timestamps are measured in nanoseconds. + virtual int64_t timestamp() const = 0; + + /// @brief Waits until the given duration has elapsed on the clock + virtual Expected sleepFor(int64_t duration_ns) = 0; + + /// @brief Waits until the given target time + virtual Expected sleepUntil(int64_t target_ns) = 0; +}; + +/// @brief A clock which runs based on a realtime clock +class RealtimeClock : public Clock { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override; + double time() const override; + int64_t timestamp() const override; + Expected sleepFor(int64_t duration_ns) override; + Expected sleepUntil(int64_t target_time_ns) override; + + // Changes time scaling used by the clock. + Expected setTimeScale(double time_scale); + + private: + Parameter initial_time_offset_; + Parameter initial_time_scale_; + Parameter use_time_since_epoch_; + + std::chrono::time_point reference_; + double time_offset_; + double time_scale_; +}; + +/// @brief A clock where time flow is controlled manually +class ManualClock : public Clock { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override; + double time() const override; + int64_t timestamp() const override; + Expected sleepFor(int64_t duration_ns) override; + Expected sleepUntil(int64_t target_time_ns) override; + + private: + Parameter initial_timestamp_; + + int64_t current_time_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/codelet.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/codelet.hpp new file mode 100644 index 00000000..a838c7d4 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/codelet.hpp @@ -0,0 +1,96 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#pragma once + +#include + +#include "gxf/core/component.hpp" + +namespace nvidia { +namespace gxf { + +// Codelets are special components which allow the execution of custom code. The user can +// create her own codelets by deriving from this class and overriding the functions initialize, +// start, tick, stop, and deinitialize. +class Codelet : public Component { + public: + virtual ~Codelet() = default; + + // This function is called during the start phase of the codelet. It allows derived classes to + // execute custom code during the start phase. This is a good place to obtain resources which + // are necessary for ticking the codelet. This function is guaranteed to be called before the + // first call to tick. + virtual gxf_result_t start() = 0; + + // This function is called whenever the codelet is expected to do work, e.g. when an event was + // received or periodically. The tick method can be specified with various other member functions. + // This function is the main work horse of the codelet. + virtual gxf_result_t tick() = 0; + + // This function is called during the stop phase of the codelet. It allows derived classes to + // execute custom code during the stop phase. This is a good place to clean up any resources which + // where obtained during 'start'. After the codelet is stopped it should be in the same state as + // it was before 'start' was called. Be careful to not leave any unintended left overs as 'start' + // might be called again afterwards. It is guaranteed that stop is called after the last + // call to tick. When start was called stop will be called, too. + virtual gxf_result_t stop() = 0; + + // Timestamp (in nanoseconds) of the beginning of the start, tick or stop function. The execution + // timestamp does not change during the start, tick or stop function. + int64_t getExecutionTimestamp() const { return execution_timestamp_; } + + // Similar to getExecutionTimestamp but returns time as a floating point number and using seconds + // as unit. Equivalent to 'ToSeconds(getExecutionCount())'. + double getExecutionTime() const { return execution_time_; } + + // The delta between the current execution time and the execution time of the previous execution. + // During the start function this will return 0. + double getDeltaTime() const { return delta_time_; } + + // Returns the number of times a codelet is executed. This will return 0 during start and 1 during + // the first tick. + int64_t getExecutionCount() const { return execution_count_; } + + // Returns true if this is the first time tick is called after start. + bool isFirstTick() const { return getExecutionCount() == 1; } + + private: + // Class is friend to allow EntityExecutor to call private member functions + friend class EntityExecutor; + + // Called by EntityExecutor before each 'start' + void beforeStart(int64_t timestamp); + + // Called by EntityExecutor before each 'tick' + void beforeTick(int64_t timestamp); + + // Called by EntityExecutor before each 'stop' + void beforeStop(); + + // The number of times the codelet tick function was called. + int64_t execution_count_; + // The timestamp of the previous execution. Equal to 'execution_timestamp' during 'start'. + int64_t previous_execution_timestamp_; + // The timestamp of the current execution in nanoseconds. + int64_t execution_timestamp_; + // Same as execution_timestamp_ but in seconds and as a floating point. + double execution_time_; + // The difference between the current and the previous execution time in seconds. + double delta_time_; +}; + +} // namespace gxf +} // namespace nvidia diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/component_allocator.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/component_allocator.hpp new file mode 100644 index 00000000..ed11b148 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/component_allocator.hpp @@ -0,0 +1,51 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_COMPONENT_ALLOCATOR_HPP +#define NVIDIA_GXF_STD_COMPONENT_ALLOCATOR_HPP + +#include "gxf/core/expected.hpp" + +namespace nvidia { +namespace gxf { + +// Base class for allocating components. +class ComponentAllocator { + public: + virtual ~ComponentAllocator() = default; + + ComponentAllocator(const ComponentAllocator&) = delete; + ComponentAllocator(ComponentAllocator&&) = delete; + ComponentAllocator& operator=(const ComponentAllocator&) = delete; + ComponentAllocator& operator=(ComponentAllocator&&) = delete; + + // Allocates a new component of the specific component type this allocator is handling. + virtual gxf_result_t allocate_abi(void** out_pointer) = 0; + + // Deallocates a component which was previously allocated by this allocator. + virtual gxf_result_t deallocate_abi(void* pointer) = 0; + + Expected allocate(); + + Expected deallocate(void* pointer); + + protected: + ComponentAllocator() = default; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/component_factory.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/component_factory.hpp new file mode 100644 index 00000000..21c98801 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/component_factory.hpp @@ -0,0 +1,52 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_COMPONENT_FACTORY_HPP +#define NVIDIA_GXF_STD_COMPONENT_FACTORY_HPP + +#include "gxf/core/expected.hpp" + +namespace nvidia { +namespace gxf { + +// Base class for extension factories. An extension factory is used to create instances +// of components. +class ComponentFactory { + public: + virtual ~ComponentFactory() = default; + + ComponentFactory(const ComponentFactory&) = delete; + ComponentFactory(ComponentFactory&&) = delete; + ComponentFactory& operator=(const ComponentFactory&) = delete; + ComponentFactory& operator=(ComponentFactory&&) = delete; + + // Allocates a component of the given type + virtual gxf_result_t allocate_abi(gxf_tid_t tid, void** out_pointer) = 0; + + // Frees a component of the given type + virtual gxf_result_t deallocate_abi(gxf_tid_t tid, void* pointer) = 0; + + Expected allocate(gxf_tid_t tid); + + Expected deallocate(gxf_tid_t tid, void* pointer); + + protected: + ComponentFactory() = default; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/default_extension.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/default_extension.hpp new file mode 100644 index 00000000..d49415a7 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/default_extension.hpp @@ -0,0 +1,127 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_DEFAULT_EXTENSION_HPP_ +#define NVIDIA_GXF_STD_DEFAULT_EXTENSION_HPP_ + +#include +#include +#include +#include + +#include "core/fixed_vector.hpp" +#include "core/type_name.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/component_allocator.hpp" +#include "gxf/std/extension.hpp" +#include "gxf/std/new_component_allocator.hpp" + +namespace nvidia { +namespace gxf { + +namespace detail { + +struct VoidBaseHelper {}; + +template +struct BaseTypenameAsString { + static const char* Value() { return TypenameAsString(); } +}; + +template <> +struct BaseTypenameAsString { + static constexpr const char* Value() { return ""; } +}; + +} // namespace detail + +// A standard component factor for GXF extensions. It keeps track of all components in the +// extensions and provides mechanisms to create components. +class DefaultExtension : public Extension { + public: + ~DefaultExtension() override = default; + + // Sets the extension metadata info + gxf_result_t setInfo_abi(gxf_tid_t tid, const char* name, const char* desc, const char* author, + const char* version, const char* license) override; + + // Gets description of the extension and list of components it provides + gxf_result_t getInfo_abi(gxf_extension_info_t* info) override; + + gxf_result_t checkInfo_abi() override; + + // Gets description of specified component (No parameter information) + gxf_result_t getComponentInfo_abi(const gxf_tid_t tid, gxf_component_info_t* info) override; + + gxf_result_t registerComponents_abi(gxf_context_t context) override; + + gxf_result_t getComponentTypes_abi(gxf_tid_t* pointer, size_t* size) override; + + gxf_result_t allocate_abi(gxf_tid_t tid, void** out_pointer) override; + + gxf_result_t deallocate_abi(gxf_tid_t tid, void* pointer) override; + + gxf_result_t getParameterInfo_abi(gxf_context_t context, const gxf_tid_t cid, const char* key, + gxf_parameter_info_t* info) override; + + template + Expected add(gxf_tid_t tid, const char* description) { + static_assert(std::is_same::value + || std::is_base_of::value, + "The given base class is not actually a base class"); + static_assert(!std::is_base_of::value || + (std::is_base_of::value || std::is_same::value), + "If a component derives from Codelet then its base class also needs to derive " + "from Codelet. Have you used Component as base class instead of Codelet?"); + + if (find(tid)) { + return Unexpected{GXF_FACTORY_DUPLICATE_TID}; + } + auto result = entries_.push_back({ + tid, TypenameAsString(), detail::BaseTypenameAsString::Value(), description, + std::is_abstract::value ? nullptr : std::make_unique>()}); + if (!result) { + GXF_LOG_WARNING("Exceeding maximum number of components"); + return Unexpected{GXF_EXCEEDING_PREALLOCATED_SIZE}; + } + return Success; + } + + private: + struct Entry { + gxf_tid_t tid; + std::string name; + std::string base; + std::string description; + std::unique_ptr allocator; + }; + + Expected find(const gxf_tid_t& tid); + + FixedVector entries_; + gxf_tid_t tid_{GxfTidNull()}; + std::string name_; + std::string description_; + std::string author_; + std::string extension_version_; + std::string gxf_core_version_{kGxfCoreVersion}; // FIXME: Use setInfo() api to set this post 2.3 + std::string license_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_DEFAULT_EXTENSION_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/double_buffer_receiver.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/double_buffer_receiver.hpp new file mode 100644 index 00000000..d4cb5481 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/double_buffer_receiver.hpp @@ -0,0 +1,65 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef DOUBLE_BUFFER_RECEIVER_HPP +#define DOUBLE_BUFFER_RECEIVER_HPP + +#include + +#include "gxf/core/component.hpp" +#include "gxf/core/entity.hpp" +#include "gxf/core/handle.hpp" +#include "gxf/std/gems/staging_queue/staging_queue.hpp" +#include "gxf/std/receiver.hpp" + +namespace nvidia { +namespace gxf { + +// A receiver which uses a double-buffered queue where new messages are first pushed to a +// backstage. Incoming messages are not immediately available and need to be moved to the mainstage +// first. +class DoubleBufferReceiver : public Receiver { + public: + using queue_t = ::gxf::staging_queue::StagingQueue; + + gxf_result_t registerInterface(Registrar* registrar) override; + + gxf_result_t initialize() override; + + gxf_result_t deinitialize() override; + + gxf_result_t pop_abi(gxf_uid_t* uid) override; + + gxf_result_t push_abi(gxf_uid_t other) override; + + gxf_result_t peek_abi(gxf_uid_t* uid, int32_t index) override; + + gxf_result_t peek_back_abi(gxf_uid_t* uid, int32_t index) override; + + size_t capacity_abi() override; + + size_t size_abi() override; + + gxf_result_t receive_abi(gxf_uid_t* uid) override; + + size_t back_size_abi() override; + + gxf_result_t sync_abi() override; + + Parameter capacity_; + Parameter policy_; + + private: + std::unique_ptr queue_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/extension.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/extension.hpp new file mode 100644 index 00000000..15b018b1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/extension.hpp @@ -0,0 +1,77 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_EXTENSION_HPP +#define NVIDIA_GXF_STD_EXTENSION_HPP + +#include "gxf/core/expected.hpp" +#include "gxf/std/component_factory.hpp" + +namespace nvidia { +namespace gxf { + +// Interface used for extensions. An extension class is holding information about the extension +// and allows creation of components which are provided by the extension. +class Extension : public ComponentFactory { + public: + virtual ~Extension() = default; + + Extension(const Extension&) = delete; + Extension(Extension&&) = delete; + Extension& operator=(const Extension&) = delete; + Extension& operator=(Extension&&) = delete; + + // Capture extension metadata + virtual gxf_result_t setInfo_abi(gxf_tid_t tid, const char* name, const char* desc, + const char* author, const char* version, + const char* license) = 0; + + // Check if extension metadata has been captured + virtual gxf_result_t checkInfo_abi() = 0; + + // Gets description of the extension and list of components it provides + virtual gxf_result_t getInfo_abi(gxf_extension_info_t* info) = 0; + + // Registers all components in the extension with the given context. + virtual gxf_result_t registerComponents_abi(gxf_context_t context) = 0; + + // Gets a list with IDs of all types which are registered with this factory. + virtual gxf_result_t getComponentTypes_abi(gxf_tid_t* pointer, size_t* size) = 0; + + // Gets description of specified component (No parameter information) + virtual gxf_result_t getComponentInfo_abi(const gxf_tid_t tid, gxf_component_info_t* info) = 0; + + // Gets description of specified parameter + virtual gxf_result_t getParameterInfo_abi(gxf_context_t context, const gxf_tid_t cid, + const char* key, gxf_parameter_info_t* info) = 0; + + Expected registerComponents(gxf_context_t context); + Expected getComponentTypes(gxf_tid_t* pointer, size_t* size); + Expected setInfo(gxf_tid_t tid, const char* name, const char* desc, + const char* author, const char* version, const char* license); + Expected checkInfo(); + Expected getInfo(gxf_extension_info_t* info); + Expected getComponentInfo(const gxf_tid_t tid, gxf_component_info_t* info); + Expected getParameterInfo(gxf_context_t context, const gxf_tid_t cid, const char* key, + gxf_parameter_info_t* info); + + protected: + Extension() = default; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/extension_factory_helper.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/extension_factory_helper.hpp new file mode 100644 index 00000000..02852fa2 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/extension_factory_helper.hpp @@ -0,0 +1,112 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_FACTORY_HPP +#define NVIDIA_GXF_CORE_FACTORY_HPP + +#include +#include + +#include "gxf/core/expected.hpp" +#include "gxf/std/default_extension.hpp" + +// Helper macro to create an extensions factory. Every component in this extensions must be +// explicitly registered. Otherwise it can not be used by GXF applications. +// +// A component can be registered using the macro GXF_EXT_FACTORY_ADD. For each +// component the base class need to be specified. Components base classes must be registered before +// they can be used as a base class in a component registration. If a component does not have a base +// class the macro GXF_EXT_FACTORY_ADD_0 is used instead. +// +// Components can have at most one base class. Multiple base classes are not supported. +// +// Every component must be registered with a unique 128-bit identifier. The identifer must be +// unique across all existing extensions. +// +// Note that the extension factory can also be created manually without using these macros. +// +// Usage example: +// GXF_EXT_FACTORY_BEGIN(0x8ec2d5d6b5df48bf, 0x8dee0252606fdd7e, "1.0.0") +// GXF_EXT_FACTORY_SET_INFO("Extension Name", "Extension Desc", "Author", "LICENSE") +// GXF_EXT_FACTORY_ADD(0x792151bf31384603, 0xa9125ca91828dea8, +// nvidia::gxf::Queue, nvidia::gxf::Component, +// "Interface for storing entities in a queue"); +// GXF_EXT_FACTORY_ADD(0xc30cc60f0db2409d, 0x92b6b2db92e02cce, +// nvidia::gxf::Transmitter, nvidia::gxf::Queue, +// "Interface for publishing entities"); +// ... +// GXF_EXT_FACTORY_END() +#define GXF_EXT_FACTORY_BEGIN() \ + namespace { \ + nvidia::gxf::Expected> \ + CreateComponentFactory() { \ + auto factory = std::make_unique(); \ + if (!factory) { return nvidia::gxf::Unexpected{GXF_OUT_OF_MEMORY}; } \ + +// See GXF_EXT_FACTORY_BEGIN for more information. +#define GXF_EXT_FACTORY_SET_INFO(H1, H2, NAME, DESC, AUTHOR, VERSION, LICENSE) \ + { \ + const nvidia::gxf::Expected result = factory->setInfo({(H1), (H2)}, NAME, DESC, \ + AUTHOR, VERSION, LICENSE); \ + if (!result) { return nvidia::gxf::ForwardError(result); } \ + } \ + +// See GXF_EXT_FACTORY_BEGIN for more information. +#define GXF_EXT_FACTORY_ADD_0(H1, H2, TYPE, DESC) \ + { \ + const nvidia::gxf::Expected result = factory->add({(H1), (H2)}, DESC); \ + if (!result) { return nvidia::gxf::ForwardError(result); } \ + } \ + +// See GXF_EXT_FACTORY_BEGIN for more information. +#define GXF_EXT_FACTORY_ADD_0_LITE(H1, H2, TYPE) \ + { \ + const nvidia::gxf::Expected result = factory->add({(H1), (H2)}, ""); \ + if (!result) { return nvidia::gxf::ForwardError(result); } \ + } \ + +// See GXF_EXT_FACTORY_BEGIN for more information. +#define GXF_EXT_FACTORY_ADD(H1, H2, TYPE, BASE, DESC) \ + { \ + const nvidia::gxf::Expected result = factory->add({(H1), (H2)}, DESC); \ + if (!result) { return nvidia::gxf::ForwardError(result); } \ + } \ + +// See GXF_EXT_FACTORY_BEGIN for more information. +#define GXF_EXT_FACTORY_ADD_LITE(H1, H2, TYPE, BASE) \ + { \ + const nvidia::gxf::Expected result = factory->add({(H1), (H2)}, ""); \ + if (!result) { return nvidia::gxf::ForwardError(result); } \ + } \ + +// See GXF_EXT_FACTORY_BEGIN for more information. +#define GXF_EXT_FACTORY_END() \ + const nvidia::gxf::Expected result = factory->checkInfo(); \ + if (!result) { return nvidia::gxf::ForwardError(result); } \ + return std::move(factory); \ + } \ + } /* namespace */ \ + \ + extern "C" { \ + gxf_result_t GxfExtensionFactory(void** result) { \ + static nvidia::gxf::Expected> s_factory \ + = CreateComponentFactory(); \ + if (!s_factory) { return s_factory.error(); } \ + *result = s_factory.value().get(); \ + return GXF_SUCCESS; \ + } \ + } /* extern "C" */ \ + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue.hpp new file mode 100644 index 00000000..5825036c --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue.hpp @@ -0,0 +1,353 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_GEMS_STAGING_QUEUE_HPP +#define NVIDIA_GXF_STD_GEMS_STAGING_QUEUE_HPP + +#include +#include +#include + +#include "core/assert.hpp" +#include "gxf/std/gems/staging_queue/staging_queue_iterator.hpp" + +namespace gxf { +namespace staging_queue { + +// Defines the behavior of a StagingQueue in case an element is added while the queue is already +// full. +enum class OverflowBehavior { + // Pops oldest item to make room for the incoming item. + kPop, + // Rejects the incoming item. + kReject, + // The queue goes into an error state. Currently this raises a PANIC. + kFault +}; + +// A thread-safe double-buffered queue implemented based on a ring buffer. +// +// This data structure provides a queue-like interface to a collection of items. When items are +// added to the queue with the function push they are placed into a backstage area. The pop +// function and query functions like size, peek or latest only operate on items on +// the main stage. Items are moved from the backstage to the main stage by calling the sync +// function. The queue only provides a fixed number of slots for elements. If elements are added to +// a full queue a user-selected strategy is used to determine how to proceed. Note that the overflow +// strategy can by triggerd when calling push in case the backstage area is full, or when calling +// sync in case the main stage is too full to receive all items from the backstage. When items are +// removed from the queue they are overwritten with a user-defined default value. This is useful +// for example in case shared pointers are stored in the queue. All functions of this type are +// protected by a common mutex thus making this a thread-safe type. The queue is implemented as a +// ring buffer internally. +// +// The following diagram depicts an example of a queue with a total capacity of four items. It +// currently stores three items in the main stage and two items in the backstage. O indicates +// empty slots, X indicates (filled) main stage slots and B indicates (filled) backstage slots. +// There are three empty slots as neither main stage nor backstage are at full capacity. If the +// sync function would be called in this situation the overflow behavior would be triggered as +// the main stage does not have enough room to receive all items from the backstage. +// +// # start of ringbuffer # end of ringbuffer +// | | +// | O | X | X | X | B | B | O | O | +// | | | +// | | # end +// # begin | +// # backstage +// +template +class StagingQueue { + public: + using const_iterator_t = StagingQueueIterator; + + // Creates a new staging queue. 'capacity' indicates the maximum number of elements allowed in + // the queue. Note that the queue will allocate memory to hold two times capacity slots of item + // type T. 'overflow_behevior' defines what will happen if a new item is added to a full queue. + // 'null' is the default element which is used for empty slots. If an element is removed from the + // queue the slot it occupied is set to this value. + StagingQueue(size_t capacity, OverflowBehavior overflow_behavior, T null); + + // Creates an empty staging queue with no capacity and Fault overflow behavior + StagingQueue(); + + // Gets the overflow behavior which is used by this queue + OverflowBehavior overflow_behavior() const; + + // Returns true if there are no elements in the main stage of the queue. + // Identical to 'size() == 0;' + bool empty() const; + // Returns the number of elements in the main stage of the queue. + size_t size() const; + // Returns the maximum number of elements which can be stored in the main stage. + size_t capacity() const; + + // Returns the number of elements in the back main stage of the queue. + size_t back_size() const; + + // Gets the item at position 'index' in the main stage of the queue starting with the oldest item. + // Returns a reference to the null object if there are no items in the main stage. + const T& peek(size_t index = 0) const; + // Gets the item at position 'index' in the back stage of the queue starting with the oldest item. + // Returns a reference to the null object if there are no items in the back stage. + const T& peek_backstage(size_t index = 0) const; + // Gets the item at position 'index' in the main stage of the queue starting with the newest item. + // Returns a reference to the null object if there are no items in the main stage. + // Identical to 'peek(size() - 1 - index)'. + const T& latest(size_t index = 0) const; + + // Gives an iterator pointing to the first element in the main stage. + const_iterator_t begin() const; + // Gives an iterator pointing to the element after the last element in the main stage. + const_iterator_t end() const; + + // Removes the oldest item from the queue's main stage and returns it. In case there are no items + // in the main stage this function simply returns a copy of the null object. This function + // invalidates iterators returned by begin() or end(). + T pop(); + // Removes all items from the main stage. This function invalidates iterators in the same way + // as the pop() function. + void popAll(); + + // Adds a new item to the back stage. In case the back stage is at capacity the overflow behavior + // is used to decide what to do. The added item will NOT be visible to any other functions which + // operate on the main stage, like size, peek, pop or similar, until 'sync' is called. + bool push(T item); + + // Moves all items from the back stage to the main stage. In case the main stage is too full + // to receive all items from the back stage the specified overflow behavior is used to decide what + // to do. This function invalidates iterators in the same way as the pop() function. + bool sync(); + + private: + // Returns the item in the underlying ringbuffer which is at position 'index' relative to the + // start of the ring buffer. + const T& at(size_t index) const { return items_[index % items_.size()]; } + T& at(size_t index) { return items_[index % items_.size()]; } + + // The maximum number of items in the main stage and back stage. Total number items in the queue + // is two times capacity. + const size_t capacity_; + // This behavior defines if either push or sync are called but the main stage contains too many + // items already. + const OverflowBehavior overflow_behavior_; + + // The null value is used for empty slots. It is also used as return value for peek and latest + // in case the given index is out of bounds. + T null_; + + // The container which holds the elements of the main stage and back stage. The container + // allocates memory in the constructor and does not change it's capacity thereafter. + std::vector items_; + + // Index of the first element of the main stage. The value of begin_ is guaranteed to be in the + // range {0, ..., items_.size() - 1}. + size_t begin_; + + // Number of elements in the mainstage. + size_t num_mainstage_; + // Number of elements in the backstage. + size_t num_backstage_; + + // This mutext protects all functions from concurrent access. + mutable std::mutex mutex_; +}; + +//-------------------------------------------------------------------------------------------------- + +template +StagingQueue::StagingQueue(size_t capacity, OverflowBehavior overflow_behavior, T null) + : capacity_(capacity), + overflow_behavior_(overflow_behavior), + null_(null), + items_(2 * capacity, null), + begin_(0), + num_mainstage_(0), + num_backstage_(0) {} + +template +StagingQueue::StagingQueue() + : capacity_(0), + overflow_behavior_(OverflowBehavior::kFault), + null_(), + items_(0), + begin_(0), + num_mainstage_(0), + num_backstage_(0) {} + +template +OverflowBehavior StagingQueue::overflow_behavior() const { + // Mutex not necessary as overflow_behavior_ is immutable. + return overflow_behavior_; +} + +template +bool StagingQueue::empty() const { + std::lock_guard lock(mutex_); + return num_mainstage_ == 0; +} + +template +size_t StagingQueue::size() const { + std::lock_guard lock(mutex_); + return num_mainstage_; +} + +template +size_t StagingQueue::capacity() const { + // Mutex not necessary as capacity_ is immutable. + return capacity_; +} + +template +size_t StagingQueue::back_size() const { + std::lock_guard lock(mutex_); + return num_backstage_; +} + +template +const T& StagingQueue::peek(size_t index) const { + std::lock_guard lock(mutex_); + if (index < num_mainstage_) { + return at(begin_ + index); + } else { + return null_; + } +} + +template +const T& StagingQueue::peek_backstage(size_t index) const { + std::lock_guard lock(mutex_); + if (index < num_backstage_) { + const size_t begin_backstage = begin_ + num_mainstage_; + return at(begin_backstage + index); + } else { + return null_; + } +} + +template +const T& StagingQueue::latest(size_t index) const { + std::lock_guard lock(mutex_); + if (index < num_mainstage_) { + return at(begin_ + num_mainstage_ - index - 1); + } else { + return null_; + } +} + +template +typename StagingQueue::const_iterator_t StagingQueue::begin() const { + return const_iterator_t(items_.data(), items_.size(), begin_); +} + +template +typename StagingQueue::const_iterator_t StagingQueue::end() const { + return const_iterator_t(items_.data(), items_.size(), begin_ + num_mainstage_); +} + +template +T StagingQueue::pop() { + std::lock_guard lock(mutex_); + T result = null_; + if (num_mainstage_ > 0) { + std::swap(at(begin_++), result); + num_mainstage_--; + } + begin_ %= items_.size(); + return result; +} + +template +void StagingQueue::popAll() { + std::lock_guard lock(mutex_); + const size_t begin_backstage = begin_ + num_mainstage_; + while (begin_ < begin_backstage) { + at(begin_++) = null_; + } + begin_ %= items_.size(); + num_mainstage_ = 0; +} + +template +bool StagingQueue::push(T item) { + std::lock_guard lock(mutex_); + const size_t begin_backstage = begin_ + num_mainstage_; + if (num_backstage_ == capacity_) { + // Trying to add a item to a full backstage. + switch (overflow_behavior_) { + case OverflowBehavior::kPop: { + // Move items in back stage one over. This removes the oldest item and makes room for one + // new item. + const size_t backstage_end = begin_backstage + num_backstage_; + for (size_t i = begin_backstage + 1; i < backstage_end; i++) { + at(i - 1) = std::move(at(i)); + } + // Add new item at the end of the backstage. + at(backstage_end - 1) = std::move(item); + } break; + case OverflowBehavior::kReject: + // Don't add the new item to the backstage. + break; + case OverflowBehavior::kFault: + return false; + // FIXME "Added an item to a full queue while using the 'Fault' overflow behavior." + default: + // FIXME "Invalid parameter" + return false; + } + } else { + // Add the new item to the end of the backstage. + at(begin_backstage + num_backstage_) = std::move(item); + num_backstage_++; + } + return true; +} + +template +bool StagingQueue::sync() { + std::lock_guard lock(mutex_); + // Add back stage items to main stage + num_mainstage_ += num_backstage_; + num_backstage_ = 0; + // Handle overflow if necessary + if (num_mainstage_ > capacity_) { + switch (overflow_behavior_) { + case OverflowBehavior::kPop: { + // Make sure that main and back stage together don't execeed capacity. Remove excess items + // starting with the first item in the main stage. This effectively pops the oldest items to + // make room for new items. + const size_t new_begin = begin_ + num_mainstage_ - capacity_; + while (begin_ < new_begin) { + at(begin_++) = null_; + } + num_mainstage_ = capacity_; + } break; + case OverflowBehavior::kReject: + // Make sure that main and back stage together don't execeed capacity. Remove excess items + // starting with the last item in the back stage. This effectively rejects new items. + while (num_mainstage_ > capacity_) { + at(begin_ + --num_mainstage_) = null_; + } + break; + case OverflowBehavior::kFault: + return false; + // FIXME "Added items to a full queue while using the 'Fault' overflow behavior."; + default: + // FIXME "Invalid parameter" + return false; + } + } + begin_ %= items_.size(); + return true; +} + +} // namespace staging_queue +} // namespace gxf + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue_iterator.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue_iterator.hpp new file mode 100644 index 00000000..3eb14a62 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/gems/staging_queue/staging_queue_iterator.hpp @@ -0,0 +1,107 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_GEMS_STAGING_QUEUE_ITERATOR_HPP +#define NVIDIA_GXF_STD_GEMS_STAGING_QUEUE_ITERATOR_HPP + +#include + +namespace gxf { +namespace staging_queue { + +// A forward iterator for a staging queue. +// +// This type can be used to iterate through the items of the main stage of a staging queue. (It +// could be used to iterate over any part of the ring buffer, but is only used for the main stage.) +// The iterator correctly "wraps around" the ring buffer in case the iterated sequence spans over +// the end of the ring buffer. This iterator could in theory also be used to loop over the range +// multiple times by adding multiples of size to the end index, however it is not used in this +// fashion by the staging queue. +// +// Let's take the example of a staging queue which stores four items (capacity = 2) as depicted in +// the diagram below. An iterator using index=3 would point to the third element. An iterator using +// index=5 would point to the second element in the sequence. If these two iterators would be used +// as begin and end of a range iteration would "wrap around" and iterate over the items A and B. +// +// 0 1 2 3 4 +// # # # # # +// | B | O | O | A | +// | | +// | # begin +// # end +// +// Note that the member functions of this type are part of the standard implementation for a +// forward iterator. Please refer to the C++ standard definition for forward iterators for details. +template +class StagingQueueIterator { + public: + using difference_type = std::ptrdiff_t; + using value_type = T; + using reference = const T&; + using pointer = const T*; + + // Creates an empty (invalid) iterator + StagingQueueIterator() : data_(nullptr), size_(0), index_(0) {} + + // Creates and iterator based on a sequence of items pointed to by 'data' which stores 'size' + // number of items. The given 'index' indicates the position of the element in the underlying + // sequence modulo the length of the sequence. + StagingQueueIterator(pointer data, size_t size, size_t index) + : data_(data), size_(size), index_(index) {} + + StagingQueueIterator(const StagingQueueIterator& other) = default; + StagingQueueIterator& operator=(const StagingQueueIterator& other) = default; + StagingQueueIterator(StagingQueueIterator&& other) = default; + StagingQueueIterator& operator=(StagingQueueIterator&& other) = default; + + ~StagingQueueIterator() = default; + + const StagingQueueIterator& operator++() { + ++index_; + return *this; + } + StagingQueueIterator operator++(int) { return StagingQueueIterator(data_, size_, index_++); } + + reference operator*() const { return data_[index_ % size_]; } + pointer operator->() const { return data_ + (index_ % size_); } + + bool operator==(const StagingQueueIterator& rhs) const { + return data_ == rhs.data_ && size_ == rhs.size_ && index_ == rhs.index_; + } + bool operator!=(const StagingQueueIterator& rhs) const { return !(*this == rhs); } + + private: + // A pointer to the sequence of items to which this iterator refers. + const pointer data_; + + // The length of the sequence pointer to by 'data_'. + const size_t size_; + + // The index of the item in the sequence to which this iterator points. The index is taken modulo + // 'size_' when accessing 'data_'. + size_t index_; +}; + +} // namespace staging_queue +} // namespace gxf + +namespace std { + +template +struct iterator_traits> { + using difference_type = typename gxf::staging_queue::StagingQueueIterator::difference_type; + using value_type = typename gxf::staging_queue::StagingQueueIterator::value_type; + using reference = typename gxf::staging_queue::StagingQueueIterator::reference; + using pointer = typename gxf::staging_queue::StagingQueueIterator::pointer; + using iterator_category = std::forward_iterator_tag; +}; + +} // namespace std + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/memory_buffer.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/memory_buffer.hpp new file mode 100644 index 00000000..06178f4b --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/memory_buffer.hpp @@ -0,0 +1,118 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ + +#ifndef NVIDIA_GXF_STD_MEMORY_BUFFER_HPP_ +#define NVIDIA_GXF_STD_MEMORY_BUFFER_HPP_ + +#include + +#include "core/byte.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/handle.hpp" +#include "gxf/std/allocator.hpp" + +namespace nvidia { +namespace gxf { + +class MemoryBuffer { + public: + MemoryBuffer() = default; + MemoryBuffer(const MemoryBuffer&) = delete; + MemoryBuffer& operator=(const MemoryBuffer&) = delete; + + MemoryBuffer(MemoryBuffer&& other) { *this = std::move(other); } + + MemoryBuffer& operator=(MemoryBuffer&& other) { + size_ = other.size_; + storage_type_ = other.storage_type_; + pointer_ = other.pointer_; + release_func_ = std::move(other.release_func_); + + other.pointer_ = nullptr; + other.release_func_ = nullptr; + + return *this; + } + + // Type of the callback function to release memory passed to the MemoryBuffer + // using the wrapMemory method + using release_function_t = std::function (void* pointer)>; + + Expected freeBuffer() { + if (release_func_ && pointer_) { + const Expected result = release_func_(pointer_); + if (!result) { return ForwardError(result); } + + release_func_ = nullptr; + pointer_ = nullptr; + size_ = 0; + } + + return Success; + } + + ~MemoryBuffer() { freeBuffer(); } + + Expected resize(Handle allocator, uint64_t size, + MemoryStorageType storage_type) { + const auto result = freeBuffer(); + if (!result) { return ForwardError(result); } + + const auto maybe = allocator->allocate(size, storage_type); + if (!maybe) { return ForwardError(maybe); } + + storage_type_ = storage_type; + pointer_ = maybe.value(); + size_ = size; + + release_func_ = [allocator] (void *data) { + return allocator->free(reinterpret_cast(data)); + }; + + return Success; + } + + // Wrap existing memory inside the MemoryBuffer. A callback function of type + // release_function_t may be passed that will be called when the MemoryBuffer + // wants to release the memory. + Expected wrapMemory(void* pointer, uint64_t size, + MemoryStorageType storage_type, + release_function_t release_func) { + const auto result = freeBuffer(); + if (!result) { return ForwardError(result); } + + storage_type_ = storage_type; + pointer_ = reinterpret_cast(pointer); + size_ = size; + release_func_ = release_func; + + return Success; + } + + // The type of memory where the data is stored. + MemoryStorageType storage_type() const { return storage_type_; } + + // Raw pointer to the first byte of elements stored in the buffer. + byte* pointer() const { return pointer_; } + + // Size of buffer contents in bytes + uint64_t size() const { return size_; } + + private: + uint64_t size_ = 0; + byte* pointer_ = nullptr; + MemoryStorageType storage_type_ = MemoryStorageType::kHost; + release_function_t release_func_ = nullptr; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_MEMORY_BUFFER_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/metric.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/metric.hpp new file mode 100644 index 00000000..1fed7f02 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/metric.hpp @@ -0,0 +1,83 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_METRIC_HPP_ +#define NVIDIA_GXF_STD_METRIC_HPP_ + +#include +#include + +#include "gxf/core/component.hpp" +#include "gxf/core/gxf.h" + +namespace nvidia { +namespace gxf { + +// This component holds data a single metric, where a metric is any double-typed value that is +// computed during the execution of a GXF application, and has success criteria defined by a +// lower threshold, an upper threshold, and an aggregation function that specifies how to +// aggregate multiple samples into a final value for the metric. Other components in a GXF app can +// access this component in order to, for example, write the metrics to a file for downstream +// analysis of app execution. +class Metric : public Component { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t deinitialize() override { return GXF_SUCCESS; } + + // Type for the aggregation functor. + using aggregation_function_t = std::function; + + // Records a single sample to the metric and updates aggregated_value_. + Expected record(double sample); + + // Sets a custom function object to use when computing the aggregated_value_ over a set of + // samples. + Expected setAggregationFunction(aggregation_function_t aggregation_function); + + // Checks whether the aggregated_value_ lies within the expected range. + Expected evaluateSuccess(); + + // Public accessor functions for metric data. + Expected getAggregatedValue(); + Expected getLowerThreshold(); + Expected getUpperThreshold(); + + // Public functions to set a few common aggregation functions. + // Computes the mean of a set of samples. + Expected setMeanAggregationFunction(); + // Computes the root-mean-square average over a set of samples. + Expected setRootMeanSquareAggregationFunction(); + // Finds the maximum absolute value over a set of samples. + Expected setAbsMaxAggregationFunction(); + // Finds the maximum over a set of samples. + Expected setMaxAggregationFunction(); + // Finds the minimum over a set of samples. + Expected setMinAggregationFunction(); + // Computes the total sum over a set of samples. + Expected setSumAggregationFunction(); + // Fixes the aggregated value to the last recorded sample. + Expected setFixedAggregationFunction(); + + private: + Parameter aggregation_policy_; + Parameter lower_threshold_; + Parameter upper_threshold_; + + // Current aggregated value across all samples recorded to this metric. Updated on record(). + Expected aggregated_value_ = Unexpected{GXF_UNINITIALIZED_VALUE}; + // Function object that is used to update the metric's aggregated value based on a given sample. + // The function accepts a sample and returns the updated aggregated value. Called on record(). + aggregation_function_t aggregation_function_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_METRIC_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/monitor.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/monitor.hpp new file mode 100644 index 00000000..5f82ceab --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/monitor.hpp @@ -0,0 +1,36 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_MONITOR_HPP_ +#define NVIDIA_GXF_STD_MONITOR_HPP_ + +#include "gxf/core/component.hpp" + +namespace nvidia { +namespace gxf { + +// Interface for monitoring entities during runtime +class Monitor : public Component { + public: + virtual ~Monitor() = default; + + // Callback for after an entity executes + // eid - ID of entity that finished execution + // timestamp - execution timestamp + // code - execution result + virtual gxf_result_t on_execute_abi(gxf_uid_t eid, uint64_t timestamp, gxf_result_t code) = 0; + + // C++ API wrapper + Expected onExecute(gxf_uid_t eid, uint64_t timestamp, gxf_result_t code); +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_MONITOR_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/new_component_allocator.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/new_component_allocator.hpp new file mode 100644 index 00000000..bb68230f --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/new_component_allocator.hpp @@ -0,0 +1,71 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_NEW_COMPONENT_ALLOCATOR_HPP +#define NVIDIA_GXF_STD_NEW_COMPONENT_ALLOCATOR_HPP + +#include "gxf/core/expected.hpp" +#include "gxf/std/component_allocator.hpp" + +namespace nvidia { +namespace gxf { + +// Default implementation for allocating components using new/delete +template +class NewComponentAllocator + : public ComponentAllocator { + public: + ~NewComponentAllocator() override = default; + + gxf_result_t allocate_abi(void** out_pointer) override { + if (out_pointer == nullptr) { + return GXF_ARGUMENT_NULL; + } + *out_pointer = static_cast(new T()); + if (*out_pointer == nullptr) { + return GXF_OUT_OF_MEMORY; + } + return GXF_SUCCESS; + } + + gxf_result_t deallocate_abi(void* pointer) override { + if (pointer == nullptr) { + return GXF_ARGUMENT_NULL; + } + delete static_cast(pointer); + return GXF_SUCCESS; + } +}; + +// Special case of standard component allocator for abstract components +template +class NewComponentAllocator::value>> + : public ComponentAllocator { + public: + ~NewComponentAllocator() override = default; + + gxf_result_t allocate_abi(void** out_pointer) override { + return GXF_FACTORY_ABSTRACT_CLASS; + } + + gxf_result_t deallocate_abi(void* pointer) override { + return GXF_FACTORY_ABSTRACT_CLASS; + } +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser.hpp new file mode 100644 index 00000000..30050390 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser.hpp @@ -0,0 +1,223 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_PARAMETER_PARSER_HPP_ +#define NVIDIA_GXF_STD_PARAMETER_PARSER_HPP_ + +#include +#include +#include +#include + +#include "core/assert.hpp" +#include "core/fixed_vector.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/gxf.h" +#include "gxf/core/handle.hpp" +#include "yaml-cpp/yaml.h" + +namespace nvidia { +namespace gxf { + +template +struct ParameterParser; + +// Parses a parameter from YAML using the default YAML parser. This class can be specialized to +// support custom types. +template +struct ParameterParser { + static Expected Parse(gxf_context_t context, gxf_uid_t component_uid, const char* key, + const YAML::Node& node, const std::string& prefix) { + try { + return node.as(); + } catch (...) { + std::stringstream ss; + ss << node; + GXF_LOG_ERROR("Could not parse parameter '%s' from '%s'", key, ss.str().c_str()); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + } +}; + +// Specialization of ParameterParser for std::string. The full node is serialized to a string, even +// though it might contain sub children. +template <> +struct ParameterParser { + static Expected Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + try { + std::stringstream ss; + ss << node; + return ss.str(); + } catch (...) { + std::stringstream ss; + ss << node; + GXF_LOG_ERROR("Could not parse parameter '%s' from '%s'", key, ss.str().c_str()); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + } +}; + +struct FilePath : public std::string { + FilePath() : std::string() {} + + FilePath(const char* s) : std::string(s) {} + + FilePath(const std::string& str) : std::string(str) {} +}; + +template <> +struct ParameterParser { + static Expected Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + try { + FilePath path; + std::stringstream ss; + ss << node; + path.assign(ss.str()); + return path; + } catch (...) { + std::stringstream ss; + ss << node; + GXF_LOG_ERROR("Could not parse parameter '%s' from '%s'", key, ss.str().c_str()); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + } +}; + +// Specialization of ParameterParser for uint8_t because it is not supported natively by yaml-cpp +template <> +struct ParameterParser { + static Expected Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + try { + return static_cast(node.as()); + } catch (...) { + std::stringstream ss; + ss << node; + GXF_LOG_ERROR("Could not parse parameter '%s' from '%s'", key, ss.str().c_str()); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + } +}; + +// Specialization of ParameterParser for FixedVector with stack allocation. +// Substitutes std::array for safety-critical components. +// TODO(ayusmans): parsing support for FixedVector with heap allocation +template +struct ParameterParser> { + static Expected> Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + if (!node.IsSequence()) { + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + if (node.size() > N) { + GXF_LOG_ERROR("Parameter size (%zu) exceeds vector capacity (%zu)", node.size(), N); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + FixedVector vector; + for (size_t i = 0; i < node.size(); i++) { + const auto maybe = ParameterParser::Parse(context, component_uid, key, node[i], prefix); + if (!maybe) { + return ForwardError(maybe); + } + vector.push_back(std::move(maybe.value())); + } + return vector; + } +}; + +// Specialization of ParameterParser for gxf::Handle. It parses the parameter as a string and +// interprets it as either a component name in the current entity, or as a composed string of the +// form 'entity_name/component_name'. +template +struct ParameterParser> { + static Expected> Parse(gxf_context_t context, gxf_uid_t component_uid, const char* key, + const YAML::Node& node, const std::string& prefix) { + // Parse string from node + std::string tag; + try { + tag = node.as(); + } catch (...) { + std::stringstream ss; + ss << node; + GXF_LOG_ERROR("Could not parse parameter '%s' from '%s'", key, ss.str().c_str()); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + + gxf_uid_t eid; + std::string component_name; + + const size_t pos = tag.find('/'); + if (pos == std::string::npos) { + // Get the entity of this component + const gxf_result_t result_1 = GxfComponentEntity(context, component_uid, &eid); + if (result_1 != GXF_SUCCESS) { + return Unexpected{result_1}; + } + component_name = tag; + } else { + // Split the tag into entity and component name + const std::string entity_name = prefix.empty() ? + tag.substr(0, pos) : (prefix + tag.substr(0, pos)); + component_name = tag.substr(pos + 1); + + // Search for the entity + const gxf_result_t result_1 = GxfEntityFind(context, entity_name.c_str(), &eid); + if (result_1 != GXF_SUCCESS) { + GXF_LOG_ERROR("Could not find entity '%s' while parsing parameter '%s' of component %zu", + entity_name.c_str(), key, component_uid); + return Unexpected{result_1}; + } + } + + // Get the type id of the component we are are looking for. + gxf_tid_t tid; + const gxf_result_t result_2 = GxfComponentTypeId(context, TypenameAsString(), &tid); + if (result_2 != GXF_SUCCESS) { + return Unexpected{result_2}; + } + + // Find the component in the indicated entity + gxf_uid_t cid; + const gxf_result_t result_3 = GxfComponentFind(context, eid, tid, component_name.c_str(), + nullptr, &cid); + if (result_3 != GXF_SUCCESS) { + if (component_name == "") { + GXF_LOG_DEBUG("Using an handle in entity %zu while parsing parameter '%s'" + " of component %zu. This handle must be set to a valid component before graph activation", + eid, key, component_uid); + return Handle::Unspecified(); + } else { + GXF_LOG_WARNING("Could not find component '%s' in entity %zu while parsing parameter '%s' " + "of component %zu", component_name.c_str(), eid, key, + component_uid); + } + + return Unexpected{result_3}; + } + + return Handle::Create(context, cid); + } +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_PARAMETER_PARSER_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser_std.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser_std.hpp new file mode 100644 index 00000000..0eebf301 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_parser_std.hpp @@ -0,0 +1,140 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_PARAMETER_PARSER_STD_HPP_ +#define NVIDIA_GXF_STD_PARAMETER_PARSER_STD_HPP_ + +#include +#include +#include +#include +#include + +#include "yaml-cpp/yaml.h" + +#include "core/assert.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/core/gxf.h" +#include "gxf/core/handle.hpp" +#include "gxf/std/parameter_parser.hpp" +#include "gxf/std/parameter_registrar.hpp" + +namespace nvidia { +namespace gxf { + +// Parses unknown many of known types. +template +struct ParameterParser> { + static Expected> Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + if (!node.IsSequence()) { + const char* component_name = "UNKNOWN"; + GxfParameterGetStr(context, component_uid, kInternalNameParameterKey, &component_name); + GXF_LOG_ERROR("Parameter '%s' in component '%s' must be a vector", key, component_name); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + std::vector result(node.size()); + for (size_t i = 0; i < node.size(); i++) { + const auto maybe = ParameterParser::Parse(context, component_uid, key, node[i], prefix); + if (!maybe) { + return ForwardError(maybe); + } + result[i] = std::move(maybe.value()); + } + return result; + } +}; + +// Parses known many of known types. +template +struct ParameterParser> { + static Expected> Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + if (!node.IsSequence()) { + const char* component_name = "UNKNOWN"; + GxfParameterGetStr(context, component_uid, kInternalNameParameterKey, &component_name); + GXF_LOG_ERROR("Parameter '%s' in component '%s' must be an array", key, component_name); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + if (node.size() != N) { + GXF_LOG_ERROR("Length of parameter array (%zu) does not match required length (%zu)", + node.size(), N); + return Unexpected{GXF_PARAMETER_PARSER_ERROR}; + } + std::array result; + for (size_t i = 0; i < result.size(); i++) { + const auto maybe = ParameterParser::Parse(context, component_uid, key, node[i], prefix); + if (!maybe) { return ForwardError(maybe); } + result[i] = std::move(maybe.value()); + } + return result; + } +}; + +// Template specializations for ParameterInfo to be used during +// parameter registration in the extension + +// Specialized ParameterInfoOverride for parameters of type std::vector +template +struct ParameterInfoOverride> { + Expected apply(ParameterRegistrar* registrar, + ParameterRegistrar::ComponentParameterInfo& info) { + // Get the element info + ParameterInfoOverride override; + ParameterRegistrar::ComponentParameterInfo element_info; + const auto result = override.apply(registrar, element_info); + if (!result) { return ForwardError(result); } + info.type = element_info.type; + info.is_arithmetic = element_info.is_arithmetic; + info.handle_tid = element_info.handle_tid; + + // Fetch the shape of and update it to the current ComponentParameterInfo + for (int32_t i = 0; i < element_info.rank; ++i) { + info.shape[i] = element_info.shape[i]; + } + // A vector increases the rank by 1 and adds shape [-1] to . + info.shape[element_info.rank] = -1; + info.rank = element_info.rank + 1; + + return Success; + } +}; + +// Specialized ParameterInfoOverride for parameters of type std::array +template +struct ParameterInfoOverride> { + Expected apply(ParameterRegistrar* registrar, + ParameterRegistrar::ComponentParameterInfo& info) { + // Get the element info + ParameterInfoOverride override; + ParameterRegistrar::ComponentParameterInfo element_info; + const auto result = override.apply(registrar, element_info); + if (!result) { return ForwardError(result); } + info.type = element_info.type; + info.is_arithmetic = element_info.is_arithmetic; + info.handle_tid = element_info.handle_tid; + + // Fetch the shape of and update it to the current ComponentParameterInfo + for (int32_t i = 0; i < element_info.rank; ++i) { + info.shape[i] = element_info.shape[i]; + } + // An increases the rank by 1 and adds shape [N] to . + info.shape[element_info.rank] = N; + info.rank = element_info.rank + 1; + + return Success; + } +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_PARAMETER_PARSER_STD_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/parameter_registrar.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_registrar.hpp new file mode 100644 index 00000000..bc7c18f4 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_registrar.hpp @@ -0,0 +1,364 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_PARAMETER_REGISTRAR_HPP_ +#define NVIDIA_GXF_STD_PARAMETER_REGISTRAR_HPP_ + +#include +#include +#include // NOLINT +#include +#include +#include +#include + +#include "core/any.hpp" +#include "gxf/core/gxf.h" +#include "gxf/core/handle.hpp" +#include "gxf/core/parameter.hpp" +#include "gxf/std/type_registry.hpp" +namespace nvidia { +namespace gxf { + +// @brief Struct specifying parameters for registering parameter +template +struct ParameterInfo { + // Key used to access the parameter. Required. + const char* key = nullptr; + // Brief description. Optional. + const char* headline = nullptr; + // Detailed description. Optional. + const char* description = nullptr; + // Applicable platform list separated by comma. Optional. + const char* platform_information = nullptr; + + // Default value if not provided otherwise. Not applicable to Handle parameter. Optional. + Expected value_default = Unexpected{GXF_PARAMETER_NOT_INITIALIZED}; + // Minimal value, Maximum value and Minimal step for arithmetic types. Optional. + Expected> value_range = Unexpected{GXF_PARAMETER_NOT_INITIALIZED}; + + // Bit flags about properties like if it is required etc. + gxf_parameter_flags_t flags = GXF_PARAMETER_FLAGS_NONE; + + // Max allowed is rank 8 + static constexpr const int32_t kMaxRank = 8; + // Parameters can be tensors and this value indicates its rank. For a "scalar" rank is 0. + int32_t rank = 0; + // Parameters can be tensors and this is its shape. Only values up to rank must be set. If rank + // is 0 no value must be set. -1 can be used to indicate a dynamic size which is not fixed at + // compile time. + int32_t shape[kMaxRank] = {1}; +}; + +class Component; + +template +struct ParameterTypeTrait { + static constexpr const char* type_name = "(custom)"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_CUSTOM; + static constexpr const bool is_arithmetic = false; +}; + +template +struct ParameterTypeTrait> { + static constexpr const char* type_name = "(handle)"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_HANDLE; + static constexpr const bool is_arithmetic = false; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "Int64"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_INT64; + static constexpr const bool is_arithmetic = true; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "UInt64"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_UINT64; + static constexpr const bool is_arithmetic = true; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "Float64"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_FLOAT64; + static constexpr const bool is_arithmetic = true; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "String"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_STRING; + static constexpr const bool is_arithmetic = false; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "String"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_STRING; + static constexpr const bool is_arithmetic = false; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "Boolean"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_BOOL; + static constexpr const bool is_arithmetic = false; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "Int32"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_INT32; + static constexpr const bool is_arithmetic = true; +}; + +template <> +struct ParameterTypeTrait { + static constexpr const char* type_name = "File"; + static constexpr const gxf_parameter_type_t type = GXF_PARAMETER_TYPE_FILE; + static constexpr const bool is_arithmetic = false; +}; + +// Stores parameters for an GXF application +class ParameterRegistrar { + public: + // Struct to hold information about a single parameter + struct ComponentParameterInfo { + std::string key; + std::string headline; + std::string description; + + std::string platform_information; + + gxf_parameter_type_t type; + gxf_tid_t handle_tid = GxfTidNull(); + bool is_arithmetic; + + gxf_parameter_flags_t flags; + + // params to be accessed only via getDefaultValue(...) + // and getNumericRange(...) apis + std::any default_value; + // Range info as [min, max, step] + std::array value_range; + + int32_t rank = 0; + int32_t shape[ParameterInfo::kMaxRank]; + }; + + // Struct to hold information about all the parameters in a component + struct ComponentInfo { + std::string type_name; + std::vector parameter_keys; + std::unordered_map parameters; + }; + + ParameterRegistrar() = default; + + template + Expected registerComponentParameter(gxf_tid_t tid, const std::string& type_name, + const ParameterInfo& parameter_info); + + // Add's a parameterless component to parameter registrar. These are useful to lookup component + // tid using component type name when parameters of type Handle are being registered + void addParameterlessType(const gxf_tid_t tid, std::string type_name); + + // Check if parameter registrar has a component + bool hasComponent(const gxf_tid_t tid) const; + + // Get the number of parameters in a component + size_t componentParameterCount(const gxf_tid_t tid) const; + + // Get the list of parameter keys in a component + Expected getParameterKeys(const gxf_tid_t tid, const char** keys, size_t& count) const; + + // Check if a component has a parameter + Expected componentHasParameter(const gxf_tid_t tid, const char* key) const; + + // Get the default value of a component + // Dependening on the data type of the parameter, default value has to be + // casted into the data type specifed in gxf_parameter_type_t in gxf.h + Expected getDefaultValue(const gxf_tid_t tid, const char* key) const; + + // Load the numeric range of a parameter into gxf_parameter_info_t + // Dependening on the data type of the parameter, numeric ranges value have to be + // casted into the data type specifed in gxf_parameter_type_t in gxf.h + Expected getNumericRange(const gxf_tid_t tid, const char* key, + gxf_parameter_info_t* info) const; + + // fills the gxf_parameter_info_t struct with the info stored in the parameter registrar + // for that specific component and parameter key + Expected getParameterInfo(const gxf_tid_t tid, const char* key, + gxf_parameter_info_t* info) const; + + // Returns the pointer to ComponentParameterInfo object in ComponentInfo + Expected getComponentParameterInfoPtr(const gxf_tid_t tid, + const char* key) const; + + // Get the tid of a component which has already been registered with the type registry, + // returns Unexpected if component not found + Expected tidFromTypename(std::string type_name) { + for (const auto& cparam : component_parameters) { + if (cparam.second->type_name == type_name) { + return cparam.first; + } + } + GXF_LOG_ERROR("Component type not found %s", type_name.c_str()); + return Unexpected{GXF_ENTITY_COMPONENT_NOT_FOUND}; + } + + private: + // Verifies the info of a new parameter being registered and fills the info + // in the ComponentParameterInfo struct which is returned + Expected registerComponentParameterImpl(gxf_tid_t tid, const std::string& type_name, + ComponentParameterInfo& info); + + // Maintains a map of {tid : ComponentInfo} + // component type name in ComponentInfo is used to look up the corresponding tid when a parameter + // of handle is used for that component + std::map> component_parameters; +}; + +// loads numeric range info from ComponentParameterInfo to gxf_parameter_info_t +template +static bool getNumericRangeImpl(ParameterRegistrar::ComponentParameterInfo* ptr, + gxf_parameter_info_t* info) { + static_assert(ParameterTypeTrait::is_arithmetic); + + if (!ptr || !info) { + return false; + } + + info->numeric_min = nullptr; + info->numeric_max = nullptr; + info->numeric_step = nullptr; + + if (!std::get<0>(ptr->value_range).empty()) { + info->numeric_min = static_cast(std::any_cast(&std::get<0>(ptr->value_range))); + } + if (!std::get<1>(ptr->value_range).empty()) { + info->numeric_max = static_cast(std::any_cast(&std::get<1>(ptr->value_range))); + } + if (!std::get<2>(ptr->value_range).empty()) { + info->numeric_step = static_cast(std::any_cast(&std::get<2>(ptr->value_range))); + } + + return true; +} + +// Provides a customizable step which can be used during parameter registration to modify +// parameter info given to registry before it is written to the parameter info storage. +template +struct ParameterInfoOverride { + Expected apply(ParameterRegistrar* /*registrar*/, + ParameterRegistrar::ComponentParameterInfo& info) { + info.type = ParameterTypeTrait::type; + info.is_arithmetic = ParameterTypeTrait::is_arithmetic; + info.handle_tid = GxfTidNull(); + return Success; + } +}; + +// Specialized ParameterInfoOverride for parameters of type handle +template +struct ParameterInfoOverride> { + Expected apply(ParameterRegistrar* registrar, + ParameterRegistrar::ComponentParameterInfo& info) { + info.type = GXF_PARAMETER_TYPE_HANDLE; + info.is_arithmetic = false; + auto handle = registrar->tidFromTypename(TypenameAsString()); + if (!handle) { return ForwardError(handle); } + info.handle_tid = handle.value(); + return Success; + } +}; + +template +Expected ParameterRegistrar::registerComponentParameter( + gxf_tid_t tid, const std::string& type_name, const ParameterInfo& registrar_info) { + + ComponentParameterInfo info; + + if (registrar_info.key == nullptr) { + return Unexpected{GXF_ARGUMENT_NULL}; + } + info.key = std::string{registrar_info.key}; + + if (registrar_info.headline == nullptr) { + return Unexpected{GXF_ARGUMENT_NULL}; + } + info.headline = std::string{registrar_info.headline}; + + if (registrar_info.description == nullptr) { + return Unexpected{GXF_ARGUMENT_NULL}; + } + info.description = std::string{registrar_info.description}; + + // Handles platform information if present + if (registrar_info.platform_information != nullptr) { + info.platform_information = std::string{registrar_info.platform_information}; + } + + if (registrar_info.value_default) { + info.default_value = *registrar_info.value_default; + } else { + info.default_value.clear(); + } + + if (registrar_info.value_range) { + std::get<0>(info.value_range) = std::get<0>(*registrar_info.value_range); + std::get<1>(info.value_range) = std::get<1>(*registrar_info.value_range); + std::get<2>(info.value_range) = std::get<2>(*registrar_info.value_range); + } else { + std::get<0>(info.value_range).clear(); + std::get<1>(info.value_range).clear(); + std::get<2>(info.value_range).clear(); + } + + info.flags = registrar_info.flags; + + // Set the rank and make sure the shape is correct. + info.rank = registrar_info.rank; + if (info.rank > ParameterInfo::kMaxRank) { + return Unexpected{GXF_ARGUMENT_OUT_OF_RANGE}; + } + + for (int32_t i = 0; i < info.rank; i++) { + info.shape[i] = registrar_info.shape[i]; + } + for (int32_t i = info.rank; i < ParameterInfo::kMaxRank; i++) { + info.shape[i] = 1; + } + + // Apply custom overrides + ParameterInfoOverride custom_override; + const auto result = custom_override.apply(this, info); + if (!result) { + GXF_LOG_ERROR("Parameter Override failed for Component \"%s\" and Parameter \"%s\"", + type_name.c_str(), registrar_info.key); + return result; + } + + // register the parameter + return registerComponentParameterImpl(tid, type_name, info); +} + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_PARAMETER_REGISTRAR_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/parameter_storage.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_storage.hpp new file mode 100644 index 00000000..591fd00c --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/parameter_storage.hpp @@ -0,0 +1,212 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_PARAMETER_STORAGE_HPP_ +#define NVIDIA_GXF_STD_PARAMETER_STORAGE_HPP_ + +#include +#include +#include // NOLINT +#include +#include + +#include "gxf/core/parameter.hpp" + +namespace nvidia { +namespace gxf { + +// Stores all parameters for an GXF application +// +// Parameters are stored in a dictionary style class. For each parameter the actual parameter value +// and various helper classes to query and set parameters are provided. +class ParameterStorage { + public: + ParameterStorage(gxf_context_t context); + + // Registers a parameter with the backend. This is used by components when they register their + // parameter interface to connect parameters in components to the backend. + template + Expected registerParameter(nvidia::gxf::Parameter* frontend, gxf_uid_t uid, + const char* key, const char* headline, const char* description, + Expected default_value, gxf_parameter_flags_t flags) { + if (frontend == nullptr) { return Unexpected{GXF_ARGUMENT_NULL}; } + if (key == nullptr) { return Unexpected{GXF_ARGUMENT_NULL}; } + if (headline == nullptr) { return Unexpected{GXF_ARGUMENT_NULL}; } + if (description == nullptr) { return Unexpected{GXF_ARGUMENT_NULL}; } + + std::unique_lock lock(mutex_); + + auto it = parameters_.find(uid); + if (it == parameters_.end()) { + std::map> tmp; + it = parameters_.insert({uid, std::move(tmp)}).first; + } + + const auto jt = it->second.find(key); + if (jt != it->second.end()) { return Unexpected{GXF_PARAMETER_ALREADY_REGISTERED}; } + + auto backend = std::make_unique>(); + backend->context_ = context_; + backend->uid_ = uid; + backend->flags_ = flags; + backend->is_dynamic_ = false; + backend->key_ = key; + backend->headline_ = headline; + backend->description_ = description; + backend->frontend_ = frontend; + // FIXME(v1) validator + + frontend->connect(backend.get()); + + if (default_value) { + const auto code = backend->set(std::move(*default_value)); + if (!code) { return ForwardError(code); } + backend->writeToFrontend(); + } + + it->second.insert({key, std::move(backend)}).first; + + return Success; + } + + Expected parse(gxf_uid_t uid, const char* key, const YAML::Node& node, + const std::string& prefix); + + // Sets a parameter. If the parameter is not yet present a new dynamic parameter will be created. + // This function fails if a parameter already exists, but with the wrong type. + template + Expected set(gxf_uid_t uid, const char* key, T value) { + std::shared_lock lock(mutex_); + + auto it = parameters_.find(uid); + if (it == parameters_.end()) { + std::map> tmp; + it = parameters_.insert({uid, std::move(tmp)}).first; + } + + auto jt = it->second.find(key); + if (jt == it->second.end()) { + auto ptr = std::make_unique>(); + ptr->context_ = context_; + ptr->uid_ = uid; + ptr->flags_ = GXF_PARAMETER_FLAGS_OPTIONAL | GXF_PARAMETER_FLAGS_DYNAMIC; + ptr->is_dynamic_ = true; + ptr->key_ = key; + ptr->headline_ = key; + ptr->description_ = "N/A"; + jt = it->second.insert({key, std::move(ptr)}).first; + } + + auto* ptr = dynamic_cast*>(jt->second.get()); + if (ptr == nullptr) { return Unexpected{GXF_PARAMETER_INVALID_TYPE}; } + + const auto code = ptr->set(std::move(value)); + if (!code) { return ForwardError(code); } + + ptr->writeToFrontend(); // FIXME(v1) Special treatment for codelet parameters + return Success; + } + + // Gets a parameter + template + Expected get(gxf_uid_t uid, const char* key) const { + std::shared_lock lock(mutex_); + return getValuePointer(uid, key).map([](const T* pointer) { return *pointer; }); + } + + // Sets a string parameter. The storage creates it's own internal copy and does not take ownership + // of the given pointer. + Expected setStr(gxf_uid_t uid, const char* key, const char* value); + + // Gets a string parameter. A pointer to the internal storage is returned whose contents may + // change if a call to setStr happens in the meantime. + Expected getStr(gxf_uid_t uid, const char* key) const; + + // Gets a file path parameter. A pointer to the internal storage is returned whose contents may + // change if a call to setPath happens in the meantime. + Expected getPath(gxf_uid_t uid, const char* key) const; + + // Sets a handle parameter. + Expected setHandle(gxf_uid_t, const char* key, gxf_uid_t value); + + // Gets a handle parameter. + Expected getHandle(gxf_uid_t uid, const char* key) const; + + // Sets a vector of string parameter. The storage creates it's own internal copy and does not take + // ownership of the given pointer. + Expected setStrVector(gxf_uid_t uid, const char* key, const char** value, uint64_t length); + + // Adds the given value to a parameter and returns the result. The parameter is initialized to + // 0 in case it does not exist. + Expected addGetInt64(gxf_uid_t uid, const char* key, int64_t delta); + + // Returns true if all mandatory parameters are available + Expected isAvailable() const; + + // Returns true if all mandatory parameters of a component are available + Expected isAvailable(gxf_uid_t uid) const; + + // Clean up data for specific Entity upon Entity destruction + Expected clearEntityParameters(gxf_uid_t eid); + + private: + friend class Runtime; + + // Finds a parameter and returns a pointer to its value. + template + Expected getValuePointer(gxf_uid_t uid, const char* key) const { + std::shared_lock lock(mutex_); + auto backend = getBackendPointerImpl>(uid, key); + if (!backend) { return ForwardError(backend); } + const auto& maybe = backend.value()->try_get(); + if (!maybe) { return Unexpected{GXF_PARAMETER_NOT_INITIALIZED}; } + return &(*maybe); + } + + // Finds a parameter backend and returns a pointer to it. + template + Expected getBackendPointerImpl(gxf_uid_t uid, const char* key) const { + const auto it = parameters_.find(uid); + if (it == parameters_.end()) { return Unexpected{GXF_PARAMETER_NOT_FOUND}; } + const auto jt = it->second.find(key); + if (jt == it->second.end()) { return Unexpected{GXF_PARAMETER_NOT_FOUND}; } + + const T* ptr = dynamic_cast(jt->second.get()); + if (ptr == nullptr) { return Unexpected{GXF_PARAMETER_INVALID_TYPE}; } + return ptr; + } + + // Finds a parameter backend and returns a pointer to it. + template + Expected getBackendPointerImpl(gxf_uid_t uid, const char* key) { + const auto it = parameters_.find(uid); + if (it == parameters_.end()) { return Unexpected{GXF_PARAMETER_NOT_FOUND}; } + const auto jt = it->second.find(key); + if (jt == it->second.end()) { return Unexpected{GXF_PARAMETER_NOT_FOUND}; } + + T* ptr = dynamic_cast(jt->second.get()); + if (ptr == nullptr) { return Unexpected{GXF_PARAMETER_INVALID_TYPE}; } + return ptr; + } + + mutable std::shared_timed_mutex mutex_; + gxf_context_t context_; + std::map>> parameters_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_PARAMETER_STORAGE_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/queue.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/queue.hpp new file mode 100644 index 00000000..c6c3f6d9 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/queue.hpp @@ -0,0 +1,53 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_QUEUE_HPP +#define NVIDIA_GXF_STD_QUEUE_HPP + +#include "gxf/core/component.hpp" + +namespace nvidia { +namespace gxf { + +// Interface for storing entities in a queue +class Queue : public Component { + public: + virtual ~Queue() = default; + + // Gets the next (oldest) entity in the queue. + virtual gxf_result_t pop_abi(gxf_uid_t* uid) = 0; + + // Adds a new entity to the queue. The receiver takes shared + // ownership of the entity. + virtual gxf_result_t push_abi(gxf_uid_t other) = 0; + + // Peeks the entity at given index on the main stage. + virtual gxf_result_t peek_abi(gxf_uid_t* uid, int32_t index) = 0; + + // The total number of entities the queue can hold. + virtual size_t capacity_abi() = 0; + + // The total number of entities the queue currently holds. + virtual size_t size_abi() = 0; + + Expected pop(); + + Expected push(const Entity& other); + + Expected peek(int32_t index = 0); + + size_t capacity(); + + size_t size(); +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/receiver.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/receiver.hpp new file mode 100644 index 00000000..aea76aa3 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/receiver.hpp @@ -0,0 +1,51 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_RECEIVER_HPP +#define NVIDIA_GXF_STD_RECEIVER_HPP + +#include "gxf/std/queue.hpp" + +namespace nvidia { +namespace gxf { + +// Interface for receiving entities. +class Receiver : public Queue { + public: + // Receives the next entity from the main stage. + virtual gxf_result_t receive_abi(gxf_uid_t* uid) = 0; + + // The total number of entities which have recently arrived but are not yet on the main stage. + virtual size_t back_size_abi() = 0; + + // Peeks into back stage + virtual gxf_result_t peek_back_abi(gxf_uid_t* uid, int32_t index) = 0; + + // Moves entities which recently arrived to the main stage. + virtual gxf_result_t sync_abi() = 0; + + Expected receive(); + + size_t back_size(); + + Expected sync(); + + Expected peekBack(int32_t index = 0); +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_condition.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_condition.hpp new file mode 100644 index 00000000..52717348 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_condition.hpp @@ -0,0 +1,54 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_SCHEDULING_CONDITION_HPP +#define NVIDIA_GXF_STD_SCHEDULING_CONDITION_HPP +#include + +namespace nvidia { +namespace gxf { + +// The type of a scheduling condition +enum class SchedulingConditionType { + // Will never execute again + NEVER = 0, + // Ready to execute now + READY = 1, + // May execute again at some point in the future + WAIT = 2, + // Will execute after a certain known time interval. Negative or zero interval will result in + // immediate execution. + WAIT_TIME = 3, + // Waiting for an event with unknown interval time. Entity will be put in a waiting queue until + // event done notification is signalled + WAIT_EVENT = 4, +}; + +// A condition for which the scheduling term is waiting. +struct SchedulingCondition { + // Describes the type of the condition + SchedulingConditionType type; + // A timestamp needed for certain conditions. Might not be set always. + int64_t target_timestamp; +}; + +// Merges two scheduling conditions with an And-like logic. For example NEVER and READY will result +// in NEVER. +SchedulingCondition AndCombine(SchedulingCondition a, SchedulingCondition b); + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_SCHEDULING_CONDITION_HPP diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_term.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_term.hpp new file mode 100644 index 00000000..fc6bc8ef --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_term.hpp @@ -0,0 +1,54 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_SCHEDULING_TERM_HPP +#define NVIDIA_GXF_STD_SCHEDULING_TERM_HPP + +#include "gxf/core/component.hpp" +#include "gxf/std/scheduling_condition.hpp" + +namespace nvidia { +namespace gxf { + +/// @brief Base class for scheduling terms +/// +/// Scheduling terms are used by a scheduler to determine if codelets in an entity are ready for +/// execution. +class SchedulingTerm : public Component { + public: + virtual ~SchedulingTerm() = default; + + // Get the condition on which the scheduling waits before allowing execution. If the term is + // waiting for a time event 'target_timestamp' will contain the target timestamp. + virtual gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const = 0; + + // Called each time after the entity of this term was executed. + virtual gxf_result_t onExecute_abi(int64_t dt) = 0; + + Expected check(int64_t timestamp) { + SchedulingConditionType status; + int64_t target_timestamp; + const gxf_result_t error = check_abi(timestamp, &status, &target_timestamp); + return ExpectedOrCode(error, SchedulingCondition{status, target_timestamp}); + } + + Expected onExecute(int64_t timestamp) { return ExpectedOrCode(onExecute_abi(timestamp)); } +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_terms.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_terms.hpp new file mode 100644 index 00000000..fbe9d1ff --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/scheduling_terms.hpp @@ -0,0 +1,209 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_SCHEDULING_TERMS_HPP_ +#define NVIDIA_GXF_STD_SCHEDULING_TERMS_HPP_ + +#include +#include +#include + +#include "gxf/core/component.hpp" +#include "gxf/core/handle.hpp" +#include "gxf/std/clock.hpp" +#include "gxf/std/parameter_parser_std.hpp" +#include "gxf/std/receiver.hpp" +#include "gxf/std/scheduling_term.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// A scheduling term which permits execution only after a minium time period has passed since the +// last execution. +class PeriodicSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + // Minimum time which needs to elapse between two executions (in nano seconds). + int64_t recess_period_ns() const { return recess_period_ns_; } + + private: + // Parses given text to return the desired period in nanoseconds. + Expected parseRecessPeriodString(std::string text); + + Parameter recess_period_; + + int64_t recess_period_ns_; + Expected last_run_timestamp_ = Unexpected{GXF_UNINITIALIZED_VALUE}; +}; + +// A scheduling term which permits execution only a limited number of times. +class CountSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + private: + Parameter count_; + + int64_t remaining_; // The remaining number of permitted executions. +}; + +// A component which specifies that an entity shall be executed if the receiver for a given +// transmitter can accept new messages. +class DownstreamReceptiveSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + // The transmitter which needs to be able to publish a message. + Handle transmitter() const { return transmitter_.get(); } + // The receiver which is connected to the transmitter and which needs to have room for messages. + void setReceiver(Handle receiver) { receiver_ = std::move(receiver); } + + private: + Parameter> transmitter_; + Parameter min_size_; + + Handle receiver_; // The receiver connected to the transmitter (if any). +}; + +// A scheduling term which permits execution at a user-specified timestamp. The timestamp is +// specified on the clock provided. +class TargetTimeSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + // Needs to be called to determine how long to wait for the next execution. If it is not called, + // the scheduling condition will stay as WAIT. + gxf_result_t setNextTargetTime(int64_t target_timestamp); + + private: + Parameter> clock_; + + // The timestamp at which the most recent execution cycle began + int64_t last_timestamp_; + // The timestamp at which the next execution cycle is requested to begin + mutable Expected target_timestamp_ = Unexpected{GXF_UNINITIALIZED_VALUE}; + // The timestamp at which the next execution cycle is locked to begin + mutable Expected locked_target_timestamp_ = Unexpected{GXF_UNINITIALIZED_VALUE}; +}; + +// A component which specifies that an entity shall be executed when a queue has at least a certain +// number of elements. +class MessageAvailableSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + private: + // Returns true if the condition imposed by min_size is true. + bool checkMinSize() const; + + // Returns true if the condition imposed by front_stage_max_size is true. + bool checkFrontStageMaxSize() const; + + Parameter> receiver_; + Parameter min_size_; + Parameter front_stage_max_size_; +}; + +// A scheduling term which specifies that an entity can be executed when a list of provided input +// channels combined have at least a given number of messages. +class MultiMessageAvailableSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + private: + Parameter>> receivers_; + Parameter min_size_; +}; + +// A scheduling term which tries to wait for specified number of messages in receiver. +// When the first message in the queue mature after specified delay since arrival it would fire +// regardless. +class ExpiringMessageAvailableSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t timestamp) override; + + private: + Parameter max_batch_size_; + Parameter max_delay_ns_; + Parameter> receiver_; // The receiver to check + Parameter> clock_; +}; + +// A scheduling term which acts as a boolean AND term to control execution of the +// entity +class BooleanSchedulingTerm : public SchedulingTerm { + public: + // Enable entity execution + void enable_tick(); + // Disable entity execution + void disable_tick(); + + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t dt) override; + + private: + bool enable_tick_ = true; +}; + +enum class AsynchronousEventState { + READY = 0, // Init state, first tick is pending + WAIT, // Request to async service yet to be sent, nothing to do but wait + EVENT_WAITING, // Request sent to an async service, pending event done notification + EVENT_DONE, // Event done notification received, entity ready to be ticked + EVENT_NEVER, // Entity does not want to be ticked again, end of execution +}; + +// A scheduling term which waits on an asynchronous event from the codelet which can happen outside +// of the regular tick function. +class AsynchronousSchedulingTerm : public SchedulingTerm { + public: + gxf_result_t initialize() override; + gxf_result_t check_abi(int64_t timestamp, SchedulingConditionType* type, + int64_t* target_timestamp) const override; + gxf_result_t onExecute_abi(int64_t dt) override; + void setEventState(AsynchronousEventState state); + AsynchronousEventState getEventState() const; + + private: + AsynchronousEventState event_state_{AsynchronousEventState::READY}; + mutable std::mutex event_state_mutex_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_SCHEDULING_TERMS_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/system.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/system.hpp new file mode 100644 index 00000000..cba349f1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/system.hpp @@ -0,0 +1,51 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_CORE_SYSTEM_HPP +#define NVIDIA_GXF_CORE_SYSTEM_HPP + +#include "gxf/core/component.hpp" + +namespace nvidia { +namespace gxf { + +// Component interface for systems which are run as part of the application run cycle. +class System : public Component { + public: + virtual ~System() = default; + + virtual gxf_result_t offer_abi(gxf_uid_t eid) = 0; + virtual gxf_result_t runAsync_abi() = 0; + virtual gxf_result_t stop_abi() = 0; + virtual gxf_result_t wait_abi() = 0; + virtual gxf_result_t event_notify_abi(gxf_uid_t eid) = 0; + + // These apis will be made pure virtual interfaces post V2.3 to replace offer_abi() interface + virtual gxf_result_t schedule_abi(gxf_uid_t eid) { return GXF_SUCCESS; } + virtual gxf_result_t unschedule_abi(gxf_uid_t eid) { return GXF_SUCCESS; } + + Expected offer(const Entity& entity); + Expected schedule(const Entity& entity); + Expected unschedule(const Entity& entity); + Expected runAsync(); + Expected stop(); + Expected wait(); + Expected event_notify(gxf_uid_t eid); +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/tensor.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/tensor.hpp new file mode 100644 index 00000000..a384b9d1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/tensor.hpp @@ -0,0 +1,311 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#pragma once + +#include +#include +#include +#include +#include + +#include "core/byte.hpp" +#include "gxf/core/component.hpp" +#include "gxf/core/expected.hpp" +#include "gxf/std/allocator.hpp" +#include "gxf/std/memory_buffer.hpp" + +namespace nvidia { +namespace gxf { + +// Type of parameters and other primitives +enum class PrimitiveType { + kCustom, + kInt8, + kUnsigned8, + kInt16, + kUnsigned16, + kInt32, + kUnsigned32, + kInt64, + kUnsigned64, + kFloat32, + kFloat64, +}; + +// Returns the size of each element of specific PrimitiveType as number of bytes. +// Returns 0 for kCustom. +uint64_t PrimitiveTypeSize(PrimitiveType primitive); + +template +struct PrimitiveTypeTraits; + +#define GXF_PRIMITIVE_TYPE_TRAITS(TYPE, ENUM) \ + template <> struct PrimitiveTypeTraits { \ + static constexpr PrimitiveType value = PrimitiveType::ENUM; \ + static constexpr size_t size = sizeof(TYPE); \ + }; \ + +GXF_PRIMITIVE_TYPE_TRAITS(int8_t, kInt8); +GXF_PRIMITIVE_TYPE_TRAITS(uint8_t, kUnsigned8); +GXF_PRIMITIVE_TYPE_TRAITS(int16_t, kInt16); +GXF_PRIMITIVE_TYPE_TRAITS(uint16_t, kUnsigned16); +GXF_PRIMITIVE_TYPE_TRAITS(int32_t, kInt32); +GXF_PRIMITIVE_TYPE_TRAITS(uint32_t, kUnsigned32); +GXF_PRIMITIVE_TYPE_TRAITS(int64_t, kInt64); +GXF_PRIMITIVE_TYPE_TRAITS(uint64_t, kUnsigned64); +GXF_PRIMITIVE_TYPE_TRAITS(float, kFloat32); +GXF_PRIMITIVE_TYPE_TRAITS(double, kFloat64); + +// Type to hold the shape of a tensor +class Shape { + public: + // The maximum possible rank of the tensor. + static constexpr uint32_t kMaxRank = 8; + + // Intializes an empty rank-0 tensor. + Shape() : rank_(0) {} + + // Initializes a shape object with the given dimensions. + Shape(std::initializer_list dimensions) + : rank_(0) { + for (int32_t dimension : dimensions) { + if (rank_ == kMaxRank) { + return; // FIXME(v1) + } + dimensions_[rank_++] = dimension; + } + } + + // Creates shape from array + Shape(const std::array& dims, uint32_t rank) + : rank_(rank), dimensions_(dims) { + } + + // Creates shape from array with correct rank + template + Shape(const std::array& dims) : rank_(N) { + static_assert(N < kMaxRank, "Invalid rank"); + for (size_t i = 0; i < N; i++) { + dimensions_[i] = dims[i]; + } + } + + // The rank of the tensor + uint32_t rank() const { return rank_; } + + // The total number of elements in the tensor. Note: this is not the same as the number of bytes + // required in memory. + uint64_t size() const { + uint64_t element_count = 1; + for (size_t i = 0; i < rank_; i++) { + element_count *= dimensions_[i]; + } + return rank_ == 0 ? 0 : element_count; + } + + // Gets the i-th dimension of the tensor. + // Special cases: + // If the rank is 0 the function always returns 0. + // If 'index' is greater or equal than the rank the function returns 1. + int32_t dimension(uint32_t index) const { + if (rank_ == 0) { + return 0; + } else if (index >= rank_) { + return 1; + } else { + return dimensions_[index]; + } + } + + bool operator== (const Shape& other) const { + if (rank_ != other.rank_) { return false; } + for (uint32_t i = 0; i < rank_; ++i) { + if (dimensions_[i] != other.dimensions_[i]) { return false; } + } + return true; + } + + bool operator!= (const Shape& other) const { + return !(*this == other); + } + + // Check whether shape is valid + bool valid() const { + for (uint32_t i = 0; i < rank_; ++i) { + if (dimensions_[i] <= 0) { return false; } + } + return true; + } + + private: + uint32_t rank_ = 0; + std::array dimensions_; +}; + +// A component which holds a single tensor. Multiple tensors can be added to one +// entity to create a map of tensors. The component name can be used as key. +class Tensor { + public: + typedef std::array stride_array_t; + + Tensor() = default; + + ~Tensor() { + memory_buffer_.freeBuffer(); // FIXME(V2) error code? + } + + Tensor(const Tensor&) = delete; + + Tensor(Tensor&& other) { + *this = std::move(other); + } + + Tensor& operator=(const Tensor&) = delete; + + Tensor& operator=(Tensor&& other) { + shape_ = other.shape_; + element_count_ = other.element_count_; + element_type_ = other.element_type_; + bytes_per_element_ = other.bytes_per_element_; + strides_ = std::move(other.strides_); + memory_buffer_ = std::move(other.memory_buffer_); + + return *this; + } + + // The type of memory where the tensor data is stored. + MemoryStorageType storage_type() const { return memory_buffer_.storage_type(); } + + // The shape of the dimensions holds the rank and the dimensions. + const Shape& shape() const { return shape_; } + + // The rank of the tensor. + uint32_t rank() const { return shape_.rank(); } + + // The scalar type of elements stored in the tensor + PrimitiveType element_type() const { return element_type_; } + + // Number of bytes stored per element + uint64_t bytes_per_element() const { return bytes_per_element_; } + + // Total number of elements stored in the tensor. + uint64_t element_count() const { return element_count_; } + + // Size of tensor contents in bytes + size_t size() const { return memory_buffer_.size(); } + + // Raw pointer to the first byte of elements stored in the tensor. + byte* pointer() const { return memory_buffer_.pointer(); } + + // Gets a pointer to the first element stored in this tensor. Requested type must match the + // tensor element type. + template + Expected data() { + if (element_type_ != PrimitiveType::kCustom && PrimitiveTypeTraits::value != element_type_) { + return Unexpected{GXF_INVALID_DATA_FORMAT}; + } + return reinterpret_cast(memory_buffer_.pointer()); + } + + // Gets a pointer to the first element stored in this tensor. Requested type must match the + // tensor element type. + template + Expected data() const { + if (element_type_ != PrimitiveType::kCustom && PrimitiveTypeTraits::value != element_type_) { + return Unexpected{GXF_INVALID_DATA_FORMAT}; + } + return reinterpret_cast(memory_buffer_.pointer()); + } + + // Changes the shape and type of the tensor. Uses a primitive type and dense memory layot. + // Memory will be allocated with the given allocator. + template + Expected reshape(const Shape& shape, MemoryStorageType storage_type, + Handle allocator) { + return reshapeCustom(shape, PrimitiveTypeTraits::value, PrimitiveTypeTraits::size, + Unexpected{GXF_UNINITIALIZED_VALUE}, storage_type, allocator); + } + // Changes the shape and type of the tensor. Memory will be allocated with the given allocator + // strides: The number of bytes that each slide takes for each dimension (alignment). + // Use ComputeStrides() to calculate it. + Expected reshapeCustom(const Shape& shape, + PrimitiveType element_type, uint64_t bytes_per_element, + Expected strides, + MemoryStorageType storage_type, Handle allocator); + + // Type of the callback function to release memory passed to the tensor using the + // wrapMemory method + using release_function_t = std::function (void* pointer)>; + + // Wrap existing memory inside the tensor. A callback function of type release_function_t + // may be passed that will be called when the Tensor wants to release the memory. + Expected wrapMemory(const Shape& shape, + PrimitiveType element_type, uint64_t bytes_per_element, + Expected strides, + MemoryStorageType storage_type, void* pointer, + release_function_t release_func); + + // The size of data in bytes + uint64_t bytes_size() { return shape_.dimension(0) * strides_[0]; } + + // The stride of specified rank in bytes + uint64_t stride(uint32_t index) const { + if (index >= shape_.rank()) { + return 0; + } + return strides_[index]; + } + + private: + Shape shape_; + uint64_t element_count_ = 0; + PrimitiveType element_type_ = PrimitiveType::kUnsigned8; + uint64_t bytes_per_element_ = 1; + stride_array_t strides_; + MemoryBuffer memory_buffer_; +}; + +// Helper function to compute strides from Tensor shape, element size and non-trivial +// alignment step size for row dimension. +// The third rank from the end is assumed to be the row dimension. +Expected ComputeRowStrides(const Shape& shape, uint32_t row_step_size, + const uint32_t bytes_per_element); + +// Helper function to compute trivial strides from Tensor shape and element size +Tensor::stride_array_t ComputeTrivialStrides(const Shape& shape, const uint32_t bytes_per_element); + +// Helper function to compute strides from steps (minimal number of bytes per slice on each rank) +Tensor::stride_array_t ComputeStrides(const Shape& shape, + const Tensor::stride_array_t& stride_steps); + +// Type to description a tensor used by 'CreateTensorMap' +struct TensorDescription { + std::string name; + MemoryStorageType storage_type; + Shape shape; + PrimitiveType element_type; + uint64_t bytes_per_element; + // array providing number of bytes for each slice on each rank + Expected strides = Unexpected{GXF_UNINITIALIZED_VALUE}; +}; + +// Creates a new entity with a collection of named tensors +Expected CreateTensorMap(gxf_context_t context, Handle pool, + std::initializer_list descriptions, + bool activate = true); + +} // namespace gxf +} // namespace nvidia diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/timestamp.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/timestamp.hpp new file mode 100644 index 00000000..45387147 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/timestamp.hpp @@ -0,0 +1,31 @@ +/* +Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_STD_TIMESTAMP_HPP +#define NVIDIA_GXF_STD_TIMESTAMP_HPP + +#include + +namespace nvidia { +namespace gxf { + +// Contains timing information for the data in a message. All times are relative to the global GXF +// clock and in nanoseconds. +struct Timestamp { + // The timestamp in nanoseconds at which the message was published into the system. + int64_t pubtime; + // The timestamp in nanoseconds at the message was acquired. This usually refers to the timestamp + // of the original sensor data which created the message. + int64_t acqtime; +}; + +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_STD_TIMESTAMP_HPP diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/transmitter.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/transmitter.hpp new file mode 100644 index 00000000..a2b36507 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/transmitter.hpp @@ -0,0 +1,49 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_TRANSMITTER_HPP +#define NVIDIA_GXF_STD_TRANSMITTER_HPP + +#include "gxf/std/queue.hpp" + +namespace nvidia { +namespace gxf { + +// Interface for publishing entities. +class Transmitter : public Queue { + public: + // Publishes an entity + virtual gxf_result_t publish_abi(gxf_uid_t uid) = 0; + + // The total number of entities which have previously been published and were moved out of the + // main stage. + virtual size_t back_size_abi() = 0; + + // Moves entities which were published recently out of the main stage. + virtual gxf_result_t sync_abi() = 0; + + Expected publish(const Entity& other); + + Expected publish(Entity& other, const int64_t acq_timestamp); + + size_t back_size(); + + Expected sync(); +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/std/type_registry.hpp b/isaac_ros_nvengine/gxf/include/gxf/std/type_registry.hpp new file mode 100644 index 00000000..ea1d97e3 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/std/type_registry.hpp @@ -0,0 +1,52 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +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. +*/ +#ifndef NVIDIA_GXF_STD_TYPE_REGISTRY_HPP +#define NVIDIA_GXF_STD_TYPE_REGISTRY_HPP + +#include +#include +#include // NOLINT +#include + +#include "gxf/core/expected.hpp" + +namespace nvidia { +namespace gxf { + +// A type registry which maps a C++ type to it's name and which can be used to +// track base classes. +class TypeRegistry { + public: + Expected add(gxf_tid_t tid, const char* component_type_name); + + Expected add_base(const char* component_type_name, const char* base_type_name); + + Expected id_from_name(const char* component_type_name) const; + + bool is_base(gxf_tid_t derived, gxf_tid_t base) const; + + Expected name(gxf_tid_t tid) const; + + private: + std::map tids_; + std::map> bases_; + mutable std::shared_timed_mutex mutex_; +}; + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/LICENSE b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/LICENSE new file mode 100644 index 00000000..c8e7adf8 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/LICENSE @@ -0,0 +1,13 @@ +################################################################################ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA Corporation and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA Corporation is strictly prohibited. +# +################################################################################ + + +<<< PLACEHOLDER >>> \ No newline at end of file diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/entity_monitor.hpp b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/entity_monitor.hpp new file mode 100644 index 00000000..4b6a0dbc --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/entity_monitor.hpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_TEST_EXTENSIONS_ENTITY_MONITOR_HPP_ +#define NVIDIA_GXF_TEST_EXTENSIONS_ENTITY_MONITOR_HPP_ + +#include "gxf/std/monitor.hpp" + +namespace nvidia { +namespace gxf { +namespace test { + +// Monitors entity execution during runtime and logs status to console +class EntityMonitor : public Monitor { + public: + gxf_result_t on_execute_abi(gxf_uid_t eid, uint64_t timestamp, gxf_result_t code) override; +}; + +} // namespace test +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_TEST_EXTENSIONS_ENTITY_MONITOR_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_comparator.hpp b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_comparator.hpp new file mode 100644 index 00000000..c9639947 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_comparator.hpp @@ -0,0 +1,84 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_TEST_EXTENSIONS_TENSOR_COMPARATOR_HPP +#define NVIDIA_GXF_TEST_EXTENSIONS_TENSOR_COMPARATOR_HPP + +#include + +#include "gxf/std/codelet.hpp" +#include "gxf/std/receiver.hpp" + +namespace nvidia { +namespace gxf { +namespace test { + +enum struct CompareTimestamp { + kPubtimeOnly = 0, + kAcqtimeOnly = 1, + kPubtimeAndAcqtime = 2, + kNone = 3, +}; + + +// Compares two tensor messages for equality +class TensorComparator : public Codelet { + public: + TensorComparator() = default; + ~TensorComparator() = default; + + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override { return GXF_SUCCESS; } + gxf_result_t deinitialize() override { return GXF_SUCCESS; } + + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + // Expected message + Parameter> expected_; + // Actual message + Parameter> actual_; + + // Timestamp + Parameter compare_timestamp_; +}; + +} // namespace test + + +// Custom parameter parser for CompareTimestamp +template <> +struct ParameterParser { + static Expected Parse(gxf_context_t context, gxf_uid_t component_uid, + const char* key, const YAML::Node& node, + const std::string& prefix) { + const std::string value = node.as(); + if (strcmp(value.c_str(), "PubtimeOnly") == 0) { + return test::CompareTimestamp::kPubtimeOnly; + } + if (strcmp(value.c_str(), "AcqtimeOnly") == 0) { + return test::CompareTimestamp::kAcqtimeOnly; + } + if (strcmp(value.c_str(), "PubtimeAndAcqtime") == 0) { + return test::CompareTimestamp::kPubtimeAndAcqtime; + } + if (strcmp(value.c_str(), "None") == 0) { + return test::CompareTimestamp::kNone; + } + return nvidia::gxf::Unexpected{GXF_ARGUMENT_OUT_OF_RANGE}; + } +}; + + +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_generator.hpp b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_generator.hpp new file mode 100644 index 00000000..b7044f22 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/tensor_generator.hpp @@ -0,0 +1,62 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_TEST_EXTENSIONS_TENSOR_GENERATOR_HPP_ +#define NVIDIA_GXF_TEST_EXTENSIONS_TENSOR_GENERATOR_HPP_ + +#include +#include +#include + +#include "gxf/std/allocator.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { +namespace test { + +// Creates a random tensor message with a timestamp +class TensorGenerator : public Codelet { + public: + // Type for tensor contents + using DataType = float; + + gxf_result_t registerInterface(Registrar* registrar) override; + gxf_result_t initialize() override { return GXF_SUCCESS; } + gxf_result_t deinitialize() override { return GXF_SUCCESS; } + + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t tick() override; + gxf_result_t stop() override { return GXF_SUCCESS; } + + private: + // Output message + Parameter> output_; + // Memory allocator + Parameter> allocator_; + // Tensor shape + Parameter> shape_; + // Tensor storage type + Parameter storage_type_; + // Flag to enable timestamps + Parameter enable_timestamps_; + // Name of the tensor in the generated message + Parameter tensor_name_; + // Name of the timestamp in the generated message + Parameter timestamp_name_; + // Random number generator + std::default_random_engine generator_; +}; + +} // namespace test +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_TEST_EXTENSIONS_TENSOR_GENERATOR_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_helpers.hpp b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_helpers.hpp new file mode 100644 index 00000000..fefe3703 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_helpers.hpp @@ -0,0 +1,1004 @@ +/* +Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_TEST_EXTENSIONS_TEST_HELPERS_HPP +#define NVIDIA_GXF_TEST_EXTENSIONS_TEST_HELPERS_HPP + +#include + +#include +#include +#include +#include +#include +#include + +#include "core/logger.hpp" +#include "gxf/core/component.hpp" +#include "gxf/core/entity.hpp" +#include "gxf/std/allocator.hpp" +#include "gxf/std/clock.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/receiver.hpp" +#include "gxf/std/scheduling_terms.hpp" +#include "gxf/std/tensor.hpp" +#include "gxf/std/timestamp.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { +namespace test { + +// Tests that the component has certain parameters set to correct values +class ParameterTest : public Component { + public: + gxf_result_t initialize() override { + if (fact_ != true) return GXF_FAILURE; + if (rumor_ != false) return GXF_FAILURE; + if (forty_two_ != 42) return GXF_FAILURE; + if (minus_one_ != -1) return GXF_FAILURE; + if (some_text_.get() != std::string("hello")) return GXF_FAILURE; + constexpr const char* expected_more = + "- a: st\n b: ee\n- c: an\n d: en\n- e:\n - f: figy\n g: g"; + if (more_.get() != std::string(expected_more)) return GXF_FAILURE; + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(fact_, "fact"); + result &= registrar->parameter(rumor_, "rumor"); + result &= registrar->parameter(forty_two_, "forty_two"); + result &= registrar->parameter(minus_one_, "minus_one"); + result &= registrar->parameter(some_text_, "some_text"); + result &= registrar->parameter(more_, "more"); + return ToResultCode(result); + } + + private: + Parameter fact_; + Parameter rumor_; + Parameter forty_two_; + Parameter minus_one_; + Parameter some_text_; + Parameter more_; +}; + +// Tests that the codelet was stepped a certain number of times. +class StepCount : public Codelet { + public: + gxf_result_t initialize() override { + is_initialized_ = true; + count_start_ = 0; + count_tick_ = 0; + count_stop_ = 0; + return GXF_SUCCESS; + } + + gxf_result_t start() override { + if (use_assert_) { + GXF_ASSERT(is_initialized_, "not initialized"); + } else { + if (!is_initialized_) return GXF_CONTRACT_INVALID_SEQUENCE; + } + count_start_++; + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + if (use_assert_) { + GXF_ASSERT_GT(count_start_, 0); + } else { + if (count_start_ == 0) return GXF_CONTRACT_INVALID_SEQUENCE; + } + count_tick_++; + return GXF_SUCCESS; + } + + gxf_result_t stop() override { + if (use_assert_) { + GXF_ASSERT_EQ(count_start_, count_stop_ + 1); + } else { + if (count_start_ != count_stop_ + 1) return GXF_CONTRACT_INVALID_SEQUENCE; + } + count_stop_++; + return GXF_SUCCESS; + } + + gxf_result_t deinitialize() override { + if (use_assert_) { + GXF_ASSERT(is_initialized_, "not initialized"); + GXF_ASSERT_EQ(count_start_, expected_start_count_.get()); + GXF_ASSERT_EQ(count_tick_, expected_count_.get()); + GXF_ASSERT_EQ(count_start_, count_stop_); + } else { + if (!is_initialized_) return GXF_CONTRACT_INVALID_SEQUENCE; + if (count_start_ != expected_start_count_) return GXF_FAILURE; + if (count_tick_ != expected_count_) return GXF_FAILURE; + if (count_start_ != count_stop_) return GXF_CONTRACT_INVALID_SEQUENCE; + } + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(use_assert_, "use_assert", "Use ASSERT", + "If enabled the codelet " + "will assert when test conditions are not true", + true); + result &= registrar->parameter(expected_start_count_, "expected_start_count", "", "", 1UL); + result &= registrar->parameter(expected_count_, "expected_count"); + return ToResultCode(result); + } + + private: + Parameter use_assert_; + Parameter expected_start_count_; + Parameter expected_count_; + + bool is_initialized_ = false; + uint64_t count_start_; + uint64_t count_tick_; + uint64_t count_stop_; +}; + +// Sends an entity +class PingTx : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + auto message = Entity::New(context()); + if (!message) { + GXF_LOG_ERROR("Failure creating message entity."); + return message.error(); + } + auto maybe_clock = clock_.try_get(); + int64_t now; + if (maybe_clock) { + now = maybe_clock.value()->timestamp(); + } else { + now = 0; + } + auto result = signal_->publish(message.value(), now); + return ToResultCode(message); + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(clock_, "clock", "Clock", "Clock for Timestamp", + Registrar::NoDefaultParameter(), GXF_PARAMETER_FLAGS_OPTIONAL); + return ToResultCode(result); + } + + Parameter> signal_; + Parameter> clock_; +}; + +// Sends a ping after a user-defined delay. If the offset clock parameter is set, an offset is +// added to the acqtime and pubtime before publishing. +class ScheduledPingTx : public Codelet { + public: + gxf_result_t start() override { + // Set the target time so that we tick + scheduling_term_->setNextTargetTime(execution_clock_->timestamp()); + + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + auto message = Entity::New(context()); + if (!message) return GXF_FAILURE; + + // Compute the timestamp when the codelet should be executed next + const int64_t target_timestamp = execution_clock_->timestamp() + delay_; + scheduling_term_->setNextTargetTime(target_timestamp); + + // Add a timestamp field to the ping message with acquisition and publishing times of the ping + auto timestamp = message.value().add("timestamp"); + if (!timestamp) { + return ToResultCode(timestamp); + } + timestamp.value()->acqtime = target_timestamp; + timestamp.value()->pubtime = target_timestamp; + + // If an offset clock is specified add the offset time + const auto& maybe_offset_clock = offset_clock_.try_get(); + if (maybe_offset_clock) { + timestamp.value()->acqtime = maybe_offset_clock.value()->timestamp() + target_timestamp; + timestamp.value()->pubtime = maybe_offset_clock.value()->timestamp() + target_timestamp; + } + const auto result = signal_->publish(std::move(message.value())); + return ToResultCode(message); + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(delay_, "delay"); + result &= registrar->parameter(execution_clock_, "execution_clock"); + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(scheduling_term_, "scheduling_term"); + result &= registrar->parameter(offset_clock_, "offset_clock", "", "", + Registrar::NoDefaultParameter(), GXF_PARAMETER_FLAGS_OPTIONAL); + return ToResultCode(result); + } + Parameter delay_; + Parameter> execution_clock_; + Parameter> offset_clock_; + Parameter> signal_; + Parameter> scheduling_term_; +}; + +// Sends an entity asynchronously +// Uses the AsynchronousSchedulingTerm to asynchronously ping the gxf context +// that it is ready to send a new message. Sends at max "count" number of messages. +class AsyncPingTx : public Codelet { + public: + void async_ping() { + GXF_LOG_INFO("Async ping thread entering."); + while (true) { + if (should_stop_) { + GXF_LOG_INFO("Async ping thread exiting."); + return; + } + + std::this_thread::sleep_for(std::chrono::milliseconds(delay_)); + + if (scheduling_term_->getEventState() == AsynchronousEventState::EVENT_WAITING) { + scheduling_term_->setEventState(AsynchronousEventState::EVENT_DONE); + } + } + } + + gxf_result_t start() override { + async_thread_ = std::thread([this] { async_ping(); }); + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + auto message = Entity::New(context()); + if (!message) { + GXF_LOG_ERROR("Failure creating message entity."); + return message.error(); + } + + ++tick_count_; + if (tick_count_ == count_) { + // Reached max count of ticks + scheduling_term_->setEventState(AsynchronousEventState::EVENT_NEVER); + } else { + scheduling_term_->setEventState(AsynchronousEventState::EVENT_WAITING); + } + const auto result = signal_->publish(std::move(message.value())); + return ToResultCode(message); + } + + gxf_result_t stop() override { + should_stop_ = true; + async_thread_.join(); + + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(delay_, "delay", "Ping delay in ms", "", 10L); + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(count_, "count", "Ping count", "", 0UL); + result &= registrar->parameter(scheduling_term_, "scheduling_term"); + return ToResultCode(result); + } + + private: + std::atomic tick_count_{0}; + std::atomic should_stop_{false}; + std::thread async_thread_; + Parameter delay_; + Parameter> signal_; + Parameter> scheduling_term_; + Parameter count_; +}; + +// Receives an entity +class PingRx : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + auto message = signal_->receive(); + if (!message || message.value().is_null()) { + return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; + } + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(signal_, "signal"); + return ToResultCode(result); + } + + Parameter> signal_; +}; + +// Receives an entity asynchronously +// Uses the AsynchronousSchedulingTerm to asynchronously ping the gxf context +// that it is ready to send a new message. +class AsyncPingRx : public Codelet { + public: + void async_ping() { + GXF_LOG_INFO("Async ping thread entering."); + while (true) { + if (should_stop_) { + GXF_LOG_INFO("Async ping thread exiting."); + return; + } + + std::this_thread::sleep_for(std::chrono::milliseconds(delay_)); + if (scheduling_term_->getEventState() == AsynchronousEventState::EVENT_WAITING) { + scheduling_term_->setEventState(AsynchronousEventState::EVENT_DONE); + } + } + } + + gxf_result_t start() override { + async_thread_ = std::thread([this] { async_ping(); }); + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + size_t size = signal_->size(); + if (size > 0) { + auto message = signal_->receive(); + if (!message || message.value().is_null()) { + return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; + } + scheduling_term_->setEventState(AsynchronousEventState::EVENT_WAITING); + } else { + GXF_LOG_DEBUG("No messages to read from receiver queue!"); + } + return GXF_SUCCESS; + } + + gxf_result_t stop() override { + should_stop_ = true; + async_thread_.join(); + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(delay_, "delay", "Ping delay in ms", "", 10L); + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(scheduling_term_, "scheduling_term"); + return ToResultCode(result); + } + + std::atomic should_stop_{false}; + std::thread async_thread_; + Parameter delay_; + Parameter> scheduling_term_; + Parameter> signal_; +}; + +// Receives an entity +class PingPollRx : public Codelet { + public: + gxf_result_t start() override { + counter_ = 0; + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + auto message = signal_->receive(); + if (message && !message.value().is_null()) { + counter_++; + } + return GXF_SUCCESS; + } + + gxf_result_t stop() override { + if (counter_ != expected_counter_) { + GXF_LOG_ERROR("counter does not match: %lld vs %lld", counter_, expected_counter_); + return GXF_FAILURE; + } + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(expected_counter_, "expected_counter"); + return ToResultCode(result); + } + + Parameter> signal_; + Parameter expected_counter_; + uint64_t counter_ = 0; +}; + +// Receives an entity in specified batch size +class PingBatchRx : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + for (int64_t i = 0; i < batch_size_; i++) { + auto message = signal_->receive(); + if (assert_full_batch_ && (!message || message.value().is_null())) { + return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; + } + } + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(batch_size_, "batch_size"); + result &= registrar->parameter(assert_full_batch_, "assert_full_batch", "Assert Full Batch", + "Assert if the batch is not fully populated.", true); + return ToResultCode(result); + } + + Parameter> signal_; + Parameter batch_size_; + Parameter assert_full_batch_; +}; + +// Generates interger and fibonacci messages +class Generator : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + const Expected msg1 = createIntegerMessage(); + if (!msg1) return msg1.error(); + integers_->publish(msg1.value()); + + const Expected msg2 = createFibonacciMessage(); + if (!msg1) return msg1.error(); + fibonacci_->publish(msg2.value()); + + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(integers_, "integers", "Name of 'integers' channel", ""); + result &= registrar->parameter(fibonacci_, "fibonacci", "Name of 'fibonacci' channel", ""); + result &= registrar->parameter(pool_, "pool", "Pool", ""); + return ToResultCode(result); + } + + private: + Expected createIntegerMessage() { + Expected message = + CreateTensorMap(context(), pool_, + {{"positive", MemoryStorageType::kHost, {2, 3, 4}, PrimitiveType::kInt32}, + {"negative", MemoryStorageType::kHost, {2, 3, 4}, PrimitiveType::kInt32}}); + if (!message) return ForwardError(message); + + auto positive = message.value().get("positive"); + if (!positive) return ForwardError(positive); + Expected maybe_ptr1 = positive.value()->data(); + if (!maybe_ptr1) return ForwardError(maybe_ptr1); + int32_t* ptr1 = maybe_ptr1.value(); + for (int i = 0; i < 24; i++) { + ptr1[i] = i; + } + + auto negative = message.value().get("negative"); + if (!negative) return ForwardError(negative); + Expected maybe_ptr2 = negative.value()->data(); + if (!maybe_ptr2) return ForwardError(maybe_ptr2); + int32_t* ptr2 = maybe_ptr2.value(); + for (int i = 0; i < 24; i++) { + ptr2[i] = -i; + } + + return message; + } + + Expected createFibonacciMessage() { + Expected message = CreateTensorMap( + context(), pool_, {{"fibonacci", MemoryStorageType::kHost, {8}, PrimitiveType::kFloat32}}); + if (!message) return ForwardError(message); + + auto fibonacci = message.value().get("fibonacci"); + if (!fibonacci) return ForwardError(fibonacci); + Expected maybe_ptr = fibonacci.value()->data(); + if (!maybe_ptr) return ForwardError(maybe_ptr); + float* ptr = maybe_ptr.value(); + ptr[0] = 0; + ptr[1] = 1; + for (int i = 2; i < 8; i++) { + ptr[i] = static_cast(ptr[i - 1] + ptr[i - 2]); + } + + return message; + } + + Parameter> integers_; + Parameter> fibonacci_; + Parameter> pool_; +}; + +// Forwards incoming messages at the receiver to the transmitter +class Forward : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + // in_->receive() + // .and_then([] {}) + auto message = in_->receive(); + if (!message) { + return message.error(); + } + out_->publish(message.value()); + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(in_, "in"); + result &= registrar->parameter(out_, "out"); + return ToResultCode(result); + } + + private: + Parameter> in_; + Parameter> out_; +}; + +// Pops an incoming message at the reciever +class Pop : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + message_->receive(); + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(message_, "message"); + return ToResultCode(result); + } + + Parameter> message_; +}; + +// Receives a message with tensors and prints the element count to debug log +class Print : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + auto message = message_->receive(); + if (!message) return message.error(); + + for (const auto tensor : message.value().findAll()) { + // FIXME print component name + GXF_LOG_DEBUG("[%05zu] Received E%05zu with Tensor with %zu elements", cid(), + message.value().eid(), tensor->element_count()); + } + + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(message_, "message"); + return ToResultCode(result); + } + + Parameter> message_; +}; + +// Prints the elements of a tensor with the given type +// T1 is the type of data +// T2 is the type to use when printing +template +gxf_result_t PrintSingleTensorGivenType(const Tensor& tensor, const char* format) { + Expected maybe_ptr = tensor.data(); + if (!maybe_ptr) { + return maybe_ptr.error(); + } + const T1* ptr = maybe_ptr.value(); + for (size_t i = 0; i < tensor.element_count(); i++) { + std::printf(format, static_cast(ptr[i])); + } + std::printf("\n"); + return GXF_SUCCESS; +} + +// Prints the elements of a tensor for various types +gxf_result_t PrintSingleTensorAllTypes(const Tensor& tensor) { + switch (tensor.element_type()) { + case PrimitiveType::kUnsigned8: + return PrintSingleTensorGivenType(tensor, "%u, "); + case PrimitiveType::kUnsigned16: + return PrintSingleTensorGivenType(tensor, "%u, "); + case PrimitiveType::kUnsigned32: + return PrintSingleTensorGivenType(tensor, "%u, "); + case PrimitiveType::kUnsigned64: + return PrintSingleTensorGivenType(tensor, "%" PRIu64 ", "); + case PrimitiveType::kInt8: + return PrintSingleTensorGivenType(tensor, "%d, "); + case PrimitiveType::kInt16: + return PrintSingleTensorGivenType(tensor, "%d, "); + case PrimitiveType::kInt32: + return PrintSingleTensorGivenType(tensor, "%d, "); + case PrimitiveType::kInt64: + return PrintSingleTensorGivenType(tensor, "%" PRId64 ", "); + case PrimitiveType::kFloat32: + if (tensor.storage_type() == MemoryStorageType::kHost) { + return PrintSingleTensorGivenType(tensor, "%f, "); + } else { + std::printf("[device-data]\n"); + return GXF_SUCCESS; + } + case PrimitiveType::kFloat64: + if (tensor.storage_type() == MemoryStorageType::kHost) { + return PrintSingleTensorGivenType(tensor, "%f, "); + } else { + std::printf("[device-data]\n"); + return GXF_SUCCESS; + } + default: + std::printf("Unknown type %d\n", static_cast(tensor.element_type())); + return GXF_SUCCESS; + } +} + +// Receives a message with tensors and prints them to the console. +class PrintTensor : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + auto message = tensors_->receive(); + if (!message) return message.error(); + + if (silent_) { + return GXF_SUCCESS; + } + + for (const auto tensor : message.value().findAll()) { + // GXF_LOG_DEBUG("[%05zu] Received E%05zu with Tensor '%s' with %zu elements", + // cid(), message.value().eid(), tensor->name(), tensor->size()); + std::printf("shape: ("); + for (size_t i = 0; i < tensor->rank(); i++) { + std::printf("%d", tensor->shape().dimension(i)); + if (i + 1 < tensor->rank()) std::printf(", "); + } + std::printf("), %s: ", tensor.name()); + + PrintSingleTensorAllTypes(*tensor); + } + + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(tensors_, "tensors", "Input Tensor", ""); + result &= registrar->parameter(silent_, "silent", "Enable silent mode", + "If enabled this codelet will not print anything to the command line.", + false, GXF_PARAMETER_FLAGS_DYNAMIC); + return ToResultCode(result); + } + + private: + Parameter> tensors_; + Parameter silent_; +}; + +// Generates an arbitrary precision factorial tensor message +class ArbitraryPrecisionFactorial : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + const int32_t digits = digits_; + const uint32_t factorial = factorial_; + + Expected message = CreateTensorMap( + context(), pool_, + {{"factorial", MemoryStorageType::kHost, {digits}, PrimitiveType::kUnsigned8}}); + if (!message) return message.error(); + + auto tensor = message.value().get("factorial"); + if (!tensor) return tensor.error(); + + Expected maybe_digit = tensor.value()->data(); + if (!maybe_digit) return maybe_digit.error(); + uint8_t* digit = maybe_digit.value(); + digit[0] = 1; + for (int32_t i = 1; i < digits; i++) digit[i] = 0; + + int32_t last = 1; + for (uint32_t n = 1; n <= factorial; n++) { + uint32_t carry = 0; + for (int32_t i = 0; i < last; i++) { + const uint32_t d = static_cast(digit[i]) * n + carry; + digit[i] = static_cast(d % 10); + carry = d / 10; + } + while (carry > 0) { + if (last >= digits) { + // error + return GXF_FAILURE; + } + digit[last] = static_cast(carry % 10); + carry = carry / 10; + last++; + } + } + + result_->publish(message.value()); + + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(digits_, "digits"); + result &= registrar->parameter(factorial_, "factorial"); + result &= registrar->parameter(result_, "result"); + result &= registrar->parameter(pool_, "pool"); + return ToResultCode(result); + } + + Parameter digits_; + Parameter factorial_; + Parameter> result_; + Parameter> pool_; +}; + +// Creates a tensor message with a cumulative sum of sines +class IntegerSinSum : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + const size_t count = count_; + + double x = 0.0; + for (size_t i = 0; i < count; i++) { + x += std::sin(i); + } + + Expected message = CreateTensorMap( + context(), pool_, {{"sum", MemoryStorageType::kHost, {1}, PrimitiveType::kFloat32}}); + if (!message) return message.error(); + + auto sum = message.value().get("sum"); + if (!sum) return sum.error(); + auto maybe_ptr = sum.value()->data(); + if (!maybe_ptr) return maybe_ptr.error(); + *maybe_ptr.value() = x; + + result_->publish(message.value()); + + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(count_, "count"); + result &= registrar->parameter(result_, "result"); + result &= registrar->parameter(pool_, "pool"); + return ToResultCode(result); + } + + Parameter count_; + Parameter> result_; + Parameter> pool_; +}; + +class TestTensorStrides : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + gxf_result_t stop() override { return GXF_SUCCESS; } + gxf_result_t tick() override { + Shape shape{2, 3, 4}; + auto foo_strides = ComputeRowStrides(shape, 256, PrimitiveTypeTraits::size); + GXF_ASSERT(foo_strides, "ComputeRowStrides failed"); + Expected message = CreateTensorMap( + context(), pool_, + { + TensorDescription{"foo", MemoryStorageType::kHost, shape, PrimitiveType::kFloat32, 0, + foo_strides.value()}, + TensorDescription{"bar", MemoryStorageType::kHost, shape, PrimitiveType::kFloat32, 0, + ComputeStrides(shape, {256, 64, 8})}, + TensorDescription{"zoo", MemoryStorageType::kHost, shape, PrimitiveType::kFloat64, 0, + Unexpected{GXF_UNINITIALIZED_VALUE}}, + }); + if (!message) { + return message.error(); + } + auto foo = message.value().get("foo"); + if (!foo) { + return foo.error(); + } + Handle foo_tensor = foo.value(); + if (foo_tensor->rank() != 3) { + GXF_LOG_ERROR("Bad rank"); + return GXF_FAILURE; + } + GXF_ASSERT(foo_tensor->bytes_size() == 2 * 256, "Bad foo bytes_size"); + GXF_ASSERT(foo_tensor->stride(0) == 256, "Bad foo stride 0"); + GXF_ASSERT(foo_tensor->stride(1) == 16, "Bad foo stride 1"); + GXF_ASSERT(foo_tensor->stride(2) == 4, "Bad foo stride 1"); + + auto bar = message.value().get("bar"); + if (!bar) { + return bar.error(); + } + Handle bar_tensor = bar.value(); + if (bar_tensor->rank() != 3) { + GXF_LOG_ERROR("Bad rank"); + return GXF_FAILURE; + } + GXF_ASSERT(bar_tensor->bytes_size() == 2 * 256, "Bad bar bytes_size"); + GXF_ASSERT(bar_tensor->stride(0) == 256, "Bad bar stride 0"); + GXF_ASSERT(bar_tensor->stride(1) == 64, "Bad bar stride 1"); + GXF_ASSERT(bar_tensor->stride(2) == 8, "Bad bar stride 1"); + + auto zoo = message.value().get("zoo"); + if (!zoo) { + return bar.error(); + } + Handle zoo_tensor = zoo.value(); + GXF_ASSERT(zoo_tensor->bytes_size() == 2 * 3 * 4 * 8 /* sizeof(double) */, + "Bad zoo bytes_size %lu"); + GXF_ASSERT(zoo_tensor->stride(0) == 3 * 4 * 8, "Bad zoo stride 0"); + GXF_ASSERT(zoo_tensor->stride(1) == 4 * 8, "Bad zoo stride 1"); + GXF_ASSERT(zoo_tensor->stride(2) == 8, "Bad zoo stride 1"); + + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(pool_, "pool"); + return ToResultCode(result); + } + + Parameter> pool_; +}; // namespace test + +class TestTimestampTx : public Codelet { + public: + gxf_result_t start() override { + // Set the target time so that we tick + scheduling_term_->setNextTargetTime(execution_clock_->timestamp()); + + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + auto message = Entity::New(context()); + if (!message) return GXF_FAILURE; + + // Compute the timestamp when the codelet should be executed next + const int64_t target_timestamp = execution_clock_->timestamp() + delay_; + scheduling_term_->setNextTargetTime(target_timestamp); + const auto result = signal_->publish(message.value(), execution_clock_->timestamp()); + return ToResultCode(message); + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(delay_, "delay"); + result &= registrar->parameter(execution_clock_, "execution_clock"); + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(scheduling_term_, "scheduling_term"); + result &= registrar->parameter(offset_clock_, "offset_clock", "", "", + Registrar::NoDefaultParameter(), GXF_PARAMETER_FLAGS_OPTIONAL); + return ToResultCode(result); + } + Parameter delay_; + Parameter> execution_clock_; + Parameter> offset_clock_; + Parameter> signal_; + Parameter> scheduling_term_; +}; + +class TestTimestampRx : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + auto message = signal_->receive(); + if (!message || message.value().is_null()) { return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; } + auto timestamp = message.value().get(); + if (!timestamp) { return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; } + auto pubtime = timestamp.value()->pubtime; + auto acqtime = timestamp.value()->acqtime; + + if (last_pubtime == 0) { + last_pubtime = pubtime; + last_acqtime = acqtime; + return GXF_SUCCESS; + } + if (pubtime != last_pubtime + delay_) { return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; } + if (acqtime != last_acqtime + delay_) { return GXF_CONTRACT_MESSAGE_NOT_AVAILABLE; } + last_pubtime = pubtime; + last_acqtime = acqtime; + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(signal_, "signal"); + result &= registrar->parameter(delay_, "delay"); + return ToResultCode(result); + } + + Parameter> signal_; + Parameter delay_; + + private: + int64_t last_pubtime = 0; + int64_t last_acqtime = 0; +}; + +// Prints test logs for various severity levels defined in `gxf_severity_t` +class TestLogger : public Codelet { + public: + gxf_result_t start() override { return GXF_SUCCESS; } + + gxf_result_t tick() override { + GXF_LOG_ERROR("This is test error message"); + GXF_LOG_WARNING("This is a test warning message"); + GXF_LOG_INFO("This is a test info message"); + GXF_LOG_DEBUG("This is a test debug message"); + return GXF_SUCCESS; + } + + gxf_result_t stop() override { return GXF_SUCCESS; } +}; + +} // namespace test +} // namespace gxf +} // namespace nvidia + +#endif diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_metric.hpp b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_metric.hpp new file mode 100644 index 00000000..4ab02ef6 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_metric.hpp @@ -0,0 +1,115 @@ +/* +Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_TEST_EXTENSIONS_TEST_METRIC_HPP +#define NVIDIA_GXF_TEST_EXTENSIONS_TEST_METRIC_HPP + +#include "core/assert.hpp" +#include "gtest/gtest.h" +#include "gxf/std/codelet.hpp" +#include "gxf/std/metric.hpp" + +namespace nvidia { +namespace gxf { +namespace test { + +// Test metric logger codelet that computes and writes to a set of metrics on every tick. +class TestMetricLogger : public Codelet { + public: + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(sample_metric_parameter_, "sample_metric_parameter"); + result &= registrar->parameter(sample_metric_mean_, "sample_metric_mean"); + result &= registrar->parameter(sample_metric_rms_, "sample_metric_rms"); + result &= registrar->parameter(sample_metric_abs_max_, "sample_metric_abs_max"); + result &= registrar->parameter(sample_metric_max_, "sample_metric_max"); + result &= registrar->parameter(sample_metric_min_, "sample_metric_min"); + result &= registrar->parameter(sample_metric_sum_, "sample_metric_sum"); + result &= registrar->parameter(sample_metric_fixed_, "sample_metric_fixed"); + result &= registrar->parameter(sample_metric_fail_threshold_, "sample_metric_fail_threshold"); + return ToResultCode(result); + } + + gxf_result_t start() override { + tick_count_ = 0; + sample_metric_mean_->setMeanAggregationFunction(); + sample_metric_rms_->setRootMeanSquareAggregationFunction(); + sample_metric_abs_max_->setAbsMaxAggregationFunction(); + sample_metric_max_->setMaxAggregationFunction(); + sample_metric_min_->setMinAggregationFunction(); + sample_metric_sum_->setSumAggregationFunction(); + sample_metric_fixed_->setFixedAggregationFunction(); + return GXF_SUCCESS; + } + + gxf_result_t tick() override { + sample_metric_parameter_->record(tick_count_); + sample_metric_mean_->record(tick_count_); + sample_metric_rms_->record(tick_count_); + sample_metric_abs_max_->record(-1.0 * tick_count_); + sample_metric_max_->record(tick_count_); + sample_metric_min_->record(tick_count_); + sample_metric_sum_->record(tick_count_); + sample_metric_fixed_->record(tick_count_); + sample_metric_fail_threshold_->record(tick_count_); + tick_count_ += 1.0; + return GXF_SUCCESS; + } + + gxf_result_t stop() override { + Expected result; + result &= verifyMetricResult(sample_metric_parameter_, 49.5, true); + result &= verifyMetricResult(sample_metric_mean_, 49.5, true); + result &= verifyMetricResult(sample_metric_rms_, 57.301832, true); + result &= verifyMetricResult(sample_metric_abs_max_, 99.0, true); + result &= verifyMetricResult(sample_metric_max_, 99.0, true); + result &= verifyMetricResult(sample_metric_min_, 0.0, true); + result &= verifyMetricResult(sample_metric_sum_, 4950.0, true); + result &= verifyMetricResult(sample_metric_fixed_, 99.0, true); + result &= verifyMetricResult(sample_metric_fail_threshold_, 4950.0, false); + return ToResultCode(result); + } + + Expected verifyMetricResult(Handle metric, double expected_aggregated_value, + bool expected_success) { + const auto maybe_aggregated_value = metric->getAggregatedValue(); + if (!maybe_aggregated_value) { + gxf::ForwardError(maybe_aggregated_value); + } + // FIXME(dbhaskara): use GXF_ASSERT_NEAR when available + EXPECT_NEAR(maybe_aggregated_value.value(), expected_aggregated_value, 1e-4); + + const auto maybe_success = metric->evaluateSuccess(); + if (!maybe_success) { + gxf::ForwardError(maybe_success); + } + GXF_ASSERT_EQ(maybe_success.value(), expected_success); + return Success; + } + + private: + Parameter> sample_metric_parameter_; + Parameter> sample_metric_mean_; + Parameter> sample_metric_rms_; + Parameter> sample_metric_abs_max_; + Parameter> sample_metric_max_; + Parameter> sample_metric_min_; + Parameter> sample_metric_sum_; + Parameter> sample_metric_fixed_; + Parameter> sample_metric_fail_threshold_; + + // Tracks number of ticks so far + double tick_count_; +}; + +} // namespace test +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_TEST_EXTENSIONS_TEST_METRIC_HPP diff --git a/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_parameters.hpp b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_parameters.hpp new file mode 100644 index 00000000..42a96363 --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/gxf/test/extensions/test_parameters.hpp @@ -0,0 +1,447 @@ +/* +Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. + +NVIDIA CORPORATION and its licensors retain all intellectual property +and proprietary rights in and to this software, related documentation +and any modifications thereto. Any use, reproduction, disclosure or +distribution of this software and related documentation without an express +license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ +#ifndef NVIDIA_GXF_TEST_EXTENSIONS_TEST_PARAMETERS_HPP_ +#define NVIDIA_GXF_TEST_EXTENSIONS_TEST_PARAMETERS_HPP_ + +#include +#include +#include +#include +#include + +#include "core/logger.hpp" +#include "gxf/core/component.hpp" +#include "gxf/core/entity.hpp" +#include "gxf/std/allocator.hpp" +#include "gxf/std/codelet.hpp" +#include "gxf/std/parameter_parser_std.hpp" +#include "gxf/std/receiver.hpp" +#include "gxf/std/tensor.hpp" +#include "gxf/std/transmitter.hpp" + +namespace nvidia { +namespace gxf { + +// A simple structure used for testing ParameterParser +struct MyDouble { + double d; +}; + +// Support MyDouble parameters +template <> +struct ParameterParser { + static Expected Parse(gxf_context_t context, gxf_uid_t component_uid, const char* key, + const YAML::Node& node, const std::string& prefix) { + const auto maybe = ParameterParser::Parse(context, component_uid, key, node, prefix); + if (!maybe) { + return ForwardError(maybe); + } + return MyDouble{maybe.value()}; + } +}; + +namespace test { + +class LoadParameterFromYamlTest : public Component { + public: + gxf_result_t initialize() override { + constexpr const char* expected_more = + "- a: st\n b: ee\n- c: an\n d: en\n- e:\n - f: figy\n g: g"; + GXF_ASSERT_TRUE(fact_); + GXF_ASSERT_FALSE(rumor_); + GXF_ASSERT_EQ(forty_two_, 42); + GXF_ASSERT_EQ(minus_one_, -1); + GXF_ASSERT_STREQ(some_text_.get().c_str(), "hello"); + GXF_ASSERT_STREQ(more_.get().c_str(), expected_more); + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(fact_, "fact"); + result &= registrar->parameter(rumor_, "rumor"); + result &= registrar->parameter(forty_two_, "forty_two"); + result &= registrar->parameter(minus_one_, "minus_one"); + result &= registrar->parameter(some_text_, "some_text"); + result &= registrar->parameter(more_, "more"); + return ToResultCode(result); + } + + private: + Parameter fact_; + Parameter rumor_; + Parameter forty_two_; + Parameter minus_one_; + Parameter some_text_; + Parameter more_; +}; + +class VectorParameterTest : public Component { + public: + gxf_result_t initialize() override { + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + ParameterInfo> five_64_bit_floats_info { + "five_64_bit_floats", + "testing float vector", + "description for five_64_bit_floats", + "linux_x86_64, linux_aarch64", + }; + five_64_bit_floats_info.rank = 1; + five_64_bit_floats_info.shape[0] = 5; + ParameterInfo> five_64_bit_ints_info { + "five_64_bit_ints", + "testing float vector", + "description for five_64_bit_ints", + "linux_x86_64, linux_aarch64", + }; + five_64_bit_ints_info.rank = 1; + five_64_bit_ints_info.shape[0] = 5; + ParameterInfo> five_64_bit_unsigned_info { + "five_64_bit_unsigned_ints", + "testing int64 vector", + "description for five_64_bit_unsigned_ints", + "linux_x86_64, linux_aarch64", + }; + five_64_bit_unsigned_info.rank = 1; + five_64_bit_unsigned_info.shape[0] = 5; + ParameterInfo> five_32_bit_ints_info { + "five_32_bit_ints", + "testing float vector", + "description for five_32_bit_ints", + "linux_x86_64, linux_aarch64", + }; + five_32_bit_ints_info.rank = 1; + five_32_bit_ints_info.shape[0] = 5; + ParameterInfo>> six_64_bit_float_2d_info { + "six_64_bit_float_2d", + "testing float vector", + "description for six_64_bit_float_2d", + "linux_x86_64, linux_aarch64", + }; + six_64_bit_float_2d_info.rank = 2; + six_64_bit_float_2d_info.shape[0] = 2; + six_64_bit_float_2d_info.shape[1] = 3; + ParameterInfo>> six_64_bit_int_2d_info { + "six_64_bit_int_2d", + "testing float vector", + "description for six_64_bit_int_2d", + "linux_x86_64, linux_aarch64", + }; + six_64_bit_int_2d_info.rank = 2; + six_64_bit_int_2d_info.shape[0] = 2; + six_64_bit_int_2d_info.shape[1] = 3; + ParameterInfo>> six_64_bit_uint_2d_info { + "six_64_bit_uint_2d", + "testing float vector", + "description for six_64_bit_uint_2d", + "linux_x86_64, linux_aarch64", + }; + six_64_bit_uint_2d_info.rank = 2; + six_64_bit_uint_2d_info.shape[0] = 2; + six_64_bit_uint_2d_info.shape[1] = 3; + ParameterInfo>> six_32_bit_int_2d_info { + "six_32_bit_int_2d", + "testing float vector", + "description for vector_of_float", + "linux_x86_64, linux_aarch64", + }; + six_32_bit_int_2d_info.rank = 2; + six_32_bit_int_2d_info.shape[0] = 2; + six_32_bit_int_2d_info.shape[1] = 3; + + Expected result; + result &= registrar->parameter(floats_, five_64_bit_floats_info); + result &= registrar->parameter(int64s_, five_64_bit_ints_info); + result &= registrar->parameter(uint64s_, five_64_bit_unsigned_info); + result &= registrar->parameter(int32s_, five_32_bit_ints_info); + result &= registrar->parameter(floats_2d, six_64_bit_float_2d_info); + result &= registrar->parameter(int64s_2d, six_64_bit_int_2d_info); + result &= registrar->parameter(uint64s_2d, six_64_bit_uint_2d_info); + result &= registrar->parameter(int32s_2d, six_32_bit_int_2d_info); + return ToResultCode(result); + } + + private: + Parameter> floats_; + Parameter> int64s_; + Parameter> uint64s_; + Parameter> int32s_; + Parameter>> floats_2d; + Parameter>> int64s_2d; + Parameter>> uint64s_2d; + Parameter>> int32s_2d; +}; + +class RegisterParameterInterfaceTest : public Component { + public: + gxf_result_t initialize() override { + if (mandatory_no_default_ != 1) { + return GXF_FAILURE; + } + if (mandatory_with_default_ != 2) { + return GXF_FAILURE; + } + + const auto result = optional_no_default_.try_get(); + if (!result || result.value() != 3) { + return GXF_FAILURE; + } + + const auto result2 = optional_with_default_.try_get(); + if (!result2 || result2.value() != 4) { + return GXF_FAILURE; + } + + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(mandatory_no_default_, + {"mandatory_no_default", "Mandatory No Default", "N/A"}); + + ParameterInfo mandate_with_default_info{ + "mandatory_with_default", + "Mandatory With Default", + "N/A", + "linux_x86_64, linux_aarch64", + }; + mandate_with_default_info.value_default = 3L; + mandate_with_default_info.value_range = {-100, 100, 1}; + result &= registrar->parameter(mandatory_with_default_, mandate_with_default_info); + + result &= + registrar->parameter(optional_no_default_, "optional_no_default", "Mandatory No Default", + "N/A", Registrar::NoDefaultParameter(), GXF_PARAMETER_FLAGS_OPTIONAL); + + ParameterInfo optional_with_default_info{ + "optional_with_default", + "Optional With Default", + "N/A", + }; + optional_with_default_info.flags = GXF_PARAMETER_FLAGS_OPTIONAL, + optional_with_default_info.value_default = 5UL; + optional_with_default_info.value_range = {10UL, 1000UL, 10UL}; + result &= registrar->parameter(optional_with_default_, optional_with_default_info); + result &= registrar->parameter(std_string_text_, "std_string_text", "Std_String_Text", + "This is a std::string", + std::string("Default value of std::string text")); + result &= registrar->parameter(bool_default_, "bool_default", "Bool_Default", + "Description of bool default", true); + + ParameterInfo double_default_info{ + "double_default", + "Double_Default", + "Description of double default", + }; + double_default_info.value_default = 12345.6789; + double_default_info.value_range = {-10.0, 10.0, 1.0}; + result &= registrar->parameter(double_default_, double_default_info); + + result &= registrar->parameter(custom_parameter_, "custom_parameter"); + + // Breaks build + // std::string default_text("default char text"); + // result &= registrar->parameter(char_text_, "char_text_","Char_Text", + // "This is a char array", + // const_cast(default_text.c_str())); + return ToResultCode(result); + } + + private: + Parameter mandatory_no_default_; + Parameter mandatory_with_default_; + Parameter optional_no_default_; + Parameter optional_with_default_; + Parameter std_string_text_; + Parameter bool_default_; + Parameter double_default_; + Parameter> custom_parameter_; + Parameter char_text_; +}; + +class FixedVectorParameterTest : public Component { + public: + gxf_result_t initialize() override { + GXF_ASSERT_EQ(fixed_vector_stack_.get().size(), kVectorSize); + for (size_t i = 0; i < fixed_vector_stack_.get().size(); i++) { + GXF_ASSERT_EQ(fixed_vector_stack_.get().at(i).value(), i); + } + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(fixed_vector_stack_, "fixed_vector_stack"); + return ToResultCode(result); + } + + private: + static constexpr size_t kVectorSize = 16; + Parameter> fixed_vector_stack_; +}; + +class StdParameterTest : public Component { + public: + gxf_result_t initialize() override { + const auto& integers = integers_.get(); + GXF_ASSERT_EQ(integers.size(), 5); + GXF_ASSERT_EQ(integers[0], 2); + GXF_ASSERT_EQ(integers[1], 3); + GXF_ASSERT_EQ(integers[2], 5); + GXF_ASSERT_EQ(integers[3], 7); + GXF_ASSERT_EQ(integers[4], 11); + + const auto& my_unsigned_int8 = my_unsigned_int8_.get(); + GXF_ASSERT_EQ(my_unsigned_int8.size(), 4); + GXF_ASSERT_EQ(my_unsigned_int8[0], 133); + GXF_ASSERT_EQ(my_unsigned_int8[1], 100); + GXF_ASSERT_EQ(my_unsigned_int8[2], 1); + GXF_ASSERT_EQ(my_unsigned_int8[3], 3); + + const auto& strings = strings_.get(); + GXF_ASSERT_EQ(strings.size(), 3); + GXF_ASSERT_STREQ(strings[0].c_str(), "Hello"); + GXF_ASSERT_STREQ(strings[1].c_str(), "world,"); + GXF_ASSERT_STREQ(strings[2].c_str(), "GXF"); + + const auto& my_doubles = my_doubles_.get(); + GXF_ASSERT_EQ(my_doubles.size(), 3); + GXF_ASSERT_EQ(my_doubles[0].size(), 3); + GXF_ASSERT_EQ(my_doubles[1].size(), 0); + GXF_ASSERT_EQ(my_doubles[2].size(), 1); + GXF_ASSERT_EQ(my_doubles[0][0].d, 4.2); + GXF_ASSERT_EQ(my_doubles[0][1].d, -5.2); + GXF_ASSERT_EQ(my_doubles[0][2].d, 0.0); + GXF_ASSERT_EQ(my_doubles[2][0].d, 100.0); + + const auto& segments = segments_.get(); + GXF_ASSERT_EQ(segments.size(), 2); + GXF_ASSERT_EQ(segments[0].first[0], -100.0); + GXF_ASSERT_EQ(segments[0].first[1], 0.0); + GXF_ASSERT_EQ(segments[0].second[0], 100.0); + GXF_ASSERT_EQ(segments[0].second[1], 0.0); + GXF_ASSERT_EQ(segments[1].first[0], 0.0); + GXF_ASSERT_EQ(segments[1].first[1], 0.0); + GXF_ASSERT_EQ(segments[1].second[0], 20.0); + GXF_ASSERT_EQ(segments[1].second[1], 2.0); + + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + ParameterInfo> float64_vector_info { + "vector_of_float", + "testing float vector", + "description for vector_of_float", + "linux_x86_64, linux_aarch64", + }; + float64_vector_info.rank = 1; + float64_vector_info.shape[0] = 4; + + Expected result; + result &= registrar->parameter(integers_, "integers"); + result &= registrar->parameter(my_unsigned_int8_, "my_unsigned_int8"); + result &= registrar->parameter(strings_, "strings"); + result &= registrar->parameter(my_doubles_, "my_doubles"); + result &= registrar->parameter(segments_, "segments"); + result &= registrar->parameter(rank_2_vector_, "rank_2_vector"); + result &= registrar->parameter(rank_3_vector_, "rank_3_vector"); + result &= registrar->parameter(floats_, float64_vector_info); + ParameterInfo>> vector_info { + "vector_of_handles", + "headline for vector_of_handles", + "description for vector_of_handles", + "linux_x86_64, linux_aarch64", + }; + vector_info.flags = GXF_PARAMETER_FLAGS_OPTIONAL; + result &= registrar->parameter(vector_of_handles_, vector_info); + result &= registrar->parameter(rank_2_array_, "rank_2_array"); + ParameterInfo, 2>> array_info { + "array_of_two_handles", + "headline for array_of_two_handles", + "description for array_of_two_handles", + "linux_x86_64, linux_aarch64", + }; + array_info.flags = GXF_PARAMETER_FLAGS_OPTIONAL; + result &= registrar->parameter(array_of_two_handles_, array_info); + return ToResultCode(result); + } + + private: + Parameter> integers_; + Parameter> floats_; + Parameter> my_unsigned_int8_; + Parameter> strings_; + Parameter>> my_doubles_; + Parameter, std::array>>> segments_; + Parameter>> rank_2_vector_; + Parameter>>> rank_3_vector_; + Parameter>> vector_of_handles_; + Parameter, 1>> rank_2_array_; + Parameter, 2>> array_of_two_handles_; +}; + +// Tests various features around handle parameters +class TestHandleParameter : public Component { + public: + gxf_result_t initialize() override { + // Get the two pools + const gxf_uid_t pool_cid = entity().get("pool").value().cid(); + const gxf_uid_t other_pool_cid = entity().get("other_pool").value().cid(); + GXF_ASSERT_NE(pool_cid, other_pool_cid); + + // Check that the handle parameter was correctly set + GXF_ASSERT(pool_.try_get(), "pool not set"); + GXF_ASSERT_EQ(pool_.try_get()->cid(), pool_cid); + GXF_ASSERT_EQ(pool_->cid(), pool_cid); + + // Check that C API gives the same result + { + gxf_uid_t handle_cid; + GXF_ASSERT_SUCCESS(GxfParameterGetHandle(context(), cid(), "pool", &handle_cid)); + GXF_ASSERT_EQ(handle_cid, pool_cid); + } + + // Change via C API + GXF_ASSERT_SUCCESS(GxfParameterSetHandle(context(), cid(), "pool", other_pool_cid)); + + // Check that C API gives the correct new result + { + gxf_uid_t handle_cid; + GXF_ASSERT_SUCCESS(GxfParameterGetHandle(context(), cid(), "pool", &handle_cid)); + GXF_ASSERT_EQ(handle_cid, other_pool_cid); + } + + // Check that C++ API gives the correct new result + GXF_ASSERT(pool_.try_get(), "pool not set"); + GXF_ASSERT_EQ(pool_.try_get()->cid(), other_pool_cid); + GXF_ASSERT_EQ(pool_->cid(), other_pool_cid); + + return GXF_SUCCESS; + } + + gxf_result_t registerInterface(Registrar* registrar) override { + Expected result; + result &= registrar->parameter(pool_, "pool"); + return ToResultCode(result); + } + + Parameter> pool_; +}; + +} // namespace test +} // namespace gxf +} // namespace nvidia + +#endif // NVIDIA_GXF_TEST_EXTENSIONS_TEST_PARAMETERS_HPP_ diff --git a/isaac_ros_nvengine/gxf/include/third_party/LICENSE.txt b/isaac_ros_nvengine/gxf/include/third_party/LICENSE.txt new file mode 100644 index 00000000..0916c17e --- /dev/null +++ b/isaac_ros_nvengine/gxf/include/third_party/LICENSE.txt @@ -0,0 +1,3880 @@ +================================================================================ +This project uses the following software and the following licensing terms +apply to all the extensions and its associated files used to interact with the +graph composer tools suite that includes composer, registry, container builder +and gxe. + +================================================================================ +python 3.6.9 (Provided under following license) +================================================================================ + +Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a successor of a language called ABC. Guido remains Python’s principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for National Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, Virginia where he released several versions of the software. + +In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same year, the PythonLabs team moved to Digital Creations (now Zope Corporation; see https://www.zope.org/). In 2001, the Python Software Foundation (PSF, see https://www.python.org/psf/) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation is a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org/ for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. + + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Note + +GPL-compatible doesn’t mean that we’re distributing Python under the GPL. All Python licenses, unlike the GPL, let you distribute a modified version without making your changes open source. The GPL-compatible licenses make it possible to combine Python with other software that is released under the GPL; the others don’t. + +Thanks to the many outside volunteers who have worked under Guido’s direction to make these releases possible. +Terms and conditions for accessing or otherwise using Python +PSF LICENSE AGREEMENT FOR PYTHON 3.6.13 + +1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and + the Individual or Organization ("Licensee") accessing and otherwise using Python + 3.6.13 software in source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby + grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, + analyze, test, perform and/or display publicly, prepare derivative works, + distribute, and otherwise use Python 3.6.13 alone or in any derivative + version, provided, however, that PSF's License Agreement and PSF's notice of + copyright, i.e., "Copyright © 2001-2021 Python Software Foundation; All Rights + Reserved" are retained in Python 3.6.13 alone or in any derivative version + prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on or + incorporates Python 3.6.13 or any part thereof, and wants to make the + derivative work available to others as provided herein, then Licensee hereby + agrees to include in any such work a brief summary of the changes made to Python + 3.6.13. + +4. PSF is making Python 3.6.13 available to Licensee on an "AS IS" basis. + PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF + EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR + WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE + USE OF PYTHON 3.6.13 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 3.6.13 + FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF + MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 3.6.13, OR ANY DERIVATIVE + THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material breach of + its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any relationship + of agency, partnership, or joint venture between PSF and Licensee. This License + Agreement does not grant permission to use PSF trademarks or trade name in a + trademark sense to endorse or promote products or services of Licensee, or any + third party. + +8. By copying, installing or otherwise using Python 3.6.13, Licensee agrees + to be bound by the terms and conditions of this License Agreement. + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an office at + 160 Saratoga Avenue, Santa Clara, CA 95051, and the Individual or Organization + ("Licensee") accessing and otherwise using this software in source or binary + form and its associated documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License Agreement, + BeOpen hereby grants Licensee a non-exclusive, royalty-free, world-wide license + to reproduce, analyze, test, perform and/or display publicly, prepare derivative + works, distribute, and otherwise use the Software alone or in any derivative + version, provided, however, that the BeOpen Python License is retained in the + Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" basis. + BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF + EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION OR + WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE + USE OF THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR + ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING, + MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN IF + ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material breach of + its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all respects + by the law of the State of California, excluding conflict of law provisions. + Nothing in this License Agreement shall be deemed to create any relationship of + agency, partnership, or joint venture between BeOpen and Licensee. This License + Agreement does not grant permission to use BeOpen trademarks or trade names in a + trademark sense to endorse or promote products or services of Licensee, or any + third party. As an exception, the "BeOpen Python" logos available at + http://www.pythonlabs.com/logos.html may be used according to the permissions + granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee agrees to be + bound by the terms and conditions of this License Agreement. + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 + +1. This LICENSE AGREEMENT is between the Corporation for National Research + Initiatives, having an office at 1895 Preston White Drive, Reston, VA 20191 + ("CNRI"), and the Individual or Organization ("Licensee") accessing and + otherwise using Python 1.6.1 software in source or binary form and its + associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI hereby + grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, + analyze, test, perform and/or display publicly, prepare derivative works, + distribute, and otherwise use Python 1.6.1 alone or in any derivative version, + provided, however, that CNRI's License Agreement and CNRI's notice of copyright, + i.e., "Copyright © 1995-2001 Corporation for National Research Initiatives; All + Rights Reserved" are retained in Python 1.6.1 alone or in any derivative version + prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, + Licensee may substitute the following text (omitting the quotes): "Python 1.6.1 + is made available subject to the terms and conditions in CNRI's License + Agreement. This Agreement together with Python 1.6.1 may be located on the + Internet using the following unique, persistent identifier (known as a handle): + 1895.22/1013. This Agreement may also be obtained from a proxy server on the + Internet using the following URL: http://hdl.handle.net/1895.22/1013."; + +3. In the event Licensee prepares a derivative work that is based on or + incorporates Python 1.6.1 or any part thereof, and wants to make the derivative + work available to others as provided herein, then Licensee hereby agrees to + include in any such work a brief summary of the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" basis. CNRI + MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, + BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY + OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF + PYTHON 1.6.1 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 1.6.1 FOR + ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF + MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, OR ANY DERIVATIVE + THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material breach of + its terms and conditions. + +7. This License Agreement shall be governed by the federal intellectual property + law of the United States, including without limitation the federal copyright + law, and, to the extent such U.S. federal law does not apply, by the law of the + Commonwealth of Virginia, excluding Virginia's conflict of law provisions. + Notwithstanding the foregoing, with regard to derivative works based on Python + 1.6.1 that incorporate non-separable material that was previously distributed + under the GNU General Public License (GPL), the law of the Commonwealth of + Virginia shall govern this License Agreement only as to issues arising under or + with respect to Paragraphs 4, 5, and 7 of this License Agreement. Nothing in + this License Agreement shall be deemed to create any relationship of agency, + partnership, or joint venture between CNRI and Licensee. This License Agreement + does not grant permission to use CNRI trademarks or trade name in a trademark + sense to endorse or promote products or services of Licensee, or any third + party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, installing + or otherwise using Python 1.6.1, Licensee agrees to be bound by the terms and + conditions of this License Agreement. + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 + +Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The +Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that +the above copyright notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting documentation, and that +the name of Stichting Mathematisch Centrum or CWI not be used in advertising or +publicity pertaining to distribution of the software without specific, written +prior permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +Licenses and Acknowledgements for Incorporated Software + +This section is an incomplete, but growing list of licenses and acknowledgements for third-party software incorporated in the Python distribution. +Mersenne Twister + +The _random module includes code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html. The following are the verbatim comments from the original code: + +A C-program for MT19937, with initialization improved 2002/1/26. +Coded by Takuji Nishimura and Makoto Matsumoto. + +Before using, initialize the state by using init_genrand(seed) +or init_by_array(init_key, key_length). + +Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Any feedback is very welcome. +http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html +email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) + +Sockets + +The socket module uses the functions, getaddrinfo(), and getnameinfo(), which are coded in separate source files from the WIDE Project, http://www.wide.ad.jp/. + +Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the project nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +Floating point exception control + +The source for the fpectl module includes the following notice: + + --------------------------------------------------------------------- + / Copyright (c) 1996. \ +| The Regents of the University of California. | +| All rights reserved. | +| | +| Permission to use, copy, modify, and distribute this software for | +| any purpose without fee is hereby granted, provided that this en- | +| tire notice is included in all copies of any software which is or | +| includes a copy or modification of this software and in all | +| copies of the supporting documentation for such software. | +| | +| This work was produced at the University of California, Lawrence | +| Livermore National Laboratory under contract no. W-7405-ENG-48 | +| between the U.S. Department of Energy and The Regents of the | +| University of California for the operation of UC LLNL. | +| | +| DISCLAIMER | +| | +| This software was prepared as an account of work sponsored by an | +| agency of the United States Government. Neither the United States | +| Government nor the University of California nor any of their em- | +| ployees, makes any warranty, express or implied, or assumes any | +| liability or responsibility for the accuracy, completeness, or | +| usefulness of any information, apparatus, product, or process | +| disclosed, or represents that its use would not infringe | +| privately-owned rights. Reference herein to any specific commer- | +| cial products, process, or service by trade name, trademark, | +| manufacturer, or otherwise, does not necessarily constitute or | +| imply its endorsement, recommendation, or favoring by the United | +| States Government or the University of California. The views and | +| opinions of authors expressed herein do not necessarily state or | +| reflect those of the United States Government or the University | +| of California, and shall not be used for advertising or product | + \ endorsement purposes. / + --------------------------------------------------------------------- + +Asynchronous socket services + +The asynchat and asyncore modules contain the following notice: + +Copyright 1996 by Sam Rushing + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that copyright notice and this permission +notice appear in supporting documentation, and that the name of Sam +Rushing not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Cookie management + +The http.cookies module contains the following notice: + +Copyright 2000 by Timothy O'Malley + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software +and its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that copyright notice and this permission +notice appear in supporting documentation, and that the name of +Timothy O'Malley not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. + +Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR +ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +Execution tracing + +The trace module contains the following notice: + +portions copyright 2001, Autonomous Zones Industries, Inc., all rights... +err... reserved and offered to the public under the terms of the +Python 2.2 license. +Author: Zooko O'Whielacronx +http://zooko.com/ +mailto:zooko@zooko.com + +Copyright 2000, Mojam Media, Inc., all rights reserved. +Author: Skip Montanaro + +Copyright 1999, Bioreason, Inc., all rights reserved. +Author: Andrew Dalke + +Copyright 1995-1997, Automatrix, Inc., all rights reserved. +Author: Skip Montanaro + +Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. + + +Permission to use, copy, modify, and distribute this Python software and +its associated documentation for any purpose without fee is hereby +granted, provided that the above copyright notice appears in all copies, +and that both that copyright notice and this permission notice appear in +supporting documentation, and that the name of neither Automatrix, +Bioreason or Mojam Media be used in advertising or publicity pertaining to +distribution of the software without specific, written prior permission. + +UUencode and UUdecode functions + +The uu module contains the following notice: + +Copyright 1994 by Lance Ellinghouse +Cathedral City, California Republic, United States of America. + All Rights Reserved +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Lance Ellinghouse +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Modified by Jack Jansen, CWI, July 1995: +- Use binascii module to do the actual line-by-line conversion + between ascii and binary. This results in a 1000-fold speedup. The C + version is still 5 times faster, though. +- Arguments more compliant with Python standard + +XML Remote Procedure Calls + +The xmlrpc.client module contains the following notice: + + The XML-RPC client interface is + +Copyright (c) 1999-2002 by Secret Labs AB +Copyright (c) 1999-2002 by Fredrik Lundh + +By obtaining, using, and/or copying this software and/or its +associated documentation, you agree that you have read, understood, +and will comply with the following terms and conditions: + +Permission to use, copy, modify, and distribute this software and +its associated documentation for any purpose and without fee is +hereby granted, provided that the above copyright notice appears in +all copies, and that both that copyright notice and this permission +notice appear in supporting documentation, and that the name of +Secret Labs AB or the author not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. + +SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + +test_epoll + +The test_epoll module contains the following notice: + +Copyright (c) 2001-2006 Twisted Matrix Laboratories. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Select kqueue + +The select module contains the following notice for the kqueue interface: + +Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +SipHash24 + +The file Python/pyhash.c contains Marek Majkowski’ implementation of Dan Bernstein’s SipHash24 algorithm. The contains the following note: + + +Copyright (c) 2013 Marek Majkowski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +Original location: + https://github.com/majek/csiphash/ + +Solution inspired by code from: + Samuel Neves (supercop/crypto_auth/siphash24/little) + djb (supercop/crypto_auth/siphash24/little2) + Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c) + +strtod and dtoa + +The file Python/dtoa.c, which supplies C functions dtoa and strtod for conversion of C doubles to and from strings, is derived from the file of the same name by David M. Gay, currently available from http://www.netlib.org/fp/. The original file, as retrieved on March 16, 2009, contains the following copyright and licensing notice: + +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +OpenSSL + +The modules hashlib, posix, ssl, crypt use the OpenSSL library for added performance if made available by the operating system. Additionally, the Windows and Mac OS X installers for Python may include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL license here: + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + + /* ==================================================================== + * Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"; + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)"; + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +Original SSLeay License +----------------------- + + /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +expat + +The pyexpat extension is built using an included copy of the expat sources unless the build is configured --with-system-expat: + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +libffi + +The _ctypes extension is built using an included copy of the libffi sources unless the build is configured --with-system-libffi: + +Copyright (c) 1996-2008 Red Hat, Inc and others. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +zlib + +The zlib extension is built using an included copy of the zlib sources if the zlib version found on the system is too old to be used for the build: + +Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. + +Jean-loup Gailly Mark Adler +jloup@gzip.org madler@alumni.caltech.edu + +cfuhash + +The implementation of the hash table used by the tracemalloc is based on the cfuhash project: + +Copyright (c) 2005 Don Owens +All rights reserved. + +This code is released under the BSD license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the author nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +libmpdec + +The _decimal module is built using an included copy of the libmpdec library unless the build is configured --with-system-libmpdec: + +Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + +================================================================================ +pybind11 2.5.0 (Provided under following license) +================================================================================ + +Copyright (c) 2016 Wenzel Jakob , All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Please also refer to the file CONTRIBUTING.md, which clarifies licensing of +external contributions to this project including patches, pull requests, etc. + +================================================================================ + +result (Provided under following license) +================================================================================ + +Copyright (C) 2015-2020 Danilo Bargen and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================================ + +requests 2.25.1 (Provided under following license) +================================================================================ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +================================================================================ + +toml 0.10.2 (Provided under following license) +================================================================================ +The MIT License + +Copyright 2013-2019 William Pearson +Copyright 2015-2016 Julien Enselme +Copyright 2016 Google Inc. +Copyright 2017 Samuel Vasko +Copyright 2017 Nate Prewitt +Copyright 2017 Jack Evans +Copyright 2019 Filippo Broggini + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +================================================================================ + +pyyaml 5.3.1 (Provided under following license) +================================================================================ + +Copyright (c) 2017-2020 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================================ + +packaging 20.9 (Provided under following license) +================================================================================ + +This software is made available under the terms of *either* of the licenses +found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made +under the terms of *both* these licenses. + +Apache 2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +BSD + +Copyright (c) Donald Stufft and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================================ +urllib3 1.26.4 (Provided under following license) +================================================================================ + +MIT License + +Copyright (c) 2008-2020 Andrey Petrov and contributors (see CONTRIBUTORS.txt) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================================ + +idna 2.6 (Provided under following license) +================================================================================ + +Copyright (c) 2013-2017, Kim Davies. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + Neither the name of the copyright holder nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Portions of the codec implementation and unit tests are derived from the Python standard library, which carries the Python Software Foundation License: + + Copyright (c) 2001-2014 Python Software Foundation; All Rights Reserved + +Portions of the unit tests are derived from the Unicode standard, which is subject to the Unicode, Inc. License Agreement: + + Copyright (c) 1991-2014 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in . + + Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that + + (a) this copyright and permission notice appear with all copies of the Data Files or Software, + + (b) this copyright and permission notice appear in associated documentation, and + + (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified. + + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. + +================================================================================ + +certifi 2020.12.5 (Provided under following license) +================================================================================ + +This packge contains a modified version of ca-bundle.crt: + +ca-bundle.crt -- Bundle of CA Root Certificates + +Certificate data from Mozilla as of: Thu Nov 3 19:04:19 2011# +This is a bundle of X.509 certificates of public Certificate Authorities +(CA). These were automatically extracted from Mozilla's root certificates +file (certdata.txt). This file can be found in the mozilla source tree: +http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1# +It contains the certificates in PEM format and therefore +can be directly used with curl / libcurl / php_curl, or with +an Apache+mod_ssl webserver for SSL client authentication. +Just configure this file as the SSLCACertificateFile.# + +***** BEGIN LICENSE BLOCK ***** +This Source Code Form is subject to the terms of the Mozilla Public License, +v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain +one at http://mozilla.org/MPL/2.0/. + +***** END LICENSE BLOCK ***** +@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $ + +================================================================================ + +chardet 3.0.4 (Provided under following license) +================================================================================ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + +================================================================================ + +GLib (Provided under following license) +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +GStreamer (Provided under following license) +================================================================================ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +docker 4.4.1 (Provided under following license) +=============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2016 Docker, Inc. + + 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. +================================================================================ + +jinja 2.11.2 (Provided under following license) +=============================================================================== + +Copyright 2007 Pallets + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================================ + +markupsafe 1.1.1 (Provided under following license) +=============================================================================== + +Copyright 2010 Pallets + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================================ + +urllib3 1.26.2 (Provided under following license) +=============================================================================== + +MIT License + +Copyright (c) 2008-2020 Andrey Petrov and contributors (see CONTRIBUTORS.txt) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================================ + +pyyaml 5.3.1 (Provided under following license) +=============================================================================== + +Copyright (c) 2017-2021 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +================================================================================ + +typing 3.7.4.3 (Provided under following license) +=============================================================================== + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations (now Zope +Corporation, see http://www.zope.com). In 2001, the Python Software +Foundation (PSF, see http://www.python.org/psf/) was formed, a +non-profit organization created specifically to own Python-related +Intellectual Property. Zope Corporation is a sponsoring member of +the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014 Python Software Foundation; All Rights Reserved" are +retained in Python alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +================================================================================ + +yaml-cpp 0.6.3 (Provided under following license) +=============================================================================== + +Copyright (c) 2008-2015 Jesse Beder. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +================================================================================ + +gflags 2.2.1 (Provided under following license) +=============================================================================== + +Copyright (c) 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================================ + +gtest 1.8.0 (Provided under following license) +=============================================================================== +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +================================================================================ + +rules_python 0.1.0 (Provided under following license) +=============================================================================== + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. + +================================================================================ + +DCMI specification (Provided under following license) +=============================================================================== + + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + Licensor means the individual(s) or entity(ies) granting rights under this Public License. + Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + License grant. + Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + reproduce and Share the Licensed Material, in whole or in part; and + produce, reproduce, and Share Adapted Material. + Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + Term. The term of this Public License is specified in Section 6(a). + Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + Downstream recipients. + Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + + Other rights. + Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + Patent and trademark rights are not licensed under this Public License. + To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + Attribution. + + If You Share the Licensed Material (including in modified form), You must: + retain the following if it is supplied by the Licensor with the Licensed Material: + identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + a copyright notice; + a notice that refers to this Public License; + a notice that refers to the disclaimer of warranties; + a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and + You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + upon express reinstatement by the Licensor. + For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +=============================================================================== \ No newline at end of file diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/core/libgxf_core.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/core/libgxf_core.so new file mode 100755 index 00000000..4e90cf53 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/core/libgxf_core.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5073ad50a33c17c53159f2e3ff8f5726c2caa7cc40e50039455bac700f588033 +size 1530872 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/cuda/libgxf_cuda.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/cuda/libgxf_cuda.so new file mode 100755 index 00000000..57c92cfd --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/cuda/libgxf_cuda.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfc77c2c08e28eb2b09ce8248d9cbf743c7058be334e55624490a750d8c0c32e +size 1678576 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/libgxf_ros_bridge.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/libgxf_ros_bridge.so new file mode 100755 index 00000000..e36fdc94 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/libgxf_ros_bridge.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:369147333be8c410caee768f130fe84fd31b3558d65bb380d23beb8543a20890 +size 795208 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/multimedia/libgxf_multimedia.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/multimedia/libgxf_multimedia.so new file mode 100755 index 00000000..48d4c84e --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/multimedia/libgxf_multimedia.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee1ab0f719062287165239966b15c7fe41714c8b04e76ddbad082f70a428b219 +size 1914768 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/network/libgxf_network.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/network/libgxf_network.so new file mode 100755 index 00000000..025c2b3d --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/network/libgxf_network.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b48e512d6e0495038ec32d4a14de41c502cf88ea20dcca9c3d63f309718d6d4 +size 1993864 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/npp/libgxf_npp.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/npp/libgxf_npp.so new file mode 100755 index 00000000..705e24b1 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/npp/libgxf_npp.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a4cf4f2b812a8aa0e4c8188fd14c8418c168237ed0e2f5c585317d3229b6359 +size 1946688 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/sample/libgxf_sample.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/sample/libgxf_sample.so new file mode 100755 index 00000000..45ef864c --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/sample/libgxf_sample.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40bc95f353e22637093ec811ef800433122256021d3fd0e99f60e6b2f5f7dc92 +size 1930720 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/serialization/libgxf_serialization.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/serialization/libgxf_serialization.so new file mode 100755 index 00000000..fe83dffe --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/serialization/libgxf_serialization.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bec1a62d2a614ddceddf2d048640c1691e787896e45c02651ff242ee8e2ab808 +size 2037104 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/std/libgxf_std.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/std/libgxf_std.so new file mode 100755 index 00000000..0b19f42f --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/std/libgxf_std.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f475db723652a7104c01b8adb7cc9d9511ee57068e8672037d55942aa240d188 +size 2113400 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/tensor_rt/libgxf_tensor_rt.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/tensor_rt/libgxf_tensor_rt.so new file mode 100755 index 00000000..132fb565 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/tensor_rt/libgxf_tensor_rt.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f1b784f871d24ff7075fb4cb27a93726c693b626fa562193c3aba7c631db08e +size 2046480 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LICENSE.txt b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LICENSE.txt new file mode 100644 index 00000000..b8d2e377 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LICENSE.txt @@ -0,0 +1,5484 @@ +/* Sample apps are provided under the following license: + * + * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * +*/ + +/* libnvds_kafka_proto.so uses librdkafka.so which is provided under the + * following terms: +################################################################################ +# librdkafka - Apache Kafka C driver library +# +# Copyright (c) 2012-2018, Magnus Edenhill +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +################################################################################ +*/ + +/* libnvds_amqp_proto.so uses librabbitmq.so which is provided under the + * following terms: +################################################################################ +# Portions created by Alan Antonuk are Copyright (c) 2012-2013 +# Alan Antonuk. All Rights Reserved. +# +# Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc. +# All Rights Reserved. +# +# Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010 +# VMware, Inc. and Tony Garnock-Jones. All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +*/ + +/* libnvds_azure_proto.so and libnvds_azure_edge_proto.so use + * libiothub_client.so which is provided under the following terms: +############################################################################### +# Microsoft Azure IoT SDKs +# Copyright (c) Microsoft Corporation +# All rights reserved. +# MIT License +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +############################################################################### +*/ + +/* libnvds_nvdcf.so, libnvds_mot_iou.so, libnvds_mot_klt.so, libnvds_tracker.so + * and libnvds_infer.so use opencv 3.4.0 which is provided under the following + * terms: +# ############################################################################### +# License Agreement +# For Open Source Computer Vision Library +# (3-clause BSD License) +# +# Copyright (C) 2000-2016, Intel Corporation, all rights reserved. +# Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +# Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +# Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +# Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. +# Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +# Third party copyrights are property of their respective owners. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the names of the copyright holders nor the names of the contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# This software is provided by the copyright holders and contributors "as is" and +# any express or implied warranties, including, but not limited to, the implied +# warranties of merchantability and fitness for a particular purpose are disclaimed. +# In no event shall copyright holders or contributors be liable for any direct, +# indirect, incidental, special, exemplary, or consequential damages +# (including, but not limited to, procurement of substitute goods or services; +# loss of use, data, or profits; or business interruption) however caused +# and on any theory of liability, whether in contract, strict liability, +# or tort (including negligence or otherwise) arising in any way out of +# the use of this software, even if advised of the possibility of such damage. +############################################################################### +*/ + +/* libnvdsgst_dsexample.so is provided under the following terms: +################################################################################ +# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +################################################################################ +*/ + +/* libnvds_infer_server.so uses Google Protobuf v3.0.0 which is provided under + * the following terms: +################################################################################ +# This license applies to all parts of Protocol Buffers except the following: +# +# - Atomicops support for generic gcc, located in +# src/google/protobuf/stubs/atomicops_internals_generic_gcc.h. +# This file is copyrighted by Red Hat Inc. +# +# - Atomicops support for AIX/POWER, located in +# src/google/protobuf/stubs/atomicops_internals_power.h. +# This file is copyrighted by Bloomberg Finance LP. +# +# Copyright 2014, Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Code generated by the Protocol Buffer compiler is owned by the owner +# of the input file used when generating it. This code is not +# standalone and requires a support library to be linked with it. This +# support library is itself covered by the above license. +################################################################################ + */ + +/* libtensorflow_trtis.so.1 uses TensorFlow which is provided under + * the following terms: +################################################################################ +# Copyright 2019 The TensorFlow Authors. All rights reserved. +# +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright [yyyy] [name of copyright owner] +# +# 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. +################################################################################ + */ + + /* Portions of pyds.so are generated using Pybind11, provided under the + * following terms: + +Copyright (c) 2016 Wenzel Jakob , All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +Portions of the software are provided under the following licenses. + +GLib +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +GStreamer +================================================================================ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +libX11 +================================================================================ +The following is the 'standard copyright' agreed upon by most contributors, +and is currently the canonical license preferred by the X.Org Foundation. +This is a slight variant of the common MIT license form published by the +Open Source Initiative at http://www.opensource.org/licenses/mit-license.php + +Copyright holders of new code should use this license statement where +possible, and insert their name to this list. Please sort by surname +for people, and by the full name for other entities (e.g. Juliusz +Chroboczek sorts before Intel Corporation sorts before Daniel Stone). + +See each individual source file or directory for the license that applies +to that file. + +Copyright (C) 2003-2006,2008 Jamey Sharp, Josh Triplett +Copyright © 2009 Red Hat, Inc. +Copyright 1990-1992,1999,2000,2004,2009,2010 Oracle and/or its affiliates. +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + ---------------------------------------------------------------------- + +The following licenses are 'legacy' - usually MIT/X11 licenses with the name +of the copyright holder(s) in the license statement: + +Copyright 1984-1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +X Window System is a trademark of The Open Group. + + ---------------------------------------- + +Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium +Copyright 2000 The XFree86 Project, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 by +Digital Equipment Corporation + +Portions Copyright 1990, 1991 by Tektronix, Inc. + +Permission to use, copy, modify and distribute this documentation for +any purpose and without fee is hereby granted, provided that the above +copyright notice appears in all copies and that both that copyright notice +and this permission notice appear in all copies, and that the names of +Digital and Tektronix not be used in in advertising or publicity pertaining +to this documentation without specific, written prior permission. +Digital and Tektronix makes no representations about the suitability +of this documentation for any purpose. +It is provided ``as is'' without express or implied warranty. + + ---------------------------------------- + +Copyright (c) 1999-2000 Free Software Foundation, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +FREE SOFTWARE FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the Free Software Foundation +shall not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization from the +Free Software Foundation. + + ---------------------------------------- + +Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. + All Rights Reserved + +This file is a component of an X Window System-specific implementation +of Xcms based on the TekColor Color Management System. TekColor is a +trademark of Tektronix, Inc. The term "TekHVC" designates a particular +color space that is the subject of U.S. Patent No. 4,985,853 (equivalent +foreign patents pending). Permission is hereby granted to use, copy, +modify, sell, and otherwise distribute this software and its +documentation for any purpose and without fee, provided that: + +1. This copyright, permission, and disclaimer notice is reproduced in + all copies of this software and any modification thereof and in + supporting documentation; +2. Any color-handling application which displays TekHVC color + cooordinates identifies these as TekHVC color coordinates in any + interface that displays these coordinates and in any associated + documentation; +3. The term "TekHVC" is always used, and is only used, in association + with the mathematical derivations of the TekHVC Color Space, + including those provided in this file and any equivalent pathways and + mathematical derivations, regardless of digital (e.g., floating point + or integer) representation. + +Tektronix makes no representation about the suitability of this software +for any purpose. It is provided "as is" and with all faults. + +TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, +INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +(c) Copyright 1995 FUJITSU LIMITED +This is source code modified by FUJITSU LIMITED under the Joint +Development Agreement for the CDE/Motif PST. + + ---------------------------------------- + +Copyright 1992 by Oki Technosystems Laboratory, Inc. +Copyright 1992 by Fuji Xerox Co., Ltd. + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Oki Technosystems +Laboratory and Fuji Xerox not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. +Oki Technosystems Laboratory and Fuji Xerox make no representations +about the suitability of this software for any purpose. It is provided +"as is" without express or implied warranty. + +OKI TECHNOSYSTEMS LABORATORY AND FUJI XEROX DISCLAIM ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OKI TECHNOSYSTEMS +LABORATORY AND FUJI XEROX BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1990, 1991, 1992, 1993, 1994 by FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of FUJITSU LIMITED +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +FUJITSU LIMITED makes no representations about the suitability of +this software for any purpose. +It is provided "as is" without express or implied warranty. + +FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + + +Copyright (c) 1995 David E. Wexelblat. All rights reserved + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL DAVID E. WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of David E. Wexelblat shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from David E. Wexelblat. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name OMRON not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. OMRON makes no representations +about the suitability of this software for any purpose. It is provided +"as is" without express or implied warranty. + +OMRON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL OMRON BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 by +Digital Equipment Corporation + +Portions Copyright 1990, 1991 by Tektronix, Inc + +Rewritten for X.org by Chris Lee + +Permission to use, copy, modify, distribute, and sell this documentation +for any purpose and without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. +Chris Lee makes no representations about the suitability for any purpose +of the information in this document. It is provided \`\`as-is'' without +express or implied warranty. + + ---------------------------------------- + +Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts, +Copyright 1994 by FUJITSU LIMITED +Copyright 1994 by Sony Corporation + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Digital, FUJITSU +LIMITED and Sony Corporation not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. + +DIGITAL, FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL, FUJITSU LIMITED +AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + + +Copyright 1991 by the Open Software Foundation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Open Software Foundation +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Open Software +Foundation makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1990, 1991, 1992,1993, 1994 by FUJITSU LIMITED +Copyright 1993, 1994 by Sony Corporation + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of FUJITSU LIMITED and Sony Corporation +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. FUJITSU LIMITED and +Sony Corporation makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL FUJITSU LIMITED OR SONY CORPORATION BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright (c) 1993, 1995 by Silicon Graphics Computer Systems, Inc. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1991, 1992, 1993, 1994 by FUJITSU LIMITED +Copyright 1993 by Digital Equipment Corporation + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of FUJITSU LIMITED and +Digital Equipment Corporation not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. FUJITSU LIMITED and Digital Equipment Corporation +makes no representations about the suitability of this software for +any purpose. It is provided "as is" without express or implied +warranty. + +FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR +ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1992, 1993 by FUJITSU LIMITED +Copyright 1993 by Fujitsu Open Systems Solutions, Inc. +Copyright 1994 by Sony Corporation + +Permission to use, copy, modify, distribute and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of FUJITSU LIMITED, +Fujitsu Open Systems Solutions, Inc. and Sony Corporation not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. +FUJITSU LIMITED, Fujitsu Open Systems Solutions, Inc. and +Sony Corporation make no representations about the suitability of +this software for any purpose. It is provided "as is" without +express or implied warranty. + +FUJITSU LIMITED, FUJITSU OPEN SYSTEMS SOLUTIONS, INC. AND SONY +CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, +IN NO EVENT SHALL FUJITSU OPEN SYSTEMS SOLUTIONS, INC., FUJITSU LIMITED +AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1987, 1988, 1990, 1993 by Digital Equipment Corporation, +Maynard, Massachusetts, + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + ---------------------------------------- + +Copyright 1993 by SunSoft, Inc. +Copyright 1999-2000 by Bruno Haible + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the names of SunSoft, Inc. and +Bruno Haible not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. SunSoft, Inc. and Bruno Haible make no representations +about the suitability of this software for any purpose. It is +provided "as is" without express or implied warranty. + +SunSoft Inc. AND Bruno Haible DISCLAIM ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL SunSoft, Inc. OR Bruno Haible BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1991 by the Open Software Foundation +Copyright 1993 by the TOSHIBA Corp. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of Open Software Foundation and TOSHIBA +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Open Software +Foundation and TOSHIBA make no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OPEN SOFTWARE FOUNDATION AND TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN OR TOSHIBA BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name Wyse not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + ---------------------------------------- + + +Copyright 1991 by the Open Software Foundation +Copyright 1993, 1994 by the Sony Corporation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of Open Software Foundation and +Sony Corporation not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior permission. +Open Software Foundation and Sony Corporation make no +representations about the suitability of this software for any purpose. +It is provided "as is" without express or implied warranty. + +OPEN SOFTWARE FOUNDATION AND SONY CORPORATION DISCLAIM ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OPEN +SOFTWARE FOUNDATIONN OR SONY CORPORATION BE LIABLE FOR ANY SPECIAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1992, 1993 by FUJITSU LIMITED +Copyright 1993 by Fujitsu Open Systems Solutions, Inc. + +Permission to use, copy, modify, distribute and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of FUJITSU LIMITED and +Fujitsu Open Systems Solutions, Inc. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. +FUJITSU LIMITED and Fujitsu Open Systems Solutions, Inc. makes no +representations about the suitability of this software for any purpose. +It is provided "as is" without express or implied warranty. + +FUJITSU LIMITED AND FUJITSU OPEN SYSTEMS SOLUTIONS, INC. DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJITSU OPEN SYSTEMS +SOLUTIONS, INC. AND FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1993, 1994 by Sony Corporation + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Sony Corporation +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +Sony Corporation makes no representations about the suitability of +this software for any purpose. It is provided "as is" without +express or implied warranty. + +SONY CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1986, 1998 The Open Group +Copyright (c) 2000 The XFree86 Project, Inc. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM OR THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of the X Consortium or of the +XFree86 Project shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the X Consortium and the XFree86 Project. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, + and Nippon Telegraph and Telephone Corporation +Copyright 1991 by the Open Software Foundation +Copyright 1993 by the FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of OMRON, NTT Software, NTT, and +Open Software Foundation not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. OMRON, NTT Software, NTT, and Open Software +Foundation make no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OMRON, NTT SOFTWARE, NTT, AND OPEN SOFTWARE FOUNDATION +DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT +SHALL OMRON, NTT SOFTWARE, NTT, OR OPEN SOFTWARE FOUNDATION BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1988 by Wyse Technology, Inc., San Jose, Ca, +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + + +Copyright 1991, 1992 by Fuji Xerox Co., Ltd. +Copyright 1992, 1993, 1994 by FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Fuji Xerox, +FUJITSU LIMITED not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. Fuji Xerox, FUJITSU LIMITED make no representations +about the suitability of this software for any purpose. +It is provided "as is" without express or implied warranty. + +FUJI XEROX, FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJI XEROX, +FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA +OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 2006 Josh Triplett + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + ---------------------------------------- + +(c) Copyright 1996 by Sebastien Marineau and Holger Veit + + + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of Sebastien Marineau or Holger Veit +shall not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from Holger Veit or +Sebastien Marineau. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, + and Nippon Telegraph and Telephone Corporation +Copyright 1991 by the Open Software Foundation +Copyright 1993 by the TOSHIBA Corp. +Copyright 1993, 1994 by Sony Corporation +Copyright 1993, 1994 by the FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of OMRON, NTT Software, NTT, Open +Software Foundation, and Sony Corporation not be used in advertising +or publicity pertaining to distribution of the software without specific, +written prior permission. OMRON, NTT Software, NTT, Open Software +Foundation, and Sony Corporation make no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. + +OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY +CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT +SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY +CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 2000 by Bruno Haible + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Bruno Haible not +be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Bruno Haible +makes no representations about the suitability of this software for +any purpose. It is provided "as is" without express or implied +warranty. + +Bruno Haible DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL Bruno Haible BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright © 2003 Keith Packard + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Keith Packard not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Keith Packard makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright (c) 2007-2009, Troy D. Hanson +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ---------------------------------------- + +Copyright 1992, 1993 by TOSHIBA Corp. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of TOSHIBA not be used in advertising +or publicity pertaining to distribution of the software without specific, +written prior permission. TOSHIBA make no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. + +TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +TOSHIBA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + + ---------------------------------------- + +Copyright IBM Corporation 1993 + +All Rights Reserved + +License to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of IBM not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL +IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, + and Nippon Telegraph and Telephone Corporation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of OMRON, NTT Software, and NTT +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. OMRON, NTT Software, +and NTT make no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OMRON, NTT SOFTWARE, AND NTT, DISCLAIM ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL OMRON, NTT SOFTWARE, OR NTT, BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +================================================================================ + +Eigen +================================================================================ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +================================================================================ + +Curl +================================================================================ +Copyright (c) 1996 - 2014, Daniel Stenberg, . + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. +================================================================================ + +Jansson +================================================================================ +Copyright (c) 2009-2014 Petri Lehtinen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +================================================================================ + +JSON-Glib +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +OpenSSL +================================================================================ +The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + ================================================================================ + + Pango + ================================================================================ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307 USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +UUID +================================================================================ +Copyright (C) 1996, 1997, 1998 Theodore Ts'o. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, and the entire permission notice in its entirety, + including the disclaimer of warranties. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. +================================================================================ + +lib-v4l +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License, version 2.1, as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +GStreamer EGL/GLES Sink +================================================================================ +Copyright (C) 2012 Collabora Ltd. + @author: Reynaldo H. Verdejo Pinochet + @author: Sebastian Dröge +Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +================================================================================ + +Gst-V4L2 +================================================================================ +Copyright (C) 2014 Collabora Ltd. + Author: Nicolas Dufresne +Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the +Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +Boston, MA 02110-1301, USA. +================================================================================ + +Cairo +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +OpenCV4Tegra (Jetson only) +================================================================================ + License Agreement + For Open Source Computer Vision Library + +Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of the copyright holders may not be used to endorse or promote products + derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall the Intel Corporation or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. +================================================================================ + +OpenCV4Tegra uses tbb (Thread Building Blocks) and tbb comes under following +license (Jetson only) +================================================================================ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. +---------------- END OF Gnu General Public License ---------------- + +The source code of Threading Building Blocks is distributed under version 2 +of the GNU General Public License, with the so-called "runtime exception," +as follows (or see any header or implementation file): + + As a special exception, you may use this file as part of a free software + library without restriction. Specifically, if other files instantiate + templates or use macros or inline functions from this file, or you compile + this file and link it with other files to produce an executable, this + file does not by itself cause the resulting executable to be covered by + the GNU General Public License. This exception does not however + invalidate any other reasons why the executable file might be covered by + the GNU General Public License. +================================================================================ diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LicenseAgreement.pdf b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/LicenseAgreement.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ad3e7533aa905ec73437dd9e88adf4dddd5a8a24 GIT binary patch literal 131 zcmWN?K@!3s3;@7;U%>|~2?h%N4FnKoR62(C;OliSdzFv$@m6ilLw2nnecql`*8lBH zE033!qp-ek89gg$(O9?VXrMq1(NSX9ya&VJA~3s@IiL@Y40vXX*;0*nrY&FwThVj! NX_5Xd3W?Cb@&gq$C$0bh literal 0 HcmV?d00001 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libgxf_triton_ext.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libgxf_triton_ext.so new file mode 100644 index 00000000..205e88cd --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libgxf_triton_ext.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:170e91aead9e30d6a7a77eeb7c9400fcb81ed053b075e910b965135785747e5b +size 5801272 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbuf_fdmap.so.1.0.0 b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbuf_fdmap.so.1.0.0 new file mode 100644 index 00000000..aa5a4f3d --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbuf_fdmap.so.1.0.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57a30a171d5a3d0d38f62a928f11bd22779494eb023284cf10fcbdef9186d513 +size 9952 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurface.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurface.so new file mode 100644 index 00000000..75fe94a0 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurface.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8eb8ef27fdc52c470e16c2db784d0ecb85a3dcc3e5027b3a78623aebfb1ac909 +size 446160 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurftransform.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurftransform.so new file mode 100644 index 00000000..1b022b10 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvbufsurftransform.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edabc9cbf8bac3a2e7009d5f7f688a9aee118301d739b6a7c6c42dfb07576623 +size 24318496 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_infer_server.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_infer_server.so new file mode 100644 index 00000000..2eb587d7 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_infer_server.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b56a0749b3a0e63f8ea3d8c30b7ade639a9f6c30cfe396816759d5b6d84a3bbe +size 6985432 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_inferutils.so b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_inferutils.so new file mode 100644 index 00000000..ec562e4e --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_jetpack46/triton/libnvds_inferutils.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa8bd92de3debbbbcb10a7677c66172fde1830ee5805a3edb0649026f9bdd284 +size 104696 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/core/libgxf_core.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/core/libgxf_core.so new file mode 100755 index 00000000..9b5a5b86 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/core/libgxf_core.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0366c907b3b3b18ed69792826b56b12dfcc29da85d60d6836ad0191d9cf633f7 +size 1573736 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/cuda/libgxf_cuda.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/cuda/libgxf_cuda.so new file mode 100755 index 00000000..e4ef120f --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/cuda/libgxf_cuda.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:795033cebe2603e46cd41bf899775d9a991ba5598bfb7c98946cb201e498ca68 +size 1718112 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/libgxf_ros_bridge.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/libgxf_ros_bridge.so new file mode 100755 index 00000000..c9ea2522 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/libgxf_ros_bridge.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a023a1b751ac046b0d121e44e0198066b19bed08146bc7670d325440bd87c1d +size 798008 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/multimedia/libgxf_multimedia.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/multimedia/libgxf_multimedia.so new file mode 100755 index 00000000..b3412441 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/multimedia/libgxf_multimedia.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6306bb9f1a46ae23f5135e2c107c3eb30bead3f40421091742c1c8298e87d8f +size 1988248 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/network/libgxf_network.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/network/libgxf_network.so new file mode 100755 index 00000000..a8446516 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/network/libgxf_network.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7c7e2f986581f75069f8fa52381b9d61b5d4f8ac1a78e3ece27a2dbdf977794 +size 2049544 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/npp/libgxf_npp.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/npp/libgxf_npp.so new file mode 100755 index 00000000..7e70840c --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/npp/libgxf_npp.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:deb45b6cdaea885731b9a10e349580d9c24daaeeb12fc8d062b1dca4c148f8f6 +size 2017912 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/sample/libgxf_sample.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/sample/libgxf_sample.so new file mode 100755 index 00000000..1805ba23 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/sample/libgxf_sample.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33c7921f16e122c383aa3d24322041af020661d646b514d64656a9955aeeba69 +size 1999016 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/serialization/libgxf_serialization.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/serialization/libgxf_serialization.so new file mode 100755 index 00000000..059aaad0 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/serialization/libgxf_serialization.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:105b2f5b33dce54fd1ec1bf005d1f7636f4dfc88969934189a4d513b6239c588 +size 2107992 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/std/libgxf_std.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/std/libgxf_std.so new file mode 100755 index 00000000..3c92e85a --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/std/libgxf_std.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e0032e2a104e9d9afab8c5031e60fbdac9566537693155e7138ec4aacfbf947 +size 2186584 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/tensor_rt/libgxf_tensor_rt.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/tensor_rt/libgxf_tensor_rt.so new file mode 100755 index 00000000..777bbcba --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/tensor_rt/libgxf_tensor_rt.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0702292c5dbf1e1b030ed7d31931ad44f9e487e7320f576578dc516882cd41d1 +size 2111440 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LICENSE.txt b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LICENSE.txt new file mode 100644 index 00000000..b8d2e377 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LICENSE.txt @@ -0,0 +1,5484 @@ +/* Sample apps are provided under the following license: + * + * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * +*/ + +/* libnvds_kafka_proto.so uses librdkafka.so which is provided under the + * following terms: +################################################################################ +# librdkafka - Apache Kafka C driver library +# +# Copyright (c) 2012-2018, Magnus Edenhill +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +################################################################################ +*/ + +/* libnvds_amqp_proto.so uses librabbitmq.so which is provided under the + * following terms: +################################################################################ +# Portions created by Alan Antonuk are Copyright (c) 2012-2013 +# Alan Antonuk. All Rights Reserved. +# +# Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc. +# All Rights Reserved. +# +# Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010 +# VMware, Inc. and Tony Garnock-Jones. All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +*/ + +/* libnvds_azure_proto.so and libnvds_azure_edge_proto.so use + * libiothub_client.so which is provided under the following terms: +############################################################################### +# Microsoft Azure IoT SDKs +# Copyright (c) Microsoft Corporation +# All rights reserved. +# MIT License +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +############################################################################### +*/ + +/* libnvds_nvdcf.so, libnvds_mot_iou.so, libnvds_mot_klt.so, libnvds_tracker.so + * and libnvds_infer.so use opencv 3.4.0 which is provided under the following + * terms: +# ############################################################################### +# License Agreement +# For Open Source Computer Vision Library +# (3-clause BSD License) +# +# Copyright (C) 2000-2016, Intel Corporation, all rights reserved. +# Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +# Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +# Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +# Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. +# Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +# Third party copyrights are property of their respective owners. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the names of the copyright holders nor the names of the contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# This software is provided by the copyright holders and contributors "as is" and +# any express or implied warranties, including, but not limited to, the implied +# warranties of merchantability and fitness for a particular purpose are disclaimed. +# In no event shall copyright holders or contributors be liable for any direct, +# indirect, incidental, special, exemplary, or consequential damages +# (including, but not limited to, procurement of substitute goods or services; +# loss of use, data, or profits; or business interruption) however caused +# and on any theory of liability, whether in contract, strict liability, +# or tort (including negligence or otherwise) arising in any way out of +# the use of this software, even if advised of the possibility of such damage. +############################################################################### +*/ + +/* libnvdsgst_dsexample.so is provided under the following terms: +################################################################################ +# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +################################################################################ +*/ + +/* libnvds_infer_server.so uses Google Protobuf v3.0.0 which is provided under + * the following terms: +################################################################################ +# This license applies to all parts of Protocol Buffers except the following: +# +# - Atomicops support for generic gcc, located in +# src/google/protobuf/stubs/atomicops_internals_generic_gcc.h. +# This file is copyrighted by Red Hat Inc. +# +# - Atomicops support for AIX/POWER, located in +# src/google/protobuf/stubs/atomicops_internals_power.h. +# This file is copyrighted by Bloomberg Finance LP. +# +# Copyright 2014, Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Code generated by the Protocol Buffer compiler is owned by the owner +# of the input file used when generating it. This code is not +# standalone and requires a support library to be linked with it. This +# support library is itself covered by the above license. +################################################################################ + */ + +/* libtensorflow_trtis.so.1 uses TensorFlow which is provided under + * the following terms: +################################################################################ +# Copyright 2019 The TensorFlow Authors. All rights reserved. +# +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright [yyyy] [name of copyright owner] +# +# 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. +################################################################################ + */ + + /* Portions of pyds.so are generated using Pybind11, provided under the + * following terms: + +Copyright (c) 2016 Wenzel Jakob , All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +Portions of the software are provided under the following licenses. + +GLib +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +GStreamer +================================================================================ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +libX11 +================================================================================ +The following is the 'standard copyright' agreed upon by most contributors, +and is currently the canonical license preferred by the X.Org Foundation. +This is a slight variant of the common MIT license form published by the +Open Source Initiative at http://www.opensource.org/licenses/mit-license.php + +Copyright holders of new code should use this license statement where +possible, and insert their name to this list. Please sort by surname +for people, and by the full name for other entities (e.g. Juliusz +Chroboczek sorts before Intel Corporation sorts before Daniel Stone). + +See each individual source file or directory for the license that applies +to that file. + +Copyright (C) 2003-2006,2008 Jamey Sharp, Josh Triplett +Copyright © 2009 Red Hat, Inc. +Copyright 1990-1992,1999,2000,2004,2009,2010 Oracle and/or its affiliates. +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + ---------------------------------------------------------------------- + +The following licenses are 'legacy' - usually MIT/X11 licenses with the name +of the copyright holder(s) in the license statement: + +Copyright 1984-1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +X Window System is a trademark of The Open Group. + + ---------------------------------------- + +Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium +Copyright 2000 The XFree86 Project, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 by +Digital Equipment Corporation + +Portions Copyright 1990, 1991 by Tektronix, Inc. + +Permission to use, copy, modify and distribute this documentation for +any purpose and without fee is hereby granted, provided that the above +copyright notice appears in all copies and that both that copyright notice +and this permission notice appear in all copies, and that the names of +Digital and Tektronix not be used in in advertising or publicity pertaining +to this documentation without specific, written prior permission. +Digital and Tektronix makes no representations about the suitability +of this documentation for any purpose. +It is provided ``as is'' without express or implied warranty. + + ---------------------------------------- + +Copyright (c) 1999-2000 Free Software Foundation, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +FREE SOFTWARE FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the Free Software Foundation +shall not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization from the +Free Software Foundation. + + ---------------------------------------- + +Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. + All Rights Reserved + +This file is a component of an X Window System-specific implementation +of Xcms based on the TekColor Color Management System. TekColor is a +trademark of Tektronix, Inc. The term "TekHVC" designates a particular +color space that is the subject of U.S. Patent No. 4,985,853 (equivalent +foreign patents pending). Permission is hereby granted to use, copy, +modify, sell, and otherwise distribute this software and its +documentation for any purpose and without fee, provided that: + +1. This copyright, permission, and disclaimer notice is reproduced in + all copies of this software and any modification thereof and in + supporting documentation; +2. Any color-handling application which displays TekHVC color + cooordinates identifies these as TekHVC color coordinates in any + interface that displays these coordinates and in any associated + documentation; +3. The term "TekHVC" is always used, and is only used, in association + with the mathematical derivations of the TekHVC Color Space, + including those provided in this file and any equivalent pathways and + mathematical derivations, regardless of digital (e.g., floating point + or integer) representation. + +Tektronix makes no representation about the suitability of this software +for any purpose. It is provided "as is" and with all faults. + +TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, +INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +(c) Copyright 1995 FUJITSU LIMITED +This is source code modified by FUJITSU LIMITED under the Joint +Development Agreement for the CDE/Motif PST. + + ---------------------------------------- + +Copyright 1992 by Oki Technosystems Laboratory, Inc. +Copyright 1992 by Fuji Xerox Co., Ltd. + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Oki Technosystems +Laboratory and Fuji Xerox not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. +Oki Technosystems Laboratory and Fuji Xerox make no representations +about the suitability of this software for any purpose. It is provided +"as is" without express or implied warranty. + +OKI TECHNOSYSTEMS LABORATORY AND FUJI XEROX DISCLAIM ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OKI TECHNOSYSTEMS +LABORATORY AND FUJI XEROX BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1990, 1991, 1992, 1993, 1994 by FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of FUJITSU LIMITED +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +FUJITSU LIMITED makes no representations about the suitability of +this software for any purpose. +It is provided "as is" without express or implied warranty. + +FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + + +Copyright (c) 1995 David E. Wexelblat. All rights reserved + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL DAVID E. WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of David E. Wexelblat shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from David E. Wexelblat. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name OMRON not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. OMRON makes no representations +about the suitability of this software for any purpose. It is provided +"as is" without express or implied warranty. + +OMRON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL OMRON BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 by +Digital Equipment Corporation + +Portions Copyright 1990, 1991 by Tektronix, Inc + +Rewritten for X.org by Chris Lee + +Permission to use, copy, modify, distribute, and sell this documentation +for any purpose and without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. +Chris Lee makes no representations about the suitability for any purpose +of the information in this document. It is provided \`\`as-is'' without +express or implied warranty. + + ---------------------------------------- + +Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts, +Copyright 1994 by FUJITSU LIMITED +Copyright 1994 by Sony Corporation + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Digital, FUJITSU +LIMITED and Sony Corporation not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. + +DIGITAL, FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL, FUJITSU LIMITED +AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + + +Copyright 1991 by the Open Software Foundation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Open Software Foundation +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Open Software +Foundation makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1990, 1991, 1992,1993, 1994 by FUJITSU LIMITED +Copyright 1993, 1994 by Sony Corporation + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of FUJITSU LIMITED and Sony Corporation +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. FUJITSU LIMITED and +Sony Corporation makes no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +FUJITSU LIMITED AND SONY CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL FUJITSU LIMITED OR SONY CORPORATION BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright (c) 1993, 1995 by Silicon Graphics Computer Systems, Inc. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1991, 1992, 1993, 1994 by FUJITSU LIMITED +Copyright 1993 by Digital Equipment Corporation + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of FUJITSU LIMITED and +Digital Equipment Corporation not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. FUJITSU LIMITED and Digital Equipment Corporation +makes no representations about the suitability of this software for +any purpose. It is provided "as is" without express or implied +warranty. + +FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION DISCLAIM ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +FUJITSU LIMITED AND DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR +ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1992, 1993 by FUJITSU LIMITED +Copyright 1993 by Fujitsu Open Systems Solutions, Inc. +Copyright 1994 by Sony Corporation + +Permission to use, copy, modify, distribute and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of FUJITSU LIMITED, +Fujitsu Open Systems Solutions, Inc. and Sony Corporation not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. +FUJITSU LIMITED, Fujitsu Open Systems Solutions, Inc. and +Sony Corporation make no representations about the suitability of +this software for any purpose. It is provided "as is" without +express or implied warranty. + +FUJITSU LIMITED, FUJITSU OPEN SYSTEMS SOLUTIONS, INC. AND SONY +CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, +IN NO EVENT SHALL FUJITSU OPEN SYSTEMS SOLUTIONS, INC., FUJITSU LIMITED +AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1987, 1988, 1990, 1993 by Digital Equipment Corporation, +Maynard, Massachusetts, + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + ---------------------------------------- + +Copyright 1993 by SunSoft, Inc. +Copyright 1999-2000 by Bruno Haible + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the names of SunSoft, Inc. and +Bruno Haible not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. SunSoft, Inc. and Bruno Haible make no representations +about the suitability of this software for any purpose. It is +provided "as is" without express or implied warranty. + +SunSoft Inc. AND Bruno Haible DISCLAIM ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL SunSoft, Inc. OR Bruno Haible BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1991 by the Open Software Foundation +Copyright 1993 by the TOSHIBA Corp. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of Open Software Foundation and TOSHIBA +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Open Software +Foundation and TOSHIBA make no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OPEN SOFTWARE FOUNDATION AND TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN OR TOSHIBA BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name Wyse not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + ---------------------------------------- + + +Copyright 1991 by the Open Software Foundation +Copyright 1993, 1994 by the Sony Corporation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of Open Software Foundation and +Sony Corporation not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior permission. +Open Software Foundation and Sony Corporation make no +representations about the suitability of this software for any purpose. +It is provided "as is" without express or implied warranty. + +OPEN SOFTWARE FOUNDATION AND SONY CORPORATION DISCLAIM ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OPEN +SOFTWARE FOUNDATIONN OR SONY CORPORATION BE LIABLE FOR ANY SPECIAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1992, 1993 by FUJITSU LIMITED +Copyright 1993 by Fujitsu Open Systems Solutions, Inc. + +Permission to use, copy, modify, distribute and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of FUJITSU LIMITED and +Fujitsu Open Systems Solutions, Inc. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. +FUJITSU LIMITED and Fujitsu Open Systems Solutions, Inc. makes no +representations about the suitability of this software for any purpose. +It is provided "as is" without express or implied warranty. + +FUJITSU LIMITED AND FUJITSU OPEN SYSTEMS SOLUTIONS, INC. DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJITSU OPEN SYSTEMS +SOLUTIONS, INC. AND FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1993, 1994 by Sony Corporation + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Sony Corporation +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +Sony Corporation makes no representations about the suitability of +this software for any purpose. It is provided "as is" without +express or implied warranty. + +SONY CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1986, 1998 The Open Group +Copyright (c) 2000 The XFree86 Project, Inc. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM OR THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of the X Consortium or of the +XFree86 Project shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the X Consortium and the XFree86 Project. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, + and Nippon Telegraph and Telephone Corporation +Copyright 1991 by the Open Software Foundation +Copyright 1993 by the FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of OMRON, NTT Software, NTT, and +Open Software Foundation not be used in advertising or publicity +pertaining to distribution of the software without specific, +written prior permission. OMRON, NTT Software, NTT, and Open Software +Foundation make no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OMRON, NTT SOFTWARE, NTT, AND OPEN SOFTWARE FOUNDATION +DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT +SHALL OMRON, NTT SOFTWARE, NTT, OR OPEN SOFTWARE FOUNDATION BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 1988 by Wyse Technology, Inc., San Jose, Ca, +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + + +Copyright 1991, 1992 by Fuji Xerox Co., Ltd. +Copyright 1992, 1993, 1994 by FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Fuji Xerox, +FUJITSU LIMITED not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. Fuji Xerox, FUJITSU LIMITED make no representations +about the suitability of this software for any purpose. +It is provided "as is" without express or implied warranty. + +FUJI XEROX, FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJI XEROX, +FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA +OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 2006 Josh Triplett + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + ---------------------------------------- + +(c) Copyright 1996 by Sebastien Marineau and Holger Veit + + + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of Sebastien Marineau or Holger Veit +shall not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from Holger Veit or +Sebastien Marineau. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, + and Nippon Telegraph and Telephone Corporation +Copyright 1991 by the Open Software Foundation +Copyright 1993 by the TOSHIBA Corp. +Copyright 1993, 1994 by Sony Corporation +Copyright 1993, 1994 by the FUJITSU LIMITED + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of OMRON, NTT Software, NTT, Open +Software Foundation, and Sony Corporation not be used in advertising +or publicity pertaining to distribution of the software without specific, +written prior permission. OMRON, NTT Software, NTT, Open Software +Foundation, and Sony Corporation make no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. + +OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, AND SONY +CORPORATION DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT +SHALL OMRON, NTT SOFTWARE, NTT, OPEN SOFTWARE FOUNDATION, OR SONY +CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright 2000 by Bruno Haible + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Bruno Haible not +be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Bruno Haible +makes no representations about the suitability of this software for +any purpose. It is provided "as is" without express or implied +warranty. + +Bruno Haible DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +NO EVENT SHALL Bruno Haible BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright © 2003 Keith Packard + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Keith Packard not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Keith Packard makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + ---------------------------------------- + +Copyright (c) 2007-2009, Troy D. Hanson +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ---------------------------------------- + +Copyright 1992, 1993 by TOSHIBA Corp. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of TOSHIBA not be used in advertising +or publicity pertaining to distribution of the software without specific, +written prior permission. TOSHIBA make no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. + +TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +TOSHIBA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + + ---------------------------------------- + +Copyright IBM Corporation 1993 + +All Rights Reserved + +License to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of IBM not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL +IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + ---------------------------------------- + +Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation, + and Nippon Telegraph and Telephone Corporation + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the names of OMRON, NTT Software, and NTT +not be used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. OMRON, NTT Software, +and NTT make no representations about the suitability of this +software for any purpose. It is provided "as is" without express or +implied warranty. + +OMRON, NTT SOFTWARE, AND NTT, DISCLAIM ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL OMRON, NTT SOFTWARE, OR NTT, BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +================================================================================ + +Eigen +================================================================================ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +================================================================================ + +Curl +================================================================================ +Copyright (c) 1996 - 2014, Daniel Stenberg, . + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. +================================================================================ + +Jansson +================================================================================ +Copyright (c) 2009-2014 Petri Lehtinen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +================================================================================ + +JSON-Glib +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +OpenSSL +================================================================================ +The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + ================================================================================ + + Pango + ================================================================================ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307 USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +UUID +================================================================================ +Copyright (C) 1996, 1997, 1998 Theodore Ts'o. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, and the entire permission notice in its entirety, + including the disclaimer of warranties. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. +================================================================================ + +lib-v4l +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License, version 2.1, as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +GStreamer EGL/GLES Sink +================================================================================ +Copyright (C) 2012 Collabora Ltd. + @author: Reynaldo H. Verdejo Pinochet + @author: Sebastian Dröge +Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +================================================================================ + +Gst-V4L2 +================================================================================ +Copyright (C) 2014 Collabora Ltd. + Author: Nicolas Dufresne +Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this library; if not, write to the +Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +Boston, MA 02110-1301, USA. +================================================================================ + +Cairo +================================================================================ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +================================================================================ + +OpenCV4Tegra (Jetson only) +================================================================================ + License Agreement + For Open Source Computer Vision Library + +Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * The name of the copyright holders may not be used to endorse or promote products + derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall the Intel Corporation or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. +================================================================================ + +OpenCV4Tegra uses tbb (Thread Building Blocks) and tbb comes under following +license (Jetson only) +================================================================================ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. +---------------- END OF Gnu General Public License ---------------- + +The source code of Threading Building Blocks is distributed under version 2 +of the GNU General Public License, with the so-called "runtime exception," +as follows (or see any header or implementation file): + + As a special exception, you may use this file as part of a free software + library without restriction. Specifically, if other files instantiate + templates or use macros or inline functions from this file, or you compile + this file and link it with other files to produce an executable, this + file does not by itself cause the resulting executable to be covered by + the GNU General Public License. This exception does not however + invalidate any other reasons why the executable file might be covered by + the GNU General Public License. +================================================================================ diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LicenseAgreement.pdf b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/LicenseAgreement.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ad3e7533aa905ec73437dd9e88adf4dddd5a8a24 GIT binary patch literal 131 zcmWN?K@!3s3;@7;U%>|~2?h%N4FnKoR62(C;OliSdzFv$@m6ilLw2nnecql`*8lBH zE033!qp-ek89gg$(O9?VXrMq1(NSX9ya&VJA~3s@IiL@Y40vXX*;0*nrY&FwThVj! NX_5Xd3W?Cb@&gq$C$0bh literal 0 HcmV?d00001 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libgxf_triton_ext.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libgxf_triton_ext.so new file mode 100644 index 00000000..4d98686e --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libgxf_triton_ext.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a7cac20230d43afc5726071a19415d2f04b04374dfda5f5a650b908ea871ae9 +size 3452664 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbuf_fdmap.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbuf_fdmap.so new file mode 100644 index 00000000..0a3a2bf6 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbuf_fdmap.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7357ddbe3f78f57588b91921cafc227c7311e175d64c590b36864175285e7a44 +size 82312 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurface.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurface.so new file mode 100644 index 00000000..e9437196 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurface.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8bc635d972df4b8198598961bc9f441d81c8192a12e9f43353cece50f7b39e4 +size 31480 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurftransform.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurftransform.so new file mode 100644 index 00000000..366a9e89 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvbufsurftransform.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18873039693455654527438584f9719c1122aae0ea44290bcefa1f2d8936de98 +size 59226000 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_infer_server.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_infer_server.so new file mode 100644 index 00000000..9f0c5bc8 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_infer_server.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1dc2063a4b90e00a73f2e3fe05693f28f02859081c036ac5a96dfdc3be8b7ef2 +size 21885840 diff --git a/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_inferutils.so b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_inferutils.so new file mode 100644 index 00000000..7a57a194 --- /dev/null +++ b/isaac_ros_nvengine/gxf/lib/gxf_x86_64_cuda_11_4/triton/libnvds_inferutils.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31f4185e26eff5ba90c7d2f49906e7aa28e851fc1deda48bdaa20d21c00baea4 +size 937360 diff --git a/isaac_ros_nvengine/include/isaac_ros_nvengine/gxe_node.hpp b/isaac_ros_nvengine/include/isaac_ros_nvengine/gxe_node.hpp new file mode 100644 index 00000000..9b579a5b --- /dev/null +++ b/isaac_ros_nvengine/include/isaac_ros_nvengine/gxe_node.hpp @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef ISAAC_ROS_NVENGINE__GXE_NODE_HPP_ +#define ISAAC_ROS_NVENGINE__GXE_NODE_HPP_ + +#include +#include +#include +#include + +#include "rclcpp/rclcpp.hpp" + +namespace isaac_ros +{ +namespace nvengine +{ + +class GXENode : public rclcpp::Node +{ +public: + // Constructor brings up functional ROS Node which only runs GXF test ping + explicit GXENode(const rclcpp::NodeOptions & options); + + ~GXENode(); + + GXENode(const GXENode & node) = delete; + + GXENode & operator=(const GXENode & node) = delete; + +protected: + GXENode( + const rclcpp::NodeOptions & options, + std::string app_yaml_filename, + const char * const * extensions, + uint32_t extensions_length, + std::string package_name); + + // Activates and asynchronously runs nvengine graph + void RunGraph(); + + void SetParameterInt64( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const int64_t parameter_value); + + void SetParameterInt32( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const int32_t parameter_value); + + void SetParameterUInt32( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const uint32_t parameter_value); + + void SetParameterUInt16( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const uint16_t parameter_value); + + void SetParameterStr( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const std::string & parameter_value); + + void SetParameterBool( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const bool parameter_value); + + void SetParameter1DStrVector( + const std::string & group_name, + const std::string & codelet_type, + const std::string & parameter_name, + const std::vector & parameter_value); + +private: + struct GXENodeImpl; + std::unique_ptr impl_; + std::vector toCStringArray(const std::vector & strings); +}; + +} // namespace nvengine +} // namespace isaac_ros + +#endif // ISAAC_ROS_NVENGINE__GXE_NODE_HPP_ diff --git a/isaac_ros_nvengine/include/isaac_ros_nvengine/ros_tensor_publisher_node.hpp b/isaac_ros_nvengine/include/isaac_ros_nvengine/ros_tensor_publisher_node.hpp new file mode 100644 index 00000000..b8e3f8fc --- /dev/null +++ b/isaac_ros_nvengine/include/isaac_ros_nvengine/ros_tensor_publisher_node.hpp @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef ISAAC_ROS_NVENGINE__ROS_TENSOR_PUBLISHER_NODE_HPP_ +#define ISAAC_ROS_NVENGINE__ROS_TENSOR_PUBLISHER_NODE_HPP_ + +#include +#include + +#include "rclcpp/rclcpp.hpp" + +#include "isaac_ros_nvengine_interfaces/msg/tensor_list.hpp" + +namespace isaac_ros +{ +namespace nvengine +{ + +class ROSTensorPublisherNode : public rclcpp::Node +{ +public: + // Constructor brings up functional ROS Node which only runs GXF test ping + explicit ROSTensorPublisherNode(const rclcpp::NodeOptions & options); + +private: + void timer_callback(); + rclcpp::TimerBase::SharedPtr timer_; + rclcpp::Publisher::SharedPtr pub_; +}; + +} // namespace nvengine +} // namespace isaac_ros + +#endif // ISAAC_ROS_NVENGINE__ROS_TENSOR_PUBLISHER_NODE_HPP_ diff --git a/isaac_ros_nvengine/package.xml b/isaac_ros_nvengine/package.xml new file mode 100644 index 00000000..377dde00 --- /dev/null +++ b/isaac_ros_nvengine/package.xml @@ -0,0 +1,40 @@ + + + + + + + isaac_ros_nvengine + 0.1.0 + NVEngine support for Isaac ROS + + Hemal Shah + JetPack EULA + https://developer.nvidia.com/blog/accelerating-ai-modules-for-ros-and-ros-2-on-jetson/ + Ethan Yu + Herón Ordóñez Guillén + Isaac Chang + + ament_cmake_auto + + isaac_ros_nvengine_interfaces + rclcpp + rclcpp_components + + ament_lint_auto + ament_lint_common + isaac_ros_test + sensor_msgs_py + + + ament_cmake + + diff --git a/isaac_ros_nvengine/src/gxe_node.cpp b/isaac_ros_nvengine/src/gxe_node.cpp new file mode 100644 index 00000000..292927b3 --- /dev/null +++ b/isaac_ros_nvengine/src/gxe_node.cpp @@ -0,0 +1,346 @@ +/** + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include "isaac_ros_nvengine/gxe_node.hpp" + +#include + +#include +#include +#include + +#include "gxf/core/gxf.h" + +#include "rclcpp/logger.hpp" +#include "rclcpp/rclcpp.hpp" + +namespace isaac_ros +{ +namespace nvengine +{ + +const char * nvengine_extensions[] = { + "gxf/std/libgxf_std.so", + "gxf/libgxf_ros_bridge.so" +}; + +namespace +{ +// Split strings +std::vector SplitStrings(const std::string & list_of_files) +{ + std::vector filenames; + + for (size_t begin = 0;; ) { + const size_t end = list_of_files.find(',', begin); + if (end == std::string::npos) { + if (begin == 0 && !list_of_files.empty()) { + filenames.push_back(list_of_files); + } else if (!list_of_files.substr(begin).empty()) { + filenames.push_back(list_of_files.substr(begin)); + } + break; + } else { + filenames.push_back(list_of_files.substr(begin, end - begin)); + begin = end + 1; + } + } + + return filenames; +} + +} // namespace + + +struct GXENode::GXENodeImpl +{ + explicit GXENodeImpl(const GXENode & node) + : node_(node) {} + + ~GXENodeImpl() {} + + // Loads extension manifest(s) + gxf_result_t LoadExtensionManifest( + const std::string & base_dir, + const char * const * extensions, + const uint32_t extensions_length) + { + const GxfLoadExtensionsInfo load_extension_info{ + extensions, extensions_length, nullptr, 0, base_dir.c_str()}; + + return GxfLoadExtensions(context_, &load_extension_info); + } + +// Loads application graph file(s) + gxf_result_t LoadApplication(const std::string & list_of_files) + { + const auto filenames = SplitStrings(list_of_files); + + if (filenames.empty()) { + RCLCPP_ERROR( + node_.get_logger(), "An NVEngine application file has to be specified"); + return GXF_FILE_NOT_FOUND; + } + + for (const auto & filename : filenames) { + RCLCPP_INFO( + node_.get_logger(), "Loading app: '%s'", filename.c_str()); + const gxf_result_t code = GxfGraphLoadFile(context_, filename.c_str()); + if (code != GXF_SUCCESS) {return code;} + } + + return GXF_SUCCESS; + } + + gxf_result_t GetCid(std::string group_name, std::string codelet_type, gxf_uid_t & cid) + { + gxf_result_t code; + gxf_uid_t eid; + + code = GxfEntityFind(context_, group_name.c_str(), &eid); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(node_.get_logger(), "GXF Entity find failed"); + return GXF_FAILURE; + } + + gxf_tid_t tid; + + code = GxfComponentTypeId(context_, codelet_type.c_str(), &tid); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(node_.get_logger(), "GXF Component Type ID get Failed"); + return GXF_FAILURE; + } + + code = GxfComponentFind(context_, eid, tid, nullptr, nullptr, &cid); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(node_.get_logger(), "GXF Component find failed"); + return GXF_FAILURE; + } + + return GXF_SUCCESS; + } + + const GXENode & node_; + gxf_context_t context_; +}; + +GXENode::GXENode( + const rclcpp::NodeOptions & options, + std::string app_yaml_filename, + const char * const * extensions, + uint32_t extensions_length, + std::string package_name) +: Node("GXENode", options), + impl_(std::make_unique(*this)) +{ + const std::string package_share_directory = ament_index_cpp::get_package_share_directory( + package_name); + + const std::string nvengine_package_share_directory = ament_index_cpp::get_package_share_directory( + "isaac_ros_nvengine"); + + RCLCPP_INFO(get_logger(), "%s", package_share_directory.c_str()); + + // FLAGS + const int32_t FLAGS_severity = 2; + + gxf_result_t code; + + RCLCPP_INFO(get_logger(), "Creating context"); + code = GxfContextCreate(&impl_->context_); + + if (code != GXF_SUCCESS) { + RCLCPP_INFO(get_logger(), "GxfContextCreate Error: %s", GxfResultStr(code)); + return; + } + + code = GxfSetSeverity(&impl_->context_, static_cast(FLAGS_severity)); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(get_logger(), "GxfSetSeverity Error: %s", GxfResultStr(code)); + return; + } + + code = impl_->LoadExtensionManifest( + nvengine_package_share_directory, extensions, extensions_length); + + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(get_logger(), "LoadExtensionManifest Error: %s", GxfResultStr(code)); + return; + } + + code = impl_->LoadApplication(package_share_directory + "/" + app_yaml_filename); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(get_logger(), "LoadApplication Error: %s", GxfResultStr(code)); + return; + } +} + +GXENode::GXENode(const rclcpp::NodeOptions & options) +: GXENode(options, "config/test_tensor.yaml", nvengine_extensions, 2, "isaac_ros_nvengine") +{ + SetParameterInt64( + "tx", "nvidia::isaac_ros::RosBridgeTensorSubscriber", "node_address", + reinterpret_cast(this)); + + SetParameterInt64( + "rx", "nvidia::isaac_ros::RosBridgeTensorPublisher", "node_address", + reinterpret_cast(this)); + + RunGraph(); +} + +void GXENode::RunGraph() +{ + gxf_result_t code; + + RCLCPP_INFO(get_logger(), "Initializing..."); + code = GxfGraphActivate(impl_->context_); + if (code != GXF_SUCCESS) { + RCLCPP_INFO(get_logger(), "GxfGraphActivate Error: %s", GxfResultStr(code)); + return; + } + + RCLCPP_INFO(get_logger(), "Running..."); + code = GxfGraphRunAsync(impl_->context_); + if (code != GXF_SUCCESS) { + RCLCPP_INFO(get_logger(), "GxfGraphRunError: %s", GxfResultStr(code)); + return; + } +} + +std::vector GXENode::toCStringArray(const std::vector & strings) +{ + std::vector cstrings; + cstrings.reserve(strings.size()); + + + for (size_t i = 0; i < strings.size(); ++i) { + cstrings.push_back(const_cast(strings[i].c_str())); + } + + return cstrings; +} + +void GXENode::SetParameterInt64( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, const int64_t parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + GxfParameterSetInt64(impl_->context_, cid, parameter_name.c_str(), parameter_value); +} + +void GXENode::SetParameterInt32( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, const int32_t parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + GxfParameterSetInt32(impl_->context_, cid, parameter_name.c_str(), parameter_value); +} + +void GXENode::SetParameterUInt32( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, const uint32_t parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + GxfParameterSetUInt32(impl_->context_, cid, parameter_name.c_str(), parameter_value); +} + +void GXENode::SetParameterUInt16( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, const uint16_t parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + GxfParameterSetUInt16(impl_->context_, cid, parameter_name.c_str(), parameter_value); +} + +void GXENode::SetParameterStr( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, + const std::string & parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + GxfParameterSetStr(impl_->context_, cid, parameter_name.c_str(), parameter_value.c_str()); +} + +void GXENode::SetParameterBool( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, const bool parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + GxfParameterSetBool(impl_->context_, cid, parameter_name.c_str(), parameter_value); +} + +void GXENode::SetParameter1DStrVector( + const std::string & group_name, const std::string & codelet_type, + const std::string & parameter_name, const std::vector & parameter_value) +{ + gxf_uid_t cid; + if (impl_->GetCid(group_name, codelet_type, cid) != GXF_SUCCESS) {return;} + + std::vector parameter_value_cstring = toCStringArray(parameter_value); + + GxfParameterSet1DStrVector( + impl_->context_, cid, parameter_name.c_str(), + (const char **) ¶meter_value_cstring[0], parameter_value_cstring.size()); +} + +GXENode::~GXENode() +{ + gxf_result_t code; + + RCLCPP_INFO(get_logger(), "Interrupting GXF..."); + code = GxfGraphInterrupt(impl_->context_); + if (code != GXF_SUCCESS) { + RCLCPP_INFO(get_logger(), "GxfGraphInterrupt Error: %s", GxfResultStr(code)); + } + + RCLCPP_INFO(get_logger(), "Waiting on GXF..."); + code = GxfGraphWait(impl_->context_); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(get_logger(), "GxfGraphWait Error: %s", GxfResultStr(code)); + return; + } + + RCLCPP_INFO(get_logger(), "Deinitializing..."); + code = GxfGraphDeactivate(impl_->context_); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(get_logger(), "GxfGraphDeactivate Error: %s", GxfResultStr(code)); + return; + } + + RCLCPP_INFO(get_logger(), "Destroying context"); + code = GxfContextDestroy(impl_->context_); + if (code != GXF_SUCCESS) { + RCLCPP_ERROR(get_logger(), "GxfContextDestroy Error: %s", GxfResultStr(code)); + return; + } + + RCLCPP_INFO(get_logger(), "Done."); +} + + +} // namespace nvengine +} // namespace isaac_ros + +// Register as a component +#include "rclcpp_components/register_node_macro.hpp" +RCLCPP_COMPONENTS_REGISTER_NODE(isaac_ros::nvengine::GXENode) diff --git a/isaac_ros_nvengine/src/nvengine_main.cpp b/isaac_ros_nvengine/src/nvengine_main.cpp new file mode 100644 index 00000000..3096a9b7 --- /dev/null +++ b/isaac_ros_nvengine/src/nvengine_main.cpp @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include + +#include "rclcpp/rclcpp.hpp" + +#include "isaac_ros_nvengine/gxe_node.hpp" + +int main(int argc, char * argv[]) +{ + rclcpp::init(argc, argv); + + rclcpp::executors::SingleThreadedExecutor exec; + + rclcpp::NodeOptions gxe_node_options; + + auto gxe_node = std::make_shared(gxe_node_options); + exec.add_node(gxe_node); + + // Spin with all the components loaded + exec.spin(); + + rclcpp::shutdown(); + return 0; +} diff --git a/isaac_ros_nvengine/src/ros_tensor_publisher_node.cpp b/isaac_ros_nvengine/src/ros_tensor_publisher_node.cpp new file mode 100644 index 00000000..80ec61db --- /dev/null +++ b/isaac_ros_nvengine/src/ros_tensor_publisher_node.cpp @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include "isaac_ros_nvengine/ros_tensor_publisher_node.hpp" + +#include +#include +#include + +#include "isaac_ros_nvengine_interfaces/msg/tensor.hpp" +#include "isaac_ros_nvengine_interfaces/msg/tensor_shape.hpp" + +namespace isaac_ros +{ +namespace nvengine +{ + +using namespace std::chrono_literals; + +ROSTensorPublisherNode::ROSTensorPublisherNode(const rclcpp::NodeOptions & options) +: Node("tensor_publisher", options) +{ + pub_ = this->create_publisher("tensor_pub", 10); + timer_ = + this->create_wall_timer(1000ms, std::bind(&ROSTensorPublisherNode::timer_callback, this)); +} + +void ROSTensorPublisherNode::timer_callback() +{ + auto tensor_1 = isaac_ros_nvengine_interfaces::msg::Tensor(); + tensor_1.name = "Tensor_1"; + tensor_1.data_type = 1; + tensor_1.strides = {4}; + tensor_1.data = {1, 2, 3, 4}; + auto tensor_1_shape = isaac_ros_nvengine_interfaces::msg::TensorShape(); + tensor_1_shape.rank = 1; + tensor_1_shape.dims = {4}; + tensor_1.shape = tensor_1_shape; + + auto tensor_2 = isaac_ros_nvengine_interfaces::msg::Tensor(); + tensor_2.name = "Tensor_2"; + tensor_2.data_type = 1; + tensor_2.strides = {4}; + tensor_2.data = {5, 6, 7, 8}; + auto tensor_2_shape = isaac_ros_nvengine_interfaces::msg::TensorShape(); + tensor_2_shape.rank = 1; + tensor_2_shape.dims = {4}; + tensor_2.shape = tensor_2_shape; + + auto tensor_list = isaac_ros_nvengine_interfaces::msg::TensorList(); + tensor_list.tensors = {tensor_1, tensor_2}; + pub_->publish(tensor_list); +} + +} // namespace nvengine +} // namespace isaac_ros diff --git a/isaac_ros_nvengine/src/tensor_publish.cpp b/isaac_ros_nvengine/src/tensor_publish.cpp new file mode 100644 index 00000000..73d38307 --- /dev/null +++ b/isaac_ros_nvengine/src/tensor_publish.cpp @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include + +#include "rclcpp/rclcpp.hpp" + +#include "isaac_ros_nvengine/ros_tensor_publisher_node.hpp" + +int main(int argc, char * argv[]) +{ + rclcpp::init(argc, argv); + + rclcpp::executors::SingleThreadedExecutor exec; + + rclcpp::NodeOptions node_options; + + auto pub_node = std::make_shared(node_options); + exec.add_node(pub_node); + + // Spin with all the components loaded + exec.spin(); + + rclcpp::shutdown(); + return 0; +} diff --git a/isaac_ros_nvengine/test/isaac_ros_nvengine_pol.py b/isaac_ros_nvengine/test/isaac_ros_nvengine_pol.py new file mode 100644 index 00000000..b182e273 --- /dev/null +++ b/isaac_ros_nvengine/test/isaac_ros_nvengine_pol.py @@ -0,0 +1,125 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +""" +Basic Proof-Of-Life test for the Isaac ROS NVEngine package. + +This test ensures that an NVEngine graph of bridge codelets can successfully +round trip a message from ROS through GXF and back. +""" +import time + +from isaac_ros_nvengine_interfaces.msg import Tensor, TensorList, TensorShape +from isaac_ros_test import IsaacROSBaseTest + +import launch_ros +import pytest +import rclpy +from std_msgs.msg import Header + + +@pytest.mark.rostest +def generate_test_description(): + """Generate launch description with GXENode nodes for testing.""" + nvengine_exe = launch_ros.actions.Node( + package='isaac_ros_nvengine', + executable='test_tensor', + name='nvengine_exe', + namespace=IsaacROSNVEngineTest.generate_namespace() + ) + + return IsaacROSNVEngineTest.generate_test_description([ + nvengine_exe + ]) + + +class IsaacROSNVEngineTest(IsaacROSBaseTest): + SUBSCRIBER_CHANNEL = 'ping' + # The amount of seconds to allow GXENode node to run before verifying received tensors + PYTHON_SUBSCRIBER_WAIT_SEC = 5.0 + + def test_tensor_rt_node(self) -> None: + self.node._logger.info('Starting Isaac ROS NVEngine POL Test') + + received_messages = {} + + self.generate_namespace_lookup(['tensor_pub']) + + subscriber_topic_namespace = self.generate_namespace(self.SUBSCRIBER_CHANNEL) + test_subscribers = [ + (subscriber_topic_namespace, TensorList) + ] + + subs = self.create_logging_subscribers( + subscription_requests=test_subscribers, + received_messages=received_messages, + use_namespace_lookup=False, + accept_multiple_messages=True, + add_received_message_timestamps=True + ) + + tensor_pub = self.node.create_publisher(TensorList, self.namespaces['tensor_pub'], + self.DEFAULT_QOS) + + # Create test tensor to publish and receive back. + pub_header = Header() + pub_header.stamp.sec = 1111 + pub_header.stamp.nanosec = 7777 + + pub_tensor_shape = TensorShape() + pub_tensor_shape.rank = 1 + pub_tensor_shape.dims = [1] + + pub_tensor = Tensor() + pub_tensor.name = 'Test' + pub_tensor.shape = pub_tensor_shape + pub_tensor.data_type = 1 # uint8 + pub_tensor.strides = [1] + pub_tensor.data = [1] + pub_tensor_list = TensorList() + pub_tensor_list.tensors.append(pub_tensor) + pub_tensor_list.header = pub_header + + try: + end_time = time.time() + self.PYTHON_SUBSCRIBER_WAIT_SEC + while time.time() < end_time: + tensor_pub.publish(pub_tensor_list) + rclpy.spin_once(self.node, timeout_sec=0.1) + + # Verify received tensors and log total number of tensors received + num_tensors_received = len(received_messages[subscriber_topic_namespace]) + self.assertGreater(num_tensors_received, 0) + self.node._logger.info( + f'Received {num_tensors_received} tensors in ' + f'{self.PYTHON_SUBSCRIBER_WAIT_SEC} seconds') + + # Log properties of last received tensor + tensor_list, _ = received_messages[subscriber_topic_namespace][-1] + tensor = tensor_list.tensors[0] + shape = tensor.shape + length = len(tensor.data.tolist()) + strides = tensor.strides.tolist() + dimensions = shape.dims.tolist() + + self.node._logger.info( + f'Received Tensor Properties:\n' + f'Name: {tensor.name}\n' + f'Data Type: {tensor.data_type}\n' + f'Strides: {strides}\n' + f'Byte Length: {length}\n' + f'Rank: {shape.rank}\n' + f'Dimensions: {dimensions}' + ) + + self.assertEqual(pub_tensor_list, tensor_list, + 'Received tensor_list does not match published tensor_list') + + self.node._logger.info('Finished Isaac ROS NVEngine POL Test') + finally: + [self.node.destroy_subscription(sub) for sub in subs] + self.node.destroy_publisher(tensor_pub) diff --git a/isaac_ros_nvengine_interfaces/CMakeLists.txt b/isaac_ros_nvengine_interfaces/CMakeLists.txt new file mode 100644 index 00000000..610ab9fc --- /dev/null +++ b/isaac_ros_nvengine_interfaces/CMakeLists.txt @@ -0,0 +1,40 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +cmake_minimum_required(VERSION 3.5) +project(isaac_ros_nvengine_interfaces LANGUAGES C CXX) + +# Default to C++17 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +# Prepare custom interfaces +find_package(rosidl_default_generators REQUIRED) +rosidl_generate_interfaces(${PROJECT_NAME} + msg/TensorShape.msg + msg/Tensor.msg + msg/TensorList.msg + DEPENDENCIES std_msgs +) +ament_export_dependencies(rosidl_default_runtime) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() + +endif() + +ament_auto_package() diff --git a/isaac_ros_nvengine_interfaces/msg/Tensor.msg b/isaac_ros_nvengine_interfaces/msg/Tensor.msg new file mode 100644 index 00000000..22a4b8d3 --- /dev/null +++ b/isaac_ros_nvengine_interfaces/msg/Tensor.msg @@ -0,0 +1,25 @@ +# Name of the tensor +string name + +# Shape information for tensor +TensorShape shape + +# Data type for tensor +# Use the following values to represent these data types: +# - 1: "uint8" +# - 2: "int8" +# - 3: "uint16" +# - 4: "int16" +# - 5: "uint32" +# - 6: "int32" +# - 7: "uint64" +# - 8: "int64" +# - 9: "float32" +# - 10: "float64" +int32 data_type + +# Strides of tensor (byte size for each dimension) +uint64[] strides + +# Data buffer +uint8[] data \ No newline at end of file diff --git a/isaac_ros_nvengine_interfaces/msg/TensorList.msg b/isaac_ros_nvengine_interfaces/msg/TensorList.msg new file mode 100644 index 00000000..e2f20333 --- /dev/null +++ b/isaac_ros_nvengine_interfaces/msg/TensorList.msg @@ -0,0 +1,4 @@ +std_msgs/Header header + +# A list of tensors +Tensor[] tensors \ No newline at end of file diff --git a/isaac_ros_nvengine_interfaces/msg/TensorShape.msg b/isaac_ros_nvengine_interfaces/msg/TensorShape.msg new file mode 100644 index 00000000..7ee0fdbe --- /dev/null +++ b/isaac_ros_nvengine_interfaces/msg/TensorShape.msg @@ -0,0 +1,5 @@ +# Rank of the tensor +uint8 rank + +# Number of elements in each dimension +uint32[] dims \ No newline at end of file diff --git a/isaac_ros_nvengine_interfaces/package.xml b/isaac_ros_nvengine_interfaces/package.xml new file mode 100644 index 00000000..86860053 --- /dev/null +++ b/isaac_ros_nvengine_interfaces/package.xml @@ -0,0 +1,37 @@ + + + + + isaac_ros_nvengine_interfaces + 0.9.0 + Interfaces for general Isaac ROS messages + + Ethan Yu + JetPack EULA + https://developer.nvidia.com/blog/accelerating-ai-modules-for-ros-and-ros-2-on-jetson/ + Hemal Shah + + rosidl_default_runtime + + std_msgs + + ament_cmake_auto + rosidl_default_generators + + ament_lint_auto + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + \ No newline at end of file diff --git a/isaac_ros_test/isaac_ros_test/__init__.py b/isaac_ros_test/isaac_ros_test/__init__.py index 922facf4..2e6519e4 100644 --- a/isaac_ros_test/isaac_ros_test/__init__.py +++ b/isaac_ros_test/isaac_ros_test/__init__.py @@ -11,11 +11,15 @@ from .cpu_profiler import CPUProfiler from .isaac_ros_base_test import IsaacROSBaseTest from .json_conversion import JSONConversion +from .pcd_loader import PCDLoader +from .pose_utilities import PoseUtilities from .tegrastats_profiler import TegrastatsProfiler __all__ = [ 'CPUProfiler', 'IsaacROSBaseTest', 'JSONConversion', - 'TegrastatsProfiler' + 'TegrastatsProfiler', + 'PCDLoader', + 'PoseUtilities', ] diff --git a/isaac_ros_test/isaac_ros_test/json_conversion.py b/isaac_ros_test/isaac_ros_test/json_conversion.py index bce3ab8f..07d9c3f3 100644 --- a/isaac_ros_test/isaac_ros_test/json_conversion.py +++ b/isaac_ros_test/isaac_ros_test/json_conversion.py @@ -10,7 +10,7 @@ import json from pathlib import Path -from typing import Dict, Tuple +from typing import Dict, List, Tuple import cv2 from cv_bridge import CvBridge @@ -195,3 +195,27 @@ def load_chessboard_image_from_json(json_filepath: Path) -> Tuple[Image, Tuple[i # Return the loaded image along with the dimensions return JSONConversion.load_image_from_json(json_filepath), \ chessboard_dimensions + + @staticmethod + def load_ground_truth_pose_list_from_json(json_filepath: Path) -> List[float]: + """ + Load a ground truth list from a JSON filepath. + + Parameters + ---------- + json_filepath : Path + The path to a JSON file to read from + + Returns + ------- + List + The ground truth pose of the object location. + Note: the expected format is [x_p, y_p, z_p, x_o, y_o, z_o, w_o] + where the subscript p represents position and the subscript o represents orientation + + """ + pose_json = JSONConversion.load_from_json(json_filepath) + position = pose_json['ground_truth']['position'] + orientation = pose_json['ground_truth']['orientation'] + ground_truth = position + orientation + return ground_truth diff --git a/isaac_ros_test/isaac_ros_test/pcd_loader.py b/isaac_ros_test/isaac_ros_test/pcd_loader.py new file mode 100644 index 00000000..60603786 --- /dev/null +++ b/isaac_ros_test/isaac_ros_test/pcd_loader.py @@ -0,0 +1,125 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +"""Utilities to convert ROS2 messages from PCD files.""" + +from pathlib import Path +from typing import Tuple + +import numpy as np +from sensor_msgs.msg import PointCloud2, PointField +from sensor_msgs_py import point_cloud2 +from std_msgs.msg import Header + + +class PCDLoader: + """Class for PC Dloader utilities.""" + + @staticmethod + def get_relevant_properties_from_ascii_pcd(pcd_path: Path) -> Tuple: + """ + Generate the PCD fields and the PCD data from a ASCII PCD file. + + This function serves a utility function for GeneratePointCloud2FromASCIIPCD. + + Parameters + ---------- + pcd_path : Path + The filepath to the PCD file that should be read + + Returns + ------- + [Tuple][fields, data] + The first element gives the fields that the PCD file has + The second element gives the PCD data, in the order of first element. + For example, if fields was 'x,y,z,rgb' the data will be formatted as: [[x,y,z,rgb]] + + """ + # Read the PCD file + pcd_lines = [] + with open(pcd_path, 'r') as pcd_file: + for pcd_line in pcd_file.readlines(): + pcd_lines.append(pcd_line.strip().split(' ')) + + # Assign relevant data to the PCD file + # This can be hardcoded since it won't vary + fields = pcd_lines[2] + sizes = pcd_lines[3] + types = pcd_lines[4] + counts = pcd_lines[5] + data_type = pcd_lines[10] + data = pcd_lines[11:] + + # Ensure our assumptions about the PCD file is valid + assert data_type[1] == 'ascii' + for i in range(1, len(fields)): + assert fields[i] == 'x' or fields[i] == 'y' \ + or fields[i] == 'z' or fields[i] == 'rgb' + for i in range(1, len(sizes)): + assert int(sizes[i]) == 4 + for i in range(1, len(types)): + assert types[i] == 'F' or types[i] == 'U' + for i in range(1, len(counts)): + assert int(counts[i]) == 1 + + # Get rid of header + types = types[1:] + + # Convert the data to the necessary format + for i in range(len(data)): + for j in range(len(data[i])): + if types[j] == 'F': + data[i][j] = np.float32(data[i][j]) + if types[j] == 'U': + data[i][j] = np.uintc(data[i][j]) + + # Get rid of header + fields = fields[1:] + + return fields, data + + def generate_pointcloud2_from_pcd_file(pcd_path: Path, cloud_frame: str) -> PointCloud2: + """ + Generate a PointCloud2 message from a PCD file path and a coordinate frame. + + Note: this does not fill the timestamp of the message + + Parameters + ---------- + pcd_path : Path + The filepath to the PCD file that should be read + cloud_frame : str + The coordinate frame that the PointCloud is in + Note: this does not create the necessary transform on the tf2 tree + + Returns + ------- + [sensor_msgs.msg.PointCloud2] + The PointCloud2 message that was generated + + """ + fields, data = PCDLoader.get_relevant_properties_from_ascii_pcd( + pcd_path) + point_fields = [] + + # This can be hardcoded because of the above function + # Note: we reinterpret a uint32 datatype as a float + # This is fine since the bits are what's important + size_of_float = 4 + float_data_type = 7 + + # Add the point fields to message + for i in range(len(fields)): + point_fields.append(PointField(name=fields[i], + offset=size_of_float * i, + datatype=float_data_type, count=1)) + + # Create an empty header and set the frame id + cloud_header = Header() + cloud_header.frame_id = cloud_frame + return point_cloud2.create_cloud(cloud_header, point_fields, data) diff --git a/isaac_ros_test/isaac_ros_test/pose_utilities.py b/isaac_ros_test/isaac_ros_test/pose_utilities.py new file mode 100644 index 00000000..1e2dc3b2 --- /dev/null +++ b/isaac_ros_test/isaac_ros_test/pose_utilities.py @@ -0,0 +1,124 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +"""Utilities to work with Poses for Pose Estimation tests.""" + +from typing import List + +from geometry_msgs.msg import Pose +import numpy as np +from scipy.spatial.transform import Rotation as R + + +class PoseUtilities: + """Class for Pose Utilities.""" + + @staticmethod + def generate_random_pose_offset_by_list(offset: List[float], + translation_scale: int, rotation_scale: int, + seed: int) -> List[float]: + """ + Generate a random Pose message that is offset slightly from a list. + + Parameters + ---------- + offset : list + The list that the random pose will be offset from. + Note: the expected format is [x_p, y_p, z_p, x_o, y_o, z_o, w_o] + where the subscript p represents position and the subscript o represents orientation + translation_scale: int + The amount to scale the randomization for each position term by. + If set to 1, the offset will be +/- 1. + rotation_scale: int + The amount to scale the randomization for each rotation term by. + If set to 1, the offset will be +/- 1. + seed: int + The seed for randomization. + + Returns + ------- + [geometry_msgs.msg.Pose] + The randomized pose msg that was generated + + """ + pose = Pose() + + # Generate random position + np.random.seed(seed) + pose.position.x = offset[0] + \ + np.random.random_sample() / translation_scale + pose.position.y = offset[1] + \ + np.random.random_sample() / translation_scale + pose.position.z = offset[2] + \ + np.random.random_sample() / translation_scale + + # Convert to Euler angles, then randomize, then convert back to quarternion + r = R.from_quat([offset[3], offset[4], offset[5], offset[6]]) + euler_r = r.as_euler('xyz') + euler_r[0] += np.random.random_sample() / rotation_scale + euler_r[1] += np.random.random_sample() / rotation_scale + euler_r[2] += np.random.random_sample() / rotation_scale + quat_r = R.from_euler( + 'xyz', [euler_r[0], euler_r[1], euler_r[2]]).as_quat() + + # Normalize the quarternion + normalization_factor = np.linalg.norm(quat_r) + quat_r = quat_r / normalization_factor + + pose.orientation.x = quat_r[0] + pose.orientation.y = quat_r[1] + pose.orientation.z = quat_r[2] + pose.orientation.w = quat_r[3] + return pose + + @staticmethod + def calculate_MSE_between_pose_and_list(pose: Pose, + ground_truth: List[float]) -> float: + """ + Calculate the mean squared error (MSE) between a Pose msg and ground truth pose. + + Parameters + ---------- + pose : geometry_msgs.msg.Pose + The predicted pose. + ground_truth : List + The ground truth pose. + Note: the expected format is [x_p, y_p, z_p, x_o, y_o, z_o, w_o] + where the subscript p represents position and the subscript o represents orientation + + Returns + ------- + float + The computed mean squared error between the pose and ground truth + + """ + # Convert to numpy array + ground_truth_np = np.array(ground_truth) + estimated_pose_np = np.array([pose.position.x, pose.position.y, pose.position.z, + pose.orientation.x, pose.orientation.y, pose.orientation.z, + pose.orientation.w]) + # Compute mean squared error + return (np.square(ground_truth_np - estimated_pose_np)).mean() + + @staticmethod + def print_pose(pose: Pose) -> None: + """ + Print the pose of a pose message in the [position, orientation] format. + + Note: the orientation is given as a quarternion. + + Parameters + ---------- + pose : [geometry_msgs.msg.Pose] + The pose that will be printed + + """ + pose_array = [pose.position.x, pose.position.y, pose.position.z] + pose_array += [pose.orientation.x, pose.orientation.y, + pose.orientation.z, pose.orientation.z] + print(pose_array) diff --git a/scripts/README.md b/scripts/README.md index 7b093140..731376f5 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -2,5 +2,5 @@ For Jetson or x86_64: - `run_dev.sh` creates a dev environment with ROS2 installed. By default, the directory `/workspace` in the container is mapped from `~/workspaces/isaac_ros-dev` on the host machine, but the directory the container is mapping from can be replaced by running the script and passing a path as the first argument: + `run_dev.sh` creates a dev environment with ROS2 installed. By default, the directory `/workspaces/isaac_ros-dev` in the container is mapped from `~/workspaces/isaac_ros-dev` on the host machine if it exists OR the current working directory from where the script was invoked otherwise. The host directory the container maps to can be explicitly set by running the script with the desired path as the first argument: `run_dev.sh ` diff --git a/scripts/run_dev.sh b/scripts/run_dev.sh index c84d2e82..1f6186e6 100755 --- a/scripts/run_dev.sh +++ b/scripts/run_dev.sh @@ -16,9 +16,20 @@ function usage() { print_into "Copyright (c) 2021, NVIDIA CORPORATION." } +# Get the entry in the dpkg status file corresponding to the provied package name +# Prepend two newlines so it can be safely added to the end of any existing +# dpkg/status file. +function get_dpkg_status() { + echo -e "\n" + awk '/Package: '"$1"'/,/^$/' /var/lib/dpkg/status +} + ISAAC_ROS_DEV_DIR="$1" if [[ -z "$ISAAC_ROS_DEV_DIR" ]]; then ISAAC_ROS_DEV_DIR="$HOME/workspaces/isaac_ros-dev" + if [[ ! -d "$ISAAC_ROS_DEV_DIR" ]]; then + ISAAC_ROS_DEV_DIR=$(pwd) + fi print_warning "isaac_ros_dev not specified, assuming $ISAAC_ROS_DEV_DIR" else shift 1 @@ -42,26 +53,54 @@ PLATFORM="$(uname -m)" BASE_NAME="isaac_ros_dev-$PLATFORM" CONTAINER_NAME="$BASE_NAME-container" +# Remove any exited containers. +if [ "$(docker ps -a --quiet --filter status=exited --filter name=$CONTAINER_NAME)" ]; then + docker rm $CONTAINER_NAME > /dev/null +fi + +# Re-use existing container. +if [ "$(docker ps -a --quiet --filter status=running --filter name=$CONTAINER_NAME)" ]; then + print_info "Attaching to running container: $CONTAINER_NAME" + docker exec -i -t -u admin --workdir /workspaces/isaac_ros-dev $CONTAINER_NAME /bin/bash $@ + exit 0 +fi + # Arguments for docker build -BUILD_ARGS+=("--build-arg USERNAME="admin"") -BUILD_ARGS+=("--build-arg USER_UID=`id -u`") -BUILD_ARGS+=("--build-arg USED_GID=`id -g`") +BUILD_ARGS+=("--build-arg" "USERNAME="admin"") +BUILD_ARGS+=("--build-arg" "USER_UID=`id -u`") +BUILD_ARGS+=("--build-arg" "USER_GID=`id -g`") # Check if GPU is installed if [[ $PLATFORM == "x86_64" ]]; then if type nvidia-smi &>/dev/null; then GPU_ATTACHED=(`nvidia-smi -a | grep "Attached GPUs"`) if [ ! -z $GPU_ATTACHED ]; then - BUILD_ARGS+=("--build-arg HAS_GPU="true"") + BUILD_ARGS+=("--build-arg" "HAS_GPU="true"") fi fi fi +if [[ "$PLATFORM" == "aarch64" ]]; then + # Get information about the user's installed cuda packages + BUILD_ARGS+=("--build-arg" "DPKG_STATUS=$(get_dpkg_status cuda-cudart-10-2)$(get_dpkg_status libcufft-10-2)") + + # Make sure the nvidia docker runtime will be used for builds + DEFAULT_RUNTIME=$(docker info | grep "Default Runtime: nvidia" ; true) + if [[ -z "$DEFAULT_RUNTIME" ]]; then + print_error "Default docker runtime is not nvidia!, please make sure the following line is" + print_error "present in /etc/docker/daemon.json" + print_error '"default-runtime": "nvidia",' + print_error "" + print_error "And then restart the docker daemon" + exit 1 + fi +fi + # Build image print_info "Building $PLATFORM base as image: $BASE_NAME" docker build -f $ROOT/../docker/Dockerfile.$PLATFORM.base \ -t $BASE_NAME \ - ${BUILD_ARGS[@]} \ + "${BUILD_ARGS[@]}" \ $ROOT/../docker # Map host's display socket to docker @@ -71,14 +110,20 @@ DOCKER_ARGS+=("-e NVIDIA_VISIBLE_DEVICES=all") DOCKER_ARGS+=("-e NVIDIA_DRIVER_CAPABILITIES=all") if [[ $PLATFORM == "aarch64" ]]; then - DOCKER_ARGS+=("-v /opt/nvidia:/opt/nvidia") DOCKER_ARGS+=("-v /usr/bin/tegrastats:/usr/bin/tegrastats") - DOCKER_ARGS+=("-v /usr/share/vpi1:/usr/share/vpi1") + DOCKER_ARGS+=("-v /tmp/argus_socket:/tmp/argus_socket") DOCKER_ARGS+=("-v /usr/lib/aarch64-linux-gnu/tegra:/usr/lib/aarch64-linux-gnu/tegra") - DOCKER_ARGS+=("-v /usr/local/cuda-10.2/targets/aarch64-linux/lib:/usr/local/cuda-10.2/targets/aarch64-linux/lib") - DOCKER_ARGS+=("-v /usr/lib/aarch64-linux-gnu/tegra-egl:/usr/lib/aarch64-linux-gnu/tegra-egl") - DOCKER_ARGS+=("-v /usr/lib/aarch64-linux-gnu/libcudnn.so.8.2.1:/usr/lib/aarch64-linux-gnu/libcudnn.so.8.2.1") - DOCKER_ARGS+=("-v /dev/video*:/dev/video*") + DOCKER_ARGS+=("-v /usr/src/jetson_multimedia_api:/usr/src/jetson_multimedia_api") +fi + +# Optionally load custom docker arguments from file +DOCKER_ARGS_FILE="$ROOT/.isaac_ros_dev-dockerargs" +if [[ -f "$DOCKER_ARGS_FILE" ]]; then + print_info "Using additional Docker run arguments from $DOCKER_ARGS_FILE" + readarray -t DOCKER_ARGS_FILE_LINES < $DOCKER_ARGS_FILE + for arg in "${DOCKER_ARGS_FILE_LINES[@]}"; do + DOCKER_ARGS+=($(eval "echo $arg | envsubst")) + done fi # Run container from image @@ -88,11 +133,10 @@ docker run -it --rm \ ${DOCKER_ARGS[@]} \ -v $ISAAC_ROS_DEV_DIR:/workspaces/isaac_ros-dev \ --name "$CONTAINER_NAME" \ - --gpus all \ + --runtime nvidia \ --user="admin" \ - --entrypoint /home/admin/workspace-entrypoint.sh \ + --entrypoint /usr/local/bin/scripts/workspace-entrypoint.sh \ + --workdir /workspaces/isaac_ros-dev \ $@ \ $BASE_NAME \ /bin/bash - -