nx_server_plugin_sdk 1.0 Server Plugin SDK

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

Provides encoder parameter configuration and media stream access (by providing media stream url) More...

`#include <camera_plugin.h>`

Inheritance diagram for nxcip::CameraMediaEncoder:

## Public Member Functions
virtual int | getMediaUrl (char *urlBuf) const =0
| Returns url of media stream as NULL-terminated utf-8 string. More...
virtual int | getResolutionList (ResolutionInfo *infoList, int *infoListCount) const =0
| Returns supported resolution list. More...
virtual int | getMaxBitrate (int *maxBitrate) const =0
| Returns maximum bitrate in Kbps. 0 is interpreted as unlimited bitrate value. More...
virtual int | setResolution (const Resolution &resolution)=0
| Change resolution on specified encoder. More...
virtual int | setFps (const float &fps, float *selectedFps)=0
virtual int | setBitrate (int bitrateKbps, int *selectedBitrateKbps)=0
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 encoder parameter configuration and media stream access (by providing media stream url)

## Member Function Documentation

## ◆ getMaxBitrate()

virtual int nxcip::CameraMediaEncoder::getMaxBitrate | ( | int * | maxBitrate | ) | const
| pure virtual

Returns maximum bitrate in Kbps. 0 is interpreted as unlimited bitrate value.

Parameters

  [out] | maxBitrate | Returned value of max bitrate

Returns
  0 on success, otherwise - error code

Implemented in AxisMediaEncoder, MediaEncoder, and rpi_cam::MediaEncoder.

## ◆ getMediaUrl()

virtual int nxcip::CameraMediaEncoder::getMediaUrl | ( | char * | urlBuf | ) | const
| pure virtual

Returns url of media stream as NULL-terminated utf-8 string.

Returned url MUST consider stream parameters set with setResolution, setFps, etc... Supported protocols:

- rtsp. RTP with h.264 and motion jpeg supported
- http. Motion jpeg only supported
  Parameters

    [out] | urlBuf | Buffer of size MAX_TEXT_LEN. MUST be NULL-terminated after return

  Returns
    0 on success, otherwise - error code

Implemented in AxisMediaEncoder, MediaEncoder, and rpi_cam::MediaEncoder.

## ◆ getResolutionList()

virtual int nxcip::CameraMediaEncoder::getResolutionList | ( | ResolutionInfo * | infoList,
|  | int * | infoListCount
| ) |  | const
| pure virtual

Returns supported resolution list.

Parameters

  [out] | infoList | Array of size MAX_RESOLUTION_LIST_SIZE
  [out] | infoListCount | Returned number of supported resolutions

Returns
  0 on success, otherwise - error code

Note
  Plugin is can return empty resolution list

Implemented in AxisMediaEncoder, MediaEncoder, and rpi_cam::MediaEncoder.

## ◆ setBitrate()

virtual int nxcip::CameraMediaEncoder::setBitrate | ( | int | bitrateKbps,
|  | int * | selectedBitrateKbps
| ) |  |
| pure virtual

Camera is allowed to select bitrate different from requested, but it should try to choose bitrate nearest to requested

Parameters

  [in] | bitrateKbps | Requested bitrate in kbps
  [out] | selectedBitrateKbps | *selectedBitrateKbps MUST be set to actual bitrate implied

Returns
  0 on success, otherwise - error code

Implemented in AxisMediaEncoder, MediaEncoder, and rpi_cam::MediaEncoder.

## ◆ setFps()

virtual int nxcip::CameraMediaEncoder::setFps | ( | const float & | fps,
|  | float * | selectedFps
| ) |  |
| pure virtual

Camera is allowed to select fps different from requested, but it should try to choose fps nearest to requested

Parameters

  [in] | fps | Requested fps
  [out] | selectedFps | *selectedFps MUST be set to actual fps implied

Returns
  0 on success, otherwise - error code

Implemented in AxisMediaEncoder, MediaEncoder, and rpi_cam::MediaEncoder.

## ◆ setResolution()

virtual int nxcip::CameraMediaEncoder::setResolution | ( | const Resolution & | resolution | ) |
| pure virtual

Change resolution on specified encoder.

Parameters

  [in] | resolution |

Returns
  0 on success, otherwise - error code

Implemented in AxisMediaEncoder, MediaEncoder, and rpi_cam::MediaEncoder.

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

- src/camera/camera_plugin.h