Kanzi Connect  1.1.10
Kanzi Connect C++ API
kanzi::connect::StreamPlaybackUtil_zlib Class Reference

StreamPlaybackUtil_zlib mimics video stream. More...

#include <stream_util_zlib.hpp>

Inheritance diagram for kanzi::connect::StreamPlaybackUtil_zlib:
kanzi::connect::ConnectStreamPlaybackUtil kanzi::connect::StreamPlaybackUtil

Public Member Functions

bool doDecode (const string &in, vector< char > &out) KZ_OVERRIDE
 Decode frame from buffer. More...
 
 ~StreamPlaybackUtil_zlib () KZ_OVERRIDE
 Destructor. More...
 
- Public Member Functions inherited from kanzi::connect::ConnectStreamPlaybackUtil
const string & getAuxData () const
 Get the optional data from encoder or stream provider. More...
 
void startDecoderThread ()
 Perform decoding on a dedicated thread. Deriving class should call this function after it has initialized the infra for decoding. More...
 
void stopDecoderThread ()
 Perform decoding on main thread. Releases Decoder thread if it exists. More...
 
 ~ConnectStreamPlaybackUtil () KZ_OVERRIDE
 Destructor. More...
 
kzUint getWidth () KZ_OVERRIDE
 
kzUint getHeight () KZ_OVERRIDE
 Gets height of video frame. More...
 
kanzi::FramebufferSharedPtr getNextRenderBuffer () KZ_OVERRIDE
 
void onRendering () KZ_OVERRIDE
 notify frame consumed More...
 
- Public Member Functions inherited from kanzi::connect::StreamPlaybackUtil
virtual ~StreamPlaybackUtil ()
 

Static Public Member Functions

static shared_ptr< StreamPlaybackUtil_zlibcreate (Domain &domain, const string &filename, function< void()> onProcessSampleTask, FrameBufferFactorySharedPtr bufferFactory, const int maxQueueSize)
 
- Static Public Member Functions inherited from kanzi::connect::ConnectStreamPlaybackUtil
static shared_ptr< ConnectStreamPlaybackUtilcreate (Domain &domain, const string &streamId, function< void()> onProcessSampleTask, FrameBufferFactorySharedPtr bufferFactory)
 Create new stream playback util. More...
 

Additional Inherited Members

- Protected Member Functions inherited from kanzi::connect::ConnectStreamPlaybackUtil
 ConnectStreamPlaybackUtil (function< void()> onProcessSampleTask, int queueMaxLength, bool dropOldOnKeyFrame)
 Constructor. More...
 
bool hasConfigFrame (const StreamNewBlobEvent &blobMessage) const
 Check if the message contains a configuration frame for the encoder. More...
 
bool hasKeyFrame (const StreamNewBlobEvent &blobMessage) const
 Check if the message contains a key frame. More...
 
bool hasPartialFrame (const StreamNewBlobEvent &blobMessage) const
 Check if the message contains a partial frame. More...
 
bool initialize (Domain &domain, const string &streamId, FrameBufferFactorySharedPtr bufferFactory) KZ_OVERRIDE
 Initializes video util. More...
 
bool queueHasSpace () const
 Check if the data queue has space to add more items. More...
 
void queueRenderBuffer (FramebufferSharedPtr framebuffer)
 Add a buffer to ui-queue. More...
 
virtual void remoteSettingsChanged (bool wasValid, bool isValid)
 Callback from runtime data observer. More...
 
void requestEncoderParameter (const string &parameterName) const
 
void requestStreamInfo () const
 
void restartEncoder () const
 
void setEncoderParameter (const string &parameterName, const string &parameterValue) const
 
virtual bool shouldProcessThisFrame (const StreamNewBlobEvent &blobMessage)
 Check if this message should be passed to the decoder Decoder implementations should implement this function e.g. More...
 
void uninitialize () KZ_OVERRIDE
 Uninitializes video util. More...
 
virtual void updateVideoSurfaceTexture ()
 Populate framebuffer with data received from doDecode and queue render buffer for UI. More...
 

Detailed Description

StreamPlaybackUtil_zlib mimics video stream.

Constructor & Destructor Documentation

◆ ~StreamPlaybackUtil_zlib()

kanzi::connect::StreamPlaybackUtil_zlib::~StreamPlaybackUtil_zlib ( )

Destructor.

Member Function Documentation

◆ create()

static shared_ptr<StreamPlaybackUtil_zlib> kanzi::connect::StreamPlaybackUtil_zlib::create ( Domain &  domain,
const string &  filename,
function< void()>  onProcessSampleTask,
FrameBufferFactorySharedPtr  bufferFactory,
const int  maxQueueSize 
)
static
Parameters
filenameuri of video file to load.

◆ doDecode()

bool kanzi::connect::StreamPlaybackUtil_zlib::doDecode ( const string &  in,
vector< char > &  out 
)
virtual

Decode frame from buffer.

If output is pixel data, provide it to output buffer and return true. Depending on threading strategy, runs either on dedicated thread or within the main thread,

See also
startDecoderThread()
Parameters
inInput buffer as raw string. Connect infra has no knowledge on the contents. May contain a full or partial frame.
outOptional. If decoder provides pixels to be rendered, they need to be populated here. Decoder may use received input and pass a gpu handle to kanzi using getNextRenderBuffer instead.
Returns
Return true if output buffer is to be used. Class asks Kanzi to re-render if true is returned and creates new framebuffer with data.

Reimplemented from kanzi::connect::ConnectStreamPlaybackUtil.


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