TIOVX User Guide
c: Application Interface APIs

Detailed Description

APIs for application interface accessible only on host.

Modules

 Raw Image Data Type APIs
 APIs creating and using raw image data type.
 
 Super Node Framework Type APIs
 APIs creating and using super node framework type.
 
 Kernel Helper APIs
 Helper APIs used used for host side kernel validation.
 
 Utility APIs
 Utility APIs available for the application running on the host.
 
 Platform OSAL APIs
 Platform operating system abstraction layer on the host.
 
 Debug APIs
 APIs for debug operations on the host.
 

Data Structures

struct  tivx_resource_stats_t
 Struct containing config parameters of given static value. More...
 

Defines

#define TIVX_TARGET_MAX_NAME   (64u)
 Max possible name of a target.
 
#define TIVX_TARGET_HOST   "HOST"
 String to name a OpenVX Host. More...
 
#define TIVX_RESOURCE_NAME_MAX   (39u)
 Max size of macro.
 
#define TIVX_CONFIG_PATH_LENGTH   (512u)
 Max size of config file path.
 
#define TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP   (0x00000001u)
 Flag used with tivxGraphParameterEnqueueReadyRef to indicate that this enqueue call if for pipeup phase. More...
 
#define TIVX_CONTROL_CMD_SEND_TO_ALL_REPLICATED_NODES   ((uint32_t)-1)
 When sending a control command to a replicated node, this can be used to send control command to all replicated node. More...
 
#define dimof(x)   (sizeof(x)/sizeof(x[0]))
 Macro to find size of array.
 

Enumerations

enum  tivx_attribute_extensions_e {
  TIVX_NODE_TARGET_STRING = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x0,
  TIVX_USER_DATA_OBJECT_VALID_SIZE = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x1,
  TIVX_REFERENCE_TIMESTAMP = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x2,
  TIVX_REFERENCE_INVALID = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x3,
  TIVX_GRAPH_STREAM_EXECUTIONS = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x4,
  TIVX_KERNEL_TIMEOUT = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x5,
  TIVX_NODE_TIMEOUT = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x6,
  TIVX_GRAPH_TIMEOUT = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x7,
  TIVX_GRAPH_PIPELINE_DEPTH = VX_ATTRIBUTE_BASE(VX_ID_TI, (vx_enum)0) + 0x8
}
 TI attribute extensions. More...
 
enum  tivx_df_image_e {
  TIVX_DF_IMAGE_P12 = VX_DF_IMAGE('P','0','1','2'),
  TIVX_DF_IMAGE_NV12_P12 = VX_DF_IMAGE('N','1','2','P'),
  TIVX_DF_IMAGE_RGB565 = VX_DF_IMAGE('R','5','6','5'),
  TIVX_DF_IMAGE_BGRX = VX_DF_IMAGE('B','G','R','A')
}
 Based on the VX_DF_IMAGE definition. More...
 
enum  tivx_status_e {
  TIVX_STATUS_BASE = -(vx_int32)100,
  TIVX_ERROR_EVENT_TIMEOUT = (vx_int32)(TIVX_STATUS_BASE + 1)
}
 The enumeration of all TIVX operational error codes. More...
 
enum  tivx_cpu_id_e {
  TIVX_CPU_ID_DSP1 = 0,
  TIVX_CPU_ID_DSP2 = 1,
  TIVX_CPU_ID_DSP_C7_1 = 2,
  TIVX_CPU_ID_IPU1_0 = 3,
  TIVX_CPU_ID_IPU1_1 = 4,
  TIVX_CPU_ID_A72_0 = 5,
  TIVX_CPU_ID_MAX = 6,
  TIVX_CPU_ID_INVALID = 0xFF
}
 CPU ID for supported CPUs. More...
 

Functions

void tivxInit (void)
 Function to initialize OpenVX framework. More...
 
void tivxDeInit (void)
 Function to de-initialize OpenVX framework. More...
 
void tivxHostInit (void)
 Function to initialize OpenVX HOST side functionality. More...
 
void tivxHostDeInit (void)
 Function to de-initialize OpenVX HOST side functionality. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxAddKernelTarget (vx_kernel kernel, const char *target_name)
 Associate a target with a kernel. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxSetKernelSinkDepth (vx_kernel kernel, uint32_t num_sink_bufs)
 Set the number of sink buffers.
 
VX_API_ENTRY vx_status VX_API_CALL tivxRegisterModule (const char *name, vx_publish_kernels_f publish, vx_unpublish_kernels_f unpublish)
 Register publish and unpublish functions against a module name. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxUnRegisterModule (const char *name)
 UnRegister publish and unpublish functions if previously registered.
 
vx_enum tivxGetSelfCpuId (void)
 Return CPU ID of the CPU on which this API is called.
 
vx_status tivxQueryResourceStats (const char *resource_name, tivx_resource_stats_t *stat)
 Query resource for resource stats.
 
void tivxPrintAllResourceStats (void)
 Prints out resource stats.
 
vx_status tivxExportAllResourceMaxUsedValueToFile (void)
 Exports the max used values to a file. More...
 
vx_node tivxCreateNodeByKernelEnum (vx_graph graph, vx_enum kernelenum, vx_reference params[], vx_uint32 num)
 Utility function to create a node given parameter references and kernel enum. More...
 
vx_node tivxCreateNodeByKernelRef (vx_graph graph, vx_kernel kernel, vx_reference params[], vx_uint32 num)
 Utility function to create a node given parameter references and kernel reference. More...
 
vx_node tivxCreateNodeByKernelName (vx_graph graph, const char *kernel_name, vx_reference params[], vx_uint32 num)
 Utility function to create a node given parameter references and kernel name. More...
 
vx_bool tivxIsReferenceVirtual (vx_reference ref)
 Utility function to check if the given reference is virtual or not. More...
 
vx_reference tivxGetReferenceParent (vx_reference child_ref)
 Utility function to extract the parent reference from an element. More...
 
vx_bool tivxIsTargetEnabled (char target_name[])
 Utility function to know if target is enabled or not. More...
 
uint64_t tivxPlatformGetTimeInUsecs (void)
 Get the time in micro seconds. More...
 
vx_status VX_API_CALL tivxExportGraphToDot (vx_graph graph, const char *output_file_path, const char *output_file_prefix)
 Export graph representation as DOT graph file. More...
 
vx_status VX_API_CALL tivxSetNodeParameterNumBufByIndex (vx_node node, vx_uint32 index, vx_uint32 num_buf)
 Set number of buffers to allocate at output of a node parameter. More...
 
vx_status VX_API_CALL tivxGetNodeParameterNumBufByIndex (vx_node node, vx_uint32 index, vx_uint32 *num_buf)
 Get number of buffers to allocate at output of a node parameter. More...
 
vx_status VX_API_CALL tivxSetGraphPipelineDepth (vx_graph graph, vx_uint32 pipeline_depth)
 Indicates to the implementation the depth of the graph pipeline. More...
 
vx_status VX_API_CALL tivxGraphParameterEnqueueReadyRef (vx_graph graph, vx_uint32 graph_parameter_index, vx_reference *refs, vx_uint32 num_refs, vx_uint32 flags)
 Same as vxGraphParameterEnqueueReadyRef except that it take an additional TIOVX specific flag parameter. More...
 
vx_status VX_API_CALL tivxNodeSendCommand (vx_node node, uint32_t replicate_nodex_idx, uint32_t node_cmd_id, vx_reference ref[], uint32_t num_refs)
 Send node specific Control command. More...
 
vx_status VX_API_CALL tivxNodeSendCommandTimed (vx_node node, uint32_t replicate_nodex_idx, uint32_t node_cmd_id, vx_reference ref[], uint32_t num_refs, uint32_t timeout)
 Send node specific Control command. More...
 
vx_node tivxGraphGetNode (vx_graph graph, uint32_t index)
 This API is used to get a reference to a node within a graph at a given index within the graph. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxSetUserDataObjectAttribute (vx_user_data_object user_data_object, vx_enum attribute, const void *ptr, vx_size size)
 Sets attributes on the user data object. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxSetNodeTileSize (vx_node node, vx_uint32 block_width, vx_uint32 block_height)
 Sets the tile size for a given node in a graph. This is only valid for BAM-enabled kernels on C66 DSP. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxSetReferenceAttribute (vx_reference ref, vx_enum attribute, const void *ptr, vx_size size)
 Sets reference attributes for the below enums: TIVX_REFERENCE_TIMESTAMP. More...
 
VX_API_ENTRY vx_bool VX_API_CALL tivxIsReferenceMetaFormatEqual (vx_reference ref1, vx_reference ref2)
 Check for equivalence between the meta formats of two reference objects. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxReferenceImportHandle (vx_reference ref, const void *addr[], const uint32_t size[], uint32_t num_entries)
 Updates a reference object with the supplied handles (pointers to memory). More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxReferenceExportHandle (const vx_reference ref, void *addr[], uint32_t size[], uint32_t max_entries, uint32_t *num_entries)
 Exports the handles from a reference object. More...
 
vx_status VX_API_CALL tivxLogRtTraceEnable (vx_graph graph)
 Enable run-time logging of graph trace. More...
 
vx_status VX_API_CALL tivxLogRtTraceDisable (vx_graph graph)
 Sisable run-time logging of graph trace. More...
 
vx_status VX_API_CALL tivxLogRtTraceExportToFile (char *filename)
 Saved current log events to file and clear the event log memory. More...
 
void tivxLogRtResetShm (void *shm_base, uint32_t shm_size)
 Reset shared memory used for logging. More...
 
void tivxLogRtInit ()
 Init run-time logger module. More...
 

Macro Definition Documentation

◆ TIVX_TARGET_HOST

#define TIVX_TARGET_HOST   "HOST"

String to name a OpenVX Host.

   Host is not a unique target on its own.
   At system config "HOST" will map to one
   of available targets

Definition at line 103 of file tivx.h.

◆ TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP

#define TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP   (0x00000001u)

Flag used with tivxGraphParameterEnqueueReadyRef to indicate that this enqueue call if for pipeup phase.

Typically used only with source nodes which have a pipeup requirement

Definition at line 128 of file tivx.h.

◆ TIVX_CONTROL_CMD_SEND_TO_ALL_REPLICATED_NODES

#define TIVX_CONTROL_CMD_SEND_TO_ALL_REPLICATED_NODES   ((uint32_t)-1)

When sending a control command to a replicated node, this can be used to send control command to all replicated node.

Currently used as parameter in tivxNodeSendCommand API

Definition at line 138 of file tivx.h.

Enumeration Type Documentation

◆ tivx_attribute_extensions_e

TI attribute extensions.

   TI attribute extensions to OpenVX
Enumerator
TIVX_NODE_TARGET_STRING 

Returns the target string corresponding to the node.

TIVX_USER_DATA_OBJECT_VALID_SIZE 

Sets the valid data size within the user data object.

TIVX_REFERENCE_TIMESTAMP 

Returns the timestamp in micro-seconds corresponding to the given reference.

TIVX_REFERENCE_INVALID 

Returns a boolean indicating whether or not a reference is invalid.

TIVX_GRAPH_STREAM_EXECUTIONS 

Returns the graph stream executions. Read-only. Use a vx_uint32 parameter.

TIVX_KERNEL_TIMEOUT 

Set/Query the kernel level timeout parameter. Read-Write. Can be written at initialization as well as at runtime. Use a vx_uint32 parameter. Refer to TIVX_DEFAULT_KERNAL_TIMEOUT for details on the default value used for this attribute.

TIVX_NODE_TIMEOUT 

Set/Query the node level timeout parameter. Read-Write. Can be written at initialization as well as at runtime. This timeout attribute affects the operation of the node CREATE and DELETE target kernel functions. Use a vx_uint32 parameter. Refer to TIVX_DEFAULT_KERNAL_TIMEOUT for details on the default value used for this attribute.

TIVX_GRAPH_TIMEOUT 

Set/Query the graph level timeout parameter. Read-Write. Can be written at initialization as well as at runtime. This timeout attribute affects the operation of the following APIs.

TIVX_GRAPH_PIPELINE_DEPTH 

Query the graph pipeline depth. Read-Only. Can be read at initialization as well as at runtime. Use a vx_uint32 parameter. By default, this value is set to 1.

Definition at line 167 of file tivx.h.

◆ tivx_df_image_e

Based on the VX_DF_IMAGE definition.

Note
Use vx_df_image to contain these values.
Enumerator
TIVX_DF_IMAGE_P12 

A single plane of packed 12-bit data.

The stride_x for this data format must be set to 0

TIVX_DF_IMAGE_NV12_P12 

a NV12 frame of packed 12-bit data.

The stride_x for this data format must be set to 0

TIVX_DF_IMAGE_RGB565 

A single plane of packed 16-bit RGB565 data.

The stride_x for this data format must be set to 2

TIVX_DF_IMAGE_BGRX 

A single plane of 32-bit pixel as 4 interleaved 8-bit units of B then G then R data, then a don't care byte. This uses the BT709 full range by default.

Definition at line 228 of file tivx.h.

◆ tivx_status_e

The enumeration of all TIVX operational error codes.

Enumerator
TIVX_STATUS_BASE 

Indicates the base for the TIVX error codes. Used for bounds checks only.

TIVX_ERROR_EVENT_TIMEOUT 

Indicates that the wait operation on an event timed-out.

Definition at line 255 of file tivx.h.

◆ tivx_cpu_id_e

CPU ID for supported CPUs.

   CPU ID is defined in platform module since
   depending on platform the CPUs could be different

   Current CPU IDs are defined assuming J721E SoC

   Caution: This enum is used as index into the array
   #g_ipc_cpu_id_map, so change in this enum will require
   change in this array as well.
Enumerator
TIVX_CPU_ID_DSP1 

CPU ID for DSP1.

TIVX_CPU_ID_DSP2 

CPU ID for DSP2.

TIVX_CPU_ID_DSP_C7_1 

CPU ID for C7_1.

TIVX_CPU_ID_IPU1_0 

CPU ID for MCU2_0.

TIVX_CPU_ID_IPU1_1 

CPU ID for MCU2_1.

TIVX_CPU_ID_A72_0 

CPU ID for A72-0.

TIVX_CPU_ID_MAX 

Max value of CPU ID.

TIVX_CPU_ID_INVALID 

Invalid CPU ID.

Definition at line 223 of file tivx_soc_j721e.h.

Function Documentation

◆ tivxInit()

void tivxInit ( void  )

Function to initialize OpenVX framework.

   Should be called during system init on all OpenVX HOST
   as well as OpenVX target CPUs

   NOTE: In Vision SDK, this function is called during VIsion SDK
         system init so user need not call this explicitly

◆ tivxDeInit()

void tivxDeInit ( void  )

Function to de-initialize OpenVX framework.

   Should be called during system init on all OpenVX HOST
   as well as OpenVX target CPUs

   NOTE: In Vision SDK, this function is called during VIsion SDK
         system init so user need not call this explicitly

◆ tivxHostInit()

void tivxHostInit ( void  )

Function to initialize OpenVX HOST side functionality.

   Should be called during system init after tivxInit()
   on HOST CPUs only

   NOTE: In Vision SDK, this function is called during VIsion SDK
         system init so user need not call this explicitly

◆ tivxHostDeInit()

void tivxHostDeInit ( void  )

Function to de-initialize OpenVX HOST side functionality.

   Should be called during system init before tivxDeInit()
   on HOST CPUs only

   NOTE: In Vision SDK, this function is called during VIsion SDK
         system init so user need not call this explicitly

◆ tivxAddKernelTarget()

VX_API_ENTRY vx_status VX_API_CALL tivxAddKernelTarget ( vx_kernel  kernel,
const char *  target_name 
)

Associate a target with a kernel.

   Call multiple times for each supported target

   If given target is not valid on current platform then
   error VX_ERROR_NOT_SUPPORTED is returned.

   Typically VX_ERROR_NOT_SUPPORTED error should be ignored for this API,
   since this code is typically kept same across platforms

   During graph verify however if user asks to run the kernel
   on a target not supported by this platform it results in a
   error and graph cannot execute.

◆ tivxRegisterModule()

VX_API_ENTRY vx_status VX_API_CALL tivxRegisterModule ( const char *  name,
vx_publish_kernels_f  publish,
vx_unpublish_kernels_f  unpublish 
)

Register publish and unpublish functions against a module name.

   These functions are invoked when vxLoadKernels is called with
   the registered name.

   This is alternative instead of dynamically loading kernels during vxLoadKernels

   Duplicate module names not checked by this API.

   API is not reentrant, user is recommended to call all tivxRegisterModule
   during system init before vxCreateContext() from a single thread.

   Modules registered against TIVX_MODULE_NAME are called during vxCreateContext
   so user MUST ensure tivxRegisterModule() is called for TIVX_MODULE_NAME module

◆ tivxExportAllResourceMaxUsedValueToFile()

vx_status tivxExportAllResourceMaxUsedValueToFile ( void  )

Exports the max used values to a file.

   Note 1: For PC emulation mode, the exported files will not have a legend with the correct target
   Note 2: For target mode, only the .txt files will be generated.  These can be converted to JPEG's using the following command:

   dot -Tjpg -o<output file path>/<jpg name>.jpg <text file name>

   For example, to generate a JPEG named "graph.jpg" for the file "graph.txt" in the current directory, the following command would be used.

   dot -Tjpg -o./graph.jpg graph.txt

◆ tivxCreateNodeByKernelEnum()

vx_node tivxCreateNodeByKernelEnum ( vx_graph  graph,
vx_enum  kernelenum,
vx_reference  params[],
vx_uint32  num 
)

Utility function to create a node given parameter references and kernel enum.

Parameters
[in]graphGraph reference
[in]kernelenumEnumeration specifying a specific kernel
[in]paramsList of parameter references corresponding to the enumerated kernel
[in]numNumber of parameter references in params list
Returns
A node reference vx_node. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ tivxCreateNodeByKernelRef()

vx_node tivxCreateNodeByKernelRef ( vx_graph  graph,
vx_kernel  kernel,
vx_reference  params[],
vx_uint32  num 
)

Utility function to create a node given parameter references and kernel reference.

Parameters
[in]graphGraph reference
[in]kernelKernel reference
[in]paramsList of parameter references corresponding to the kernel reference
[in]numNumber of parameter references in params list
Returns
A node reference vx_node. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ tivxCreateNodeByKernelName()

vx_node tivxCreateNodeByKernelName ( vx_graph  graph,
const char *  kernel_name,
vx_reference  params[],
vx_uint32  num 
)

Utility function to create a node given parameter references and kernel name.

Parameters
[in]graphGraph reference
[in]kernel_nameString corresponding to the kernel name
[in]paramsList of parameter references corresponding to the kernel name
[in]numNumber of parameter references in params list
Returns
A node reference vx_node. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ tivxIsReferenceVirtual()

vx_bool tivxIsReferenceVirtual ( vx_reference  ref)

Utility function to check if the given reference is virtual or not.

Parameters
[in]refReference to query
Returns
A vx_bool value.
Return values
vx_true_eThe reference is virtual.
vx_false_eThe reference is not virtual.

◆ tivxGetReferenceParent()

vx_reference tivxGetReferenceParent ( vx_reference  child_ref)

Utility function to extract the parent reference from an element.

Parameters
[in]child_refChild reference to query
Returns
vx_reference in case of success, else NULL

◆ tivxIsTargetEnabled()

vx_bool tivxIsTargetEnabled ( char  target_name[])

Utility function to know if target is enabled or not.

Parameters
[in]target_nameString specifying the target name
Returns
A vx_bool value.
Return values
vx_true_eThe target is enabled
vx_false_eThe target is not enabled

◆ tivxPlatformGetTimeInUsecs()

uint64_t tivxPlatformGetTimeInUsecs ( void  )

Get the time in micro seconds.

Returns
Time in micro seconds.

◆ tivxExportGraphToDot()

vx_status VX_API_CALL tivxExportGraphToDot ( vx_graph  graph,
const char *  output_file_path,
const char *  output_file_prefix 
)

Export graph representation as DOT graph file.

Multiple representation of the graph are exported to different files using 'output_file_prefix' as filename prefix. The output files are stored at path 'output_file_path' Note: This must be called after vxVerifyGraph()

Parameters
[in]graphGraph reference
[in]output_file_pathString specifying the ouput file path
[in]output_file_prefixString specifying the filename prefix of the output file

◆ tivxSetNodeParameterNumBufByIndex()

vx_status VX_API_CALL tivxSetNodeParameterNumBufByIndex ( vx_node  node,
vx_uint32  index,
vx_uint32  num_buf 
)

Set number of buffers to allocate at output of a node parameter.

  • Graph to which the node belongs MUST be scheduled in VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO or VX_GRAPH_SCHEDULE_MODE_QUEUE_MANUAL mode.
  • The node parameter specified MUST be a output parameter.
  • The node parameter specified MUST NOT be an enqueueable graph parameter.

This API acts as a hint and framework may overide user specified settings in case any of above conditions are not met.

Parameters
[in]nodeNode reference
[in]indexNode parameter index
[in]num_bufNumber of buffers to allocate

◆ tivxGetNodeParameterNumBufByIndex()

vx_status VX_API_CALL tivxGetNodeParameterNumBufByIndex ( vx_node  node,
vx_uint32  index,
vx_uint32 num_buf 
)

Get number of buffers to allocate at output of a node parameter.

  • If the buffers have not been set by tivxSetNodeParameterNumBufByIndex and the graph is not in pipelining mode, the num_buf will be 0.
  • If the buffers have not been set by tivxSetNodeParameterNumBufByIndex the graph is in pipelining mode and not verified, the num_buf will be 0.
  • If the buffers have not been set by tivxSetNodeParameterNumBufByIndex the graph is in pipelining mode and verified, the num_buf will be set via the framework based on the number of nodes connected to that buffer.
  • If the buffers have been set by tivxSetNodeParameterNumBufByIndex, the num_buf will reflect this value regardless of if this is an optimal configuration.
  • The node parameter specified MUST be a output parameter.
Parameters
[in]nodeNode reference
[in]indexNode parameter index
[out]num_bufNumber of buffers allocated at output parameter

◆ tivxSetGraphPipelineDepth()

vx_status VX_API_CALL tivxSetGraphPipelineDepth ( vx_graph  graph,
vx_uint32  pipeline_depth 
)

Indicates to the implementation the depth of the graph pipeline.

Parameters
[in]graphGraph reference
[in]pipeline_depthPipeline depth; Max value is (TIVX_GRAPH_MAX_PIPELINE_DEPTH-1) else it will return an error

◆ tivxGraphParameterEnqueueReadyRef()

vx_status VX_API_CALL tivxGraphParameterEnqueueReadyRef ( vx_graph  graph,
vx_uint32  graph_parameter_index,
vx_reference refs,
vx_uint32  num_refs,
vx_uint32  flags 
)

Same as vxGraphParameterEnqueueReadyRef except that it take an additional TIOVX specific flag parameter.

For valid values of flag see

  • TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP The tivxGraphParameterEnqueueReadyRef API is needed if explicitly enqueueing and dequeueing from a capture node graph parameter that has set the VX_KERNEL_PIPEUP_OUTPUT_DEPTH using the vxSetKernelAttribute API. The tivxGraphParameterEnqueueReadyRef must be called for the num_bufs given as the VX_KERNEL_PIPEUP_OUTPUT_DEPTH. This API differs from vxGraphParameterEnqueueReadyRef in that it does not additionally schedule a graph execution. In the case that this API is not used at the capture node graph parameter, the teardown of the graph will pend as it will be waiting on graph executions that have not completed.

For more detailed description of vxGraphParameterEnqueueReadyRef see vxGraphParameterEnqueueReadyRef

Parameters
[in]graphGraph reference
[in]graph_parameter_indexGraph parameter index
[in]refsThe array of references to enqueue into the graph parameter
[in]num_refsNumber of references to enqueue
[in]flagsFlag to control behavior of the operation
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCEgraph is not a valid reference OR reference is not a valid reference
VX_ERROR_INVALID_PARAMETERSgraph_parameter_index is NOT a valid graph parameter index
VX_FAILUREReference could not be enqueued.

◆ tivxNodeSendCommand()

vx_status VX_API_CALL tivxNodeSendCommand ( vx_node  node,
uint32_t  replicate_nodex_idx,
uint32_t  node_cmd_id,
vx_reference  ref[],
uint32_t  num_refs 
)

Send node specific Control command.

This API is used to send specific control command to the node. Refer to Node documentation for specific control command. Note that this API is blocking and does not return untill command is executed by the node. This API is thread safe, ie multi commands can be sent to same or different nodes from different threads

Parameters
[in]nodeReference of the node to which this command is to be sent.
[in]replicate_nodex_idxIn case of a non-replicated node this should be 0, For a replicated node this is the index of the replicated node to which the command is targeted. To send same command to all replicated nodes use TIVX_CONTROL_CMD_SEND_TO_ALL_REPLICATED_NODES
[in]node_cmd_idNode specific control command id, refer to node specific interface file
[in,out]ref[]Node parameter, This is an array of references, required as parameters for this control command. They can be any OpenVX object, created using create API. It is bidirectional parameters, can be used for INPUT, OUTPUT or both. These parameters are list of references, which are required for the control command on the given node. Refer to node documentation to get details about the parameters required for given control command. Caller of this API should explicitely release these refs after their usage is completed.
[in]num_refsNumber of valid entries/references in ref[] array

◆ tivxNodeSendCommandTimed()

vx_status VX_API_CALL tivxNodeSendCommandTimed ( vx_node  node,
uint32_t  replicate_nodex_idx,
uint32_t  node_cmd_id,
vx_reference  ref[],
uint32_t  num_refs,
uint32_t  timeout 
)

Send node specific Control command.

This API is used to send specific control command to the node. Refer to Node documentation for specific control command. Note that this API blocks for atmost 'timeout' milli-seconds i.e. the API returns either when the command execution finishes or if the timeout occurs, whichever occurs first. This API is thread safe, ie multi commands can be sent to same or different nodes from different threads

Parameters
[in]nodeReference of the node to which this command is to be sent.
[in]replicate_nodex_idxIn case of a non-replicated node this should be 0, For a replicated node this is the index of the replicated node to which the command is targeted. To send same command to all replicated nodes use TIVX_CONTROL_CMD_SEND_TO_ALL_REPLICATED_NODES
[in]node_cmd_idNode specific control command id, refer to node specific interface file
[in,out]ref[]Node parameter, This is an array of references, required as parameters for this control command. They can be any OpenVX object, created using create API. It is bidirectional parameters, can be used for INPUT, OUTPUT or both. These parameters are list of references, which are required for the control command on the given node. Refer to node documentation to get details about the parameters required for given control command. Caller of this API should explicitely release these refs after their usage is completed.
[in]num_refsNumber of valid entries/references in ref[] array
[in]timeoutTimeout in units of msecs, use TIVX_EVENT_TIMEOUT_WAIT_FOREVER to wait forever

◆ tivxGraphGetNode()

vx_node tivxGraphGetNode ( vx_graph  graph,
uint32_t  index 
)

This API is used to get a reference to a node within a graph at a given index within the graph.

   Use vxQueryGraph with attribute VX_GRAPH_NUMNODES to get number of nodes within a graph.
   This API can be called only on a verified graph.
   Node returned by this API is not reference counted and should not be released by the user.
Parameters
[in]graphgraph handle
[in]indexnode index, value from 0 .. value returned by vxQueryGraph(VX_GRAPH_NUMNODES) - 1
Returns
vx_node in case of success, else NULL

◆ tivxSetUserDataObjectAttribute()

VX_API_ENTRY vx_status VX_API_CALL tivxSetUserDataObjectAttribute ( vx_user_data_object  user_data_object,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Sets attributes on the user data object.

Parameters
[in]user_data_objectThe reference to the user data object.
[in]attributeThe attribute to modify. Use a vx_user_data_object_attribute_e.
[in]ptrThe pointer to the value to which to set the attribute.
[in]sizeThe size in bytes of the container to which ptr points.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCEIf the user_data_object is not a vx_user_data_object.
VX_ERROR_NOT_SUPPORTEDIf the attribute is not a value supported on this implementation.
VX_ERROR_INVALID_PARAMETERSIf any of the other parameters are incorrect.

◆ tivxSetNodeTileSize()

VX_API_ENTRY vx_status VX_API_CALL tivxSetNodeTileSize ( vx_node  node,
vx_uint32  block_width,
vx_uint32  block_height 
)

Sets the tile size for a given node in a graph. This is only valid for BAM-enabled kernels on C66 DSP.

Parameters
[in]nodeThe reference to the vx_node object.
[in]block_widthThe tile width in pixels.
[in]block_heightThe tile height in lines.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSif the tile size is set correctly.

◆ tivxSetReferenceAttribute()

VX_API_ENTRY vx_status VX_API_CALL tivxSetReferenceAttribute ( vx_reference  ref,
vx_enum  attribute,
const void *  ptr,
vx_size  size 
)

Sets reference attributes for the below enums: TIVX_REFERENCE_TIMESTAMP.

Parameters
[in]refThe reference object.
[in]attributeThe attribute of the reference to be set.
[in]ptrThe value of the reference attribute to be set.
[in]sizeThe size of the value of the reference attribute to be set.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSif the attribute was set correctly.

◆ tivxIsReferenceMetaFormatEqual()

VX_API_ENTRY vx_bool VX_API_CALL tivxIsReferenceMetaFormatEqual ( vx_reference  ref1,
vx_reference  ref2 
)

Check for equivalence between the meta formats of two reference objects.

This API is used to check for equivalence between the meta formats of two reference objects. The function returns true if they are equal and false if not.

Parameters
[in]ref1First reference object to be compared.
[in]ref2Second reference object to be compared.
Returns
A _vx_bool_e enumeration.
vx_true_e in case of equal meta formats, vx_false else

◆ tivxReferenceImportHandle()

VX_API_ENTRY vx_status VX_API_CALL tivxReferenceImportHandle ( vx_reference  ref,
const void *  addr[],
const uint32_t  size[],
uint32_t  num_entries 
)

Updates a reference object with the supplied handles (pointers to memory).

Any existing handles in the reference object will be over-written with the new handles provided. No error will be reported. If the caller chooses to preserve the existing handles then the caller should use tivxReferenceExportHandle for retrieving the current handles before invoking this function.

The following conditions regarding 'addr' must be TRUE:

  • allocated using appMemAlloc()/tivxMemAlloc() on ARM
  • memory block is contiguous

Only the following reference object types are supported:

  • VX_TYPE_IMAGE
  • VX_TYPE_TENSOR
  • VX_TYPE_USER_DATA_OBJECT
  • VX_TYPE_ARRAY
  • VX_TYPE_DISTRIBUTION
  • VX_TYPE_MATRIX
  • VX_TYPE_CONVOLUTION
  • TIVX_TYPE_RAW_IMAGE
  • TIVX_TYPE_PYRAMID

For TIVX_TYPE_PYRAMID type, the references are packed for each level. If the image type has multiple planes then all the handles for a given level are packed contiguously before the handles of the next level. For example if the pyramid object has N levels and each level has image with X levels then the packing will look like: Level 0 Plane 0 Level 0 Plane 1 ........... Level 0 Plane (X-1) ........... Level (N-1) Plane 0 Level (N-1) Plane 1 ........... Level (N-1) Plane (X-1)

Parameters
[in,out]refThe reference object to be updated.
[in]addrAn array of pointers for holding the handles. The entries can be NULL.
[in]sizeAn array of sizes corresponding to handles. The entries will be looked at if the corresponding handle is not NULL.
[in]num_entriesNumber of valid entries in addr[]. This should match the number of handles expected to be maintained internally by 'ref' (ex:- for an image object with multiple planes, num_extries > 1).
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESS,ifthe import operation is successful. The 'ref' object will have the internal handles updated. VX_FAILURE, if the operation is unsuccessful. The state of the reference object is not changed. A failure can occur for the following reasons:
  • Unsupported reference object type
  • The argument check fails
  • The handle check fails i.e. the handles have not been allocated using appMemAlloc()/tivxMemAlloc()
  • The number of handles specified is less than the number expected by the reference object.

◆ tivxReferenceExportHandle()

VX_API_ENTRY vx_status VX_API_CALL tivxReferenceExportHandle ( const vx_reference  ref,
void *  addr[],
uint32_t  size[],
uint32_t  max_entries,
uint32_t *  num_entries 
)

Exports the handles from a reference object.

It is the responsibility of the caller to make sure that the addr array is dimensioned to hold all the handles expected from the reference object.

Only the following reference object types are supported:

  • VX_TYPE_IMAGE
  • VX_TYPE_TENSOR
  • VX_TYPE_USER_DATA_OBJECT
  • VX_TYPE_ARRAY
  • VX_TYPE_DISTRIBUTION
  • VX_TYPE_MATRIX
  • VX_TYPE_CONVOLUTION
  • TIVX_TYPE_RAW_IMAGE
  • TIVX_TYPE_PYRAMID

For TIVX_TYPE_PYRAMID type, the references are packed for each level. If the image type has multiple planes then all the handles for a given level are packed contiguously before the handles of the next level. For example if the pyramid object has N levels and each level has image with X levels then the packing will look like: Level 0 Plane 0 Level 0 Plane 1 ........... Level 0 Plane (X-1) ........... Level (N-1) Plane 0 Level (N-1) Plane 1 ........... Level (N-1) Plane (X-1)

Parameters
[in]refThe reference object to export the handles from.
[out]addrAn array of pointers for holding the handles.
[out]sizeAn array of sizes corresponding to handles. The entries will be looked
[in]max_entriesMaximum number of entries to export.
[out]num_entriesNumber of valid entries in addr[]. This should match the number of handles expected to be maintained internally by 'ref' (ex:- for an image object with multiple planes, num_extries > 1).
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESS,ifthe export operation is successful. The 'addr' object will be populated with 'num_entries' handles. size[i] will correspond to the handle addr[i]. VX_FAILURE, if the operation is unsuccessful. The state of the reference object is not changed. A failure can occur for the following reasons:
  • Unsupported reference object type
  • The argument check fails
  • The max number of handles specified is less than the number expected to be exported by the reference object.

◆ tivxLogRtTraceEnable()

vx_status VX_API_CALL tivxLogRtTraceEnable ( vx_graph  graph)

Enable run-time logging of graph trace.

   - By default run-time logging is disabled.
   - This API MUST be called after vxVerifyGraph and before starting the graph execution
Parameters
[in]graphGraph reference

◆ tivxLogRtTraceDisable()

vx_status VX_API_CALL tivxLogRtTraceDisable ( vx_graph  graph)

Sisable run-time logging of graph trace.

   - By default run-time logging is disabled.
   - This API MUST be called after graph executions have stopped and before calling vxReleaseGraph 
Parameters
[in]graphGraph reference

◆ tivxLogRtTraceExportToFile()

vx_status VX_API_CALL tivxLogRtTraceExportToFile ( char *  filename)

Saved current log events to file and clear the event log memory.

   - This API can be called while graphs are executing
   - Each time API is called, current log events are saved to the file 'filename'
     and existing log is cleared.
   - Calling this API periodically avoids the event log from getting full.
   - Thus this API allows to continously store data to a file on the filesystem, limited only by the
     size of free space on the filesystem.
   - The data stored in the file can be visualized by doing below
     - Copy the saved file(s) to PC
     - Convert the binary data to 'VCD - Value Change Dump' format
     - Use a opensource tool like gtkwave to visualize the data 
Parameters
[in]filenameFilename to save the log data into. When filename is NULL, data is not saved, only the event log is cleared.

◆ tivxLogRtResetShm()

void tivxLogRtResetShm ( void *  shm_base,
uint32_t  shm_size 
)

Reset shared memory used for logging.

   - Called internally during tivxInit. Should NOT be called by user

◆ tivxLogRtInit()

void tivxLogRtInit ( )

Init run-time logger module.

   - Called internally during tivxInit. Should NOT be called by user