VPI - Vision Programming Interface

1.2 Release

The main entry-point to the API is the VPIStream object. More...

Typedefs

typedef struct VPIStreamImpl * VPIStream
 A handle to a stream.
 

Functions

VPIStatus vpiStreamCreate (uint32_t flags, VPIStream *stream)
 Create a stream instance. More...
 
void vpiStreamDestroy (VPIStream stream)
 Destroy a stream instance and deallocate all HW resources. More...
 
VPIStatus vpiStreamFlush (VPIStream stream)
 Submits all pending operations for execution. More...
 
VPIStatus vpiStreamSync (VPIStream stream)
 Blocks the calling thread until all submitted commands in this stream queue are done (queue is empty). More...
 
VPIStatus vpiStreamWaitEvent (VPIStream stream, VPIEvent event)
 Pushes a command that blocks the processing of all future commands submitted to the stream until the event is signaled. More...
 
VPIStatus vpiStreamGetThreadHandle (VPIStream stream, VPINativeThreadHandle *handle)
 Returns OS-specific handle of the background stream processing thread. More...
 
VPIStatus vpiStreamGetFlags (VPIStream stream, uint32_t *flags)
 Gets the VPIStream flags passed during its creation. More...
 

Memory creation flags.

These flags can be used when creating images, pyramids or arrays.

enum  VPIBackend
 VPI Backend types. More...
 

Stream-specific flags.

#define VPI_STREAM_GREEDY   (1 << 18)
 Flushes operations to the backend at every submission.
 

Detailed Description

The main entry-point to the API is the VPIStream object.

This object represents a command queue (FIFO) storing a list of commands to execute. Commands might comprise running a particular CV algorithm or signaling an event in a particular backend. This allows the API functions to be executed asynchronously with respect to the calling thread. Invoking any CV function simply pushes a corresponding command to the command queue in the VPIStream instance and immediately returns. The queued commands then get consumed and dispatched to the associated backend device.

Enumeration Type Documentation

◆ VPIBackend

enum VPIBackend

#include <vpi/Types.h>

VPI Backend types.

Enumerator
VPI_BACKEND_CPU 

CPU backend.

VPI_BACKEND_CUDA 

CUDA backend.

VPI_BACKEND_PVA 

PVA backend.

VPI_BACKEND_VIC 

VIC backend.

VPI_BACKEND_NVENC 

NVENC backend.

VPI_BACKEND_INVALID 

Invalid backend.

Definition at line 90 of file Types.h.

Function Documentation

◆ vpiStreamCreate()

VPIStatus vpiStreamCreate ( uint32_t  flags,
VPIStream stream 
)

#include <vpi/Stream.h>

Create a stream instance.

Parameters
[in]flagsStream flags. Here it can be specified in what backends are enabled in it by or-ing VPIBackend flags together. Set flags to 0 to enable it in all backends supported by the active VPI context.
[out]streampointer to stream handle
Returns
an error code on failure else VPI_SUCCESS

◆ vpiStreamDestroy()

void vpiStreamDestroy ( VPIStream  stream)

#include <vpi/Stream.h>

Destroy a stream instance and deallocate all HW resources.

This operation will implicitly synchronize the stream to guarantee that all operations submitted to it are completed.

Parameters
[in]streamStream handle. If can be NULL, in this case the function won't do anything.

◆ vpiStreamFlush()

VPIStatus vpiStreamFlush ( VPIStream  stream)

#include <vpi/Stream.h>

Submits all pending operations for execution.

Parameters
[in]streamstream handle
Returns
an error code on failure else VPI_SUCCESS

◆ vpiStreamGetFlags()

VPIStatus vpiStreamGetFlags ( VPIStream  stream,
uint32_t *  flags 
)

#include <vpi/Stream.h>

Gets the VPIStream flags passed during its creation.

Parameters
[in]streamStream handle.
[out]flagsPointer to variable where the flags will be stored into.
Returns
an error code on failure else VPI_SUCCESS

◆ vpiStreamGetThreadHandle()

VPIStatus vpiStreamGetThreadHandle ( VPIStream  stream,
VPINativeThreadHandle handle 
)

#include <vpi/Stream.h>

Returns OS-specific handle of the background stream processing thread.

Parameters
[in]streamstream handle
[out]handlestream processing thread handle
Returns
an error code on failure else VPI_SUCCESS

◆ vpiStreamSync()

VPIStatus vpiStreamSync ( VPIStream  stream)

#include <vpi/Stream.h>

Blocks the calling thread until all submitted commands in this stream queue are done (queue is empty).

This function call is equivalent to atomically calling vpiEventRecord followed by vpiStreamWaitEvent.

The operation will implicitly flush the stream.

Parameters
[in]streamstream handle
Returns
an error code on failure else VPI_SUCCESS

◆ vpiStreamWaitEvent()

VPIStatus vpiStreamWaitEvent ( VPIStream  stream,
VPIEvent  event 
)

#include <vpi/Stream.h>

Pushes a command that blocks the processing of all future commands submitted to the stream until the event is signaled.

Parameters
[in]streamStream handle
[in]eventevent handle
Returns
an error code on failure else VPI_SUCCESS