PPlugin Class Reference

Detailed Description

The PPlugin class represents a Papillon plugin (input video source, detector, describer, ...); thread-safe.

All PPlugin instances are thread-safe: you can call different methods in separate threads. For example: one thread could change parameters or configuration of a plugin dynamically, while another thread performs processing with this plugin.

Papillon can handle 7 different types of plugins:

  • Detector
  • Describer
  • Analytics
  • Tracker
  • Image filter
  • Input Video Stream
  • Output Video Stream

Definition at line 45 of file PPlugin.h.

#include <PPlugin.h>

Constructor & Destructor Documentation

◆ PPlugin() [1/2]

PPlugin::PPlugin ( )

Construct an empty plugin.

See also
Load()

◆ PPlugin() [2/2]

PPlugin::PPlugin ( const PPlugin other)

Constructs a shared copy of other.

◆ ~PPlugin()

virtual PPlugin::~PPlugin ( )
virtual

Destroys this object.

Member Function Documentation

◆ About()

PResult PPlugin::About ( PString productName,
PVersion productVersion,
PGuid productGuid,
PString briefDescription 
) const

Returns general information about this plugin, including product name, product version, product global id and a brief description.

Returns PResult::C_OK if success, another result otherwise.

◆ CallAnalyticsApply()

PResult PPlugin::CallAnalyticsApply ( void *  instance,
const PFrame frame,
PList events 
) const

Calls PPlugin_Analytics_Apply() function of this plugin if available.

Only available for Analytics plugins: run analytics on the specified frame and retrieve a list of events. Returns PResult::C_OK if success, another result otherwise.

◆ CallAnalyticsDrawOSD()

PResult PPlugin::CallAnalyticsDrawOSD ( void *  instance,
PImage image 
) const

Calls PPlugin_Analytics_DrawOSD() function of this plugin if available.

Only available for Analytics plugins: draw metadata (OSD) on top of the specified image. Returns PResult::C_OK if success, another result otherwise.

◆ CallAnalyticsFinish()

PResult PPlugin::CallAnalyticsFinish ( void *  instance,
PList events 
) const

Calls PPlugin_Analytics_Finish() function of this plugin if available.

Only available for Analytics plugins: finalise the specified analytics engine and retrieve final events. Returns PResult::C_OK if success, another result otherwise.

◆ CallAnalyticsGetMinResolution()

PResult PPlugin::CallAnalyticsGetMinResolution ( void *  instance,
PSizei minResolution 
) const

Calls PPlugin_Analytics_GetMinResolution() function of this plugin if available.

Only available for Analytics plugins: get the minimum resolution of input frames to be used with the specified analytics. Returns PResult::C_OK if success, another result otherwise.

◆ CallCreateInstance()

PResult PPlugin::CallCreateInstance ( void **  instance,
const PProperties parameters,
const PString parametersPrefix = PString() 
) const

Calls PPlugin_CreateInstance() function of this plugin with specified parameters if available.

This is a generic plugin method which create an instance of the class or data handled by the plugin. Returns PResult::C_OK if success, another result otherwise.

◆ CallDescriberApply()

PResult PPlugin::CallDescriberApply ( void *  instance,
const PExampleSet exampleSet,
PDescription outputDescription 
) const

Calls PPlugin_Describer_Apply() function of this plugin if available.

Only available for Describer plugins: apply the describer on the specified data. Returns PResult::C_OK if success, another result otherwise.

◆ CallDescriberApplyBatch()

PResult PPlugin::CallDescriberApplyBatch ( void *  instance,
const PDetectionList detectionList,
PDescriptionList descriptionList 
) const

Calls PPlugin_Describer_ApplyBatch() function of this plugin if available.

Only available for Describer plugins: apply the describer on the specified data. Returns PResult::C_OK if success, another result otherwise.

◆ CallDescriberGetDescribeId()

PResult PPlugin::CallDescriberGetDescribeId ( void *  instance,
PGuid describeId 
) const

Calls PPlugin_Describer_GetDescribeId() function of this plugin if available.

Only available for Describer plugins: return the object type handled by the specified describer. Returns PResult::C_OK if success, another result otherwise.

◆ CallDescriberGetModelName()

PResult PPlugin::CallDescriberGetModelName ( void *  instance,
PString modelName 
) const

Calls PPlugin_Describer_GetModelName() function of this plugin if available.

Only available for Describer plugins: return the object type handled by the specified describer. Returns PResult::C_OK if success, another result otherwise.

◆ CallDescriberGetObjectType()

PResult PPlugin::CallDescriberGetObjectType ( void *  instance,
PObjectType objectType 
) const

Calls PPlugin_Describer_GetObjectType() function of this plugin if available.

Only available for Describer plugins: return the object type handled by the specified describer. Returns PResult::C_OK if success, another result otherwise.

◆ CallDestroyInstance()

PResult PPlugin::CallDestroyInstance ( void **  instance) const

Calls PPlugin_DestroyInstance() function of this plugin if available.

This is a generic plugin method which destroy the specified instance.

WARNING: 'instance' pointer will be deleted and set to NULL.

Returns PResult::C_OK if success, another result otherwise.

◆ CallDetectorDetect()

PResult PPlugin::CallDetectorDetect ( void *  instance,
const PFrame frame,
const PProperties parameters,
const PString parametersPrefix,
PDetectionList detectionList 
) const

Calls PPlugin_Detector_Detect() function of this plugin if available.

Only available for Detector plugins: apply the specified instance of the detector on a frame. Returns PResult::C_OK if success, another result otherwise.

◆ CallDetectorLocalise()

PResult PPlugin::CallDetectorLocalise ( void *  instance,
PDetectionList detectionList 
) const

Calls PPlugin_Detector_Detect() function of this plugin if available.

Only available for Detector plugins: apply the specified instance of the detector on a frame. Returns PResult::C_OK if success, another result otherwise.

◆ CallF2FTrackerApply()

PResult PPlugin::CallF2FTrackerApply ( void *  instance,
const PFrame frame,
PDetectionList detectionList 
) const

Calls PPlugin_F2FTracker_Apply() function of this plugin if available.

Only available for FrameToFrameTracker plugins: apply the tracker on the specified data. Returns PResult::C_OK if success, another result otherwise.

◆ CallGetInstanceId()

PResult PPlugin::CallGetInstanceId ( void *  instance,
PGuid id 
) const

Calls PPlugin_GetInstanceId() function of this plugin if available.

This is a generic plugin method which return the identifier of the specified instance. Returns PResult::C_OK if success, another result otherwise.

◆ CallGetInstanceName()

PResult PPlugin::CallGetInstanceName ( void *  instance,
PString name 
) const

Calls PPlugin_GetInstanceName() function of this plugin if available.

This is a generic plugin method which return the name of the specified instance. Returns PResult::C_OK if success, another result otherwise.

◆ CallGetProperties()

PResult PPlugin::CallGetProperties ( void *  instance,
PProperties properties 
) const

Calls PPlugin_GetProperties() function of this plugin if available.

Gets all properties (depends on plugin, see specific plugins documentation). Returns PResult::C_OK if success, another result otherwise.

◆ CallGetProperty()

PResult PPlugin::CallGetProperty ( void *  instance,
const PString property,
PObject object 
) const

Calls PPlugin_Get() function of this plugin if available.

Gets the specified property (depends on plugin, see specific plugins documentation). Returns PResult::C_OK if success, another result otherwise.

◆ CallImageFilterApply()

PResult PPlugin::CallImageFilterApply ( void *  instance,
const PImage source,
PImage destination 
) const

Calls PPlugin_ImageFilter_Apply() function of this plugin if available.

Only available for ImageFilter plugins: apply the image filter on the specified image. Returns PResult::C_OK if success, another result otherwise.

◆ CallSetProperty()

PResult PPlugin::CallSetProperty ( void *  instance,
const PString property,
const PObject object 
) const

Calls PPlugin_Set() function of this plugin if available.

Sets the specified property (depends on plugin, see specific plugins documentation). Returns PResult::C_OK if success, another result otherwise.

◆ CallUpdateProperties()

PResult PPlugin::CallUpdateProperties ( void *  instance,
const PProperties object 
) const

Calls PPlugin_UpdateProperties() function of this plugin if available.

Sets the specified properties (depends on plugin, see specific plugins documentation). Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamAcceptURI()

PResult PPlugin::CallVideoStreamAcceptURI ( const PUri uri) const

Calls PPlugin_VideoStream_AcceptURI() function of this plugin if available.

Only available for Input Video Stream plugins: checks if the video stream plugin can read the specified URI. Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamCanSeek()

PResult PPlugin::CallVideoStreamCanSeek ( void *  instance,
bool &  canSeek 
) const

Calls PPlugin_VideoStream_CanSeek() function of this plugin if available.

Only available for Input Video Stream plugins: checks if the specified video stream has "can seek" property. Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamClose()

PResult PPlugin::CallVideoStreamClose ( void *  instance) const

Calls PPlugin_VideoStream_Close() function of this plugin if available.

Only available for Video Stream plugins: release the specified video stream. Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamGetFrame()

PResult PPlugin::CallVideoStreamGetFrame ( void *  instance,
PFrame frame,
papillon::int32  timeOutMs 
) const

Calls PPlugin_VideoStream_GetFrame() function of this plugin if available.

Only available for Input Video Stream plugins: read a frame from the specified video stream. Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamIsOpened()

PResult PPlugin::CallVideoStreamIsOpened ( void *  instance,
bool &  isOpened 
) const

Calls PPlugin_VideoStream_IsOpened() function of this plugin if available.

Only available for Video Stream plugins: checks if the specified video stream is opened. Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamOpen()

PResult PPlugin::CallVideoStreamOpen ( void *  instance,
const PUri uri 
) const

Calls PPlugin_VideoStream_Open() function of this plugin if available.

Only available for Video Stream plugins: open the specified video stream. Returns PResult::C_OK if success, another result otherwise.

◆ CallVideoStreamPutFrame()

PResult PPlugin::CallVideoStreamPutFrame ( void *  instance,
const PFrame frame,
papillon::int32  timeOutMs 
) const

Calls PPlugin_VideoStream_PutFrame() function of this plugin if available.

Only available for Output Video Stream plugins: write a frame to the specified output video stream. Returns PResult::C_OK if success, another result otherwise.

◆ Empty()

static const PPlugin& PPlugin::Empty ( )
static

Returns empty plugin.

To be used for initialisation of variables.

◆ GetAbsoluteFilename()

PString PPlugin::GetAbsoluteFilename ( ) const

Returns the absolute path including the file name of the dynamic library associated with this plugin.

◆ GetBaseFilename()

PString PPlugin::GetBaseFilename ( ) const

Returns the base file name of the dynamic library associated with this plugin, i.e.

the file name without the path but with extension, e.g. "PPluginInputVideoStreamOpenCV.dll".

◆ GetMD5()

PString PPlugin::GetMD5 ( ) const

Returns the MD5 hash sum of the plugin.

This MD5 is computed from all the bytes contained in the plugin file.

◆ GetProductId()

PGuid PPlugin::GetProductId ( ) const

Returns the internal id of this plugin.

◆ GetProductName()

PString PPlugin::GetProductName ( ) const

Returns the internal name of this plugin.

◆ GetVersion()

PVersion PPlugin::GetVersion ( ) const

Returns the version number of this plugin.

◆ IsAnalyticsPlugin()

bool PPlugin::IsAnalyticsPlugin ( ) const

Returns true if this plugin is a PAnalytics plugin, false otherwise.

◆ IsDescriberPlugin()

bool PPlugin::IsDescriberPlugin ( ) const

Returns true if this plugin is a PDescriber plugin, false otherwise.

◆ IsDetectorPlugin()

bool PPlugin::IsDetectorPlugin ( ) const

Returns true if this plugin is a PDetector plugin, false otherwise.

◆ IsEmpty()

bool PPlugin::IsEmpty ( ) const

Returns true if this plugin is an empty plugin (i.e.

no plugin, an empty nutshell).

◆ IsFrameToFrameTrackerPlugin()

bool PPlugin::IsFrameToFrameTrackerPlugin ( ) const

Returns true if this plugin is a PFrameToFrameTracker plugin, false otherwise.

◆ IsImageFilterPlugin()

bool PPlugin::IsImageFilterPlugin ( ) const

Returns true if this plugin is a PImageFilter plugin, false otherwise.

◆ IsInputVideoStreamPlugin()

bool PPlugin::IsInputVideoStreamPlugin ( ) const

Returns true if this plugin is a PInputVideoStream plugin, false otherwise.

◆ IsOutputVideoStreamPlugin()

bool PPlugin::IsOutputVideoStreamPlugin ( ) const

Returns true if this plugin is a POutputVideoStream plugin, false otherwise.

◆ Load()

static PResult PPlugin::Load ( const PString filename,
PPlugin plugin 
)
static

Loads the specified plugin.

Returns PResult::OK if success, another result otherwise.

◆ operator!=()

bool PPlugin::operator!= ( const PPlugin other) const

Returns true if this plugin is the different from other, false otherwise.

◆ operator=()

PPlugin& PPlugin::operator= ( const PPlugin other)

Performs a shared copy of other to this object.

◆ operator==()

bool PPlugin::operator== ( const PPlugin other) const

Returns true if this plugin is the same than other (same name and same MD5), false otherwise.

◆ PrintFunctionPointers()

void PPlugin::PrintFunctionPointers ( const PLogStream os) const

Prints table of function pointers to PLogStream.