nx_server_plugin_sdk 1.0 Server Plugin SDK

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

## Public Member Functions
| StreamReader (std::shared_ptr< RPiCamera > camera, unsigned encoderNumber)
virtual void * | queryInterface (const nxpl::NX_GUID &interfaceID) override
| Cast to type, specified by interfaceID. More...
virtual int | getNextData (nxcip::MediaDataPacket **packet) override
| Returns media packet or NULL in case of error. More...
virtual void | interrupt () override
| Interrupt StreamReader::getNextData blocked in other thread.
Public Member Functions inherited from rpi_cam::DefaultRefCounter< nxcip::StreamReader >
virtual int | addRef () const override
virtual int | releaseRef () const override

## Additional Inherited Members
Protected Member Functions inherited from rpi_cam::DefaultRefCounter< nxcip::StreamReader >
| DefaultRefCounter (nxpt::CommonRefManager *refManager)
Protected Attributes inherited from rpi_cam::DefaultRefCounter< nxcip::StreamReader >
nxpt::CommonRefManager | m_refManager

## Member Function Documentation

## ◆ getNextData()

int StreamReader::getNextData | ( | nxcip::MediaDataPacket ** | packet | ) |
| override 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

Implements nxcip::StreamReader.

## ◆ queryInterface()

void * StreamReader::queryInterface | ( | const nxpl::NX_GUID & | interfaceID | ) |
| override virtual

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.

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

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