nx_metadata_sdk 1.0 Metadata SDK

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nx::sdk::analytics::VideoFrameProcessingDeviceAgent Class Referenceabstract

`#include <video_frame_processing_device_agent.h>`

Inheritance diagram for nx::sdk::analytics::VideoFrameProcessingDeviceAgent:

## Public Member Functions
virtual void | setHandler (IHandler *handler) override
Public Member Functions inherited from nx::sdk::RefCountable< IConsumingDeviceAgent >
| 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
| VideoFrameProcessingDeviceAgent (const IDeviceInfo *deviceInfo, bool enableOutput)
virtual std::string | manifestString () const =0
virtual bool | pushCompressedVideoFrame (const ICompressedVideoPacket *)
virtual bool | pushUncompressedVideoFrame (const IUncompressedVideoFrame *)
virtual bool | pullMetadataPackets (std::vector< IMetadataPacket *> *)
void | pushMetadataPacket (IMetadataPacket *metadataPacket)
void | pushPluginDiagnosticEvent (IPluginDiagnosticEvent::Level level, std::string caption, std::string description)
virtual nx::sdk::Result< const nx::sdk::IStringMap * > | settingsReceived ()
std::string | settingValue (const std::string &paramName)
virtual void | doPushDataPacket (Result< void > *outResult, IDataPacket *dataPacket) override
virtual void | doSetSettings (Result< const IStringMap *> *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

## Detailed Description

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>

## Constructor & Destructor Documentation

## ◆ VideoFrameProcessingDeviceAgent()

nx::sdk::analytics::VideoFrameProcessingDeviceAgent::VideoFrameProcessingDeviceAgent | ( | const IDeviceInfo * | deviceInfo,
|  | bool | enableOutput
| ) |  |
| protected

Parameters

  enableOutput | Enables NX_OUTPUT. Typically, use NX_DEBUG_ENABLE_OUTPUT as a value.

## Member Function Documentation

## ◆ pullMetadataPackets()

virtual bool nx::sdk::analytics::VideoFrameProcessingDeviceAgent::pullMetadataPackets | ( | std::vector< IMetadataPacket *> * |  | ) |
| inline protected virtual

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.

## ◆ pushCompressedVideoFrame()

virtual bool nx::sdk::analytics::VideoFrameProcessingDeviceAgent::pushCompressedVideoFrame | ( | const ICompressedVideoPacket * |  | ) |
| inline protected virtual

Override to accept next compressed video frame for processing. Should not block the caller thread for long.

Parameters

  videoFrame | Contains a pointer to the compressed video frame raw bytes.

Reimplemented in nx::vms_server_plugins::analytics::stub::DeviceAgent.

## ◆ pushMetadataPacket()

void nx::sdk::analytics::VideoFrameProcessingDeviceAgent::pushMetadataPacket | ( | IMetadataPacket * | metadataPacket | ) |
| 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().

## ◆ pushPluginDiagnosticEvent()

void nx::sdk::analytics::VideoFrameProcessingDeviceAgent::pushPluginDiagnosticEvent | ( | IPluginDiagnosticEvent::Level | level,
|  | std::string | caption,
|  | std::string | description
| ) |  |
| 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.

## ◆ pushUncompressedVideoFrame()

virtual bool nx::sdk::analytics::VideoFrameProcessingDeviceAgent::pushUncompressedVideoFrame | ( | const IUncompressedVideoFrame * |  | ) |
| inline protected virtual

Override to accept next uncompressed video frame for processing.

Parameters

  videoFrame | Contains a pointer to the compressed video frame raw bytes.

Reimplemented in nx::vms_server_plugins::analytics::stub::DeviceAgent.

## ◆ settingsReceived()

virtual nx::sdk::Result<const nx::sdk::IStringMap*> nx::sdk::analytics::VideoFrameProcessingDeviceAgent::settingsReceived | ( |  | ) |
| inline protected virtual

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.

Returns
  Error messages per setting (if any), as in IDeviceAgent::setSettings().

Reimplemented in nx::vms_server_plugins::analytics::stub::DeviceAgent.

## ◆ settingValue()

std::string nx::sdk::analytics::VideoFrameProcessingDeviceAgent::settingValue | ( | const std::string & | paramName | ) |
| 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.

Returns
  Setting value, or an empty string if such setting does not exist, having logged the error.

The documentation for this class was generated from the following files:

- src/nx/sdk/analytics/helpers/video_frame_processing_device_agent.h
- src/nx/sdk/analytics/helpers/video_frame_processing_device_agent.cpp