PPluginManager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PLog.h>
17 #include <PObject.h>
18 
19 PAPILLON_BEGIN_NAMESPACE
20 
21 class PAnalytics;
22 class PDescriber;
23 class PDetector;
25 class PGuid;
26 class PImageFilter;
27 class PInputVideoStream;
28 class PList;
29 class POutputVideoStream;
30 class PPlugin;
31 class PProperties;
32 class PUri;
33 class PVersion;
34 
44 class PAPILLON_API_CORE PPluginManager : public PObject {
45  public:
50  E_ANALYTICS = 1,
51  E_DESCRIBER = 2,
52  E_DETECTOR = 4,
53  E_FRAME_TO_FRAME_TRACKER = 8,
54  E_IMAGE_FILTER = 16,
55  E_INPUT_VIDEO_STREAM = 32,
56  E_OUTPUT_VIDEO_STREAM = 64,
57  E_ALL = 65535
58  };
59 
63  static PPluginManager& GetInstance();
64 
71  static PResult About(const PString& dynamicLibraryFilename,
72  PString& productName,
73  PVersion& productVersion,
74  PGuid& productGuid,
75  PString& briefDescription);
76 
80  virtual ~PPluginManager();
81 
85  int32 Size() const;
86 
91  PResult Load(const PString& dynamicLibraryFilename);
92 
103  PResult LoadAll(const PString& listPaths);
104 
109  PResult Unload(const PString& dynamicLibraryFilename);
110 
114  PResult Clear();
115 
119  PString GetBasicPath() const;
120 
125  PPlugin GetPlugin(const PString& productName) const;
126 
132  PList GetListPlugins(int32 filter = E_ALL) const;
133 
139  PStringList GetListPluginNames(int32 filter = E_ALL) const;
140 
145  PResult CreateAnalytics(const PString& productName, const PProperties& parameters, PAnalytics& analytics) const;
146 
151  PResult CreateDescriber(const PString& productName, const PProperties& parameters, PDescriber& describer) const;
152 
157  PResult CreateDetector(const PString& productName,
158  const PProperties& parameters,
159  const PString& parametersPrefix,
160  PDetector& detector) const;
161 
168  PResult CreateFrameToFrameTracker(const PString& productName,
169  const PProperties& parameters,
170  PFrameToFrameTracker& frameToFrameTracker) const;
171 
178  PResult CreateFrameToFrameTracker(const PString& productName,
179  const PString& parameters,
180  PFrameToFrameTracker& frameToFrameTracker) const;
181 
188  PResult CreateImageFilter(const PString& productName,
189  const PProperties& parameters,
190  PImageFilter& imageFilter) const;
191 
199  PResult OpenInputVideoStream(const PUri& uri, PInputVideoStream& inputVideoStream) const;
200 
208  PResult OpenOutputVideoStream(const PUri& uri, POutputVideoStream& outputVideoStream) const;
209 
213  void LogAvailablePlugins(PLog::ELogLevel level) const;
214 
218  PString ToBriefString() const;
219 
220  private:
221  PPluginManager();
224 };
225 
226 PAPILLON_END_NAMESPACE
The PUri class represents an Unified Resource Identifier (URI), this class can also be used to handle...
Definition: PUri.h:43
The PDetector class is the parent class for all detection algorithms which analyse an image or a vide...
Definition: PDetector.h:50
The PAnalytics class is the parent class for all video analytics algorithms which analyse a video str...
Definition: PAnalytics.h:38
The PString class provides an Unicode character strings.
Definition: PString.h:37
The log system.
The PVersion class represents a software version number: major.minor[.maintenance[.build]]; immutable, so thread-safe.
Definition: PVersion.h:26
The PPluginManager class is the manager for all Papillon plugins (singleton); thread-safe.
EPluginFilter
Filters to get a sub-list of plugins.
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
ELogLevel
All the available log levels.
Definition: PLog.h:81
The PList class represents a generic container which handle an ordered collection of PObject; NOT thr...
Definition: PList.h:46
The PProperties class represents a container of properties; each property has a name (PString) and a ...
Definition: PProperties.h:38
The PDescriber class is the parent class for all describer algorithms which turns an object detected ...
Definition: PDescriber.h:62
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PPlugin class represents a Papillon plugin (input video source, detector, describer, ...); thread-safe.
Definition: PPlugin.h:45
The PInputVideoStream class represents an input video streams like a video file, a webcam or a RTSP s...
The POutputVideoStream class represents an output video streams like a video file, a network socket or simply a screen display.
The PStringList class represents a list of PString; NOT thread-safe.
Definition: PStringList.h:26
The PImageFilter class represents an image filter.
Definition: PImageFilter.h:34
The PFrameToFrameTracker class represents a process that tracks, frame by frame, generic objects; not...
The PGuid class represents a Globally Unique Identifier (GUID); PGuid instances are immutable (thread...
Definition: PGuid.h:28
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45