nx_server_plugin_sdk 1.0 Server Plugin SDK

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

Used for reading media stream from camera. More...

`#include <camera_plugin.h>`

Inheritance diagram for nxcip::StreamReader:

## Public Member Functions
virtual int | getNextData (MediaDataPacket **packet)=0
| Returns media packet or NULL in case of error. More...
virtual void | interrupt ()=0
| Interrupt StreamReader::getNextData blocked in other thread.
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

Used for reading media stream from camera.

Provides synchronous API to receiving media stream

Note
  returns stream of media data of different types (video, audio)
  This class itself does not add any delay into media stream. Data is returned upon its availability. E.g., while reading media stream from file with 30fps, actual data rate is not limited with 30fps, but with read speed only

## Member Function Documentation

## ◆ getNextData()

virtual int nxcip::StreamReader::getNextData | ( | MediaDataPacket ** | packet | ) |
| pure virtual

Returns media packet or NULL in case of error.

If no data is available, blocks till some data becomes available or StreamReader::interrupt had been called

Parameters

  packet | MUST NOT be NULL if nxcip::NX_NO_ERROR is returned

Returns
  error code (nxcip::NX_NO_ERROR on success)

Note
  Returned packet has its ref counter set to 1
  On end of data, nxcip::NX_NO_ERROR is returned and packet MUST have type dptEmpty
  If two subsequent packets has timestamp difference greater than 2 seconds it is considered that timestamp discontinuity has occurred
  Packets of type dptEmpty MUST have flag MediaDataPacket::fReverseStream set if end-of-stream has been reached with reverse mode

Implemented in StreamReader, and rpi_cam::StreamReader.

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

- src/camera/camera_plugin.h