nx_server_plugin_sdk 1.0 Server Plugin SDK

camera_manager.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <camera/camera_plugin.h>
6 #include <nx/sdk/ptr.h>
7 #include <plugins/plugin_tools.h>
8
9 #include "dir_contents_manager.h"
10 #include "image_library_plugin.h"
11
12 class MediaEncoder;
13
14 class CameraManager
15 :
16 public nxcip::BaseCameraManager2
17 {
18 public:
19 CameraManager( const nxcip::CameraInfo& info );
20 virtual ~CameraManager();
21
23 virtual void* queryInterface( const nxpl::NX_GUID& interfaceID ) override;
25 virtual int addRef() const override;
27 virtual int releaseRef() const override;
28
30 virtual int getEncoderCount( int* encoderCount ) const override;
32 virtual int getEncoder( int encoderIndex, nxcip::CameraMediaEncoder** encoderPtr ) override;
34 virtual int getCameraInfo( nxcip::CameraInfo* info ) const override;
36 virtual int getCameraCapabilities( unsigned int* capabilitiesMask ) const override;
38 virtual void setCredentials( const char* username, const char* password ) override;
40 virtual int setAudioEnabled( int audioEnabled ) override;
42 virtual nxcip::CameraPtzManager* getPtzManager() const override;
44 virtual nxcip::CameraMotionDataProvider* getCameraMotionDataProvider() const override;
46 virtual nxcip::CameraRelayIOManager* getCameraRelayIOManager() const override;
48 virtual void getLastErrorString( char* errorString ) const override;
49
51 virtual int createDtsArchiveReader( nxcip::DtsArchiveReader** dtsArchiveReader ) const override;
53 virtual int find( nxcip::ArchiveSearchOptions* searchOptions, nxcip::TimePeriods** timePeriods ) const override;
55 virtual int setMotionMask( nxcip::Picture* motionMask ) override;
56
57 const nxcip::CameraInfo& info() const;
58 nxpt::CommonRefManager* refManager();
59 const DirContentsManager& dirContentsManager() const;
60 DirContentsManager* dirContentsManager();
61
62 private:
63 nxpt::CommonRefManager m_refManager;
68 nx::sdk::Ptr<ImageLibraryPlugin> m_pluginRef;
69 nxcip::CameraInfo m_info;
70 unsigned int m_capabilities;
71 std::unique_ptr<MediaEncoder> m_encoder[2];
72 mutable DirContentsManager m_dirContentsManager;
73 };
CameraManager::releaseRef
virtual int releaseRef() const override
Implementation of nxpl::PluginInterface::releaseRef.
Definition: camera_manager.cpp:60
nxcip::ArchiveSearchOptions
Set of options, used to search archive.
Definition: camera_plugin.h:711
nxcip::CameraMediaEncoder
Provides encoder parameter configuration and media stream access (by providing media stream url) ...
Definition: camera_plugin.h:304
nxcip::CameraMotionDataProvider
Provides access to motion detection support, implemented on camera.
Definition: camera_plugin.h:1387
CameraManager::getEncoder
virtual int getEncoder(int encoderIndex, nxcip::CameraMediaEncoder **encoderPtr) override
Implementation of nxcip::BaseCameraManager::getEncoder.
Definition: camera_manager.cpp:73
CameraManager::getLastErrorString
virtual void getLastErrorString(char *errorString) const override
Implementation of nxcip::BaseCameraManager::getLastErrorString.
Definition: camera_manager.cpp:131
CameraManager::setMotionMask
virtual int setMotionMask(nxcip::Picture *motionMask) override
Implementation of nxcip::BaseCameraManager2::setMotionMask.
Definition: camera_manager.cpp:151
DirContentsManager
Manages information about image directory contents: Provides file list, generates timestamps of files...
Definition: dir_contents_manager.h:13
CameraManager::setAudioEnabled
virtual int setAudioEnabled(int audioEnabled) override
Implementation of nxcip::BaseCameraManager::setAudioEnabled.
Definition: camera_manager.cpp:107
CameraManager::getPtzManager
virtual nxcip::CameraPtzManager * getPtzManager() const override
Implementation of nxcip::BaseCameraManager::getPTZManager.
Definition: camera_manager.cpp:113
nx::sdk::Ptr< ImageLibraryPlugin >
CameraManager::getCameraInfo
virtual int getCameraInfo(nxcip::CameraInfo *info) const override
Implementation of nxcip::BaseCameraManager::getCameraInfo.
Definition: camera_manager.cpp:87
nxcip::DtsArchiveReader
Provides access to archive, stored on camera.
Definition: camera_plugin.h:1219
CameraManager::createDtsArchiveReader
virtual int createDtsArchiveReader(nxcip::DtsArchiveReader **dtsArchiveReader) const override
Implementation of nxcip::BaseCameraManager2::createDtsArchiveReader.
Definition: camera_manager.cpp:137
CameraManager
Definition: camera_manager.h:14
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
nxcip::BaseCameraManager2
Extends BaseCameraManager by adding remote archive storage support (e.g., storage is mounted directly...
Definition: camera_plugin.h:770
CameraManager::find
virtual int find(nxcip::ArchiveSearchOptions *searchOptions, nxcip::TimePeriods **timePeriods) const override
Implementation of nxcip::BaseCameraManager2::find.
Definition: camera_manager.cpp:143
nxcip::CameraInfo
Contains base camera information.
Definition: camera_plugin.h:73
CameraManager::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Implementation of nxpl::PluginInterface::queryInterface.
Definition: camera_manager.cpp:35
CameraManager::getCameraMotionDataProvider
virtual nxcip::CameraMotionDataProvider * getCameraMotionDataProvider() const override
Implementation of nxcip::BaseCameraManager::getCameraMotionDataProvider.
Definition: camera_manager.cpp:119
nxcip::CameraPtzManager
Pan-tilt-zoom management.
Definition: camera_plugin.h:883
nxcip::Picture
Picture.
Definition: camera_plugin.h:654
nxcip::CameraRelayIOManager
Relay input/output management.
Definition: camera_plugin.h:1407
nxpt::CommonRefManager
Definition: plugin_tools.h:67
CameraManager::getEncoderCount
virtual int getEncoderCount(int *encoderCount) const override
Implementation of nxcip::BaseCameraManager::getEncoderCount.
Definition: camera_manager.cpp:66
CameraManager::getCameraCapabilities
virtual int getCameraCapabilities(unsigned int *capabilitiesMask) const override
Implementation of nxcip::BaseCameraManager::getCameraCapabilities.
Definition: camera_manager.cpp:94
plugin_tools.h
nxcip::TimePeriods
Array of time periods.
Definition: camera_plugin.h:687
CameraManager::addRef
virtual int addRef() const override
Implementation of nxpl::PluginInterface::addRef.
Definition: camera_manager.cpp:55
CameraManager::getCameraRelayIOManager
virtual nxcip::CameraRelayIOManager * getCameraRelayIOManager() const override
Implementation of nxcip::BaseCameraManager::getCameraRelayIOManager.
Definition: camera_manager.cpp:125
MediaEncoder
Definition: media_encoder.h:17
CameraManager::setCredentials
virtual void setCredentials(const char *username, const char *password) override
Implementation of nxcip::BaseCameraManager::setCredentials.
Definition: camera_manager.cpp:101