LibAVStream

Introduction

LibAVStream is a helper library for streaming video and geometry data between a server and client. A user of this library constructs an avs::Pipeline instance, and configures the pipeline with avs::PipelineNode subclass instances. Nodes can receive data from other nodes, process it, and pass the processed data on to other nodes.

A pipeline operates on a single thread, while queues allow threads to exchange data. For example, the server’s Network pipeline connects several avs::Queue instances to a single avs::NetworkSink. For example, the video encoding pipeline links an avs::Surface that receives raw video frames, to an avs::Encoder, and finally to a queue. On another thread, the same queue in the network pipeline passes the data to the avs::NetworkSink.

Two pipelines operating on separate threads are connected using a avs::Queue.

Classes

class avs::Context

Global library context.

Context object managing application-global state.

Note

A single instance of this class must be instantiated by the application before accessing any other library functionality.

Public Functions

void setMessageHandler(MessageHandlerFunc handler, void *userData)

Set custom message handler.

Note

Default (library provided) message handler prints to standard output.

Parameters
  • handler – Message handler function; if nullptr, default message handler is restored.

  • userData – Pointer to user supplied data passed to message handler function (never dereferenced, may be nullptr).

Public Static Functions

static Context *instance()

Get instance of the global context object.

struct Private
class avs::Pipeline

A pipeline.

A pipeline is a collection of nodes linked together in a serial manner such that each node produces output for the next node. A pipeline does not take ownership of its nodes; a single node can be a member of more than one pipeline.

It is recommended to create no more than a single pipeline per application thread and link pipelines via shared Queue or Buffer nodes to ensure thread safety.

Public Functions

void add(PipelineNode *node)

Add node to the end of the pipeline.

void add(const std::initializer_list<PipelineNode*> &nodes)

Add multiple nodes to the end of the pipeline in order specified.

Result link(const std::initializer_list<PipelineNode*> &nodes)

Link multiple nodes and add them at the end of the pipeline.

See

Pipeline::add()

Note

First added node is not automatically linked with the node previously at the end of the pipeline.

Note

This function can be used to build whole pipelines in a single function call.

Returns

PipelineNode *front() const

Get node at the front of the pipeline; returns nullptr if pipeline is empty.

PipelineNode *back() const

Get node at the back (end) of the pipeline; returns nullptr if pipeline is empty.

size_t getLength() const

Get pipeline length (number of nodes in the pipeline).

Result process()

Process pipeline. Calls PipelineNode::process() on each node in pipeline order providing consistent timestamp to each invocation.

Note

Pipeline time starts when process() is called first and is backed up by platform’s high resolution monotonic clock.

Returns

  • Result::OK on success.

  • An error result returned by a failing node (pipeline processing is immediately aborted on first PipelineNode::process() failure).

void deconfigure()

Deconfigure all nodes in the pipeline.

void reset()

Reset pipeline. Unlinks all nodes and removes them from the pipeline.

void restart()

Restart pipeline. Pipeline time counter will be reinitialized at next call to Pipeline::process().

Result startProfiling(const char *statFileName)

Start profiling the pipeline.

Parameters

statFileName – Path to output CSV file with resultant timings.

Returns

  • Result::OK on success.

  • Result::File_OpenFailed if output file coult not be opened for writing.

  • Result::Pipeline_AlreadyProfiling if pipeline profile has already been started.

Result stopProfiling()

Stop profiling the pipeline.

Returns

  • Result::OK on success.

  • Result::Pipeline_NotProfiling if pipeline profile has not been started.

struct Private
class Timer

Timer for getting the elapsed between the start time and the current time.

class UseInternalAllocator

Helper class for enforcing the use of memory allocator defined within libavstream library module.

This is used to prevent memory allocation/deallocation across DLL boundary even when operator new or operator delete are called from client code.

Subclassed by avs::DecoderBackendInterface, avs::EncoderBackendInterface

avs Interface Classes

Warning

doxygenclass: Cannot find class “avs::AudioTargetBackendInterface” in doxygen xml output for project “TeleportVR” from directory: G:/Jarvis/workspace/Teleport/Teleport/build_docs/docs/doxygen/xml

Warning

doxygenclass: Cannot find class “avs::AudioEncoderBackendInterface” in doxygen xml output for project “TeleportVR” from directory: G:/Jarvis/workspace/Teleport/Teleport/build_docs/docs/doxygen/xml

class avs::IOInterface

General (stream of bytes) I/O node interface.

Nodes implementing this interface can act as data sources and/or sinks for the purpose of arbitrary reads and/or writes.

Subclassed by avs::Buffer, avs::File, avs::NullSink, avs::Packetizer, avs::Queue

Public Functions

virtual Result read(PipelineNode *reader, void *buffer, size_t &bufferSize, size_t &bytesRead) = 0

Read bytes.

Parameters
  • readerPipelineNode which performs the read operation.

  • buffer – Pointer to destination buffer.

  • bufferSize – Size of destination buffer in bytes.

  • bytesRead – Number of bytes actually read should the read operation succeed.

Returns

  • Result::OK on success.

  • PipelineNode specific error result on failure.

virtual Result write(PipelineNode *writer, const void *buffer, size_t bufferSize, size_t &bytesWritten) = 0

Write bytes.

Parameters
  • writerPipelineNode which performs the write operation.

  • buffer – Pointer to soruce buffer.

  • bufferSize – Size of source buffer in bytes.

  • bytesWritten – Number of bytes actually written should the write operation succeed.

Returns

  • Result::OK on success.

  • Result::IO_InvalidArgument if either buffer is nullptr or bufferSize is zero.

  • PipelineNode specific error result.

class avs::PacketInterface

Packet I/O node interface.

Nodes implementing this interface can act as data sources and/or sinks for the purpose of packet reads and/or writes. Packet reads (writes) operate on atomic chunks of data - packets cannot be partially read or written.

Subclassed by avs::File, avs::NullSink

Public Functions

virtual Result readPacket(PipelineNode *reader, void *buffer, size_t &bufferSize, int index) = 0

Read packet.

Parameters
  • readerPipelineNode which performs the read operation.

  • buffer – Pointer to destination buffer (may be nullptr to query for buffer size).

  • bufferSize – Size of destination buffer in bytes.

Returns

  • Result::OK on success.

  • Result::IO_Retry if either buffer is nullptr or bufferSize is too small. Correct buffer size is written back to bufferSize and the read should be retried.

  • PipelineNode specific error result.

virtual Result writePacket(PipelineNode *writer, const void *buffer, size_t bufferSize, const int index) = 0

Write packet.

Parameters
  • writerPipelineNode which performs the write operation.

  • buffer – Pointer to source buffer.

  • bufferSize – Size of source buffer in bytes.

Returns

  • Result::OK on success.

  • Result::IO_InvalidArgument if either buffer is nullptr or bufferSize is zero.

  • PipelineNode specific error result.

class avs::SurfaceInterface

Surface node interface.

Nodes implementing this interface can act as data sources/sinks for the purpose of providing access to a surface.

Subclassed by avs::Surface

Public Functions

virtual SurfaceBackendInterface *getBackendSurface() const = 0

Get surface backend associated with this node.

virtual SurfaceBackendInterface *getAlphaBackendSurface() const = 0

Get surface backend associated with this node.

class avs::GeometrySourceInterface

Mesh interface.

Nodes implementing this interface can act as data sources/sinks for the purpose of providing access to a mesh.

Subclassed by avs::GeometrySource

Public Functions

virtual GeometrySourceBackendInterface *getGeometrySourceBackendInterface() const = 0

Get surface backend associated with this node.

class avs::GeometryTargetInterface

Geometry target interface.

Nodes implementing this interface can act as data sinks for the purpose of building geometry.

Subclassed by avs::GeometryTarget

Public Functions

virtual GeometryTargetBackendInterface *getGeometryTargetBackendInterface() const = 0

Get surface backend associated with this node.

class avs::AudioTargetInterface

Audio target interface.

Nodes implementing this interface can act as data sinks for the purpose of decoding and playing audio.

Public Functions

virtual AudioTargetBackendInterface *getAudioTargetBackendInterface() const = 0

Get audio backend associated with this node.

class avs::EncoderBackendInterface : public avs::UseInternalAllocator

Common encoder backend interface.

Encoder backend is responsible for encoding pictures using a particular hardware encoder.

Subclassed by avs::EncoderNV

Public Functions

virtual Result initialize(const DeviceHandle &device, int frameWidth, int frameHeight, const EncoderParams &params) = 0

Initialize hardware encoder. Encoder backend must be succesfully initialized before it’s ready to encode pictures.

Parameters
  • device – Graphics API device handle (DirectX or OpenGL).

  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional encoder parameters.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_InvalidDevice if passed device handle is invalid or otherwise unsuitable for this particular encoder.

  • Result::EncoderBackend_NoSuitableCodecFound if the hardware encoder does not support encoding with chosen video codec or parameters.

  • Result::EncoderBackend_OutOfMemory if the encoder failed to allocate internal resources.

  • Result::EncoderBackend_InitFailed on general initialization failure.

virtual Result reconfigure(int frameWidth, int frameHeight, const EncoderParams &params) = 0

Reconfigure hardware encoder. Encoder backend must be succesfully initialized before this function can be called.

Parameters
  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional encoder parameters.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_NotInitialized if the encoder is not initialized

  • Result::EncoderBackend_NoSuitableCodecFound if the hardware encoder does not support encoding with chosen video codec or parameters.

  • Result::EncoderBackend_OutOfMemory if the encoder failed to allocate internal resources.

  • Result::EncoderBackend_ReconfigFailed on general initialization failure.

virtual Result shutdown() = 0

Shutdown hardware encoder and release all associated resources. After encoder backend is shutdown it must be initialized again to be ready to encode pictures.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_FlushError if failed to flush hardware encoder before shutting down.

  • Result::EncoderBackend_ShutdownFailed on general failure.

virtual Result registerSurface(const SurfaceBackendInterface *surface) = 0

Register surface as source for pictures (video frames) to encode. The surface must be compatible with the graphics API device handle passed to initialize().

Note

Encoder backend does not take ownership of the registered surface.

Parameters

surfaceSurface backend to register as input.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_NotInitialized if encoder backend has not yet been initialized.

  • Result::EnocderBackend_SurfaceAlreadyRegistered if surface backend has already been registered with this encoder backend.

  • Result::EncoderBackend_InvalidSurface if passed surface backend is invalid or otherwise unsuitable for this encoder.

  • Result::EncoderBackend_InvalidDevice if the device this encoder backend has been initialized with is unsuitable for registering surfaces.

virtual Result unregisterSurface() = 0

Unregister surface as source for pictures (video frames) to encode.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_NotInitialized if encoder backend has not yet been initialized.

  • Result::EncoderBackend_SurfaceNotRegistered if no surface backend has been registered with this encoder backend.

  • Result::EncoderBackend_InvalidSurface if passed surface backend is invalid.

virtual Result encodeFrame(uint64_t timestamp, bool forceIDR = false) = 0

Encode single picture (video frame).

Parameters
  • timestamp – Abstract timestamp value to associate with encoded picture.

  • forceIDR – Tells the encoder encode thje next frame as an IDR frame.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_NotInitialized if encoder backend has not yet been initialized.

  • Result::EncoderBackend_SurfaceNotRegistered if no surface backend has been registered with this encoder backend.

  • Result::EncoderBackend_MapFailed if failed to map input surface prior to encoding.

  • Result::EncoderBackend_UnmapFailed if failed to unmap input surface after encoding.

  • Result::EncoderBackend_EncodeFailed on general encode failure.

virtual Result mapOutputBuffer(void *&bufferPtr, size_t &bufferSizeInBytes) = 0

Map output buffer to the host address space (for access by CPU).

Parameters
  • bufferPtr[out] Pointer to the compressed video bitstream of previously encoded frame.

  • bufferSizeInBytes[out] Number of bytes in the output buffer.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_NotInitialized if encoder backend has not yet been initialized.

  • Result::EncoderBackend_MapFailed if failed to map output buffer.

virtual Result unmapOutputBuffer() = 0

Unmap previously mapped output buffer.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_NotInitialized if encoder backend has not yet been initialized.

  • Result::EncoderBackend_UnmapFailed if failed to unmap output buffer.

virtual Result waitForEncodingCompletion() = 0

Wait for encoding to finish.

Returns

  • Result::OK on success.

  • Result::EncoderBackend_EncodeFailed if timeout occurs during encoding.

virtual SurfaceFormat getInputFormat() const = 0

Get registered input surface format.

class avs::DecoderBackendInterface : public avs::UseInternalAllocator

Common decoder backend interface.

Decoder backend is responsible for decoding compressed video data using a particular hardware decoder. Decoded video frames are outputted to a registered surface.

Subclassed by VideoDecoder, avs::DecoderNV

Public Functions

virtual Result initialize(const DeviceHandle &device, int frameWidth, int frameHeight, const DecoderParams &params) = 0

Initialize hardware decoder. Decoder backend must be succcesfully initialized before it’s ready to accept input.

Parameters
  • device – Graphics API device handle (DirectX or OpenGL).

  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional decoder configuration settings.

Returns

  • Result::OK on success.

  • Result::DecoderBackend_InvalidDevice if passed device handle is invalid or otherwise unsuitable for this particular decoder.

  • Result::DecoderBackend_InvalidParam if one or more parameters were invalid.

  • Result::DecoderBackend_CodecNotSupported if the selected video codec is not supported by this decoder.

  • Result::DecoderBackend_InitFailed on general initialization failure.

virtual Result reconfigure(int frameWidth, int frameHeight, const DecoderParams &params) = 0

Reconfigure hardware decoder with new initialization settings. Decoder backend must be succcesfully initialized before this function can be called.

Parameters
  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional decoder configuration settings.

Returns

  • Result::OK on success.

  • Result::DecoderBackend_NotInitialized if decoder backend has not yet been initialized.

  • Result::DecoderBackend_ReconfigFailed on general initialization failure.

virtual Result shutdown() = 0

Shutdown hardware decoder and release all associated resources. After decoder backend is shutdown it must be initialized again to accept input.

Returns

  • Result::OK on success.

  • Result::DecoderBackend_ShutdownFailed on general failure.

virtual Result registerSurface(const SurfaceBackendInterface *surface, const SurfaceBackendInterface *alphaSurface = nullptr) = 0

Register surface as destination for decoded video frames. The surface must be compatible with the graphics API device handle passed to initialize().

Note

Decoder backend does not take ownership of the registered surface.

Parameters
  • surfaceSurface backend to register as output.

  • alphaSurface – Separate surface backend to register as output for alpha only.

Returns

  • Result::OK on success.

  • Result::DecoderBackend_NotInitialized if decoder backend has not yet been initialized.

  • Result::DeocderBackend_SurfaceAlreadyRegistered if surface backend has already been registered with this decoder backend.

  • Result::DecoderBackend_InvalidSurface if passed surface backend is invalid or otherwise unsuitable for this decoder.

virtual Result unregisterSurface() = 0

Unregister surface as destination for decoded video frames.

Returns

  • Result::OK on success.

  • Result::DecoderBackend_NotInitialized if decoder backend has not yet been initialized.

  • Result::DecoderBackend_SurfaceNotRegistered if no surface backend has been registered with this decoder backend.

  • Result::DecoderBackend_InvalidSurface if passed surface backend is invalid.

virtual Result decode(const void *buffer, size_t bufferSizeInBytes, const void *alphaBuffer, size_t alphaBufferSizeInBytes, VideoPayloadType payloadType, bool lastPayload) = 0

Decode compressed video payload.

Parameters
  • buffer – Pointer to the beginning of compressed color video data.

  • bufferSizeInBytes – Size in bytes of compressed color video data.

  • alphaBuffer – Pointer to the beginning of compressed alpha video data.

  • alphaBufferSizeInBytes – Size in bytes of compressed alpha video data.

  • payloadType – Video payload type in buffer.

  • lastPayload – Signifies whether the buffer contains the last segment of the video frame.

Returns

  • Result::OK on success.

  • Result::DecoderBackend_ReadyToDisplay on success and decoder is ready to display output.

  • Result::DecoderBackend_NotInitialized if decoder backend has not yet been initialized.

  • Result::DecoderBackend_InvalidParam if either buffer is nullptr or bufferSizeInBytes is zero.

  • Result::DecoderBackend_InvalidPayload if the specified payloadType is not suitable for this decoder.

  • Result::DecoderBackend_ParseFailed if decoder failed to parse video data.

virtual Result display(bool showAlphaAsColor = false) = 0

Display decoded frame on destination surface.

Parameters

showAlphaAsColor – Determines whether to render the alpha channel to the output surface as color for debugging purposes.

Returns

  • Result::OK on succes.

  • Result::DecoderBackend_DisplayFailed on failure, or if decoder was not yet ready to display.

avs Nodes

class avs::PipelineNode

Abstract processing node.

Processing nodes are fundamental building blocks of pipelines. Each node can have N input slots, and M output slots (N,M >= 0), and can do some amount of work during pipeline processing.

Nodes can be classified as “input-active” and/or “output-active”, or “passive”.

  • Input-Active nodes read data from their inputs during processing.

  • Output-Active nodes write data to their outputs during processing.

  • Passive nodes usually don’t do any processing and just act as data sources & sinks to other, active, nodes.

Being aware of this classification is very important in correctly constructing pipelines.

Subclassed by avs::AudioDecoder, avs::AudioEncoder, avs::Buffer, avs::Decoder, avs::Encoder, avs::File, avs::Forwarder, avs::GeometryDecoder, avs::GeometryEncoder, avs::GeometrySource, avs::GeometryTarget, avs::NetworkSink, avs::NetworkSource, avs::NullSink, avs::Packetizer, avs::Queue, avs::Surface, avs::TagDataDecoder

Public Functions

Result unlinkInput(int slot = -1)

Unlink node by input slot index.

Parameters

slot – Input slot index or -1 to unlink all inputs.

Returns

  • Result::OK on success.

  • Result::Node_InvalidSlot if slot is not valid input slot index.

Result unlinkOutput(int slot = -1)

Unlink node by output slot index.

Parameters

slot – Output slot index or -1 to unlink all outputs.

Returns

  • Result::OK on success.

  • Result::Node_InvalidSlot if slot is not valid output slot index.

void unlinkAll()

Unlink all inputs and outputs.

size_t getNumInputSlots() const

Get number of input slots.

size_t getNumOutputSlots() const

Get number of output slots.

Result isInputLinked(int slot) const

Query whether another node is linked to a particular input slot.

Parameters

slot – Input slot index.

Returns

  • Result::OK if a node is linked to this input slot.

  • Result::Node_NotLinked if no node is linked to this input slot.

  • Result::Node_InvalidSlot if slot is is not valid input slot index.

Result isOutputLinked(int slot) const

Query whether another node is linked to a particular output slot.

Parameters

slot – Output slot index.

Returns

  • Result::OK if a node is linked to this output slot.

  • Result::Node_NotLinked if no node is linked to this output slot.

  • Result::Node_InvalidSlot if slot is is not valid output slot index.

inline virtual Result deconfigure()

Deconfigure this node.

Returns

  • Result::OK on success.

  • PipelineNode specific error result on failure.

inline virtual Result process(uint64_t timestamp, uint64_t deltaTime)

Perform any node specific work as part of a pipeline.

Parameters
Returns

  • Result::OK on success (or no-op).

  • PipelineNode specific error result on failure.

virtual const char *getDisplayName() const = 0

Get node display name (for reporting & profiling).

Public Static Functions

static Result link(PipelineNode &source, int sourceSlot, PipelineNode &target, int targetSlot)

Link two nodes. Data will flow from source node to target node.

Parameters
  • source – Source node.

  • sourceSlot – Index of source node output slot.

  • target – Target node.

  • targetSlot – Index of target node input slot.

Returns

  • Result::OK on success.

  • Result::Node_InvalidSlot if sourceSlot is not valid source node output slot index.

  • Result::Node_InvalidSlot if targetSlot is not valid target node input slot index.

  • Any error returned by source node onOutputLink() function.

  • Any error returned by target node onInputLink() function.

static Result link(PipelineNode &source, PipelineNode &target)

Link two nodes. Data will flow from source node to target node. First available source and target slot will be picked automatically to make the link.

Parameters
  • source – Source node.

  • target – Target node.

Returns

  • Result::OK on success.

  • Result::Node_LinkFailed if couldn’t find any free source or target slot to make the link.

  • Any error returned by source node onOutputLink() function.

  • Any error returned by target node onInputLink() function.

static Result unlink(PipelineNode &source, int sourceSlot, PipelineNode &target, int targetSlot)

Unlink two nodes.

Parameters
  • source – Source node.

  • sourceSlot – Index of source node output slot.

  • target – Target node.

  • targetSlot – Index of target node input slot.

Returns

  • Result::OK on success.

  • Result::Node_InvalidSlot if sourceSlot is not valid source node output slot index.

  • Result::Node_InvalidSlot if targetSlot is not valid target node input slot index.

  • Result::Node_InvalidLink if source and target nodes were not linked.

struct Private

Subclassed by avs::AudioEncoder::Private, avs::Buffer::Private, avs::Decoder::Private, avs::Decoder::Private, avs::Encoder::Private, avs::File::Private, avs::Forwarder::Private, avs::GeometrySource::Private, avs::GeometryTarget::Private, avs::NetworkSink::Private, avs::NetworkSource::Private, avs::Packetizer::Private, avs::Queue::Private, avs::Surface::Private

class avs::AudioDecoder : public avs::PipelineNode

Audio decoder node [input-active, output-active, 1/1]

Reads packets of encoded audio and outputs decoded data to an Audio Target.

Public Functions

explicit AudioDecoder()

Constructor.

Parameters

backendDecoder backend type to use.

Result configure(uint8_t streamId)

Configure decoder.

Parameters
  • streamId – - id for network stream

  • params – backend for decoding audio

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if decoder was already in configured state.

virtual Result deconfigure() override

Deconfigure decoder and release all associated resources.

Returns

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Process as much encoded video data as available on input and decode zero or more frames.

See

PipelineNode::process()

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if decoder was not in configured state.

  • Result::Node_InvalidInput if no compatible input node is linked to input slot 0 or most recently read input packet is invalid.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::IO_Empty if no input data is available for decoding.

  • Any error result returned by PacketInterface::readPacket().

  • Any error result returned by DecoderBackendInterface::decode().

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

class avs::AudioEncoder : public avs::PipelineNode

Audio encoder node [input-active, output-active, 1/1]

Encodes audio

  • Compatible outputs: Any node implementing IOInterface.

Public Functions

explicit AudioEncoder(AudioEncoderBackend backend = AudioEncoderBackend::Any)

Constructor.

Parameters

backendEncoder backend type to use.

explicit AudioEncoder(AudioEncoderBackendInterface *backend)

Constructor.

Note

Encoder node takes ownership of the backend instance.

Parameters

backend – Custom encoder backend instance.

Result configure(const AudioEncoderParams &params)

Configure audio encoder.

Parameters
  • device – Graphics API device handle (DirectX or OpenGL).

  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional encoder parameters.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if encoder was already in configured state.

  • Result::Encoder_NoSuitableBackendFound if there’s no usable encoder backend on the system.

  • Any error result returned by EncoderBackendInterface::initialize().

virtual Result deconfigure() override

Deconfigure encoder and release all associated resources.

Returns

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Encode single video frame from input surface and write resulting bitstream to output.

See

PipelineNode::process()

Returns

Result writeOutput(const uint8_t *extraDataBuffer, size_t bufferSize)

Write data to the output stream

See

PipelineNode::process()

Parameters
  • extra – data buffer

  • extra – data buffer size

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if encoder was not in configured state.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::Encoder_IncompleteFrame if encoded bitstream was only partially written to output node.

  • Any error result returned by EncoderBackendInterface::mapOutputBuffer().

Result unregisterSurface()

Unregister the encoder’s surface texture

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if encoder was not in configured state.

  • Result::Encoder_SurfaceNotRegistered if no input surface is registered.

  • Any error result returned by EncoderBackendInterface::unregisterSurface().

Result setBackend(AudioEncoderBackendInterface *backend)

Set custom encoder backend.

Note

Encoder node takes ownership of the backend instance.

Parameters

backend – Custom encoder backend instance.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if encoder was already in configured state.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

struct Private : public avs::PipelineNode::Private
class Buffer : public avs::PipelineNode, public avs::IOInterface

Ring buffer node [passive, 1/1]

A thread-safe, nonblocking, producer-consumer ring buffer with fixed capacity.

class avs::Decoder : public avs::PipelineNode

Video decoder node [input-active, output-active, 1/1]

Reads packets of encoded video stream and outputs decoded frames to a surface.

Public Functions

explicit Decoder(DecoderBackend backend = DecoderBackend::Any)

Constructor.

Parameters

backendDecoder backend type to use.

explicit Decoder(DecoderBackendInterface *backend)

Constructor.

Note

Decoder node takes ownership of the backend instance.

Parameters

backend – Custom decoder backend instance.

Result configure(const DeviceHandle &device, int frameWidth, int frameHeight, const DecoderParams &params, uint8_t streamId)

Configure decoder.

Parameters
  • device – Graphics API device handle (DirectX or OpenGL).

  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional decoder parameters.

  • params – callback for extracting extra video data

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if decoder was already in configured state.

  • Result::Decoder_NoSuitableBackendFound if there’s no usable decoder backend on the system.

  • Any error result returned by DecoderBackendInterface::initialize().

Result reconfigure(int frameWidth, int frameHeight, const DecoderParams &params)

Configure reconfigure.

Parameters
  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional decoder parameters.

Returns

virtual Result deconfigure() override

Deconfigure decoder and release all associated resources.

Returns

Result unregisterSurface()

Deconfigure decoder and release all associated resources.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if decoder was not in configured state.

  • Result::Decoder_SurfaceNotRegistered if an input surface is not registered.

  • Any error result returned by DecoderBackendInterface::unregisterSurface().

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Process as much encoded video data as available on input and decode zero or more frames.

See

PipelineNode::process()

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if decoder was not in configured state.

  • Result::Node_InvalidInput if no compatible input node is linked to input slot 0 or most recently read input packet is invalid.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::IO_Empty if no input data is available for decoding.

  • Any error result returned by PacketInterface::readPacket().

  • Any error result returned by DecoderBackendInterface::decode().

Result setBackend(DecoderBackendInterface *backend)

Set custom decoder backend.

Note

Decoder node takes ownership of the backend instance.

Parameters

backend – Custom decoder backend instance.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if decoder was already in configured state.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

bool idrRequired() const

If due to a decoder packet loss, a new IDR frame is needed from the server’s encoder to prevent corrupted video.

struct Private : public avs::PipelineNode::Private, public avs::PipelineNode::Private
class avs::Encoder : public avs::PipelineNode

Video encoder node [input-active, output-active, 1/1]

Encodes video frames from input surface and outputs compressed bitstream.

Public Functions

explicit Encoder(EncoderBackend backend = EncoderBackend::Any)

Constructor.

Parameters

backendEncoder backend type to use.

explicit Encoder(EncoderBackendInterface *backend)

Constructor.

Note

Encoder node takes ownership of the backend instance.

Parameters

backend – Custom encoder backend instance.

Result configure(const DeviceHandle &device, int frameWidth, int frameHeight, const EncoderParams &params)

Configure encoder.

Parameters
  • device – Graphics API device handle (DirectX or OpenGL).

  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional encoder configuration settings.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if encoder was already in configured state.

  • Result::Encoder_NoSuitableBackendFound if there’s no usable encoder backend on the system.

  • Any error result returned by EncoderBackendInterface::initialize().

Result reconfigure(int frameWidth, int frameHeight, const EncoderParams &params)

Configure encoder.

Parameters
  • frameWidth – Expected video frame width in pixels.

  • frameHeight – Expected video frame height in pixels.

  • params – Additional encoder configuration settings.

Returns

virtual Result deconfigure() override

Deconfigure encoder and release all associated resources.

Returns

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Encode single video frame from input surface and write resulting bitstream to output.

See

PipelineNode::process()

Returns

Result writeOutput()

Write data to the output stream.

Parameters
  • tag – data buffer

  • tag – data buffer size

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if encoder was not in configured state.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::Encoder_IncompleteFrame if encoded bitstream was only partially written to output node.

  • Any error result returned by EncoderBackendInterface::mapOutputBuffer().

Result unregisterSurface()

Unregister the encoder’s surface texture.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if encoder was not in configured state.

  • Result::Encoder_SurfaceNotRegistered if no input surface is registered.

  • Any error result returned by EncoderBackendInterface::unregisterSurface().

Result setBackend(EncoderBackendInterface *backend)

Set custom encoder backend.

Note

Encoder node takes ownership of the backend instance.

Parameters

backend – Custom encoder backend instance.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if encoder was already in configured state.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

void setForceIDR(bool forceIDR)

Tell encoder to encode the next frame as an IDR frame

bool isEncodingAsynchronously()

Returns true if the encoder is encoding asynchronously on a separate thread.

EncoderStats getStats() const

Gets encoder performance stats for the current session.

Public Static Functions

static Result getEncodeCapabilities(const DeviceHandle &device, const EncoderParams &params, avs::EncodeCapabilities &capabilities)

Gets the encoding capabilities of the GPU.

Parameters
  • device – Graphics API device handle (DirectX or OpenGL).

  • params – Additional encoder configuration settings.

  • capabilities – Reference to the capabilities structure that will store the output.

Returns

  • Result::OK on success.

struct Private : public avs::PipelineNode::Private
class File : public avs::PipelineNode, public avs::IOInterface, public avs::PacketInterface

File node [passive, 1/1]

File node provides a way to read or write from binary files and thus can act either as a data sink or data source depending on configured FileAccess mode.

class Forwarder : public avs::PipelineNode

Forwarder node [input-active, output-active, N/M]

Forwarder node reads data from its inputs and passes it to its outputs without modification. It is most useful as a proxy node if one wishes to link two passive nodes within a pipeline.

Note

If an input or an output of a Forwarder node implements both PacketInterface and IOInterface then PacketInterface is used by the forwarder node to read or write data.

class avs::GeometryDecoder : public avs::PipelineNode

Geometry decoder node [input-active, output-active, 1/1]

Reads packets of encoded geometry and outputs decoded data to a Geometry Target.

Public Functions

explicit GeometryDecoder()

Constructor.

Parameters

backendDecoder backend type to use.

Result configure(uint8_t streamId, GeometryDecoderBackendInterface *backend)

Configure decoder.

Parameters

backend – The object that performas the actual decoding.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if decoder was already in configured state.

  • Result::Decoder_NoSuitableBackendFound if there’s no usable decoder backend on the system.

  • Any error result returned by DecoderBackendInterface::initialize().

virtual Result deconfigure() override

Deconfigure decoder and release all associated resources.

Returns

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Process as much encoded video data as available on input and decode zero or more frames.

See

PipelineNode::process()

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if decoder was not in configured state.

  • Result::Node_InvalidInput if no compatible input node is linked to input slot 0 or most recently read input packet is invalid.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::IO_Empty if no input data is available for decoding.

  • Any error result returned by PacketInterface::readPacket().

  • Any error result returned by DecoderBackendInterface::decode().

Result setBackend(GeometryDecoderBackendInterface *backend)

Set custom decoder backend.

Note

Decoder node does not take ownership of the backend instance.

Parameters

backend – Custom decoder backend instance.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if decoder was already in configured state.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

class avs::GeometryEncoder : public avs::PipelineNode

Video encoder node [input-active, output-active, 1/1]

Encodes video frames from input surface and outputs compressed bitstream.

Public Functions

explicit GeometryEncoder()

Constructor.

Result configure(GeometryEncoderBackendInterface *backend)

Configure encoder.

virtual Result deconfigure() override

Deconfigure encoder and release all associated resources.

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Encode the current geometry stack.

See

PipelineNode::process()

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if encoder was not in configured state.

  • Result::Node_InvalidInput if no compatible input node is linked to input slot 0.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::Encoder_IncompleteFrame if encoded bitstream was only partially written to output node.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

class avs::GeometrySource : public avs::PipelineNode, public avs::GeometrySourceInterface

Mesh node [passive, 1/1]

Provides access to geometry source data for other nodes in the pipeline.

Public Functions

Result configure(GeometrySourceBackendInterface *sourceBackend, GeometryRequesterBackendInterface *req)

Configure GeometrySource node.

Parameters

backend – backend associated with this node.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if has already been configured with a backend.

  • Result::Mesh_InvalidBackend if backend is nullptr.

virtual GeometrySourceBackendInterface *getGeometrySourceBackendInterface() const override

Get surface backend associated with this node.

virtual Result deconfigure() override

Deconfigure surface node and release its backend.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if surface has not been configured.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

struct Private : public avs::PipelineNode::Private
class avs::GeometryTarget : public avs::PipelineNode, public avs::GeometryTargetInterface

Mesh node [passive, 1/1]

Provides access to geometry source data for other nodes in the pipeline.

Public Functions

Result configure(GeometryTargetBackendInterface*)

Configure GeometrySource node.

Parameters

backend – backend associated with this node.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if has already been configured with a backend.

  • Result::Mesh_InvalidBackend if backend is nullptr.

virtual GeometryTargetBackendInterface *getGeometryTargetBackendInterface() const override

Get surface backend associated with this node.

virtual Result deconfigure() override

Deconfigure surface node and release its backend.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if surface has not been configured.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

struct Private : public avs::PipelineNode::Private
class avs::NetworkSink : public avs::PipelineNode

Network sink node [passive, 0/1]

Reads data for each stream from a corresponding avs::Queue input node , assembles the data into payloads of network packets and sends the data to the client.

If data throttling is enabled for a stream, the seding of data may be spread over time to reduce network congestion.

Public Functions

Result configure(std::vector<NetworkSinkStream> &&streams, const char *local_bind_addr, uint16_t localPort, const char *remote, uint16_t remotePort, const NetworkSinkParams &params = {})

Configure network sink and bind to local UDP endpoint.

Parameters
  • streams – Collection of configurations for each stream.

  • localPort – Local UDP endpoint port number.

  • remote – Remote UDP endpoint name or IP address.

  • remotePort – Remote UDP endpoint port number.

  • params – Additional network sink parameters.

Returns

  • Result::OK on success.

  • Result::Node_InvalidConfiguration if numInputs, localPort, or remotePort is zero, or if remote is either nullptr or empty string.

  • Result::Network_BindFailed if failed to bind to local UDP socket.

virtual Result deconfigure() override

Deconfigure network sink and release all associated resources.

Returns

Always returns Result::OK.

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Send data for all streams to remote UDP endpoint.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if network sink has not been configured.

  • Result::Network_ResolveFailed if failed to resolve the name of remote UDP endpoint.

  • Result::Network_SendFailed on general network send failure.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

NetworkSinkCounters getCounters() const

Get current counter values.

void setDebugStream(uint32_t)

Debug a particular stream.

struct Private : public avs::PipelineNode::Private

Public Members

uint32_t m_packetsSent

Packets sent this frame

class avs::NetworkSource : public avs::PipelineNode

Network source node [passive, 0/1]

Receives video stream from a remote UDP endpoint.

Public Functions

Result configure(std::vector<NetworkSourceStream> &&streams, const NetworkSourceParams &params)

Configure network source and bind to local UDP endpoint.

Parameters
  • numOutputs – Number of output slots. This determines maximum number of multiplexed streams the node will support.

  • localPort – Local UDP endpoint port number.

  • remote – Remote UDP endpoint name or IP address.

  • remotePort – Remote UDP endpoint port number.

  • params – Additional network source parameters.

Returns

  • Result::OK on success.

  • Result::Node_InvalidConfiguration if numOutputs, localPort, or remotePort is zero, or if remote is either nullptr or empty string.

  • Result::Network_BindFailed if failed to bind to local UDP socket.

virtual Result deconfigure() override

Deconfigure network source and release all associated resources.

Returns

Always returns Result::OK.

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Receive and process incoming network packets.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if network source has not been configured.

  • Result::Network_ResolveFailed if failed to resolve the name of remote UDP endpoint.

  • Result::Network_RecvFailed on general network receive failure.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

NetworkSourceCounters getCounterValues() const

Get current counter values.

struct Private : public avs::PipelineNode::Private
class NullSink : public avs::PipelineNode, public avs::IOInterface, public avs::PacketInterface

Null sink node [passive, N/0]

Silently discards all data written to it.

class Packetizer : public avs::PipelineNode, public avs::IOInterface

Bitstream packetizer node [output-active, 1/M]

Accepts bitstream as input and broadcasts discrete packets to all its outputs. Expected bitstream format and output packets payload is defined by the selected stream parser.

Note

When used with AVC_AnnexB parser it accepts AVC Annex B bitstream input and outputs individual NAL units.

class avs::Queue : public avs::PipelineNode, public avs::IOInterface

Queue node [passive, 1/1]

A thread-safe, nonblocking, producer-consumer queue of byte buffers.

Note

Sharing an instance of this node is the recommended way to link two pipelines running on different threads.

Public Functions

Result configure(size_t maxBufferSize, size_t maxBuffers, const char *name)

Configure queue.

Warning

Reconfiguring an already configured Queue performs an implicit flush.

Parameters
  • maxBufferSize – Maximum size of a buffer in the queue.

  • maxBuffers – Maximum number of buffers in the queue.

Returns

  • Result::OK on success.

  • Result::Node_InvalidConfiguration if maxBuffers is zero.

virtual Result deconfigure() override

Flush & deconfigure queue.

Returns

Always returns Result::OK.

void flush()

Flush queue.

virtual Result read(PipelineNode*, void *buffer, size_t &bufferSize, size_t &bytesRead) override

Read buffer at the front of the queue.

See

IOInterface::read()

Returns

  • Result::OK on success.

  • Result::IO_Empty if attempted to read from empty queue.

  • Result::IO_Retry if buffer is nullptr or bufferSize is smaller than the size of the buffer at the front of queue. Correct buffer size is written back to bufferSize parameter and the read should be retried.

virtual Result write(PipelineNode*, const void *buffer, size_t bufferSize, size_t &bytesWritten) override

Write buffer to the back of the queue.

See

IOInterface::write()

Returns

  • Result::OK on success.

  • Result::IO_Full if attempted to write to full queue.

  • Result::IO_OutOfMemory if failed to allocate memory for the new queue buffer.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

struct Private : public avs::PipelineNode::Private

Public Members

char *m_mem = nullptr

Contiguous memory that contains buffers of equal size

size_t *m_dataSizes = nullptr

Contains sizes of data in each buffer

class avs::Surface : public avs::PipelineNode, public avs::SurfaceInterface

Surface node [passive, 1/1]

Provides access to surface for other nodes in the pipeline.

Public Functions

Result configure(SurfaceBackendInterface *surfaceBackend, SurfaceBackendInterface *alphaSurfaceBackend = nullptr)

Configure surface node.

Note

Surface node takes ownership of its backend.

Parameters

surfaceBackendSurface backend associated with this node.

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if surface has already been configured with a backend.

  • Result::Surface_InvalidBackend if surfaceBackend is nullptr.

virtual Result deconfigure() override

Deconfigure surface node and release its backend.

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if surface has not been configured.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

virtual SurfaceBackendInterface *getBackendSurface() const override

Return a non-owning pointer to associated surface backend.

virtual SurfaceBackendInterface *getAlphaBackendSurface() const override

Return a non-owning pointer to associated surface backend.

struct Private : public avs::PipelineNode::Private
class avs::TagDataDecoder : public avs::PipelineNode

Video tag data decoder node [input-active, 1/0]

Reads packets of encoded video tag data and outputs result to the application.

  • Compatible inputs: A queue of taga data.

Public Functions

TagDataDecoder()

Constructor.

Parameters

backendTagDataDecoder backend type to use.

Result configure(uint8_t streamId, std::function<void(const uint8_t *data, size_t dataSize)> onReceiveDataCallback)

Configure decoder.

Parameters

params – callback for extracting extra video data

Returns

  • Result::OK on success.

  • Result::Node_AlreadyConfigured if decoder was already in configured state.

virtual Result deconfigure() override

Deconfigure decoder and release all associated resources.

Returns

virtual Result process(uint64_t timestamp, uint64_t deltaTime) override

Process received video tag data

See

PipelineNode::process()

Returns

  • Result::OK on success.

  • Result::Node_NotConfigured if decoder was not in configured state.

  • Result::Node_InvalidInput if no compatible input node is linked to input slot 0 or most recently read input packet is invalid.

  • Result::Node_InvalidOutput if no compatible output node is linked to output slot 0.

  • Result::IO_Empty if no input data is available for decoding.

inline virtual const char *getDisplayName() const override

Get node display name (for reporting & profiling).

avs Structs

struct avs::NetworkSinkCounters

Network sink counters.

Public Members

uint64_t bytesSent = 0

Total bytes sent.

uint64_t networkPacketsSent = 0

Number of sent network packets.

double bandwidth = 0

Available bandwidth

double avgBandwidthUsed = 0

Average bandwidth used

double minBandwidthUsed = 0

Minimum bandwidth used

double maxBandwidthUsed = 0

Maximum bandwidth used

struct avs::NetworkSinkParams

Network sink parameters.

Public Members

int socketBufferSize = 1024 * 1024

Operating system socket send buffer size.

struct avs::NetworkSinkStream

Network sink stream data.

Public Members

uint64_t counter = 0

Stream index

size_t chunkSize = 0

Max size of the buffer

uint32_t id = 0

id

StreamParserType parserType

Stream parser type

NetworkDataType dataType = NetworkDataType::HEVC

Data type

bool isDataLimitPerFrame = false

Whether there is a data limit per frame on this stream

std::vector<uint8_t> buffer

Buffer of data to be sent

struct avs::NetworkSourceCounters

Network source counters.

Public Members

uint64_t bytesReceived = 0

Total bytes received.

uint64_t networkPacketsReceived = 0

Number of received network packets.

uint64_t decoderPacketsReceived = 0

Number of successfully assembled decoder packets.

uint64_t httpFilesReceived = 0

Number of HTTP files received.

uint64_t networkPacketsDropped = 0

Number of network packets dropped due to GC timeout.

uint64_t decoderPacketsDropped = 0

Number of decoder packets dropped due to GC timeout.

uint64_t incompleteDecoderPacketsReceived = 0

Number of incomplete decoder packets received.

float decoderDropped = 0.0f

Fraction of decoder packets dropped.

float networkDropped = 0.0f

Fraction of network packets dropped.

float bandwidthKPS = 0.0f

Bandwidth in kilobytes.

double decoderPacketsReceivedPerSec = 0.0

Number of successfully assembled decoder packets received per second.

struct NetworkSourceParams

Network source parameters.

struct avs::NetworkSourceStream

Network source stream data.

Public Members

uint32_t id = UINT32_MAX

id

struct avs::Result

Result type.

Public Types

enum Code

Result code enumeration.

Values:

enumerator OK
enumerator Node_InvalidSlot
enumerator Node_InvalidLink
enumerator Node_NotLinked
enumerator Node_Incompatible
enumerator Node_NotConfigured
enumerator Node_NotSupported
enumerator Node_AlreadyConfigured
enumerator Node_InvalidConfiguration
enumerator Node_InvalidInput
enumerator Node_InvalidOutput
enumerator Node_LinkFailed
enumerator Node_Null
enumerator Decoder_NoSuitableBackendFound
enumerator Encoder_NoSuitableBackendFound
enumerator Encoder_IncompleteFrame
enumerator Encoder_SurfaceAlreadyRegistered
enumerator Encoder_SurfaceNotRegistered
enumerator Decoder_SurfaceAlreadyRegistered
enumerator Decoder_SurfaceNotRegistered
enumerator Surface_InvalidBackend
enumerator IO_Retry
enumerator IO_Empty
enumerator IO_Full
enumerator IO_OutOfMemory
enumerator IO_InvalidArgument
enumerator File_OpenFailed
enumerator File_ReadFailed
enumerator File_WriteFailed
enumerator File_EOF
enumerator Pipeline_Stop
enumerator Pipeline_AlreadyProfiling
enumerator Pipeline_NotProfiling
enumerator Network_BindFailed
enumerator Network_ResolveFailed
enumerator Network_SendFailed
enumerator Network_RecvFailed
enumerator Network_NoConnection
enumerator Network_Disconnection
enumerator Network_PollTimeout
enumerator EncoderBackend_NoSuitableCodecFound
enumerator EncoderBackend_InitFailed
enumerator EncoderBackend_ReconfigFailed
enumerator EncoderBackend_ShutdownFailed
enumerator EncoderBackend_NotInitialized
enumerator EncoderBackend_InvalidDevice
enumerator EncoderBackend_InvalidSurface
enumerator EncoderBackend_SurfaceNotRegistered
enumerator EncoderBackend_SurfaceAlreadyRegistered
enumerator EncoderBackend_OutOfMemory
enumerator EncoderBackend_FlushError
enumerator EncoderBackend_MapFailed
enumerator EncoderBackend_UnmapFailed
enumerator EncoderBackend_EncodeFailed
enumerator EncoderBackend_CapabilityCheckFailed
enumerator DecoderBackend_InitFailed
enumerator DecoderBackend_ReconfigFailed
enumerator DecoderBackend_InvalidDevice
enumerator DecoderBackend_InvalidParam
enumerator DecoderBackend_InvalidConfiguration
enumerator DecoderBackend_CodecNotSupported
enumerator DecoderBackend_NotInitialized
enumerator DecoderBackend_InvalidSurface
enumerator DecoderBackend_InvalidPayload
enumerator DecoderBackend_SurfaceNotRegistered
enumerator DecoderBackend_SurfaceAlreadyRegistered
enumerator DecoderBackend_ParseFailed
enumerator DecoderBackend_DecodeFailed
enumerator DecoderBackend_DisplayFailed
enumerator DecoderBackend_ShutdownFailed
enumerator DecoderBackend_ReadyToDisplay
enumerator DecoderBackend_InvalidOutoutFormat
enumerator DecoderBackend_CapabilityCheckFailed
enumerator GeometryEncoder_Incomplete
enumerator GeometryEncoder_InvalidPayload
enumerator GeometryDecoder_Incomplete
enumerator GeometryDecoder_InvalidPayload
enumerator GeometryDecoder_InvalidBufferSize
enumerator GeometryDecoder_ClientRendererError
enumerator AudioTarget_InvalidBackend
enumerator AudioTargetBackend_AudioProcessingError
enumerator AudioTargetBackend_NullAudioPlayer
enumerator AudioTargetBackend_PlayerDeconfigurationError
enumerator Node_NotReady
enumerator UnknownError
enumerator NetworkSink_SendingDataFailed
enumerator NetworkSink_PackingDataFailed
enumerator NetworkSink_InvalidStreamDataType
enumerator Failed
enumerator Num_ResultCode
enumerator HTTPUtil_NotInitialized
enumerator HTTPUtil_AlreadyInitialized
enumerator HTTPUtil_InitError
enumerator HTTPUtil_TransferError
enumerator NotSupported

Public Functions

inline operator bool() const

if(Result) returns true only if m_code == OK i.e. is ZERO.

Client Messages

struct avs::ClientMessage

A message from a client to a server.

Subclassed by avs::ControllerPosesMessage, avs::NodeStatusMessage, avs::OriginPoseMessage, avs::ReceivedResourcesMessage

Public Functions

virtual size_t getMessageSize() const = 0

Returns byte size of message.

Public Members

ClientMessagePayloadType clientMessagePayloadType

Specifies what type of client message this is.

struct avs::DisplayInfo

Information on the resolution of a client’s display.

Public Members

uint32_t width

Width of the display.

uint32_t height

Height of the display.

struct avs::NodeStatusMessage : public avs::ClientMessage

Message info struct containing how many nodes have changed to what state; sent alongside two lists of node UIDs.

Public Functions

inline virtual size_t getMessageSize() const override

Returns byte size of message.

Public Members

size_t nodesDrawnCount

How many nodes the client is drawing. The node uid’s will be appended first in the packet.

size_t nodesWantToReleaseCount

How many nodes the client has but is no longer drawing. The node uid’s will be appended second in the packet.

struct avs::ReceivedResourcesMessage : public avs::ClientMessage

Message info struct containing how many resources were received; sent alongside a list of UIDs.

Public Functions

inline virtual size_t getMessageSize() const override

Returns byte size of message.

Public Members

size_t receivedResourcesCount

How many resources were received. The uid’s will be appended in the packet.

struct avs::ControllerPosesMessage : public avs::ClientMessage

Message info struct containing how many resources were received; sent alongside a list of UIDs.

Public Functions

inline virtual size_t getMessageSize() const override

Returns byte size of message.

Public Members

Pose headPose

The headset’s pose.

Pose controllerPoses[2]

Poses of the two controllers.

struct avs::OriginPoseMessage : public avs::ClientMessage

Public Functions

inline virtual size_t getMessageSize() const override

Returns byte size of message.