stub_analytics_plugin
1.6
Network Optix Video Analytics SDK
|
#include <video_frame_processing_device_agent.h>
Public Member Functions | |
template<typename DerivedEngine > | |
DerivedEngine * | engineCasted () const |
virtual IEngine * | engine () const override |
virtual Error | setHandler (IDeviceAgent::IHandler *handler) override |
virtual Error | pushDataPacket (IDataPacket *dataPacket) override |
virtual const IString * | manifest (Error *error) const override |
virtual void | setSettings (const nx::sdk::IStringMap *settings) override |
virtual nx::sdk::IStringMap * | pluginSideSettings () const override |
![]() | |
RefCountable (const RefCountable &)=delete | |
RefCountable (RefCountable &&)=delete | |
RefCountable & | operator= (const RefCountable &)=delete |
RefCountable & | operator= (RefCountable &&)=delete |
virtual int | addRef () const override |
virtual int | releaseRef () const override |
int | refCount () const |
virtual IRefCountable * | queryInterface (InterfaceId id) |
const IRefCountable * | queryInterface (InterfaceId id) const |
Interface * | queryInterface () |
const Interface * | queryInterface () const |
Protected Member Functions | |
VideoFrameProcessingDeviceAgent (IEngine *engine, bool enableOutput, const std::string &printPrefix="") | |
virtual std::string | manifest () const =0 |
virtual bool | pushCompressedVideoFrame (const ICompressedVideoPacket *) |
virtual bool | pushUncompressedVideoFrame (const IUncompressedVideoFrame *) |
virtual bool | pullMetadataPackets (std::vector< IMetadataPacket *> *) |
void | pushMetadataPacket (IMetadataPacket *metadataPacket) |
void | pushPluginEvent (IPluginEvent::Level level, std::string caption, std::string description) |
virtual void | settingsReceived () |
std::string | getParamValue (const char *paramName) |
virtual Error | setNeededMetadataTypes (const IMetadataTypes *metadataTypes) override=0 |
Protected Attributes | |
const LogUtils | logUtils |
Base class for a typical implementation of DeviceAgent which receives video frames and sends back constructed metadata packets. Hides many technical details of Analytics SDK, but may limit DeviceAgent capabilities - use only when suitable.
To use NX_PRINT/NX_OUTPUT in a derived class with the prefix defined by this class, add the following to the derived class .cpp:
#define NX_PRINT_PREFIX (this->logUtils.printPrefix)
#include <nx/kit/debug.h>
|
protected |
enableOutput | Enables NX_OUTPUT. Typically, use NX_DEBUG_ENABLE_OUTPUT as a value. |
printPrefix | Prefix for NX_PRINT and NX_OUTPUT. If empty, will be made from Engine's libName(). |
|
inline |
Intended to be called from a method of a derived class overriding engine().
|
protected |
Provides access to the Manager settings stored by the server for a particular Resource. ATTENTION: If settingsReceived() has not been called yet, it means that the DeviceAgent has not received its settings from the server yet, and thus this method will yield empty values.
|
inlineprotectedvirtual |
Override to send the newly constructed metadata packets to Server - add the packets to the provided list. Called after pushVideoFrame() to retrieve any metadata packets available to the moment (not necessarily referring to that frame). As an alternative, send metadata to Server by calling pushMetadataPacket() instead of implementing this method.
|
inlineprotectedvirtual |
Override to accept next compressed video frame for processing. Should not block the caller thread for long.
videoFrame | Contains a pointer to the compressed video frame raw bytes. The lifetime (validity) of this pointer is the same as of videoFrame. Thus, it can be extended by addRef() or queryInterface() inside this method. |
Reimplemented in nx::vms_server_plugins::analytics::stub::DeviceAgent.
|
protected |
Send a newly constructed metadata packet to Server. Can be called at any time, from any thread. As an alternative, send metadata to Server by implementing pullMetadataPackets().
|
protected |
Sends a PluginEvent to the Server. Can be called from any thread, but if called before settingsReceived() was called, will be ignored in case setHandler() was not called yet.
|
inlineprotectedvirtual |
Override to accept next uncompressed video frame for processing.
videoFrame | Contains a pointer to the compressed video frame raw bytes. The lifetime (validity) of this pointer is the same as of videoFrame. Thus, it can be extended by addRef() or queryInterface() inside this method. |
Reimplemented in nx::vms_server_plugins::analytics::stub::DeviceAgent.
|
inlineprotectedvirtual |
Called when the settings are received from the server (even if the values are not changed). Should perform any required (re)initialization. Called even if the settings model is empty.
Reimplemented in nx::vms_server_plugins::analytics::stub::DeviceAgent.