nx_metadata_sdk
1.0
Metadata SDK
|
#include <consuming_device_agent.h>
Public Member Functions | |
virtual void | setHandler (IHandler *handler) 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 |
Protected Member Functions | |
ConsumingDeviceAgent (const IDeviceInfo *deviceInfo, bool enableOutput, const std::string &pluginInstanceId="") | |
virtual std::string | manifestString () const =0 |
virtual bool | pushCompressedVideoFrame (const ICompressedVideoPacket *videoFrame) |
virtual bool | pushUncompressedVideoFrame (const IUncompressedVideoFrame *videoFrame) |
virtual bool | pushCustomMetadataPacket (const ICustomMetadataPacket *) |
virtual bool | pullMetadataPackets (std::vector< IMetadataPacket *> *metadataPackets) |
void | pushMetadataPacket (IMetadataPacket *metadataPacket) |
void | pushPluginDiagnosticEvent (IPluginDiagnosticEvent::Level level, std::string caption, std::string description) |
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > | settingsReceived () |
std::string | settingValue (const std::string &settingName) const |
std::map< std::string, std::string > | currentSettings () const |
void | pushManifest (const std::string &pushManifest) |
virtual void | finalize () override |
virtual void | doPushDataPacket (Result< void > *outResult, IDataPacket *dataPacket) override |
virtual void | doSetSettings (Result< const ISettingsResponse *> *outResult, const IStringMap *settings) override |
virtual void | getPluginSideSettings (Result< const ISettingsResponse *> *outResult) const override |
virtual void | getManifest (Result< const IString *> *outResult) const override |
Protected Attributes | |
const LogUtils | logUtils |
Base class for a typical implementation of DeviceAgent which receives a stream 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. |
instanceId | Must be non-empty only for Plugins from multi-IPlugin libraries. |
|
protectedvirtual |
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.
|
protectedvirtual |
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. |
Reimplemented in nx::vms_server_plugins::analytics::stub::special_objects::DeviceAgent, nx::vms_server_plugins::analytics::stub::video_frames::DeviceAgent, nx::vms_server_plugins::analytics::stub::deprecated_object_detection::DeviceAgent, nx::vms_server_plugins::analytics::stub::motion_metadata::DeviceAgent, nx::vms_server_plugins::analytics::stub::object_detection::DeviceAgent, nx::vms_server_plugins::analytics::stub::best_shots::DeviceAgent, nx::vms_server_plugins::analytics::stub::object_streamer::DeviceAgent, nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent, and nx::vms_server_plugins::analytics::stub::object_actions::DeviceAgent.
|
inlineprotectedvirtual |
Override to accept next custom metadata for processing.
customMetadataPacket | Contains a pointer to the custom metadata packet. |
Reimplemented in nx::vms_server_plugins::analytics::stub::custom_metadata::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 PluginDiagnosticEvent 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.
|
protectedvirtual |
Override to accept next uncompressed video frame for processing.
videoFrame | Contains a pointer to the compressed video frame raw bytes. |
Reimplemented in nx::vms_server_plugins::analytics::stub::video_frames::DeviceAgent, and nx::vms_server_plugins::analytics::sample::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::special_objects::DeviceAgent, nx::vms_server_plugins::analytics::stub::video_frames::DeviceAgent, nx::vms_server_plugins::analytics::stub::deprecated_object_detection::DeviceAgent, nx::vms_server_plugins::analytics::stub::diagnostic_events::DeviceAgent, nx::vms_server_plugins::analytics::stub::events::DeviceAgent, nx::vms_server_plugins::analytics::stub::object_detection::DeviceAgent, nx::vms_server_plugins::analytics::stub::motion_metadata::DeviceAgent, nx::vms_server_plugins::analytics::stub::best_shots::DeviceAgent, nx::vms_server_plugins::analytics::stub::object_streamer::DeviceAgent, nx::vms_server_plugins::analytics::stub::settings::DeviceAgent, and nx::vms_server_plugins::analytics::stub::taxonomy_features::DeviceAgent.
|
protected |
Provides access to the DeviceAgent settings stored by the Server for the particular Device.
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.