nx_storage_sdk
1.0
Storage SDK
|
// Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
The whole contents of this package, including all C/C++ source code, is licensed as Open Source under the terms of Mozilla Public License 2.0: www.mozilla.org/MPL/2.0/, with the possible exception of certain files which may be licensed under the terms of other open-source licenses explicitly referenced in those files.
See the license texts in license_*.md
files in the root directory of this package.
This package provides an SDK to create so-called Storage Plugins for the Video Management System (VMS).
From the business logic point of view, a Storage Plugin creates its own type of a Storage which can be used by the VMS for storing video archive and analytics metadata.
From the developers' point of view, a Storage Plugin is a dynamic library (.dll
on Windows, .so
on Linux) which exports a single extern "C"
entry point function. Such function is a factory for objects inherited from a dedicated SDK abstract class (in other words, implementing a dedicated interface) class nxpl::PluginInterface
(src/plugins/plugin_api.h
). This base interface also defines the name and the prototype of the entry point function.
To make it possible to develop plugins using a different C++ compiler (e.g. with an incompatible ABI) rather than the one used to compile the VMS itself, or potentially in languages other than C++, a COM-like approach is offered: all objects created in a plugin or passed to a plugin inherit abstract classes declared in header files of this SDK, which have only pure virtual functions with C-style arguments (not using C++ standard library classes). To manage lifetime of such objects, they incorporate a reference counter.
The SDK C++ files have extensive documentation comments in Doxygen format, from which HTML files are generated and included into the SDK: see docs/html/index.html
.
This package includes a number of sample Storage Plugins written in C++, located at samples/
.
These samples can be compiled and linked using CMake.
Prerequisites:
To compile the samples, execute the commands collected into the provided scripts (use their source code as a reference; run with -h
or /?
to see the possible options):
On Windows, after CMake generation phase, Visual Studio GUI can be used to compile a sample: open ..\storage_sdk-build\<sample_name>\<sample_name>.sln
and build the ALL_BUILD
project. Make sure that the platform combo-box is set to "x64".
After successful build, locate the built artifacts:
To install a plugin, just copy its library file to the dedicated folder in the VMS Server installation directory:
ATTENTION: After copying a plugin library, the Server has to be restarted.
Plugin libraries compiled using nx_storage_sdk 1.7.1 (which has been included with VMS 3.2) are compatible with VMS 4.0, because the binary interface (ABI) did not change. The same way, plugins compiled with this newer storage_sdk should work with VMS 3.2 as well.
The current storage_sdk version (coming with VMS 4.0) has no new features or extensions to the API available for the plugins in nx_storage_sdk 1.7.1 (coming with VMS 3.2).
Re-compiling the source code of plugins written with nx_storage_sdk 1.7.1 using this newer storage_sdk requires some simple adjustments due the following breaking changes in SDK source code:
class PluginInterface
methods (does not affect binary compatibility) addRef()
and releaseRef()
:int
instead of unsigned int
.const
.nxpl::Plugin3
which only added setLocale()
to nxpl::Plugin2
.include/plugins/storage/third_party/third_party_storage.h
-> src/storage/
.include/plugins/plugin_api.h -> src/plugins/
.