libxcoder  5.2.0
ni_util.c File Reference

Utility definitions. More...

#include "ni_nvme.h"
#include "ni_util.h"

Go to the source code of this file.

Data Structures

struct  _ni_err_rc_txt_entry
 
struct  tensor_rsrc
 
struct  SHA256CTX
 

Macros

#define _EPSILON   1e-8
 
#define SHA256_BLOCK_SIZE   32
 
#define ROTLEFT(a, b)   (((a) << (b)) | ((a) >> (32 - (b))))
 
#define ROTRIGHT(a, b)   (((a) >> (b)) | ((a) << (32 - (b))))
 
#define CH(x, y, z)   (((x) & (y)) ^ (~(x) & (z)))
 
#define MAJ(x, y, z)   (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
 
#define EP0(x)   (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22))
 
#define EP1(x)   (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25))
 
#define SIG0(x)   (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3))
 
#define SIG1(x)   (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10))
 

Typedefs

typedef struct _ni_err_rc_txt_entry ni_err_rc_txt_entry_t
 
typedef struct SHA256CTX SHA256CTX
 

Functions

int32_t ni_gettimeofday (struct timeval *p_tp, void *p_tzp)
 Get time for logs with microsecond timestamps. More...
 
uint32_t ni_round_up (uint32_t number_to_round, uint32_t multiple)
 
int ni_posix_memalign (void **memptr, size_t alignment, size_t size)
 Allocate aligned memory. More...
 
void ni_usleep (int64_t usec)
 
char * ni_strtok (char *s, const char *delim, char **saveptr)
 
ni_buf_tni_buf_pool_expand (ni_buf_pool_t *pool)
 
ni_buf_tni_buf_pool_get_buffer (ni_buf_pool_t *p_buffer_pool)
 
void ni_buf_pool_return_buffer (ni_buf_t *buf, ni_buf_pool_t *p_buffer_pool)
 
ni_buf_tni_buf_pool_allocate_buffer (ni_buf_pool_t *p_buffer_pool, int buffer_size)
 
int32_t ni_dec_fme_buffer_pool_initialize (ni_session_context_t *p_ctx, int32_t number_of_buffers, int width, int height, int height_align, int factor)
 
void ni_dec_fme_buffer_pool_free (ni_buf_pool_t *p_buffer_pool)
 
void ni_buffer_pool_free (ni_queue_buffer_pool_t *p_buffer_pool)
 
ni_queue_node_tni_buffer_pool_allocate_buffer (ni_queue_buffer_pool_t *p_buffer_pool)
 
int32_t ni_buffer_pool_initialize (ni_session_context_t *p_ctx, int32_t number_of_buffers)
 
ni_queue_node_tni_buffer_pool_expand (ni_queue_buffer_pool_t *pool)
 
ni_queue_node_tni_buffer_pool_get_queue_buffer (ni_queue_buffer_pool_t *p_buffer_pool)
 
void ni_buffer_pool_return_buffer (ni_queue_node_t *buf, ni_queue_buffer_pool_t *p_buffer_pool)
 
int32_t ni_get_frame_index (uint32_t *value)
 Get xcoder instance id. More...
 
ni_retcode_t ni_find_blk_name (const char *p_dev, char *p_out_buf, int out_buf_len)
 Find NVMe name space block from device name If none is found, assume nvme multi-pathing is disabled and return /dev/nvmeXn1. More...
 
ni_retcode_t ni_check_dev_name (const char *p_dev)
 check dev name More...
 
ni_retcode_t ni_timestamp_init (ni_session_context_t *p_ctx, ni_timestamp_table_t **pp_table, const char *name)
 Initialize timestamp handling. More...
 
ni_retcode_t ni_timestamp_done (ni_timestamp_table_t *p_table, ni_queue_buffer_pool_t *p_buffer_pool)
 Clean up timestamp handling. More...
 
ni_retcode_t ni_timestamp_register (ni_queue_buffer_pool_t *p_buffer_pool, ni_timestamp_table_t *p_table, int64_t timestamp, uint64_t data_info)
 Register timestamp in timestamp/frameoffset table. More...
 
ni_retcode_t ni_timestamp_get (ni_timestamp_table_t *p_table, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool)
 Retrieve timestamp from table based on frameoffset info. More...
 
ni_retcode_t ni_timestamp_get_with_threshold (ni_timestamp_table_t *p_table, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool)
 
void ni_timestamp_scan_cleanup (ni_timestamp_table_t *pts_list, ni_timestamp_table_t *dts_list, ni_queue_buffer_pool_t *p_buffer_pool)
 
ni_retcode_t ni_timestamp_get_v2 (ni_timestamp_table_t *p_table, uint64_t frame_offset, int64_t *p_timestamp, int32_t threshold, ni_queue_buffer_pool_t *p_buffer_pool)
 Retrieve timestamp from table based on frameoffset info. More...
 
ni_retcode_t ni_queue_init (ni_session_context_t *p_ctx, ni_queue_t *p_queue, const char *name)
 Initialize xcoder queue. More...
 
ni_retcode_t ni_queue_push (ni_queue_buffer_pool_t *p_buffer_pool, ni_queue_t *p_queue, uint64_t frame_info, int64_t timestamp)
 Push into xcoder queue. More...
 
ni_retcode_t ni_queue_pop (ni_queue_t *p_queue, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool)
 Pop from the xcoder queue. More...
 
ni_retcode_t ni_queue_pop_threshold (ni_queue_t *p_queue, uint64_t frame_info, int64_t *p_timestamp, int32_t threshold, int32_t print, ni_queue_buffer_pool_t *p_buffer_pool)
 
ni_retcode_t ni_queue_free (ni_queue_t *p_queue, ni_queue_buffer_pool_t *p_buffer_pool)
 Free xcoder queue. More...
 
ni_retcode_t ni_queue_print (ni_queue_t *p_queue)
 Print xcoder queue info. More...
 
int32_t ni_atobool (const char *p_str, bool *b_error)
 Convert string to boolean. More...
 
int32_t ni_atoi (const char *p_str, bool *b_error)
 Convert string to integer. More...
 
double ni_atof (const char *p_str, bool *b_error)
 Convert string to floating. More...
 
int32_t ni_parse_name (const char *arg, const char *const *names, bool *b_error)
 Parse name. More...
 
uint64_t ni_get_utime (void)
 Get system time for log. More...
 
uint64_t ni_gettime_ns (void)
 
void ni_get_hw_yuv420p_dim (int width, int height, int factor, int is_semiplanar, int plane_stride[NI_MAX_NUM_DATA_POINTERS], int plane_height[NI_MAX_NUM_DATA_POINTERS])
 Get dimension information of Netint HW YUV420p frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. More...
 
void ni_get_frame_dim (int width, int height, ni_pix_fmt_t pix_fmt, int plane_stride[NI_MAX_NUM_DATA_POINTERS], int plane_height[NI_MAX_NUM_DATA_POINTERS])
 Get dimension information of frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take alignment requirements into account. More...
 
void ni_get_min_frame_dim (int width, int height, ni_pix_fmt_t pix_fmt, int plane_stride[NI_MAX_NUM_DATA_POINTERS], int plane_height[NI_MAX_NUM_DATA_POINTERS])
 Get dimension information of frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take into account both min resolution and alignment requirements. More...
 
void ni_copy_plane_data (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, int is_semiplanar, int conf_win_right, int dst_stride[NI_MAX_NUM_DATA_POINTERS], int dst_height[NI_MAX_NUM_DATA_POINTERS], int src_stride[NI_MAX_NUM_DATA_POINTERS], int src_height[NI_MAX_NUM_DATA_POINTERS], int i)
 Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More...
 
void ni_copy_hw_yuv420p (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, int is_semiplanar, int conf_win_right, int dst_stride[NI_MAX_NUM_DATA_POINTERS], int dst_height[NI_MAX_NUM_DATA_POINTERS], int src_stride[NI_MAX_NUM_DATA_POINTERS], int src_height[NI_MAX_NUM_DATA_POINTERS])
 Copy YUV data to Netint HW YUV420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More...
 
void ni_copy_frame_data (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, ni_pix_fmt_t pix_fmt, int conf_win_right, int dst_stride[NI_MAX_NUM_DATA_POINTERS], int dst_height[NI_MAX_NUM_DATA_POINTERS], int src_stride[NI_MAX_NUM_DATA_POINTERS], int src_height[NI_MAX_NUM_DATA_POINTERS])
 Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More...
 
void ni_copy_yuv_444p_to_420p (uint8_t *p_dst0[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_dst1[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS], int frame_width, int frame_height, int factor, int mode)
 Copy yuv444p data to yuv420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. More...
 
int ni_insert_emulation_prevent_bytes (uint8_t *buf, int size)
 Insert emulation prevention byte(s) as needed into the data buffer. More...
 
int ni_remove_emulation_prevent_bytes (uint8_t *buf, int size)
 Remove emulation prevention byte(s) as needed from the data buffer. More...
 
ni_retcode_t ni_network_layer_convert_output (float *dst, uint32_t dst_len, ni_packet_t *p_packet, ni_network_data_t *p_network, uint32_t layer)
 
ni_retcode_t ni_network_layer_convert_tensor (uint8_t *dst, uint32_t dst_len, const char *tensor_file, ni_network_layer_params_t *p_param)
 
ni_retcode_t ni_network_convert_tensor_to_data (uint8_t *dst, uint32_t dst_len, float *src, uint32_t src_len, ni_network_layer_params_t *p_param)
 
ni_retcode_t ni_network_convert_data_to_tensor (float *dst, uint32_t dst_len, uint8_t *src, uint32_t src_len, ni_network_layer_params_t *p_param)
 
uint32_t ni_ai_network_layer_size (ni_network_layer_params_t *p_param)
 
uint32_t ni_ai_network_layer_dims (ni_network_layer_params_t *p_param)
 
void ni_SHA256Transform (SHA256CTX *psCtx, const uint8_t aui8Data[])
 
void ni_SHA256Init (SHA256CTX *psCtx)
 
void ni_SHA256Update (SHA256CTX *psCtx, const uint8_t aui8Data[], size_t ui32Length)
 
void ni_SHA256Final (SHA256CTX *psCtx, uint8_t aui8Hash[])
 
void ni_calculate_sha256 (const uint8_t aui8Data[], size_t ui32DataLength, uint8_t aui8Hash[])
 
void ni_copy_hw_descriptors (uint8_t *p_dst[NI_MAX_NUM_DATA_POINTERS], uint8_t *p_src[NI_MAX_NUM_DATA_POINTERS])
 Copy Descriptor data to Netint HW descriptor frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. Only necessary when metadata size in source is insufficient. More...
 
char * ni_get_libxcoder_api_ver (void)
 Get libxcoder API version. More...
 
NI_DEPRECATED char * ni_get_compat_fw_api_ver (void)
 Get FW API version libxcoder is compatible with. Deprecated in favour of ni_fmt_fw_api_ver_str(&NI_XCODER_REVISION[NI_XCODER_REVISION_API_MAJOR_VER_IDX], &char_buf[0]); More...
 
void ni_fmt_fw_api_ver_str (const char ver_str[], char fmt_str[])
 Get formatted FW API version string from unformatted FW API version string. More...
 
int ni_cmp_fw_api_ver (const char ver1[], const char ver2[])
 Compare two 3 character strings containing a FW API version. Handle comparision when FW API version format length changed from 2 to 3. More...
 
char * ni_get_libxcoder_release_ver (void)
 Get libxcoder SW release version. More...
 
const char * ni_get_rc_txt (ni_retcode_t rc)
 Get text string for the provided error. More...
 
int ni_param_get_key_value (char *p_str, char *key, char *value)
 retrieve key and value from 'key=value' pair More...
 
int ni_retrieve_xcoder_params (char xcoderParams[], ni_xcoder_params_t *params, ni_session_context_t *ctx)
 retrieve encoder config parameter values from –xcoder-params More...
 
int ni_retrieve_xcoder_gop (char xcoderGop[], ni_xcoder_params_t *params, ni_session_context_t *ctx)
 Retrieve custom gop config values from –xcoder-gop. More...
 
int ni_retrieve_decoder_params (char xcoderParams[], ni_xcoder_params_t *params, ni_session_context_t *ctx)
 retrieve decoder config parameter values from –decoder-params More...
 
int ni_pthread_mutex_init (ni_pthread_mutex_t *mutex)
 initialize a mutex More...
 
int ni_pthread_mutex_destroy (ni_pthread_mutex_t *mutex)
 destory a mutex More...
 
int ni_pthread_mutex_lock (ni_pthread_mutex_t *mutex)
 thread mutex lock More...
 
int ni_pthread_mutex_unlock (ni_pthread_mutex_t *mutex)
 thread mutex unlock More...
 
int ni_pthread_create (ni_pthread_t *thread, const ni_pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
 create a new thread More...
 
int ni_pthread_join (ni_pthread_t thread, void **value_ptr)
 join with a terminated thread More...
 
int ni_pthread_cond_init (ni_pthread_cond_t *cond, const ni_pthread_condattr_t *attr)
 initialize condition variables More...
 
int ni_pthread_cond_destroy (ni_pthread_cond_t *cond)
 destroy condition variables More...
 
int ni_pthread_cond_broadcast (ni_pthread_cond_t *cond)
 broadcast a condition More...
 
int ni_pthread_cond_wait (ni_pthread_cond_t *cond, ni_pthread_mutex_t *mutex)
 wait on a condition More...
 
int ni_pthread_cond_signal (ni_pthread_cond_t *cond)
 signal a condition More...
 
int ni_pthread_cond_timedwait (ni_pthread_cond_t *cond, ni_pthread_mutex_t *mutex, const struct timespec *abstime)
 wait on a condition More...
 
int ni_pthread_sigmask (int how, const ni_sigset_t *set, ni_sigset_t *oldset)
 examine and change mask of blocked signals More...
 
const char * ni_ai_errno_to_str (int rc)
 return error string according to error code from firmware More...
 
uint32_t ni_decode_power_measurement (uint32_t current_data, const uint8_t *serial_number)
 decode the raw current obtained and determine power More...
 
ni_retcode_t ni_quadra_card_identify_precheck (const char *p_dev)
 precheck a device can be read by ni_device_capability_query() INFO OR ERROR logs will not be printed in this function More...
 

Detailed Description

Utility definitions.


Definition in file ni_util.c.

Macro Definition Documentation

◆ _EPSILON

#define _EPSILON   1e-8

◆ CH

#define CH (   x,
  y,
 
)    (((x) & (y)) ^ (~(x) & (z)))

Definition at line 3396 of file ni_util.c.

◆ EP0

#define EP0 (   x)    (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22))

Definition at line 3398 of file ni_util.c.

◆ EP1

#define EP1 (   x)    (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25))

Definition at line 3399 of file ni_util.c.

◆ MAJ

#define MAJ (   x,
  y,
 
)    (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))

Definition at line 3397 of file ni_util.c.

◆ ROTLEFT

#define ROTLEFT (   a,
 
)    (((a) << (b)) | ((a) >> (32 - (b))))

Definition at line 3393 of file ni_util.c.

◆ ROTRIGHT

#define ROTRIGHT (   a,
 
)    (((a) >> (b)) | ((a) << (32 - (b))))

Definition at line 3394 of file ni_util.c.

◆ SHA256_BLOCK_SIZE

#define SHA256_BLOCK_SIZE   32

Definition at line 3383 of file ni_util.c.

◆ SIG0

#define SIG0 (   x)    (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3))

Definition at line 3400 of file ni_util.c.

◆ SIG1

#define SIG1 (   x)    (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10))

Definition at line 3401 of file ni_util.c.

Typedef Documentation

◆ ni_err_rc_txt_entry_t

◆ SHA256CTX

typedef struct SHA256CTX SHA256CTX

Function Documentation

◆ ni_ai_errno_to_str()

const char* ni_ai_errno_to_str ( int  rc)

return error string according to error code from firmware


Parameters
[in]rcerror code return from firmware
Returns
error string

Definition at line 4321 of file ni_util.c.

◆ ni_ai_network_layer_dims()

uint32_t ni_ai_network_layer_dims ( ni_network_layer_params_t p_param)

Definition at line 3369 of file ni_util.c.

◆ ni_ai_network_layer_size()

uint32_t ni_ai_network_layer_size ( ni_network_layer_params_t p_param)

Definition at line 3363 of file ni_util.c.

◆ ni_atobool()

int32_t ni_atobool ( const char *  p_str,
bool *  b_error 
)

Convert string to boolean.


Parameters

Definition at line 1907 of file ni_util.c.

◆ ni_atof()

double ni_atof ( const char *  p_str,
bool *  b_error 
)

Convert string to floating.


Parameters

Definition at line 1950 of file ni_util.c.

◆ ni_atoi()

int32_t ni_atoi ( const char *  p_str,
bool *  b_error 
)

Convert string to integer.


Parameters

Definition at line 1930 of file ni_util.c.

◆ ni_buf_pool_allocate_buffer()

ni_buf_t* ni_buf_pool_allocate_buffer ( ni_buf_pool_t p_buffer_pool,
int  buffer_size 
)

Definition at line 585 of file ni_util.c.

◆ ni_buf_pool_expand()

ni_buf_t* ni_buf_pool_expand ( ni_buf_pool_t pool)

Definition at line 451 of file ni_util.c.

◆ ni_buf_pool_get_buffer()

ni_buf_t* ni_buf_pool_get_buffer ( ni_buf_pool_t p_buffer_pool)

Definition at line 468 of file ni_util.c.

◆ ni_buf_pool_return_buffer()

void ni_buf_pool_return_buffer ( ni_buf_t buf,
ni_buf_pool_t p_buffer_pool 
)

Definition at line 529 of file ni_util.c.

◆ ni_buffer_pool_allocate_buffer()

ni_queue_node_t* ni_buffer_pool_allocate_buffer ( ni_queue_buffer_pool_t p_buffer_pool)

Definition at line 833 of file ni_util.c.

◆ ni_buffer_pool_expand()

ni_queue_node_t* ni_buffer_pool_expand ( ni_queue_buffer_pool_t pool)

Definition at line 902 of file ni_util.c.

◆ ni_buffer_pool_free()

void ni_buffer_pool_free ( ni_queue_buffer_pool_t p_buffer_pool)

Definition at line 789 of file ni_util.c.

◆ ni_buffer_pool_get_queue_buffer()

ni_queue_node_t* ni_buffer_pool_get_queue_buffer ( ni_queue_buffer_pool_t p_buffer_pool)

Definition at line 920 of file ni_util.c.

◆ ni_buffer_pool_initialize()

int32_t ni_buffer_pool_initialize ( ni_session_context_t p_ctx,
int32_t  number_of_buffers 
)

Definition at line 861 of file ni_util.c.

◆ ni_buffer_pool_return_buffer()

void ni_buffer_pool_return_buffer ( ni_queue_node_t buf,
ni_queue_buffer_pool_t p_buffer_pool 
)

Definition at line 973 of file ni_util.c.

◆ ni_calculate_sha256()

void ni_calculate_sha256 ( const uint8_t  aui8Data[],
size_t  ui32DataLength,
uint8_t  aui8Hash[] 
)

Definition at line 3550 of file ni_util.c.

◆ ni_check_dev_name()

ni_retcode_t ni_check_dev_name ( const char *  p_dev)

check dev name


Parameters
[in]p_devDevice name represented as c string. ex: "/dev/nvmeXnY"
Returns
On success returns NI_RETCODE_SUCCESS On failure returns NI_RETCODE_FAILURE or NI_RETCODE_INVALID_PARAM

Definition at line 1252 of file ni_util.c.

◆ ni_cmp_fw_api_ver()

int ni_cmp_fw_api_ver ( const char  ver1[],
const char  ver2[] 
)

Compare two 3 character strings containing a FW API version. Handle comparision when FW API version format length changed from 2 to 3.


Parameters
[in]ver1pointer to string containing FW API. Only up to 3 characters will be read
[in]ver2pointer to string containing FW API. Only up to 3 characters will be read
Returns
0 if ver1 == ver2, 1 if ver1 > ver2, -1 if ver1 < ver2

Definition at line 3674 of file ni_util.c.

◆ ni_copy_frame_data()

void ni_copy_frame_data ( uint8_t *  p_dst[NI_MAX_NUM_DATA_POINTERS],
uint8_t *  p_src[NI_MAX_NUM_DATA_POINTERS],
int  frame_width,
int  frame_height,
int  factor,
ni_pix_fmt_t  pix_fmt,
int  conf_win_right,
int  dst_stride[NI_MAX_NUM_DATA_POINTERS],
int  dst_height[NI_MAX_NUM_DATA_POINTERS],
int  src_stride[NI_MAX_NUM_DATA_POINTERS],
int  src_height[NI_MAX_NUM_DATA_POINTERS] 
)

Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.


Parameters
[out]p_dstpointers to which data is copied
[in]p_srcpointers from which data is copied
[in]widthsource frame width
[in]heightsource frame height
[in]factor1 for 8 bit, 2 for 10 bit
[in]pix_fmtpixel format to distinguish between planar types and/or components
[in]conf_win_rightright offset of conformance window
[in]dst_stridesize (in bytes) of each plane width in destination
[in]dst_heightsize of each plane height in destination
[in]src_stridesize (in bytes) of each plane width in source
[in]src_heightsize of each plane height in source
Returns
copied data

Definition at line 2398 of file ni_util.c.

◆ ni_copy_hw_descriptors()

void ni_copy_hw_descriptors ( uint8_t *  p_dst[NI_MAX_NUM_DATA_POINTERS],
uint8_t *  p_src[NI_MAX_NUM_DATA_POINTERS] 
)

Copy Descriptor data to Netint HW descriptor frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc. Only necessary when metadata size in source is insufficient.


Parameters
[out]p_dstpointers of Y/Cb/Cr to which data is copied
[in]p_srcpointers of Y/Cb/Cr from which data is copied
Returns
descriptor data

Definition at line 3576 of file ni_util.c.

◆ ni_copy_hw_yuv420p()

void ni_copy_hw_yuv420p ( uint8_t *  p_dst[NI_MAX_NUM_DATA_POINTERS],
uint8_t *  p_src[NI_MAX_NUM_DATA_POINTERS],
int  frame_width,
int  frame_height,
int  factor,
int  is_semiplanar,
int  conf_win_right,
int  dst_stride[NI_MAX_NUM_DATA_POINTERS],
int  dst_height[NI_MAX_NUM_DATA_POINTERS],
int  src_stride[NI_MAX_NUM_DATA_POINTERS],
int  src_height[NI_MAX_NUM_DATA_POINTERS] 
)

Copy YUV data to Netint HW YUV420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.


Parameters
[out]p_dstpointers of Y/Cb/Cr to which data is copied
[in]p_srcpointers of Y/Cb/Cr from which data is copied
[in]widthsource YUV frame width
[in]heightsource YUV frame height
[in]factor1 for 8 bit, 2 for 10 bit
[in]is_semiplanarnon-0 for semiplanar frame, 0 otherwise
[in]conf_win_rightright offset of conformance window
[in]dst_stridesize (in bytes) of each plane width in destination
[in]dst_heightsize of each plane height in destination
[in]src_stridesize (in bytes) of each plane width in source
[in]src_heightsize of each plane height in source
Returns
Y/Cb/Cr data

Definition at line 2352 of file ni_util.c.

◆ ni_copy_plane_data()

void ni_copy_plane_data ( uint8_t *  p_dst[NI_MAX_NUM_DATA_POINTERS],
uint8_t *  p_src[NI_MAX_NUM_DATA_POINTERS],
int  frame_width,
int  frame_height,
int  factor,
int  is_semiplanar,
int  conf_win_right,
int  dst_stride[NI_MAX_NUM_DATA_POINTERS],
int  dst_height[NI_MAX_NUM_DATA_POINTERS],
int  src_stride[NI_MAX_NUM_DATA_POINTERS],
int  src_height[NI_MAX_NUM_DATA_POINTERS],
int  i 
)

Copy RGBA or YUV data to Netint HW frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.


Parameters
[out]p_dstpointers to which data is copied
[in]p_srcpointers from which data is copied
[in]widthsource frame width
[in]heightsource frame height
[in]factor1 for 8 bit, 2 for 10 bit
[in]is_semiplanarnon-0 for semiplanar frame, 0 otherwise
[in]conf_win_rightright offset of conformance window
[in]dst_stridesize (in bytes) of each plane width in destination
[in]dst_heightsize of each plane height in destination
[in]src_stridesize (in bytes) of each plane width in source
[in]src_heightsize of each plane height in source
[in]iindex to plane to be copied
Returns
copied data

Definition at line 2229 of file ni_util.c.

◆ ni_copy_yuv_444p_to_420p()

void ni_copy_yuv_444p_to_420p ( uint8_t *  p_dst0[NI_MAX_NUM_DATA_POINTERS],
uint8_t *  p_dst1[NI_MAX_NUM_DATA_POINTERS],
uint8_t *  p_src[NI_MAX_NUM_DATA_POINTERS],
int  frame_width,
int  frame_height,
int  factor,
int  mode 
)

Copy yuv444p data to yuv420p frame layout to be sent to encoder for encoding. Data buffer (dst) is usually allocated by ni_encoder_frame_buffer_alloc.


Parameters
[out]p_dst0pointers of Y/Cb/Cr as yuv420p output0
[out]p_dst1pointers of Y/Cb/Cr as yuv420p output1
[in]p_srcpointers of Y/Cb/Cr as yuv444p intput
[in]widthsource YUV frame width
[in]heightsource YUV frame height
[in]factor1 for 8 bit, 2 for 10 bit
[in]mode0 for out0 is Y+1/2V, with the original input as the out0, 1/4V copy to data[1] 1/4V copy to data[2] out1 is U+1/2V, U copy to data[0], 1/4V copy to data[1], 1/4V copy to data[2] mode 1 for out0 is Y+1/2u+1/2v, with the original input as the output0, 1/4U copy to data[1] 1/4V copy to data[2] out1 is (1/2U+1/2V)+1/4U+1/4V, 1/2U & 1/2V copy to data[0], 1/4U copy to data[1], 1/4V copy to data[2]
Returns
Y/Cb/Cr data

Definition at line 2478 of file ni_util.c.

◆ ni_dec_fme_buffer_pool_free()

void ni_dec_fme_buffer_pool_free ( ni_buf_pool_t p_buffer_pool)

Definition at line 735 of file ni_util.c.

◆ ni_dec_fme_buffer_pool_initialize()

int32_t ni_dec_fme_buffer_pool_initialize ( ni_session_context_t p_ctx,
int32_t  number_of_buffers,
int  width,
int  height,
int  height_align,
int  factor 
)

Definition at line 626 of file ni_util.c.

◆ ni_decode_power_measurement()

uint32_t ni_decode_power_measurement ( uint32_t  current_data,
const uint8_t *  serial_number 
)

decode the raw current obtained and determine power


Parameters
[in]current_valuecurrent value
[in]serial_numberboard SN
Returns
On success returns power On failure returns -1

Definition at line 4384 of file ni_util.c.

◆ ni_find_blk_name()

ni_retcode_t ni_find_blk_name ( const char *  p_dev,
char *  p_out_buf,
int  out_buf_len 
)

Find NVMe name space block from device name If none is found, assume nvme multi-pathing is disabled and return /dev/nvmeXn1.


Parameters
[in]p_devDevice name represented as c string. ex: "/dev/nvme0"
[in]out_bufOutput buffer to put NVMe name space block. Must be at least length 21
Returns
On success returns NI_RETCODE_SUCCESS On failure returns NI_RETCODE_FAILURE

Definition at line 1181 of file ni_util.c.

◆ ni_fmt_fw_api_ver_str()

void ni_fmt_fw_api_ver_str ( const char  ver_str[],
char  fmt_str[] 
)

Get formatted FW API version string from unformatted FW API version string.


Parameters
[in]ver_strpointer to string containing FW API. Only up to 3 characters will be read
[out]fmt_strpointer to string buffer of at least size 5 to output formated version string to
Returns
none

Definition at line 3644 of file ni_util.c.

◆ ni_get_compat_fw_api_ver()

NI_DEPRECATED char* ni_get_compat_fw_api_ver ( void  )

Get FW API version libxcoder is compatible with. Deprecated in favour of ni_fmt_fw_api_ver_str(&NI_XCODER_REVISION[NI_XCODER_REVISION_API_MAJOR_VER_IDX], &char_buf[0]);

Get FW API version libxcoder is compatible with.


Returns
char pointer to FW API version libxcoder is compatible with

Definition at line 3612 of file ni_util.c.

◆ ni_get_frame_dim()

void ni_get_frame_dim ( int  width,
int  height,
ni_pix_fmt_t  pix_fmt,
int  plane_stride[NI_MAX_NUM_DATA_POINTERS],
int  plane_height[NI_MAX_NUM_DATA_POINTERS] 
)

Get dimension information of frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take alignment requirements into account.


Parameters
[in]widthsource frame width
[in]heightsource frame height
[in]pix_fmtni pixel format
[out]plane_stridesize (in bytes) of each plane width
[out]plane_heightsize of each plane height
Returns
stride and height info

Definition at line 2092 of file ni_util.c.

◆ ni_get_frame_index()

int32_t ni_get_frame_index ( uint32_t *  value)

Get xcoder instance id.


Parameters

Definition at line 1020 of file ni_util.c.

◆ ni_get_hw_yuv420p_dim()

void ni_get_hw_yuv420p_dim ( int  width,
int  height,
int  factor,
int  is_semiplanar,
int  plane_stride[NI_MAX_NUM_DATA_POINTERS],
int  plane_height[NI_MAX_NUM_DATA_POINTERS] 
)

Get dimension information of Netint HW YUV420p frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation.


Parameters
[in]widthsource YUV frame width
[in]heightsource YUV frame height
[in]factor1 for 8 bit, 2 for 10 bit
[in]is_semiplanar1 for semiplanar frame, 0 otherwise
[out]plane_stridesize (in bytes) of each plane width
[out]plane_heightsize of each plane height
Returns
Y/Cb/Cr stride and height info

Definition at line 2040 of file ni_util.c.

◆ ni_get_libxcoder_api_ver()

char* ni_get_libxcoder_api_ver ( void  )

Get libxcoder API version.


Returns
char pointer to libxcoder API version

Definition at line 3600 of file ni_util.c.

◆ ni_get_libxcoder_release_ver()

char* ni_get_libxcoder_release_ver ( void  )

Get libxcoder SW release version.


Returns
char pointer to libxcoder SW release version

Definition at line 3710 of file ni_util.c.

◆ ni_get_min_frame_dim()

void ni_get_min_frame_dim ( int  width,
int  height,
ni_pix_fmt_t  pix_fmt,
int  plane_stride[NI_MAX_NUM_DATA_POINTERS],
int  plane_height[NI_MAX_NUM_DATA_POINTERS] 
)

Get dimension information of frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. The returned stride and height info will take into account both min resolution and alignment requirements.


Parameters
[in]widthsource frame width
[in]heightsource frame height
[in]pix_fmtni pixel format
[out]plane_stridesize (in bytes) of each plane width
[out]plane_heightsize of each plane height
Returns
stride and height info

Definition at line 2181 of file ni_util.c.

◆ ni_get_rc_txt()

const char* ni_get_rc_txt ( ni_retcode_t  rc)

Get text string for the provided error.


Returns
char pointer for the provided error

Definition at line 3731 of file ni_util.c.

◆ ni_get_utime()

uint64_t ni_get_utime ( void  )

Get system time for log.


Parameters

Definition at line 1991 of file ni_util.c.

◆ ni_gettime_ns()

uint64_t ni_gettime_ns ( void  )

Definition at line 1998 of file ni_util.c.

◆ ni_gettimeofday()

int32_t ni_gettimeofday ( struct timeval *  p_tp,
void *  p_tzp 
)

Get time for logs with microsecond timestamps.


Parameters
[in/out]p_tp timeval struct
[in]p_tzpvoid *
Returns
return 0 for success, -1 for error

Definition at line 139 of file ni_util.c.

◆ ni_insert_emulation_prevent_bytes()

int ni_insert_emulation_prevent_bytes ( uint8_t *  buf,
int  size 
)

Insert emulation prevention byte(s) as needed into the data buffer.


Parameters
bufdata buffer to be worked on - new byte(s) will be inserted size number of bytes starting from buf to check
Returns
the number of emulation prevention bytes inserted into buf, 0 if none.

Note: caller MUST ensure for newly inserted bytes, buf has enough free space starting from buf + size

Definition at line 2591 of file ni_util.c.

◆ ni_network_convert_data_to_tensor()

ni_retcode_t ni_network_convert_data_to_tensor ( float *  dst,
uint32_t  dst_len,
uint8_t *  src,
uint32_t  src_len,
ni_network_layer_params_t p_param 
)

Definition at line 3256 of file ni_util.c.

◆ ni_network_convert_tensor_to_data()

ni_retcode_t ni_network_convert_tensor_to_data ( uint8_t *  dst,
uint32_t  dst_len,
float *  src,
uint32_t  src_len,
ni_network_layer_params_t p_param 
)

Definition at line 3246 of file ni_util.c.

◆ ni_network_layer_convert_output()

ni_retcode_t ni_network_layer_convert_output ( float *  dst,
uint32_t  dst_len,
ni_packet_t p_packet,
ni_network_data_t p_network,
uint32_t  layer 
)

Definition at line 3084 of file ni_util.c.

◆ ni_network_layer_convert_tensor()

ni_retcode_t ni_network_layer_convert_tensor ( uint8_t *  dst,
uint32_t  dst_len,
const char *  tensor_file,
ni_network_layer_params_t p_param 
)

Definition at line 3236 of file ni_util.c.

◆ ni_param_get_key_value()

int ni_param_get_key_value ( char *  p_str,
char *  key,
char *  value 
)

retrieve key and value from 'key=value' pair

Retrieve key and value from 'key=value' pair.


Parameters
[in]p_strpointer to string to extract pair from
[out]keypointer to key
[out]valuepointer to value
Returns
return 0 if successful, otherwise 1

Definition at line 3755 of file ni_util.c.

◆ ni_parse_name()

int32_t ni_parse_name ( const char *  arg,
const char *const *  names,
bool *  b_error 
)

Parse name.


Parameters

Definition at line 1970 of file ni_util.c.

◆ ni_posix_memalign()

int ni_posix_memalign ( void **  memptr,
size_t  alignment,
size_t  size 
)

Allocate aligned memory.


Parameters
[in/out]memptr The address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of sizeof(void *). If size is 0, then the value placed is either NULL, or a unique pointer value that can later be successfully passed to free.
[in]alignmentThe alignment value of the allocated value.
[in]sizeThe allocated memory size.
Returns
0 for success, ENOMEM for error

Definition at line 198 of file ni_util.c.

◆ ni_pthread_cond_broadcast()

int ni_pthread_cond_broadcast ( ni_pthread_cond_t *  cond)

broadcast a condition


Parameters
[in]condcondition variable
Returns
On success returns 0 On failure returns <0

Definition at line 4214 of file ni_util.c.

◆ ni_pthread_cond_destroy()

int ni_pthread_cond_destroy ( ni_pthread_cond_t *  cond)

destroy condition variables


Parameters
[in]condcondition variable
Returns
On success returns 0 On failure returns <0

Definition at line 4196 of file ni_util.c.

◆ ni_pthread_cond_init()

int ni_pthread_cond_init ( ni_pthread_cond_t *  cond,
const ni_pthread_condattr_t *  attr 
)

initialize condition variables


Parameters
[in]condcondition variable
[in]attrattribute to the condvar
Returns
On success returns 0 On failure returns <0

Definition at line 4177 of file ni_util.c.

◆ ni_pthread_cond_signal()

int ni_pthread_cond_signal ( ni_pthread_cond_t *  cond)

signal a condition


Parameters
[in]condcondition variable
Returns
On success returns 0 On failure returns <0

Definition at line 4251 of file ni_util.c.

◆ ni_pthread_cond_timedwait()

int ni_pthread_cond_timedwait ( ni_pthread_cond_t *  cond,
ni_pthread_mutex_t *  mutex,
const struct timespec *  abstime 
)

wait on a condition


Parameters
[in]condcondition variable
[in]mutexmutex related to the condvar
[in[abstime abstract value of timeout
Returns
On success returns 0 On failure returns <0

Definition at line 4271 of file ni_util.c.

◆ ni_pthread_cond_wait()

int ni_pthread_cond_wait ( ni_pthread_cond_t *  cond,
ni_pthread_mutex_t *  mutex 
)

wait on a condition


Parameters
[in]condcondition variable
[in]mutexmutex related to the condvar
Returns
On success returns 0 On failure returns <0

Definition at line 4233 of file ni_util.c.

◆ ni_pthread_create()

int ni_pthread_create ( ni_pthread_t *  thread,
const ni_pthread_attr_t *  attr,
void *(*)(void *)  start_routine,
void *  arg 
)

create a new thread


Parameters
[in]threadthread id
[in]attrattributes to the new thread
[in]start_routineentry of the thread routine
[in]argsole argument of the routine
Returns
On success returns 0 On failure returns <0

Definition at line 4121 of file ni_util.c.

◆ ni_pthread_join()

int ni_pthread_join ( ni_pthread_t  thread,
void **  value_ptr 
)

join with a terminated thread


Parameters
[in]threadthread id
[out]value_ptrreturn status
Returns
On success returns 0 On failure returns <0

Definition at line 4148 of file ni_util.c.

◆ ni_pthread_mutex_destroy()

int ni_pthread_mutex_destroy ( ni_pthread_mutex_t *  mutex)

destory a mutex


Parameters
[in]threadmutex
Returns
On success returns 0 On failure returns <0

Definition at line 4039 of file ni_util.c.

◆ ni_pthread_mutex_init()

int ni_pthread_mutex_init ( ni_pthread_mutex_t *  mutex)

initialize a mutex


Parameters
[in]threadmutex
Returns
On success returns 0 On failure returns <0

Definition at line 4001 of file ni_util.c.

◆ ni_pthread_mutex_lock()

int ni_pthread_mutex_lock ( ni_pthread_mutex_t *  mutex)

thread mutex lock


Parameters
[in]threadmutex
Returns
On success returns 0 On failure returns <0

Definition at line 4057 of file ni_util.c.

◆ ni_pthread_mutex_unlock()

int ni_pthread_mutex_unlock ( ni_pthread_mutex_t *  mutex)

thread mutex unlock


Parameters
[in]threadmutex
Returns
On success returns 0 On failure returns <0

Definition at line 4083 of file ni_util.c.

◆ ni_pthread_sigmask()

int ni_pthread_sigmask ( int  how,
const ni_sigset_t *  set,
ni_sigset_t *  oldset 
)

examine and change mask of blocked signals


Parameters
[in]howbehavior of this call, can be value of SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK
[in]setcurrent value of the signal mask. If NULL, the mask keeps unchanged.
[in]old_setprevious value of the signal mask, can be NULL.
Returns
On success returns 0 On failure returns <0

Definition at line 4305 of file ni_util.c.

◆ ni_quadra_card_identify_precheck()

ni_retcode_t ni_quadra_card_identify_precheck ( const char *  p_dev)

precheck a device can be read by ni_device_capability_query() INFO OR ERROR logs will not be printed in this function


Parameters
[in]p_devdevice path string. eg: "/dev/nvme1n2"
Returns
returns NI_RETCODE_FAILURE when the device can not be read by ni_device_capability_query()

returns NI_RETCODE_SUCCESS when

  1. the device can not be read by ni_device_capability_query()
  2. the result can not be determined to prevent query failures due to some reasons such as missing commands on the system

Definition at line 4874 of file ni_util.c.

◆ ni_queue_free()

ni_retcode_t ni_queue_free ( ni_queue_t p_queue,
ni_queue_buffer_pool_t p_buffer_pool 
)

Free xcoder queue.


Parameters

Definition at line 1811 of file ni_util.c.

◆ ni_queue_init()

ni_retcode_t ni_queue_init ( ni_session_context_t p_ctx,
ni_queue_t p_queue,
const char *  name 
)

Initialize xcoder queue.


Parameters

Definition at line 1513 of file ni_util.c.

◆ ni_queue_pop()

ni_retcode_t ni_queue_pop ( ni_queue_t p_queue,
uint64_t  frame_info,
int64_t *  p_timestamp,
int32_t  threshold,
int32_t  print,
ni_queue_buffer_pool_t p_buffer_pool 
)

Pop from the xcoder queue.


Parameters

If only one entry, retrieve timestamp without checking

Definition at line 1611 of file ni_util.c.

◆ ni_queue_pop_threshold()

ni_retcode_t ni_queue_pop_threshold ( ni_queue_t p_queue,
uint64_t  frame_info,
int64_t *  p_timestamp,
int32_t  threshold,
int32_t  print,
ni_queue_buffer_pool_t p_buffer_pool 
)

If only one entry, retrieve timestamp without checking

Definition at line 1716 of file ni_util.c.

◆ ni_queue_print()

ni_retcode_t ni_queue_print ( ni_queue_t p_queue)

Print xcoder queue info.


Parameters

Definition at line 1851 of file ni_util.c.

◆ ni_queue_push()

ni_retcode_t ni_queue_push ( ni_queue_buffer_pool_t p_buffer_pool,
ni_queue_t p_queue,
uint64_t  frame_info,
int64_t  timestamp 
)

Push into xcoder queue.


Parameters

Definition at line 1540 of file ni_util.c.

◆ ni_remove_emulation_prevent_bytes()

int ni_remove_emulation_prevent_bytes ( uint8_t *  buf,
int  size 
)

Remove emulation prevention byte(s) as needed from the data buffer.


Parameters
bufdata buffer to be worked on - emu prevent byte(s) will be removed from. size number of bytes starting from buf to check
Returns
the number of emulation prevention bytes removed from buf, 0 if none.

Note: buf will be modified if emu prevent byte(s) found and removed.

Definition at line 2644 of file ni_util.c.

◆ ni_retrieve_decoder_params()

int ni_retrieve_decoder_params ( char  xcoderParams[],
ni_xcoder_params_t params,
ni_session_context_t ctx 
)

retrieve decoder config parameter values from –decoder-params

Retrieve decoder config parameter values from –decoder-params.


Parameters
[in]xcoderParamspointer to string containing xcoder params
[out]paramspointer to xcoder params to fill out
[out]ctxpointer to session context
Returns
return 0 if successful, -1 otherwise

Definition at line 3931 of file ni_util.c.

◆ ni_retrieve_xcoder_gop()

int ni_retrieve_xcoder_gop ( char  xcoderGop[],
ni_xcoder_params_t params,
ni_session_context_t ctx 
)

Retrieve custom gop config values from –xcoder-gop.


Parameters
[in]xcoderGoppointer to string containing xcoder gop
[out]paramspointer to xcoder params to fill out
[out]ctxpointer to session context
Returns
return 0 if successful, -1 otherwise

Definition at line 3861 of file ni_util.c.

◆ ni_retrieve_xcoder_params()

int ni_retrieve_xcoder_params ( char  xcoderParams[],
ni_xcoder_params_t params,
ni_session_context_t ctx 
)

retrieve encoder config parameter values from –xcoder-params

Retrieve encoder config parameter values from –xcoder-params.


Parameters
[in]xcoderParamspointer to string containing xcoder params
[out]paramspointer to xcoder params to fill out
[out]ctxpointer to session context
Returns
return 0 if successful, -1 otherwise

Definition at line 3787 of file ni_util.c.

◆ ni_round_up()

uint32_t ni_round_up ( uint32_t  number_to_round,
uint32_t  multiple 
)

Definition at line 169 of file ni_util.c.

◆ ni_SHA256Final()

void ni_SHA256Final ( SHA256CTX psCtx,
uint8_t  aui8Hash[] 
)

Definition at line 3494 of file ni_util.c.

◆ ni_SHA256Init()

void ni_SHA256Init ( SHA256CTX psCtx)

Definition at line 3462 of file ni_util.c.

◆ ni_SHA256Transform()

void ni_SHA256Transform ( SHA256CTX psCtx,
const uint8_t  aui8Data[] 
)

Definition at line 3416 of file ni_util.c.

◆ ni_SHA256Update()

void ni_SHA256Update ( SHA256CTX psCtx,
const uint8_t  aui8Data[],
size_t  ui32Length 
)

Definition at line 3476 of file ni_util.c.

◆ ni_strtok()

char* ni_strtok ( char *  s,
const char *  delim,
char **  saveptr 
)

Definition at line 420 of file ni_util.c.

◆ ni_timestamp_done()

ni_retcode_t ni_timestamp_done ( ni_timestamp_table_t p_table,
ni_queue_buffer_pool_t p_buffer_pool 
)

Clean up timestamp handling.


Parameters

Definition at line 1348 of file ni_util.c.

◆ ni_timestamp_get()

ni_retcode_t ni_timestamp_get ( ni_timestamp_table_t p_table,
uint64_t  frame_info,
int64_t *  p_timestamp,
int32_t  threshold,
int32_t  print,
ni_queue_buffer_pool_t p_buffer_pool 
)

Retrieve timestamp from table based on frameoffset info.


Parameters

Definition at line 1399 of file ni_util.c.

◆ ni_timestamp_get_v2()

ni_retcode_t ni_timestamp_get_v2 ( ni_timestamp_table_t p_table,
uint64_t  frame_offset,
int64_t *  p_timestamp,
int32_t  threshold,
ni_queue_buffer_pool_t p_buffer_pool 
)

Retrieve timestamp from table based on frameoffset info.


Parameters

Definition at line 1475 of file ni_util.c.

◆ ni_timestamp_get_with_threshold()

ni_retcode_t ni_timestamp_get_with_threshold ( ni_timestamp_table_t p_table,
uint64_t  frame_info,
int64_t *  p_timestamp,
int32_t  threshold,
int32_t  print,
ni_queue_buffer_pool_t p_buffer_pool 
)

Definition at line 1423 of file ni_util.c.

◆ ni_timestamp_init()

ni_retcode_t ni_timestamp_init ( ni_session_context_t p_ctx,
ni_timestamp_table_t **  pp_table,
const char *  name 
)

Initialize timestamp handling.


Parameters

Definition at line 1308 of file ni_util.c.

◆ ni_timestamp_register()

ni_retcode_t ni_timestamp_register ( ni_queue_buffer_pool_t p_buffer_pool,
ni_timestamp_table_t p_table,
int64_t  timestamp,
uint64_t  data_info 
)

Register timestamp in timestamp/frameoffset table.


Parameters

Definition at line 1373 of file ni_util.c.

◆ ni_timestamp_scan_cleanup()

void ni_timestamp_scan_cleanup ( ni_timestamp_table_t pts_list,
ni_timestamp_table_t dts_list,
ni_queue_buffer_pool_t p_buffer_pool 
)

Definition at line 1431 of file ni_util.c.

◆ ni_usleep()

void ni_usleep ( int64_t  usec)

Definition at line 358 of file ni_util.c.