#include <stream_util_connect.hpp>
|
class | FpsCounter |
| A helper class that can be used to measure events per second. More...
|
|
◆ ~ConnectStreamPlaybackUtil()
kanzi::connect::ConnectStreamPlaybackUtil::~ConnectStreamPlaybackUtil |
( |
| ) |
|
|
override |
◆ ConnectStreamPlaybackUtil()
kanzi::connect::ConnectStreamPlaybackUtil::ConnectStreamPlaybackUtil |
( |
function< void()> | onProcessSampleTask, |
|
|
int | queueMaxLength, |
|
|
bool | dropOldOnKeyFrame ) |
|
explicitprotected |
◆ create()
Create new stream playback util.
By default the class is using either zlib or zstd compression engine for decoding frames.
- 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. |
- Returns
- New playback util on success, otherwise empty pointer.
◆ doDecode()
virtual bool kanzi::connect::ConnectStreamPlaybackUtil::doDecode |
( |
const string & | in, |
|
|
PixelFrame & | out ) |
|
protectedvirtual |
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
-
in | Input buffer as raw string. Connect infra has no knowledge on the contents. May contain a full or partial frame. |
out | Optional. 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.
◆ getAuxData()
const string & kanzi::connect::ConnectStreamPlaybackUtil::getAuxData |
( |
| ) |
const |
|
inline |
Get the optional data from encoder or stream provider.
◆ getHeight()
unsigned int kanzi::connect::ConnectStreamPlaybackUtil::getHeight |
( |
| ) |
|
|
overridevirtual |
◆ getWidth()
unsigned int kanzi::connect::ConnectStreamPlaybackUtil::getWidth |
( |
| ) |
|
|
overridevirtual |
◆ hasConfigFrame()
bool kanzi::connect::ConnectStreamPlaybackUtil::hasConfigFrame |
( |
const StreamNewBlobEvent & | blobMessage | ) |
const |
|
protected |
Check if the message contains a configuration frame for the encoder.
- Parameters
-
- Returns
- True if message contains configuration frame
◆ hasKeyFrame()
bool kanzi::connect::ConnectStreamPlaybackUtil::hasKeyFrame |
( |
const StreamNewBlobEvent & | blobMessage | ) |
const |
|
protected |
Check if the message contains a key frame.
- Parameters
-
- Returns
- True if message contains key frame
◆ hasPartialFrame()
bool kanzi::connect::ConnectStreamPlaybackUtil::hasPartialFrame |
( |
const StreamNewBlobEvent & | blobMessage | ) |
const |
|
protected |
Check if the message contains a partial frame.
- Parameters
-
- Returns
- True if message contains partial frame
◆ initialize()
bool kanzi::connect::ConnectStreamPlaybackUtil::initialize |
( |
Domain & | domain, |
|
|
const string & | streamId, |
|
|
FrameReceiverSharedPtr | frameReceiver ) |
|
overrideprotectedvirtual |
◆ onRendering()
void kanzi::connect::ConnectStreamPlaybackUtil::onRendering |
( |
| ) |
|
|
overridevirtual |
◆ queueHasSpace()
bool kanzi::connect::ConnectStreamPlaybackUtil::queueHasSpace |
( |
| ) |
const |
|
protected |
Check if the data queue has space to add more items.
- Returns
- True if there is space
◆ remoteSettingsChanged()
virtual void kanzi::connect::ConnectStreamPlaybackUtil::remoteSettingsChanged |
( |
bool | wasValid, |
|
|
bool | isValid ) |
|
protectedvirtual |
Callback from runtime data observer.
◆ requestEncoderParameter()
void kanzi::connect::ConnectStreamPlaybackUtil::requestEncoderParameter |
( |
const string & | parameterName | ) |
const |
|
protected |
◆ requestStreamInfo()
void kanzi::connect::ConnectStreamPlaybackUtil::requestStreamInfo |
( |
| ) |
const |
|
protected |
◆ restartEncoder()
void kanzi::connect::ConnectStreamPlaybackUtil::restartEncoder |
( |
| ) |
const |
|
protected |
◆ setEncoderParameter()
void kanzi::connect::ConnectStreamPlaybackUtil::setEncoderParameter |
( |
const string & | parameterName, |
|
|
const string & | parameterValue ) const |
|
protected |
◆ shouldProcessThisFrame()
virtual bool kanzi::connect::ConnectStreamPlaybackUtil::shouldProcessThisFrame |
( |
const StreamNewBlobEvent & | blobMessage | ) |
|
|
protectedvirtual |
Check if this message should be passed to the decoder Decoder implementations should implement this function e.g.
to make sure that they will wait for correct amount of configuration and key frames before proceeding to normal operation
- Parameters
-
blobMessage | contains the message from stream provider. |
- Returns
- True if the message should be passed to the decoder pipeline (default implementation always returns true)
Reimplemented in kanzi::connect::StreamPlaybackUtil_openh264.
◆ startDecoderThread()
void kanzi::connect::ConnectStreamPlaybackUtil::startDecoderThread |
( |
| ) |
|
Perform decoding on a dedicated thread. Deriving class should call this function after it has initialized the infra for decoding.
◆ stopDecoderThread()
void kanzi::connect::ConnectStreamPlaybackUtil::stopDecoderThread |
( |
| ) |
|
Perform decoding on main thread. Releases Decoder thread if it exists.
◆ uninitialize()
void kanzi::connect::ConnectStreamPlaybackUtil::uninitialize |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ m_frameReceiver
The documentation for this class was generated from the following file:
- connect/kanzi_adaptation/viewport/stream_util_connect.hpp