nx_server_plugin_sdk 1.0 Server Plugin SDK

axis_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 <memory>
6 #include <vector>
7
8 #include <QtCore/QString>
9 #include <QtNetwork/QAuthenticator>
10
11 #include <camera/camera_plugin.h>
12 #include <nx/sdk/ptr.h>
13 #include <plugins/plugin_tools.h>
14
15 class AxisCameraPlugin;
16 class AxisMediaEncoder;
17 class AxisRelayIOManager;
18 class SyncHttpClient;
19
21 class AxisCameraManager
22 :
23 public nxcip::BaseCameraManager
24 {
25 public:
26 AxisCameraManager( const nxcip::CameraInfo& info );
27 virtual ~AxisCameraManager();
28
30 virtual void* queryInterface( const nxpl::NX_GUID& interfaceID ) override;
32 virtual int addRef() const override;
34 virtual int releaseRef() const override;
35
37 virtual int getEncoderCount( int* encoderCount ) const override;
39 virtual int getEncoder( int encoderIndex, nxcip::CameraMediaEncoder** encoderPtr ) override;
41 virtual int getCameraInfo( nxcip::CameraInfo* info ) const override;
43 virtual int getCameraCapabilities( unsigned int* capabilitiesMask ) const override;
45 virtual void setCredentials( const char* username, const char* password ) override;
47 virtual int setAudioEnabled( int audioEnabled ) override;
49 virtual nxcip::CameraPtzManager* getPtzManager() const override;
51 virtual nxcip::CameraMotionDataProvider* getCameraMotionDataProvider() const override;
53 virtual nxcip::CameraRelayIOManager* getCameraRelayIOManager() const override;
55 virtual void getLastErrorString( char* errorString ) const override;
56
57 const nxcip::CameraInfo& cameraInfo() const;
58 nxcip::CameraInfo& cameraInfo();
59 const QAuthenticator& credentials() const;
60
61 bool isAudioEnabled() const;
62
64 static int readAxisParameter(
65 SyncHttpClient* const httpClient,
66 const QByteArray& paramName,
67 QVariant* paramValue );
68 static int readAxisParameter(
69 SyncHttpClient* const httpClient,
70 const QByteArray& paramName,
71 QByteArray* paramValue );
72 static int readAxisParameter(
73 SyncHttpClient* const httpClient,
74 const QByteArray& paramName,
75 QString* paramValue );
76 static int readAxisParameter(
77 SyncHttpClient* const httpClient,
78 const QByteArray& paramName,
79 unsigned int* paramValue );
80 static int readAxisParameter(
81 SyncHttpClient* const httpClient,
82 const QByteArray& paramName,
83 int* paramValue );
84
85 nxpt::CommonRefManager* refManager();
86
87 private:
88 nxpt::CommonRefManager m_refManager;
93 nx::sdk::Ptr<AxisCameraPlugin> m_pluginRef;
94 mutable nxcip::CameraInfo m_info;
95 const QString m_managementURL;
96 QAuthenticator m_credentials;
97 mutable std::vector<AxisMediaEncoder*> m_encoders;
98 bool m_audioEnabled;
99 mutable bool m_relayIOInfoRead;
100 mutable std::unique_ptr<AxisRelayIOManager> m_relayIOManager;
101 mutable unsigned int m_cameraCapabilities;
102 mutable unsigned int m_inputPortCount;
103 mutable unsigned int m_outputPortCount;
104
105 int updateCameraInfo() const;
106 };
nxcip::CameraMediaEncoder
Provides encoder parameter configuration and media stream access (by providing media stream url) ...
Definition: camera_plugin.h:304
AxisCameraManager::getEncoderCount
virtual int getEncoderCount(int *encoderCount) const override
Implementation of nxcip::BaseCameraManager::getEncoderCount.
Definition: axis_camera_manager.cpp:72
nxcip::CameraMotionDataProvider
Provides access to motion detection support, implemented on camera.
Definition: camera_plugin.h:1387
AxisMediaEncoder
Implementation of nxcip::CameraMediaEncoder.
Definition: axis_media_encoder.h:16
nx::sdk::Ptr< AxisCameraPlugin >
AxisCameraManager::getPtzManager
virtual nxcip::CameraPtzManager * getPtzManager() const override
Implementation of nxcip::BaseCameraManager::getPTZManager.
Definition: axis_camera_manager.cpp:129
AxisCameraManager::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Implementation of nxpl::PluginInterface::queryInterface.
Definition: axis_camera_manager.cpp:46
AxisRelayIOManager
Provides access to camera&#39;s relay input/output port (implements nxcip::CameraRelayIOManager) ...
Definition: axis_relayio_manager.h:25
AxisCameraManager::getCameraMotionDataProvider
virtual nxcip::CameraMotionDataProvider * getCameraMotionDataProvider() const override
Implementation of nxcip::BaseCameraManager::getCameraMotionDataProvider.
Definition: axis_camera_manager.cpp:135
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
AxisCameraPlugin
Definition: axis_camera_plugin.h:36
nxcip::CameraInfo
Contains base camera information.
Definition: camera_plugin.h:73
AxisCameraManager
Provides access to camera&#39;s properties and instantiates other managers (implements nxcip::BaseCameraM...
Definition: axis_camera_manager.h:21
nxcip::CameraPtzManager
Pan-tilt-zoom management.
Definition: camera_plugin.h:883
nxcip::CameraRelayIOManager
Relay input/output management.
Definition: camera_plugin.h:1407
AxisCameraManager::getEncoder
virtual int getEncoder(int encoderIndex, nxcip::CameraMediaEncoder **encoderPtr) override
Implementation of nxcip::BaseCameraManager::getEncoder.
Definition: axis_camera_manager.cpp:78
nxpt::CommonRefManager
Definition: plugin_tools.h:67
AxisCameraManager::getCameraCapabilities
virtual int getCameraCapabilities(unsigned int *capabilitiesMask) const override
Implementation of nxcip::BaseCameraManager::getCameraCapabilities.
Definition: axis_camera_manager.cpp:101
plugin_tools.h
AxisCameraManager::readAxisParameter
static int readAxisParameter(SyncHttpClient *const httpClient, const QByteArray &paramName, QVariant *paramValue)
reads axis parameter, triggering url like http://ip/axis-cgi/param.cgi?action=list&group=Input.NbrOfInputs
Definition: axis_camera_manager.cpp:265
AxisCameraManager::getCameraInfo
virtual int getCameraInfo(nxcip::CameraInfo *info) const override
Implementation of nxcip::BaseCameraManager::getCameraInfo.
Definition: axis_camera_manager.cpp:90
AxisCameraManager::getCameraRelayIOManager
virtual nxcip::CameraRelayIOManager * getCameraRelayIOManager() const override
Implementation of nxcip::BaseCameraManager::getCameraRelayIOManager.
Definition: axis_camera_manager.cpp:141
AxisCameraManager::setAudioEnabled
virtual int setAudioEnabled(int audioEnabled) override
Implementation of nxcip::BaseCameraManager::setAudioEnabled.
Definition: axis_camera_manager.cpp:122
nxcip::BaseCameraManager
Provides base camera operations: getting/settings fps, resolution, bitrate, media stream url(s)...
Definition: camera_plugin.h:533
AxisCameraManager::setCredentials
virtual void setCredentials(const char *username, const char *password) override
Implementation of nxcip::BaseCameraManager::setCredentials.
Definition: axis_camera_manager.cpp:113
SyncHttpClient
Synchronous wrapper on top of QNetworkAccessManager.
Definition: sync_http_client.h:18
AxisCameraManager::addRef
virtual int addRef() const override
Implementation of nxpl::PluginInterface::addRef.
Definition: axis_camera_manager.cpp:61
AxisCameraManager::getLastErrorString
virtual void getLastErrorString(char *errorString) const override
Implementation of nxcip::BaseCameraManager::getLastErrorString.
Definition: axis_camera_manager.cpp:161
AxisCameraManager::releaseRef
virtual int releaseRef() const override
Implementation of nxpl::PluginInterface::releaseRef.
Definition: axis_camera_manager.cpp:66