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 #ifndef RPI_CAMERA_MANAGER_H
4 #define RPI_CAMERA_MANAGER_H
5
6 #include <memory>
7 #include <string>
8
9 #include <camera/camera_plugin.h>
10
11 #include "ref_counter.h"
12
13 namespace rpi_cam
14 {
15 class MediaEncoder;
16 class RPiCamera;
17
19 class CameraManager : public DefaultRefCounter<nxcip::BaseCameraManager>
20 {
21 public:
22 CameraManager(const std::string& serial, const std::string& serverUrl);
23 virtual ~CameraManager();
24
25 // nxpl::PluginInterface
26
27 virtual void * queryInterface( const nxpl::NX_GUID& interfaceID ) override;
28
29 // nxcip::BaseCameraManager
30
31 virtual int getEncoderCount( int* encoderCount ) const override;
32 virtual int getEncoder( int encoderIndex, nxcip::CameraMediaEncoder** encoderPtr ) override;
33 virtual int getCameraInfo( nxcip::CameraInfo* info ) const override;
34 virtual int getCameraCapabilities( unsigned int* capabilitiesMask ) const override;
35 virtual void setCredentials( const char* username, const char* password ) override;
36 virtual int setAudioEnabled( int audioEnabled ) override;
37 virtual nxcip::CameraPtzManager* getPtzManager() const override;
38 virtual nxcip::CameraMotionDataProvider* getCameraMotionDataProvider() const override;
39 virtual nxcip::CameraRelayIOManager* getCameraRelayIOManager() const override;
40 virtual void getLastErrorString( char* errorString ) const override;
41
42 private:
43 std::shared_ptr<RPiCamera> m_rpiCamera;
44 std::shared_ptr<MediaEncoder> m_encoderHQ;
45 std::shared_ptr<MediaEncoder> m_encoderLQ;
46
47 nxcip::CameraInfo m_info;
48 CameraParameters m_parameters;
49
50 void makeInfo(const std::string& serial, const std::string& url);
51 };
52 }
53
54 #endif
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
rpi_cam::CameraParameters
Resolutions and common camera parameters.
Definition: rpi_camera.h:32
rpi_cam::CameraManager
Definition: camera_manager.h:19
rpi_cam::CameraManager::getCameraCapabilities
virtual int getCameraCapabilities(unsigned int *capabilitiesMask) const override
Return bit set of camera capabilities (CameraCapability enumeration)
Definition: camera_manager.cpp:107
rpi_cam
Raspberry Pi camera unit and configuration.
Definition: camera_manager.cpp:21
rpi_cam::CameraManager::setCredentials
virtual void setCredentials(const char *username, const char *password) override
Set credentials for camera access.
Definition: camera_manager.cpp:113
rpi_cam::CameraManager::getLastErrorString
virtual void getLastErrorString(char *errorString) const override
Returns text description of the last error.
Definition: camera_manager.cpp:137
rpi_cam::CameraManager::setAudioEnabled
virtual int setAudioEnabled(int audioEnabled) override
Turn on/off audio on ALL encoders.
Definition: camera_manager.cpp:117
rpi_cam::CameraManager::getEncoderCount
virtual int getEncoderCount(int *encoderCount) const override
Provides maximum number of available encoders.
Definition: camera_manager.cpp:66
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
nxcip::CameraInfo
Contains base camera information.
Definition: camera_plugin.h:73
nxcip::CameraPtzManager
Pan-tilt-zoom management.
Definition: camera_plugin.h:883
rpi_cam::CameraManager::getCameraRelayIOManager
virtual nxcip::CameraRelayIOManager * getCameraRelayIOManager() const override
MUST return not-NULL if BaseCameraManager::relayInputCapability is present.
Definition: camera_manager.cpp:132
rpi_cam::CameraManager::getCameraMotionDataProvider
virtual nxcip::CameraMotionDataProvider * getCameraMotionDataProvider() const override
MUST return not-NULL if hardwareMotionCapability is present.
Definition: camera_manager.cpp:127
nxcip::CameraRelayIOManager
Relay input/output management.
Definition: camera_plugin.h:1407
rpi_cam::CameraManager::getEncoder
virtual int getEncoder(int encoderIndex, nxcip::CameraMediaEncoder **encoderPtr) override
Returns encoder by index.
Definition: camera_manager.cpp:73
rpi_cam::CameraManager::getPtzManager
virtual nxcip::CameraPtzManager * getPtzManager() const override
MUST return not-NULL if ptzCapability is present.
Definition: camera_manager.cpp:122
rpi_cam::DefaultRefCounter
Definition: ref_counter.h:11
rpi_cam::CameraManager::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Cast to type, specified by interfaceID.
Definition: camera_manager.cpp:55
MediaEncoder
Definition: media_encoder.h:17
rpi_cam::CameraManager::getCameraInfo
virtual int getCameraInfo(nxcip::CameraInfo *info) const override
Fills info struct with camera data.
Definition: camera_manager.cpp:101