nx_server_plugin_sdk 1.0 Server Plugin SDK

discovery_manager.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #ifndef RPI_DISCOVERY_MANAGER_H
4 #define RPI_DISCOVERY_MANAGER_H
5
6 #include <mutex>
7
8 #include <camera/camera_plugin.h>
9
10 #include "ref_counter.h"
11
12 namespace rpi_cam
13 {
14 class CameraManager;
15
17 class DiscoveryManager : public DefaultRefCounter<nxcip::CameraDiscoveryManager>
18 {
19 public:
20 DiscoveryManager();
21 virtual ~DiscoveryManager();
22
23 // nxpl::PluginInterface
24
25 virtual void * queryInterface( const nxpl::NX_GUID& interfaceID ) override;
26
27 // nxcip::CameraDiscoveryManager
28
29 virtual void getVendorName( char* buf ) const override;
30 virtual int findCameras( nxcip::CameraInfo* cameras, const char* serverURL ) override;
31 virtual int checkHostAddress( nxcip::CameraInfo* cameras, const char* address, const char* login, const char* password ) override;
32 virtual int fromMDNSData(
33 const char* discoveredAddress,
34 const unsigned char* mdnsResponsePacket,
35 int mdnsResponsePacketSize,
36 nxcip::CameraInfo* cameraInfo ) override;
37 virtual int fromUpnpData( const char* upnpXMLData, int upnpXMLDataSize, nxcip::CameraInfo* cameraInfo ) override;
38 virtual nxcip::BaseCameraManager* createCameraManager( const nxcip::CameraInfo& info ) override;
39 virtual int getReservedModelList( char** modelList, int* count ) override;
40
41 //
42
43 static nxpt::CommonRefManager * refManager() { return &(Instance->m_refManager); }
44
45 private:
46 mutable std::mutex m_mutex;
47 CameraManager * m_camera;
48
49 static DiscoveryManager * Instance;
50 };
51 }
52
53 #endif
rpi_cam::DiscoveryManager::fromUpnpData
virtual int fromUpnpData(const char *upnpXMLData, int upnpXMLDataSize, nxcip::CameraInfo *cameraInfo) override
UPNP camera search method.
Definition: discovery_manager.cpp:129
rpi_cam::CameraManager
Definition: camera_manager.h:19
rpi_cam
Raspberry Pi camera unit and configuration.
Definition: camera_manager.cpp:21
rpi_cam::DiscoveryManager::getVendorName
virtual void getVendorName(char *buf) const override
Returns utf-8 camera vendor name.
Definition: discovery_manager.cpp:81
CameraManager
Definition: camera_manager.h:14
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
nxcip::CameraInfo
Contains base camera information.
Definition: camera_plugin.h:73
rpi_cam::DiscoveryManager::fromMDNSData
virtual int fromMDNSData(const char *discoveredAddress, const unsigned char *mdnsResponsePacket, int mdnsResponsePacketSize, nxcip::CameraInfo *cameraInfo) override
MDNS camera search method.
Definition: discovery_manager.cpp:120
nxpt::CommonRefManager
Definition: plugin_tools.h:67
rpi_cam::DiscoveryManager::findCameras
virtual int findCameras(nxcip::CameraInfo *cameras, const char *serverURL) override
Vendor-specific camera search method. Returns list of found cameras.
Definition: discovery_manager.cpp:87
rpi_cam::DiscoveryManager::getReservedModelList
virtual int getReservedModelList(char **modelList, int *count) override
Get model names, reserved by the plugin.
Definition: discovery_manager.cpp:145
rpi_cam::DefaultRefCounter
Definition: ref_counter.h:11
nxcip::BaseCameraManager
Provides base camera operations: getting/settings fps, resolution, bitrate, media stream url(s)...
Definition: camera_plugin.h:533
rpi_cam::DiscoveryManager::checkHostAddress
virtual int checkHostAddress(nxcip::CameraInfo *cameras, const char *address, const char *login, const char *password) override
Check host for camera presence.
Definition: discovery_manager.cpp:115
rpi_cam::DiscoveryManager::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Cast to type, specified by interfaceID.
Definition: discovery_manager.cpp:65
rpi_cam::DiscoveryManager
Definition: discovery_manager.h:17
rpi_cam::DiscoveryManager::createCameraManager
virtual nxcip::BaseCameraManager * createCameraManager(const nxcip::CameraInfo &info) override
Instantiates camera manager instance based on info.
Definition: discovery_manager.cpp:134