ConnectStreamPlaybackUtil

class kanzi::connect::ConnectStreamPlaybackUtil : public StreamPlaybackUtil

Subclassed by StreamPlaybackUtil_zlib

Unnamed Group

virtual kzUint getWidth () KZ_OVERRIDE

See

kanzi::connect::StreamPlaybackUtil

virtual kzUint getHeight () KZ_OVERRIDE

Gets height of video frame.

Return

Height of video frame.

virtual kanzi::FramebufferSharedPtr getNextRenderBuffer () KZ_OVERRIDE

Return

image texture.

virtual void onRendering () KZ_OVERRIDE

notify frame consumed

Public Functions

~ConnectStreamPlaybackUtil () KZ_OVERRIDE

Destructor.

inline const string &getAuxData() const

Get the optional data from encoder or stream provider.

void startDecoderThread()

Perform decoding on a dedicated thread. Deriving class should call this function after it has initialized the infra for decoding.

void stopDecoderThread()

Perform decoding on main thread. Releases Decoder thread if it exists.

Public Static Functions

static shared_ptr<ConnectStreamPlaybackUtil> create(Domain &domain, const string &streamId, function<void()> onProcessSampleTaskFrameBufferFactorySharedPtr bufferFactory, )

Create new stream playback util.

By default the class is using either zlib or zstd compression engine for decoding frames.

Return

New playback util on success, otherwise empty pointer.

Parameters
  • domain: Kanzi::Domain that is used for obtaining Connect server connection

  • streamId: Identifier of the stream to listen.

  • onProcessSampleTask: Callback to Kanzi to invalidate and re-render node hosting the playback util

  • bufferFactory: Instance of framebuffer provider to be used.

class FpsCounter

A helper class that can be used to measure events per second.

When an instance of this class is created, the time measurement is automatically started. To count event and to count per second average call countUp().

Public Functions

inline FpsCounter()

Constructor. Implicitly calls start() method.

inline void countUp()

Counts frames and calculates average fps.

inline int getFps()

Get current average frames per second number.

inline bool haveNewValue() const
inline void restart()

Starts to track the time. Can be used to restart the time measurement.