nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Types | Public Member Functions | List of all members
nxcip::BaseCameraManager Class Referenceabstract

Provides base camera operations: getting/settings fps, resolution, bitrate, media stream url(s). Also provides pointer to other camera-management interfaces. More...

`#include <camera_plugin.h>`

Inheritance diagram for nxcip::BaseCameraManager:

## Public Types
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...

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

## Detailed Description

Provides base camera operations: getting/settings fps, resolution, bitrate, media stream url(s). Also provides pointer to other camera-management interfaces.

Mediaserver uses this interface in following way:

- requests encoder count with getEncoderCount and camera capabilities with getCameraCapabilities
- requests each encoder params with getResolutionList, getMaxBitrate
- analyzes camera capabilities and set selected encoder parameters with setResolution, setFps, setBitrate, setAudioEnabled
- requests media url(s) with getMediaUrl
- requests media stream(s) using provided url

## Member Enumeration Documentation

## ◆ CameraCapability

enum nxcip::BaseCameraManager::CameraCapability

Enumeration of supported camera capabilities (bit flags)

Enumerator
hardwareMotionCapability | camera supports hardware motion. Plugin, returning this flag, MUST implement BaseCameraManager::nativeMediaStreamCapability also
relayInputCapability | if this flag is enabled, CameraRelayIOManager MUST be implemented
relayOutputCapability | if this flag is enabled, CameraRelayIOManager MUST be implemented
ptzCapability | if this flag is enabled, CameraPTZManager MUST be implemented
audioCapability | if set, camera supports audio
shareFpsCapability | if second stream is running whatever fps it has => first stream can get maximumFps - secondstreamFps
sharePixelsCapability | if second stream is running whatever megapixel it has => first stream can get maxMegapixels - secondstreamPixels
shareIpCapability | allow multiple instances on a same IP address
dtsArchiveCapability | camera has archive storage and provides access to its archive
nativeMediaStreamCapability | provides media stream through StreamReader interface, otherwise - CameraMediaEncoder::getMediaUrl is used
primaryStreamSoftMotionCapability | it is allowed to detect motion by primary stream (if no dual streaming on camera)
cameraParamsPersistentCapability | camera parameters can be read/set even if camera is not accessible at the moment
searchByMotionMaskCapability | if present, nxcip::BaseCameraManager2::find supports ArchiveSearchOptions::motionMask()
motionRegionCapability | if present, nxcip::BaseCameraManager3::setMotionMask is implemented
needIFrameDetectionCapability | packet will be tested if it's a I-Frame. Use it if plugin can't set fKeyPacket
relativeTimestampCapability | camera provides relative timestamps. It need to align them to the current time.
customMediaUrlCapability | camera's media streams are editable and can be provided directly via setProperty API call.
cameraTimeCapability | Camera sends absolute timestamps in media stream.
fixedQualityCapability | Camera does not allow to change stream quality/fps.
MulticastStreamCapability | Camera supports multicast streaming.
ServerBoundCapability | Camera is bound to a particular server.
dontAutoOpenCamera | Server should not open video from camera at its will.
noAnalytics | Analytics Engine mustn't bind to the Device.
noVideo | Audio only device.
ioDeviceCapability | Primary purpose of a device is IO module but not a camera.That flag affects UI/UX. If this flag is enabled, CameraRelayIOManager MUST be implemented.

## Member Function Documentation

## ◆ getCameraCapabilities()

virtual int nxcip::BaseCameraManager::getCameraCapabilities | ( | unsigned int * | capabilitiesMask | ) | const
| pure virtual

Return bit set of camera capabilities (CameraCapability enumeration)

Parameters

  [out] | capabilitiesMask |

Returns
  0 on success, otherwise - error code

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ getCameraInfo()

virtual int nxcip::BaseCameraManager::getCameraInfo | ( | CameraInfo * | info | ) | const
| pure virtual

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

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ getCameraMotionDataProvider()

virtual CameraMotionDataProvider* nxcip::BaseCameraManager::getCameraMotionDataProvider | ( |  | ) | const
| pure virtual

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

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ getCameraRelayIOManager()

virtual CameraRelayIOManager* nxcip::BaseCameraManager::getCameraRelayIOManager | ( |  | ) | const
| pure virtual

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

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

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ getEncoder()

virtual int nxcip::BaseCameraManager::getEncoder | ( | int | encoderIndex,
|  | CameraMediaEncoder ** | encoderPtr
| ) |  |
| pure virtual

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

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ getEncoderCount()

virtual int nxcip::BaseCameraManager::getEncoderCount | ( | int * | encoderCount | ) | const
| pure virtual

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

Implemented in AxisCameraManager, rpi_cam::CameraManager, and CameraManager.

## ◆ getLastErrorString()

virtual void nxcip::BaseCameraManager::getLastErrorString | ( | char * | errorString | ) | const
| pure virtual

Returns text description of the last error.

Parameters

  [out] | errorString | Buffer of size MAX_TEXT_LEN

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ getPtzManager()

virtual CameraPtzManager* nxcip::BaseCameraManager::getPtzManager | ( |  | ) | const
| pure virtual

MUST return not-NULL if ptzCapability is present.

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

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

## ◆ setAudioEnabled()

virtual int nxcip::BaseCameraManager::setAudioEnabled | ( | int | audioEnabled | ) |
| pure virtual

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

Implemented in AxisCameraManager, CameraManager, and rpi_cam::CameraManager.

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

- src/camera/camera_plugin.h