nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Member Functions | List of all members
rpi_cam::CameraManager Class Reference
Inheritance diagram for rpi_cam::CameraManager:

## Public Member Functions
| CameraManager (const std::string &serial, const std::string &serverUrl)
virtual void * | queryInterface (const nxpl::NX_GUID &interfaceID) override
| Cast to type, specified by interfaceID. More...
virtual int | getEncoderCount (int *encoderCount) const override
| Provides maximum number of available encoders. More...
virtual int | getEncoder (int encoderIndex, nxcip::CameraMediaEncoder **encoderPtr) override
| Returns encoder by index. More...
virtual int | getCameraInfo (nxcip::CameraInfo *info) const override
| Fills info struct with camera data. More...
virtual int | getCameraCapabilities (unsigned int *capabilitiesMask) const override
| Return bit set of camera capabilities (CameraCapability enumeration) More...
virtual void | setCredentials (const char *username, const char *password) override
| Set credentials for camera access.
virtual int | setAudioEnabled (int audioEnabled) override
| Turn on/off audio on ALL encoders. More...
virtual nxcip::CameraPtzManager * | getPtzManager () const override
| MUST return not-NULL if ptzCapability is present. More...
virtual nxcip::CameraMotionDataProvider * | getCameraMotionDataProvider () const override
| MUST return not-NULL if hardwareMotionCapability is present. More...
virtual nxcip::CameraRelayIOManager * | getCameraRelayIOManager () const override
| MUST return not-NULL if BaseCameraManager::relayInputCapability is present. More...
virtual void | getLastErrorString (char *errorString) const override
| Returns text description of the last error. More...
Public Member Functions inherited from rpi_cam::DefaultRefCounter< nxcip::BaseCameraManager >
virtual int | addRef () const override
virtual int | releaseRef () const override

## Additional Inherited Members
Public Types inherited from nxcip::BaseCameraManager
enum | CameraCapability { hardwareMotionCapability = 0x0001, relayInputCapability = 0x0002, relayOutputCapability = 0x0004, ptzCapability = 0x0008, audioCapability = 0x0010, shareFpsCapability = 0x0020, sharePixelsCapability = 0x0040, shareIpCapability = 0x0080, dtsArchiveCapability = 0x0100, nativeMediaStreamCapability = 0x0200, primaryStreamSoftMotionCapability = 0x0400, cameraParamsPersistentCapability = 0x0800, searchByMotionMaskCapability = 0x1000, motionRegionCapability = 0x2000, needIFrameDetectionCapability = 0x4000, relativeTimestampCapability = 0x8000, customMediaUrlCapability = 0x10000, cameraTimeCapability = 0x20000, fixedQualityCapability = 0x40000, MulticastStreamCapability = 0x80000, ServerBoundCapability = 0x100000, dontAutoOpenCamera = 0x200000, noAnalytics = 0x400000, noVideo = 0x800000, ioDeviceCapability = 0x1000000 }
| Enumeration of supported camera capabilities (bit flags) More...
Protected Member Functions inherited from rpi_cam::DefaultRefCounter< nxcip::BaseCameraManager >
| DefaultRefCounter (nxpt::CommonRefManager *refManager)
Protected Attributes inherited from rpi_cam::DefaultRefCounter< nxcip::BaseCameraManager >
nxpt::CommonRefManager | m_refManager

## Member Function Documentation

## ◆ getCameraCapabilities()

int CameraManager::getCameraCapabilities | ( | unsigned int * | capabilitiesMask | ) | const
| overridevirtual

Return bit set of camera capabilities (CameraCapability enumeration)

Parameters

  [out] | capabilitiesMask |

Returns
  0 on success, otherwise - error code

Implements nxcip::BaseCameraManager.

## ◆ getCameraInfo()

int CameraManager::getCameraInfo | ( | nxcip::CameraInfo * | info | ) | const
| overridevirtual

Fills info struct with camera data.

Parameters

  [out] | info |

Returns
  0 on success, otherwise - error code

Note
  This method can set some parameters that were available during discovery

Implements nxcip::BaseCameraManager.

## ◆ getCameraMotionDataProvider()

nxcip::CameraMotionDataProvider * CameraManager::getCameraMotionDataProvider | ( |  | ) | const
| overridevirtual

MUST return not-NULL if hardwareMotionCapability is present.

Note
  Increases CameraMotionDataProvider instance reference counter
  Most likely will return same pointer on multiple requests

Deprecated:
  To receive motion data, use

Implements nxcip::BaseCameraManager.

## ◆ getCameraRelayIOManager()

nxcip::CameraRelayIOManager * CameraManager::getCameraRelayIOManager | ( |  | ) | const
| overridevirtual

MUST return not-NULL if BaseCameraManager::relayInputCapability is present.

Note
  Increases CameraRelayIOManager instance reference counter
  Most likely will return same pointer on multiple requests

Implements nxcip::BaseCameraManager.

## ◆ getEncoder()

int CameraManager::getEncoder | ( | int | encoderIndex,
|  | nxcip::CameraMediaEncoder ** | encoderPtr
| ) |  |
| overridevirtual

Returns encoder by index.

Most likely will return same pointer on multiple requests with same encoderIndex

Parameters

  [in] | encoderIndex | encoder index starts with 0
  [out] | encoderPtr |

Returns
  NX_NO_ERROR on success, otherwise - error code:
  - NX_INVALID_ENCODER_NUMBER wrong encoderIndex value

Note
  BaseCameraManager holds reference to CameraMediaEncoder

Implements nxcip::BaseCameraManager.

## ◆ getEncoderCount()

int CameraManager::getEncoderCount | ( | int * | encoderCount | ) | const
| overridevirtual

Provides maximum number of available encoders.

E.g., if 2 means that camera supports dual-streaming, 3 - for triple-streaming and so on.

- encoder number starts with 0
- encoders MUST be numbered in quality decrease order (0 - encoder with best quality, 1 - low-quality)

Parameters

  [out] | encoderCount | Contains encoder count on return

Returns
  0 on success, otherwise - error code

Implements nxcip::BaseCameraManager.

## ◆ getLastErrorString()

void CameraManager::getLastErrorString | ( | char * | errorString | ) | const
| overridevirtual

Returns text description of the last error.

Parameters

  [out] | errorString | Buffer of size MAX_TEXT_LEN

Implements nxcip::BaseCameraManager.

## ◆ getPtzManager()

nxcip::CameraPtzManager * CameraManager::getPtzManager | ( |  | ) | const
| overridevirtual

MUST return not-NULL if ptzCapability is present.

Note
  Increases CameraPtzManager instance reference counter
  Most likely will return same pointer on multiple requests

Implements nxcip::BaseCameraManager.

## ◆ queryInterface()

void * CameraManager::queryInterface | ( | const nxpl::NX_GUID & | interfaceID | ) |
| overridevirtual

Cast to type, specified by interfaceID.

If pointer cannot be cast, NULL MUST be returned

Returns
  If not NULL, returned pointer can be safely cast to type, defined by interfaceID

Note
  This method increments reference counter

Implements nxpl::PluginInterface.

## ◆ setAudioEnabled()

int CameraManager::setAudioEnabled | ( | int | audioEnabled | ) |
| overridevirtual

Turn on/off audio on ALL encoders.

Parameters

  [in] | audioEnabled | If non-zero, audio should be enabled on ALL encoders, else - disabled

Returns
  0 on success, otherwise - error code

Implements nxcip::BaseCameraManager.

The documentation for this class was generated from the following files:

- samples/device/rpi_camera_plugin/src/camera_manager.h
- samples/device/rpi_camera_plugin/src/camera_manager.cpp