![]() |
libxcoder
5.2.0
|
Public definitions for managing NETINT video processing devices. More...
#include "ni_defs.h"
Go to the source code of this file.
Data Structures | |
struct | _ni_rsrc_video_ref_cap |
struct | _ni_device_queue |
struct | _ni_device_video_capability |
struct | _ni_sw_instance_info |
struct | _ni_device_pool |
struct | _ni_device_info |
struct | _ni_device |
struct | _ni_device_context |
struct | _ni_card_info_quadra |
struct | _ni_hw_device_info_quadra |
struct | _ni_hw_device_info_quadra_encoder_param |
struct | _ni_hw_device_info_quadra_decoder_param |
struct | _ni_hw_device_info_quadra_scaler_param |
struct | _ni_hw_device_info_quadra_ai_param |
struct | _ni_hw_device_info_quadra_threshold_param |
struct | _ni_hw_device_info_quadra_coder_param |
struct | _ni_device_vf_ns_id |
struct | _ni_device_temp |
struct | _ni_device_extra_info |
Macros | |
#define | NI_PROFILES_SUPP_STR_LEN 128 |
#define | NI_LEVELS_SUPP_STR_LEN 64 |
#define | NI_ADDITIONAL_INFO_STR_LEN 64 |
Enumerations | |
enum | ni_codec_t { EN_INVALID = -1, EN_H264 = 0, EN_H265, EN_VP9, EN_JPEG, EN_AV1, EN_CODEC_MAX } |
enum | ni_sw_instance_status_t { EN_IDLE, EN_ACTIVE } |
enum | ni_alloc_rule_t { EN_ALLOC_LEAST_LOAD, EN_ALLOC_LEAST_INSTANCE } |
Functions | |
LIB_API int | ni_rsrc_init (int should_match_rev, int timeout_seconds) |
Initialize and create all resources required to work with NETINT NVMe transcoder devices. This is a high level API function which is used mostly with user application like FFmpeg that relies on those resources. In case of custom application integration, revised functionality might be necessary utilizing coresponding API functions. More... | |
LIB_API ni_retcode_t | ni_rsrc_refresh (int should_match_rev) |
Scan and refresh all resources on the host, taking into account hot-plugged and pulled out cards. More... | |
LIB_API NI_DEPRECATED int | ni_rsrc_get_local_device_list (char ni_devices[][NI_MAX_DEVICE_NAME_LEN], int max_handles) |
Scans system for all NVMe devices and returns the system device names to the user which were identified as NETINT transcoder deivices. Names are suitable for OpenFile api usage afterwards This function had been replaced by ni_rsrc_get_local_device_list2 This function can't be callback with multi thread. More... | |
LIB_API int | ni_rsrc_get_local_device_list2 (char ni_devices[][NI_MAX_DEVICE_NAME_LEN], int max_handles, char **xcoder_refresh_dev_names, int xcoder_refresh_dev_count) |
Scans system for all NVMe devices and returns the system device names to the user which were identified as NETINT transcoder devices. Names are suitable for resource management API usage afterwards This function had replaced ni_rsrc_get_local_device_list This function can be callback with multi thread. More... | |
LIB_API ni_device_context_t * | ni_rsrc_get_device_context (ni_device_type_t type, int guid) |
Allocates and returns a pointer to ni_device_context_t struct based on provided device_type and guid. To be used for load update and codec query. More... | |
LIB_API void | ni_rsrc_free_device_context (ni_device_context_t *p_ctxt) |
Free previously allocated device context. More... | |
LIB_API ni_retcode_t | ni_rsrc_list_devices (ni_device_type_t device_type, ni_device_info_t *p_device_info, int *p_device_count) |
List device(s) based on device type with full information including s/w instances on the system. More... | |
LIB_API ni_retcode_t | ni_rsrc_list_all_devices (ni_device_t *p_device) |
List all devices with full information including s/w instances on the system. More... | |
LIB_API ni_retcode_t | ni_rsrc_list_all_devices2 (ni_device_t *p_device, bool list_uninitialized) |
Grabs information for every initialized and uninitialized device. More... | |
LIB_API void | ni_rsrc_print_all_devices_capability (void) |
Print detailed capability information of all devices on the system. More... | |
LIB_API void | ni_rsrc_print_all_devices_capability2 (bool list_uninitialized) |
Prints detailed capability information for all initialized devices and general information about uninitialized devices. More... | |
LIB_API ni_device_info_t * | ni_rsrc_get_device_info (ni_device_type_t device_type, int guid) |
Query a specific device with detailed information on the system. More... | |
LIB_API int | ni_rsrc_get_device_by_block_name (const char *blk_name, ni_device_type_t device_type) |
Get GUID of the device by block device name and type. More... | |
int | ni_rsrc_update_device_load (ni_device_context_t *p_ctxt, int load, int sw_instance_cnt, const ni_sw_instance_info_t sw_instance_info[]) |
Update the load value and s/w instances info of a specific decoder or encoder. This is used by resource management daemon to update periodically. More... | |
ni_device_context_t * | ni_rsrc_allocate_simple_direct (ni_device_type_t device_type, int guid) |
Allocate resources for decoding/encoding, by designating explicitly the device to use. do not track the load on the host side. More... | |
LIB_API void | ni_rsrc_release_resource (ni_device_context_t *p_ctxt, uint64_t load) |
Release resources allocated for decoding/encoding. function This must be called at the end of transcoding with previously assigned load value by allocate* functions. More... | |
LIB_API int | ni_rsrc_check_hw_available (int guid, ni_device_type_t device_type) |
check the NetInt h/w device in resource pool on the host. More... | |
LIB_API int | ni_rsrc_remove_device (const char *p_dev) |
Remove an NetInt h/w device from resource pool on the host. More... | |
LIB_API int | ni_rsrc_remove_all_devices (void) |
Remove all NetInt h/w devices from resource pool on the host. More... | |
LIB_API int | ni_rsrc_add_device (const char *p_dev, int should_match_rev) |
Add an NetInt h/w device into resource pool on the host. More... | |
LIB_API ni_device_pool_t * | ni_rsrc_get_device_pool (void) |
Create and return the allocated ni_device_pool_t struct. More... | |
LIB_API void | ni_rsrc_free_device_pool (ni_device_pool_t *p_device_pool) |
Free all resources taken by the device pool. More... | |
LIB_API void | ni_rsrc_print_device_info (const ni_device_info_t *p_device_info) |
Print the content of the ni_device_info_t struct. More... | |
LIB_API int | ni_rsrc_lock_and_open (int device_type, ni_lock_handle_t *lock) |
lock a file lock and open a session on a device More... | |
LIB_API int | ni_rsrc_unlock (int device_type, ni_lock_handle_t lock) |
unlock a file lock More... | |
LIB_API int | ni_rsrc_is_fw_compat (uint8_t fw_rev[8]) |
check if device FW revision is compatible with SW API More... | |
LIB_API ni_hw_device_info_quadra_coder_param_t * | ni_create_hw_device_info_quadra_coder_param (int mode) |
Create a pointer to hw_device_info_coder_param_t instance .This instance will be created and set to default vaule by param mode.You may change the resolution fps bit_8_10 or other vaule you want to set. More... | |
LIB_API void | ni_destory_hw_device_info_quadra_coder_param (ni_hw_device_info_quadra_coder_param_t *p_hw_device_info_quadra_coder_param) |
Release a pointer to hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param. More... | |
LIB_API ni_hw_device_info_quadra_t * | ni_hw_device_info_alloc_quadra (int device_type_num, int avaliable_card_num) |
Create a pointer to ni_hw_device_info_quadra_t instance . More... | |
LIB_API void | ni_hw_device_info_free_quadra (ni_hw_device_info_quadra_t *p_hw_device_info) |
Release a pointer to ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param. More... | |
LIB_API int | ni_check_hw_info (ni_hw_device_info_quadra_t **pointer_to_p_hw_device_info, int task_mode, ni_hw_device_info_quadra_threshold_param_t *hw_info_threshold_param, ni_device_type_t preferential_device_type, ni_hw_device_info_quadra_coder_param_t *coder_param, int hw_mode, int consider_mem) |
check hw info, return the appropriate card number to use depends on the load&task_num&used resource More... | |
LIB_API ni_device_context_t * | ni_rsrc_allocate_auto (ni_device_type_t device_type, ni_alloc_rule_t rule, ni_codec_t codec, int width, int height, int frame_rate, uint64_t *p_load) |
Allocate resources for decoding/encoding, based on the provided rule. More... | |
Variables | |
bool | g_device_in_ctxt |
ni_device_handle_t | g_dev_handle |
#define NI_ADDITIONAL_INFO_STR_LEN 64 |
Definition at line 38 of file ni_rsrc_api.h.
#define NI_LEVELS_SUPP_STR_LEN 64 |
Definition at line 37 of file ni_rsrc_api.h.
#define NI_PROFILES_SUPP_STR_LEN 128 |
Definition at line 36 of file ni_rsrc_api.h.
typedef struct _ni_card_info_quadra ni_card_info_quadra_t |
typedef struct _ni_device_context ni_device_context_t |
typedef struct _ni_device_extra_info ni_device_extra_info_t |
typedef struct _ni_device_info ni_device_info_t |
typedef struct _ni_device_pool ni_device_pool_t |
typedef struct _ni_device_queue ni_device_queue_t |
typedef struct _ni_device ni_device_t |
typedef struct _ni_device_temp ni_device_temp_t |
typedef struct _ni_device_vf_ns_id ni_device_vf_ns_id_t |
typedef struct _ni_device_video_capability ni_device_video_capability_t |
typedef struct _ni_hw_device_info_quadra ni_hw_device_info_quadra_t |
typedef struct _ni_rsrc_video_ref_cap ni_rsrc_device_video_ref_cap_t |
typedef struct _ni_sw_instance_info ni_sw_instance_info_t |
enum ni_alloc_rule_t |
Enumerator | |
---|---|
EN_ALLOC_LEAST_LOAD | |
EN_ALLOC_LEAST_INSTANCE |
Definition at line 252 of file ni_rsrc_api.h.
enum ni_codec_t |
Enumerator | |
---|---|
EN_INVALID | |
EN_H264 | |
EN_H265 | |
EN_VP9 | |
EN_JPEG | |
EN_AV1 | |
EN_CODEC_MAX |
Definition at line 47 of file ni_rsrc_api.h.
Enumerator | |
---|---|
EN_IDLE | |
EN_ACTIVE |
Definition at line 61 of file ni_rsrc_api.h.
LIB_API int ni_check_hw_info | ( | ni_hw_device_info_quadra_t ** | pointer_to_p_hw_device_info, |
int | task_mode, | ||
ni_hw_device_info_quadra_threshold_param_t * | hw_info_threshold_param, | ||
ni_device_type_t | preferential_device_type, | ||
ni_hw_device_info_quadra_coder_param_t * | coder_param, | ||
int | hw_mode, | ||
int | consider_mem | ||
) |
check hw info, return the appropriate card number to use depends on the load&task_num&used resource
[out] | pointer_to_p_hw_device_info | : pointer to user-supplied ni_hw_device_info_quadra_t (allocated by ni_hw_device_info_alloc). May be a ponter to NULL ,in which case a ni_hw_device_info_quadra_coder_param_t is allocated by this function and written to pointer_to_p_hw_device_info. record the device info, including available card num and which card to select, and each card's informaton, such as, the load, task num, device type |
[in] | task_mode | affect the scheduling strategy, 1 - both the load_num and task_num should consider, usually applied to live scenes 0 - only consider the task_num, don not care the load_num |
[in] | hw_info_threshold_param | : an array of threshold including device type task threshold and load threshold in hw_mode fill the arry with both encoder and decoder threshold or fill the arry with preferential device type threshold when don not in hw_mode load threshold in range[0:100] task num threshold in range [0:32] |
[in] | preferential_device_type | : which device type is preferential 0:decode 1:encode . This need to set to encoder/decoder even if in sw_mode to check whether coder_param is wrong. |
[in] | coder_param | : encoder and decoder information that helps to choose card .This coder_param can be created and set to default value by function hw_device_info_coder_param_t * create_hw_device_info_coder_param(). You may change the resolution fps bit_8_10 or other vaule you want to use |
[in] | hw_mode:Set | 1 then this function will choose encoder and decoder in just one card . When no card meets the conditions ,NO card will be choosed. You can try to use set hw_mode 0 to use sw_mode to do encoder/decoder in different card when hw_mode reports an error In hw_mode set both encoder_param and decoder_param in coder_param. Set 0 then just consider sw_mode to choose which card to do encode/decode, In sw_mode set one param in coder_param the other one will be set to NULL. |
[in] | consider_mem | : set 1 this function will consider memory usage extra set 0 this function will not consider memory usage |
Definition at line 3401 of file ni_rsrc_api.cpp.
LIB_API ni_hw_device_info_quadra_coder_param_t* ni_create_hw_device_info_quadra_coder_param | ( | int | mode | ) |
Create a pointer to hw_device_info_coder_param_t instance .This instance will be created and set to default vaule by param mode.You may change the resolution fps bit_8_10 or other vaule you want to set.
[in] | mode:0:create | instance with decoder_param ,encoder_param, scaler_param and ai_param will be set to NULL 1:create instance with encoder_param ,decoder_param, scaler_param and ai_param will be set to NULL 2:create instance with scaler_param ,decoder_param, encoder_param and ai_param will be set to NULL 3:create instance with ai_param ,decoder_param, encoder_param and scaler_param will be set to NULL >= 4:create instance with decoder_param encoder_param scaler_param and ai_param for ni_check_hw_info() hw_mode |
Create a pointer to hw_device_info_coder_param_t instance .This instance will be created and set to default vaule by param mode.You may change the resolution fps bit_8_10 or other vaule you want to set.
[in] | mode | 0 for decoder,1 for encoder,2 for scaler,3 for AI, >= 4 for hw_mode |
Definition at line 3118 of file ni_rsrc_api.cpp.
LIB_API void ni_destory_hw_device_info_quadra_coder_param | ( | ni_hw_device_info_quadra_coder_param_t * | p_hw_device_info_quadra_coder_param | ) |
Release a pointer to hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param.
[in] | p_hw_device_info_coder_param:pointer | to a hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param |
Release a pointer to hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param.
[in] | device_type_num | |
[in] | avaliable_card_num |
Definition at line 3271 of file ni_rsrc_api.cpp.
LIB_API ni_hw_device_info_quadra_t* ni_hw_device_info_alloc_quadra | ( | int | device_type_num, |
int | avaliable_card_num | ||
) |
Create a pointer to ni_hw_device_info_quadra_t instance .
[in] | device_type_num:number | of device type to be allocated in this function |
[in] | avaliable_card_num:number | of avaliable card per device to be allocated in this function |
Create a pointer to ni_hw_device_info_quadra_t instance .
[in] | device_type_num | |
[in] | avaliable_card_num |
Definition at line 3310 of file ni_rsrc_api.cpp.
LIB_API void ni_hw_device_info_free_quadra | ( | ni_hw_device_info_quadra_t * | p_hw_device_info | ) |
Release a pointer to ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param.
[in] | p_hw_device_info:pointer | to a ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param |
Release a pointer to ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param.
[in] | p_hw_device_info | Poiner to a ni_hw_device_info_quadra_t struct |
Definition at line 3381 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_add_device | ( | const char * | dev, |
int | should_match_rev | ||
) |
Add an NetInt h/w device into resource pool on the host.
[in] | p_dev | the NVMe device name |
[in] | should_match_rev | 0: transcoder firmware revision matching the library's version is NOT required for placing the transcoder into resource pool; 1: otherwise |
[in] | p_dev | Device name represented as C string. ex "/dev/nvme0" |
[in] | should_match_rev | 0: transcoder firmware revision matching the library's version is NOT required for placing the transcoder into resource pool; 1: otherwise |
Definition at line 2523 of file ni_rsrc_api.cpp.
LIB_API ni_device_context_t* ni_rsrc_allocate_auto | ( | ni_device_type_t | device_type, |
ni_alloc_rule_t | rule, | ||
ni_codec_t | codec, | ||
int | width, | ||
int | height, | ||
int | frame_rate, | ||
uint64_t * | p_load | ||
) |
Allocate resources for decoding/encoding, based on the provided rule.
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[in] | rule | allocation rule |
[in] | codec | EN_H264 or EN_H265 |
[in] | width | width of video resolution |
[in] | height | height of video resolution |
[in] | frame_rate | video stream frame rate |
[out] | p_load | the load that will be generated by this encoding task. Returned only for encoder for now. |
Note: codec, width, height, fps need to be supplied for NI_DEVICE_TYPE_ENCODER only, they are ignored otherwize. Note: the returned ni_device_context_t content is not supposed to be used by caller directly: should only be passed to API in the subsequent calls; also after its use, the context should be released by calling ni_rsrc_free_device_context.
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[in] | rule | allocation rule |
[in] | codec | EN_H264 or EN_H265 |
[in] | width | width of video resolution |
[in] | height | height of video resolution |
[in] | frame_rate | video stream frame rate |
[out] | p_load | the p_load that will be generated by this encoding task. Returned only for encoder for now. |
Note: codec, width, height, fps need to be supplied for NI_DEVICE_TYPE_ENCODER only, they are ignored otherwize. Note: the returned ni_device_context_t content is not supposed to be used by caller directly: should only be passed to API in the subsequent calls; also after its use, the context should be released by calling ni_rsrc_free_device_context.
retrieve the record and based on the allocation rule specified, find the least loaded or least number of s/w instances among the coders
get the individual device_info info and check the load/num-of-instances
Definition at line 4103 of file ni_rsrc_api.cpp.
ni_device_context_t* ni_rsrc_allocate_simple_direct | ( | ni_device_type_t | device_type, |
int | guid | ||
) |
Allocate resources for decoding/encoding, by designating explicitly the device to use. do not track the load on the host side.
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[in] | guid | unique device (decoder or encoder) module id |
Note: only need to specify the device type and guid and codec type
Note: the returned ni_device_context_t content is not supposed to be used by caller directly: should only be passed to API in the subsequent calls; also after its use, the context should be released by calling ni_rsrc_free_device_context.
Definition at line 1932 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_check_hw_available | ( | int | guid, |
ni_device_type_t | device_type | ||
) |
check the NetInt h/w device in resource pool on the host.
[in] | guid | the global unique device index in resource pool device_type NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
Definition at line 2016 of file ni_rsrc_api.cpp.
LIB_API void ni_rsrc_free_device_context | ( | ni_device_context_t * | p_device_context | ) |
Free previously allocated device context.
p_device_context | Pointer to previously allocated device context |
Definition at line 1310 of file ni_rsrc_api.cpp.
LIB_API void ni_rsrc_free_device_pool | ( | ni_device_pool_t * | p_device_pool | ) |
Free all resources taken by the device pool.
[in] | p_device_pool | Poiner to a device pool struct |
Definition at line 2621 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_get_device_by_block_name | ( | const char * | blk_name, |
ni_device_type_t | device_type | ||
) |
Get GUID of the device by block device name and type.
[in] | blk_name | device's block name |
[in] | type | device type |
Definition at line 1799 of file ni_rsrc_api.cpp.
LIB_API ni_device_context_t* ni_rsrc_get_device_context | ( | ni_device_type_t | type, |
int | guid | ||
) |
Allocates and returns a pointer to ni_device_context_t struct based on provided device_type and guid. To be used for load update and codec query.
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[in] | guid | GUID of the encoder or decoder device |
Note: The returned ni_device_context_t content is not supposed to be used by caller directly: should only be passed to API in the subsequent calls; also after its use, the context should be released by calling ni_rsrc_free_device_context.
LIB_API ni_device_info_t* ni_rsrc_get_device_info | ( | ni_device_type_t | device_type, |
int | guid | ||
) |
Query a specific device with detailed information on the system.
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[in] | guid | unique device(decoder or encoder) id |
Note: Caller is responsible for releasing memory that was allocated for the returned pointer
Definition at line 1748 of file ni_rsrc_api.cpp.
LIB_API ni_device_pool_t* ni_rsrc_get_device_pool | ( | void | ) |
Create and return the allocated ni_device_pool_t struct.
None |
LIB_API NI_DEPRECATED int ni_rsrc_get_local_device_list | ( | char | ni_devices[][NI_MAX_DEVICE_NAME_LEN], |
int | max_handles | ||
) |
Scans system for all NVMe devices and returns the system device names to the user which were identified as NETINT transcoder deivices. Names are suitable for OpenFile api usage afterwards This function had been replaced by ni_rsrc_get_local_device_list2 This function can't be callback with multi thread.
[out] | ni_devices | List of device names identified as NETINT NVMe transcoders |
[in] | max_handles | Max number of device names to return |
LIB_API int ni_rsrc_get_local_device_list2 | ( | char | ni_devices[][NI_MAX_DEVICE_NAME_LEN], |
int | max_handles, | ||
char ** | xcoder_refresh_dev_names, | ||
int | xcoder_refresh_dev_count | ||
) |
Scans system for all NVMe devices and returns the system device names to the user which were identified as NETINT transcoder devices. Names are suitable for resource management API usage afterwards This function had replaced ni_rsrc_get_local_device_list This function can be callback with multi thread.
[out] | ni_devices | List of device names identified as NETINT NVMe transcoders |
[in] | max_handles | Max number of device names to return |
[in] | xcoder_refresh_dev_names | Xcoder fresh device name |
[in] | xcoder_refresh_dev_count | Xcoder fresh device number count |
LIB_API int ni_rsrc_init | ( | int | should_match_rev, |
int | timeout_seconds | ||
) |
Initialize and create all resources required to work with NETINT NVMe transcoder devices. This is a high level API function which is used mostly with user application like FFmpeg that relies on those resources. In case of custom application integration, revised functionality might be necessary utilizing coresponding API functions.
[in] | should_match_rev | 0: transcoder firmware revision matching the library's version is NOT required for placing the transcoder into resource pool; 1: otherwise timeout_seconds 0: No timeout amount, loop until init success or fail; else: timeout will fail init once reached |
LIB_API int ni_rsrc_is_fw_compat | ( | uint8_t | fw_rev[8] | ) |
check if device FW revision is compatible with SW API
fw_rev |
Definition at line 2784 of file ni_rsrc_api.cpp.
LIB_API ni_retcode_t ni_rsrc_list_all_devices | ( | ni_device_t * | p_device | ) |
List all devices with full information including s/w instances on the system.
[out] | p_device | The device information returned. |
Note: Caller is responsible for allocating memory for "p_device".
Definition at line 1445 of file ni_rsrc_api.cpp.
LIB_API ni_retcode_t ni_rsrc_list_all_devices2 | ( | ni_device_t * | p_device, |
bool | list_uninitialized | ||
) |
Grabs information for every initialized and uninitialized device.
[out] | p_device | The device information returned. |
list_uninitialized | Flag to determine if uninitialized devices should be grabbed. |
Note: Caller is responsible for allocating memory for "p_device".
list_uninitialized | Flag to determine if uninitialized devices should be grabbed. |
Note: Caller is responsible for allocating memory for "p_device".
Definition at line 1487 of file ni_rsrc_api.cpp.
LIB_API ni_retcode_t ni_rsrc_list_devices | ( | ni_device_type_t | device_type, |
ni_device_info_t * | p_device_info, | ||
int * | p_device_count | ||
) |
List device(s) based on device type with full information including s/w instances on the system.
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[out] | p_device | The device information returned. |
[out] | p_device_count | The number of ni_device_info_t structs returned. |
Note: Caller is responsible for allocating memory for "p_device".
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER |
[out] | p_device | The device information returned. |
[out] | p_device_count | The number of ni_device_info_t structs returned. |
Note: Caller is responsible for allocating memory for "p_device".
Definition at line 1340 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_lock_and_open | ( | int | device_type, |
ni_lock_handle_t * | lock | ||
) |
lock a file lock and open a session on a device
device_type | |
lock |
Definition at line 2652 of file ni_rsrc_api.cpp.
LIB_API void ni_rsrc_print_all_devices_capability | ( | void | ) |
Print detailed capability information of all devices on the system.
none |
Definition at line 1681 of file ni_rsrc_api.cpp.
LIB_API void ni_rsrc_print_all_devices_capability2 | ( | bool | list_uninitialized | ) |
Prints detailed capability information for all initialized devices and general information about uninitialized devices.
list_uninitialized | Flag to determine if uninitialized devices should be grabbed. |
Definition at line 1713 of file ni_rsrc_api.cpp.
LIB_API void ni_rsrc_print_device_info | ( | const ni_device_info_t * | p_device_info | ) |
Print the content of the ni_device_info_t struct.
p_device_info | - pointer to the ni_device_info_t struct to print |
Definition at line 1600 of file ni_rsrc_api.cpp.
LIB_API ni_retcode_t ni_rsrc_refresh | ( | int | should_match_rev | ) |
Scan and refresh all resources on the host, taking into account hot-plugged and pulled out cards.
[in] | should_match_rev | 0: transcoder firmware revision matching the library's version is NOT required for placing the transcoder into resource pool; 1: otherwise |
Definition at line 159 of file ni_rsrc_api.cpp.
LIB_API void ni_rsrc_release_resource | ( | ni_device_context_t * | p_device_context, |
uint64_t | load | ||
) |
Release resources allocated for decoding/encoding. function This must be called at the end of transcoding with previously assigned load value by allocate* functions.
[in/out] | p_ctxt the device context | |
[in] | load | the load value returned by allocate* functions |
Definition at line 1953 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_remove_all_devices | ( | void | ) |
Remove all NetInt h/w devices from resource pool on the host.
none |
Definition at line 2407 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_remove_device | ( | const char * | dev | ) |
Remove an NetInt h/w device from resource pool on the host.
[in] | p_dev | the NVMe device name |
Definition at line 2203 of file ni_rsrc_api.cpp.
LIB_API int ni_rsrc_unlock | ( | int | device_type, |
ni_lock_handle_t | lock | ||
) |
unlock a file lock
device_type | |
lock |
Definition at line 2738 of file ni_rsrc_api.cpp.
int ni_rsrc_update_device_load | ( | ni_device_context_t * | p_device_context, |
int | load, | ||
int | sw_instance_cnt, | ||
const ni_sw_instance_info_t | sw_instance_info[] | ||
) |
Update the load value and s/w instances info of a specific decoder or encoder. This is used by resource management daemon to update periodically.
[in] | p_ctxt | The device context returned by ni_rsrc_get_device_context |
[in] | p_load | The latest load value to update |
[in] | sw_instance_cnt | Number of s/w instances |
[in] | sw_instance_info | Info of s/w instances |
[in] | p_ctxt | The device context returned by ni_rsrc_get_device_context |
[in] | p_load | The latest load value to update |
[in] | sw_instance_cnt | Number of s/w instances |
[in] | sw_instance_info | Info of s/w instances |
Definition at line 1878 of file ni_rsrc_api.cpp.
ni_device_handle_t g_dev_handle |
Definition at line 63 of file ni_rsrc_api.cpp.
bool g_device_in_ctxt |
Definition at line 62 of file ni_rsrc_api.cpp.