VPI - Vision Programming Interface

3.0 Release

User-Defined Function

Submits a user-defined function to be executed on the stream. More...

Typedefs

typedef void(* VPIHostFunction) (void *hostData)
 Pointer to a host function. More...
 
typedef VPIStatus(* VPIHostFunctionEx) (VPIStream stream, VPIStatus status, void *hostData)
 Pointer to a host function that handles stream status. More...
 

Functions

VPIStatus vpiSubmitHostFunction (VPIStream stream, VPIHostFunction hostFunc, void *hostData)
 Pushes a command that will invoke a custom host-side function after all prior commands have been processed. More...
 
VPIStatus vpiSubmitHostFunctionEx (VPIStream stream, VPIHostFunctionEx hostFunc, void *hostData)
 Pushes a command that will invoke a custom host-side function after all prior commands have been processed. More...
 

Detailed Description

Submits a user-defined function to be executed on the stream.

Typedef Documentation

◆ VPIHostFunction

typedef void(* VPIHostFunction) (void *hostData)

#include </opt/nvidia/vpi3/include/vpi/HostFunction.h>

Pointer to a host function.

Parameters
[in]hostDataCallback data passed to submission function.

Definition at line 81 of file HostFunction.h.

◆ VPIHostFunctionEx

typedef VPIStatus(* VPIHostFunctionEx) (VPIStream stream, VPIStatus status, void *hostData)

#include </opt/nvidia/vpi3/include/vpi/HostFunction.h>

Pointer to a host function that handles stream status.

Most often the function will return the same status passed. In some scenarios some other status values can be returned. Specifically, if status is VPI_SUCCESS and an error status is returned, the stream will be set to error state. Conversely, if status is not VPI_SUCCESS and VPI_SUCCESS is returned, the stream's error state will be reset. Further tasks in it will be executed.

Parameters
[in]streamStream that is executing the host function.
[in]statusStatus of the last operation executed by the stream.
[in]hostDataCallback data passed to submission function.
Returns
The new stream status. Mostly often status is returned.

Definition at line 126 of file HostFunction.h.

Function Documentation

◆ vpiSubmitHostFunction()

VPIStatus vpiSubmitHostFunction ( VPIStream  stream,
VPIHostFunction  hostFunc,
void *  hostData 
)

#include </opt/nvidia/vpi3/include/vpi/HostFunction.h>

Pushes a command that will invoke a custom host-side function after all prior commands have been processed.

The execution of commands submitted after this call is suspended until the callback is finished. The function will be executed at most once. It won't be executed if a previous stream task failed.

This operation will implicitly flush the stream.

Parameters
[in]streamStream that will execute the host function call.
  • Mandatory, cannot be NULL.
[in]hostFuncHost function to be executed.
  • Mandatory, cannot be NULL.
[in]hostDataPointer that will be passed unchanged to the user function when it's called.
Return values
VPI_ERROR_INVALID_ARGUMENThostFunc is NULL.
VPI_ERROR_INVALID_ARGUMENThostData is NULL.
VPI_SUCCESSOperation executed successfully.

◆ vpiSubmitHostFunctionEx()

VPIStatus vpiSubmitHostFunctionEx ( VPIStream  stream,
VPIHostFunctionEx  hostFunc,
void *  hostData 
)

#include </opt/nvidia/vpi3/include/vpi/HostFunction.h>

Pushes a command that will invoke a custom host-side function after all prior commands have been processed.

The execution of commands submitted after this call is suspended until the callback is finished. The function is guaranteed to be executed exactly once. In case the stream is in error state, the corresponding error status will be passed to hostFunc.

This operation will implicitly flush the stream.

Parameters
[in]streamStream that will execute the host function call.
  • Mandatory, cannot be NULL.
[in]hostFuncHost function to be executed.
  • Mandatory, cannot be NULL.
[in]hostDataPointer that will be passed unchanged to the user function.
Return values
VPI_ERROR_INVALID_ARGUMENTstream is NULL or doesn't correspond to a VPIStream instance.
VPI_ERROR_INVALID_ARGUMENThostFunc is NULL.
VPI_SUCCESSOperation executed successfully.