libxcoder  5.2.0
ni_device_api_priv.c File Reference

Private definitions used by ni_device_api.c for video processing tasks. More...

#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "inttypes.h"
#include "ni_nvme.h"
#include "ni_device_api.h"
#include "ni_device_api_priv.h"
#include "ni_util.h"
#include "ni_lat_meas.h"
#include "ni_rsrc_priv.h"

Go to the source code of this file.

Macros

#define MAGIC_P2P_VALUE   "p2p"
 
#define AI_MODEL_TYPE_HVSPLUS_FILTER   3
 
#define NI_XCODER_FAILURES_MAX   25
 
#define DP_IPC_PASSTHRU   0xFFFFFFFF
 
#define CHECK_ERR_RC(ctx, rc, info, opcode, type, hw_id, inst_id, opt)
 
#define CHECK_VPU_RECOVERY(ret)
 

Typedefs

typedef enum _ni_t35_sei_mesg_type ni_t35_sei_mesg_type_t
 

Enumerations

enum  _ni_t35_sei_mesg_type { NI_T35_SEI_CLOSED_CAPTION = 0, NI_T35_SEI_HDR10_PLUS = 1 }
 
enum  check_err_rc_option_t { OPT_1 = 1, OPT_2 = 2, OPT_3 = 3 }
 

Functions

void SwapSWBytes (uint8_t *buf, uint32_t bytes)
 
void SwapSW16 (uint16_t *buf, uint32_t bytes)
 
void SwapSW32 (uint32_t *buf, uint32_t bytes)
 
void SwapSW64 (uint64_t *buf, uint64_t bytes)
 
void calculate_psnr (ni_session_context_t *p_ctx, ni_packet_t *p_packet)
 
ni_retcode_t ni_decoder_session_open (ni_session_context_t *p_ctx)
 Open a xcoder decoder instance. More...
 
ni_retcode_t ni_send_session_keep_alive (uint32_t session_id, ni_device_handle_t device_handle, ni_event_handle_t event_handle, void *p_data)
 send a keep alive message to firmware More...
 
ni_retcode_t ni_decoder_session_send_eos (ni_session_context_t *p_ctx)
 Send end of stream signal to the decoder. More...
 
ni_retcode_t ni_decoder_session_flush (ni_session_context_t *p_ctx)
 Flush decoder output. More...
 
ni_retcode_t ni_decoder_session_close (ni_session_context_t *p_ctx, int eos_recieved)
 Close a xcoder decoder instance. More...
 
int ni_decoder_session_write (ni_session_context_t *p_ctx, ni_packet_t *p_packet)
 Send a video p_packet to decoder. More...
 
int ni_decoder_session_read (ni_session_context_t *p_ctx, ni_frame_t *p_frame)
 Retrieve a YUV p_frame from decoder. More...
 
int ni_xcoder_session_query (ni_session_context_t *p_ctx, ni_device_type_t device_type)
 Query current xcoder status. More...
 
int ni_xcoder_session_query_detail (ni_session_context_t *p_ctx, ni_device_type_t device_type, void *detail_data, int ver)
 Query current xcoder status. More...
 
ni_retcode_t ni_encoder_session_open (ni_session_context_t *p_ctx)
 Open a xcoder encoder instance. More...
 
ni_retcode_t ni_encoder_session_send_eos (ni_session_context_t *p_ctx)
 Flush encoder output. More...
 
ni_retcode_t ni_encoder_session_close (ni_session_context_t *p_ctx, int eos_recieved)
 Close a xcoder encoder instance. More...
 
void enqueue_ni_frame (ni_session_context_t *p_ctx, ni_frame_t *ni_frame, int32_t source_width, int32_t source_height)
 
int ni_encoder_session_write (ni_session_context_t *p_ctx, ni_frame_t *p_frame)
 Send a YUV p_frame to encoder. More...
 
int ni_encoder_session_read (ni_session_context_t *p_ctx, ni_packet_t *p_packet)
 
ni_retcode_t ni_encoder_session_sequence_change (ni_session_context_t *p_ctx, ni_resolution_t *p_resolution)
 Send sequnce change to a xcoder encoder instance. More...
 
int ni_scaler_session_open (ni_session_context_t *p_ctx)
 Open a xcoder scaler instance. More...
 
ni_retcode_t ni_scaler_session_close (ni_session_context_t *p_ctx, int eos_received)
 close a scaler session More...
 
ni_retcode_t ni_config_instance_set_scaler_params (ni_session_context_t *p_ctx, ni_scaler_params_t *p_params)
 Send a p_config command to configure scaling parameters. More...
 
ni_retcode_t ni_scaler_alloc_frame (ni_session_context_t *p_ctx, int width, int height, int format, int options, int rectangle_width, int rectangle_height, int rectangle_x, int rectangle_y, int rgba_color, int frame_index)
 allocate a frame in the scaler More...
 
ni_retcode_t ni_scaler_config_frame (ni_session_context_t *p_ctx, ni_frame_config_t *p_cfg)
 config a frame in the scaler More...
 
ni_retcode_t ni_scaler_multi_config_frame (ni_session_context_t *p_ctx, ni_frame_config_t p_cfg_in[], int numInCfgs, ni_frame_config_t *p_cfg_out)
 config multiple frames in the scaler More...
 
int ni_query_general_status (ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_general_status_t *p_gen_status)
 Query a particular xcoder instance to get GeneralStatus data. More...
 
int ni_query_detail_status (ni_session_context_t *p_ctx, ni_device_type_t device_type, void *p_detail_status, int ver)
 Query a particular xcoder instance to get DetailStatus data. More...
 
ni_retcode_t ni_query_stream_info (ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_stream_info_t *p_stream_info)
 Query a particular xcoder instance to get Stream Info data. More...
 
ni_retcode_t ni_query_session_stats (ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_session_stats_t *p_session_stats, int rc, int opcode)
 Query a particular session to get the stats info. More...
 
int ni_query_eos (ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_stream_complete_t *p_stream_complete)
 Query a particular xcoder instance to get End of Output data. More...
 
ni_retcode_t ni_query_session_statistic_info (ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_session_statistic_t *p_session_statistic)
 Query a particular xcoder session to get session statistics. More...
 
ni_retcode_t ni_query_instance_buf_info (ni_session_context_t *p_ctx, ni_instance_buf_info_rw_type_t rw_type, ni_device_type_t device_type, ni_instance_buf_info_t *p_inst_buf_info)
 Query a particular xcoder instance to get buffer/data Info data. More...
 
ni_retcode_t ni_config_session_rw (ni_session_context_t *p_ctx, ni_session_config_rw_type_t rw_type, uint8_t enable, uint8_t hw_action, uint16_t frame_id)
 Configure the read/write pipe for a session to control its behavior. More...
 
ni_retcode_t ni_config_instance_sos (ni_session_context_t *p_ctx, ni_device_type_t device_type)
 Send a p_config command for Start Of Stream. More...
 
ni_retcode_t ni_config_instance_eos (ni_session_context_t *p_ctx, ni_device_type_t device_type)
 Send a p_config command for End Of Stream. More...
 
ni_retcode_t ni_config_instance_flush (ni_session_context_t *p_ctx, ni_device_type_t device_type)
 Send a p_config command to flush the stream. More...
 
ni_retcode_t ni_config_instance_set_write_len (ni_session_context_t *p_ctx, ni_device_type_t device_type, uint32_t len)
 Send a p_config command to set the length for the incoming write packet. More...
 
ni_retcode_t ni_config_instance_set_sequence_change (ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_resolution_t *p_resolution)
 Send a p_config command to inform encoder sequence change. More...
 
ni_retcode_t ni_config_instance_set_encoder_params (ni_session_context_t *p_ctx)
 Send a p_config command to configure encoding parameters. More...
 
ni_retcode_t ni_config_instance_set_encoder_frame_params (ni_session_context_t *p_ctx, ni_encoder_frame_params_t *p_params)
 Send a p_config command to configure encoding p_frame parameters. More...
 
int ni_create_frame (ni_frame_t *p_frame, uint32_t read_length, uint64_t *p_frame_offset, bool is_hw_frame)
 Get info from received p_frame. More...
 
void ni_populate_device_capability_struct (ni_device_capability_t *p_cap, void *p_data, ni_device_handle_t device_handle, bool device_in_ctxt)
 Get info from received xcoder capability. More...
 
void ni_fix_VUI (uint8_t *vui, int pos, int value)
 insert the 32 bits of integer value at bit position pos More...
 
void ni_set_custom_dec_template (ni_session_context_t *p_ctx, ni_decoder_config_t *p_cfg, ni_xcoder_params_t *p_src, uint32_t max_pkt_size)
 Setup all xcoder configurations with custom parameters (Rev. B) More...
 
void ni_set_custom_template (ni_session_context_t *p_ctx, ni_encoder_config_t *p_cfg, ni_xcoder_params_t *p_src)
 Setup all xcoder configurations with custom parameters (Rev. B) More...
 
void ni_set_default_template (ni_session_context_t *p_ctx, ni_encoder_config_t *p_config)
 Setup and initialize all xcoder configuration to default (Rev. B) More...
 
ni_retcode_t ni_validate_custom_dec_template (ni_xcoder_params_t *p_src, ni_session_context_t *p_ctx, ni_decoder_config_t *p_cfg, char *p_param_err, uint32_t max_err_len)
 Perform validation on custom dec parameters (Rev. B) More...
 
ni_retcode_t ni_validate_custom_template (ni_session_context_t *p_ctx, ni_encoder_config_t *p_cfg, ni_xcoder_params_t *p_src, char *p_param_err, uint32_t max_err_len)
 Perform validation on custom parameters (Rev. B) More...
 
ni_retcode_t ni_check_common_params (ni_t408_config_t *p_param, ni_xcoder_params_t *p_src, char *p_param_err, uint32_t max_err_len)
 
ni_retcode_t ni_check_ratecontrol_params (ni_encoder_config_t *p_cfg, char *p_param_err, uint32_t max_err_len)
 
void ni_params_print (ni_xcoder_params_t *const p_encoder_params)
 Print xcoder user configurations. More...
 
void * ni_session_keep_alive_thread (void *arguments)
 decoder keep alive thread function triggers every 1 second More...
 
ni_retcode_t ni_uploader_session_open (ni_session_context_t *p_ctx)
 Open a xcoder upload instance. More...
 
ni_retcode_t ni_decoder_session_copy_internal (ni_session_context_t *src_p_ctx, ni_session_context_t *dst_p_ctx)
 Copy a xcoder decoder worker thread info. More...
 
ni_retcode_t ni_scaler_session_query_buffer_avail (ni_session_context_t *p_ctx)
 Query and acquire buffer from xcoder scaler instance. More...
 
ni_retcode_t ni_hwupload_session_query_buffer_avail (ni_session_context_t *p_ctx)
 Query and acquire buffer from xcoder upload instance. More...
 
int ni_hwupload_session_write (ni_session_context_t *p_ctx, ni_frame_t *p_frame, niFrameSurface1_t *hwdesc)
 Send a YUV p_frame to upload session. More...
 
int ni_hwupload_session_read_hwdesc (ni_session_context_t *p_ctx, niFrameSurface1_t *hwdesc)
 Retrieve a HW descriptor of uploaded frame. More...
 
ni_retcode_t ni_clear_instance_buf (niFrameSurface1_t *surface)
 clear a particular xcoder instance buffer/data More...
 
ni_retcode_t ni_decoder_session_read_desc (ni_session_context_t *p_ctx, ni_frame_t *p_frame)
 Retrieve a hw desc p_frame from decoder. More...
 
int ni_hwdownload_session_read (ni_session_context_t *p_ctx, ni_frame_t *p_frame, niFrameSurface1_t *hwdesc)
 Retrieve a YUV p_frame from decoder. More...
 
int ni_hwdownload_by_frame_idx (niFrameSurface1_t *hwdesc, ni_frame_t *p_frame, int is_auto_dl)
 Retrieve a YUV p_frame by frame index. More...
 
ni_retcode_t ni_hwframe_clone (ni_session_context_t *p_ctx, ni_frameclone_desc_t *p_frameclone_desc)
 Copy a src hw frame to a dst hw frame. More...
 
ni_retcode_t ni_uploader_session_close (ni_session_context_t *p_ctx)
 Close an xcoder upload instance. More...
 
ni_retcode_t ni_config_instance_set_uploader_params (ni_session_context_t *p_ctx, uint32_t pool_size, uint32_t pool)
 Send a p_config command to configure uploading parameters. More...
 
ni_retcode_t ni_config_instance_set_decoder_params (ni_session_context_t *p_ctx, uint32_t max_pkt_size)
 Send a p_config command to configure decoding parameters. More...
 
ni_retcode_t ni_scaler_session_read_hwdesc (ni_session_context_t *p_ctx, ni_frame_t *p_frame)
 read a hardware descriptor from a scaler session More...
 
int ni_get_bitdepth_factor_from_pixfmt (int pix_fmt)
 Grab bitdepth factor from NI_PIX_FMT. More...
 
int ni_get_planar_from_pixfmt (int pix_fmt)
 Grab planar info from NI_PIX_FMT. More...
 
ni_retcode_t ni_get_memory_offset (ni_session_context_t *p_ctx, const niFrameSurface1_t *hwdesc, uint32_t *p_offset)
 Get an address offset from a hw descriptor. More...
 
ni_retcode_t ni_config_instance_network_binary (ni_session_context_t *p_ctx, void *nb_data, uint32_t nb_size)
 
ni_retcode_t ni_config_instance_hvsplus (ni_session_context_t *p_ctx)
 
ni_retcode_t ni_ai_query_network_ready (ni_session_context_t *p_ctx)
 
ni_retcode_t ni_ai_session_write (ni_session_context_t *p_ctx, ni_frame_t *p_frame)
 
ni_retcode_t ni_ai_session_read (ni_session_context_t *p_ctx, ni_packet_t *p_packet)
 
ni_retcode_t ni_config_read_inout_layers (ni_session_context_t *p_ctx, ni_network_data_t *p_network)
 
ni_retcode_t ni_ai_session_open (ni_session_context_t *p_ctx)
 
ni_retcode_t ni_ai_session_close (ni_session_context_t *p_ctx, int eos_recieved)
 
ni_retcode_t ni_ai_multi_config_frame (ni_session_context_t *p_ctx, ni_frame_config_t p_cfg_in[], int numInCfgs, ni_frame_config_t *p_cfg_out)
 
ni_retcode_t ni_ai_alloc_dst_frame (ni_session_context_t *p_ctx, niFrameSurface1_t *p_out_surface)
 
ni_retcode_t ni_ai_alloc_hwframe (ni_session_context_t *p_ctx, int width, int height, int options, int pool_size, int frame_index)
 
ni_retcode_t ni_ai_session_read_hwdesc (ni_session_context_t *p_ctx, ni_frame_t *p_frame)
 read a hardware descriptor from a scaler session More...
 
ni_retcode_t ni_device_get_ddr_configuration (ni_session_context_t *p_ctx)
 Get DDR configuration of Quadra device. More...
 
ni_retcode_t ni_device_set_ddr_configuration (ni_session_context_t *p_ctx, uint8_t ddr_priority_mode)
 Set DDR configuration of Quadra device. More...
 
ni_retcode_t ni_encoder_metadata_buffer_alloc (ni_frame_t *p_frame, int extra_len)
 Allocate memory for the metadata header and auxillary data for encoder input data. More...
 
ni_retcode_t ni_encoder_start_buffer_alloc (ni_frame_t *p_frame)
 Allocate memory for the non-4k-aligned part at the start of YUV data for encoder input data. More...
 
ni_retcode_t ni_ai_session_query_metrics (ni_session_context_t *p_ctx, ni_network_perf_metrics_t *p_metrics)
 
ni_retcode_t ni_device_config_ns_qos (ni_device_handle_t device_handle, uint32_t key, uint32_t value)
 Send namespace num / Opmode and SRIOv index/value to the device with specified logic block address. More...
 
char * ni_get_core_name (ni_core_type_t eCoreType)
 
uint32_t ni_get_log_lba (ni_core_type_t eCoreType)
 
ni_retcode_t ni_dump_log_single_core (ni_session_context_t *p_ctx, void *p_data, uint32_t core_id, bool gen_log_file)
 
ni_retcode_t ni_dump_log_all_cores (ni_session_context_t *p_ctx, void *p_data, bool gen_log_file)
 
ni_retcode_t ni_send_to_target (ni_session_context_t *p_ctx, niFrameSurface1_t *source, uint64_t ui64DestAddr, uint32_t ui32FrameSize)
 
ni_retcode_t ni_recv_from_target (ni_session_context_t *p_ctx, const ni_p2p_sgl_t *dmaAddrs, ni_frame_t *pDstFrame)
 
int lower_pixel_rate (const ni_load_query_t *pQuery, uint32_t ui32CurrentLowest)
 

Detailed Description

Private definitions used by ni_device_api.c for video processing tasks.


Definition in file ni_device_api_priv.c.

Macro Definition Documentation

◆ AI_MODEL_TYPE_HVSPLUS_FILTER

#define AI_MODEL_TYPE_HVSPLUS_FILTER   3

Definition at line 85 of file ni_device_api_priv.c.

◆ CHECK_ERR_RC

#define CHECK_ERR_RC (   ctx,
  rc,
  info,
  opcode,
  type,
  hw_id,
  inst_id,
  opt 
)
Value:
{ \
(rc) = check_err_rc(ctx, rc, info, opcode, type, hw_id, inst_id, opt, __func__, __LINE__); \
if((rc) && ((opt) != OPT_3)) LRETURN; \
}

Definition at line 747 of file ni_device_api_priv.c.

◆ CHECK_VPU_RECOVERY

#define CHECK_VPU_RECOVERY (   ret)
Value:
{ \
{ \
ni_log(NI_LOG_ERROR, "Error, vpu reset.\n"); \
LRETURN; \
} \
}

Definition at line 753 of file ni_device_api_priv.c.

◆ DP_IPC_PASSTHRU

#define DP_IPC_PASSTHRU   0xFFFFFFFF

Definition at line 170 of file ni_device_api_priv.c.

◆ MAGIC_P2P_VALUE

#define MAGIC_P2P_VALUE   "p2p"

Definition at line 84 of file ni_device_api_priv.c.

◆ NI_XCODER_FAILURES_MAX

#define NI_XCODER_FAILURES_MAX   25

Definition at line 169 of file ni_device_api_priv.c.

Typedef Documentation

◆ ni_t35_sei_mesg_type_t

Enumeration Type Documentation

◆ _ni_t35_sei_mesg_type

Enumerator
NI_T35_SEI_CLOSED_CAPTION 
NI_T35_SEI_HDR10_PLUS 

Definition at line 87 of file ni_device_api_priv.c.

◆ check_err_rc_option_t

Enumerator
OPT_1 
OPT_2 
OPT_3 

Definition at line 93 of file ni_device_api_priv.c.

Function Documentation

◆ calculate_psnr()

void calculate_psnr ( ni_session_context_t p_ctx,
ni_packet_t p_packet 
)

For debug, read raster data from file

Definition at line 451 of file ni_device_api_priv.c.

◆ enqueue_ni_frame()

void enqueue_ni_frame ( ni_session_context_t p_ctx,
ni_frame_t ni_frame,
int32_t  source_width,
int32_t  source_height 
)

Definition at line 3923 of file ni_device_api_priv.c.

◆ lower_pixel_rate()

int lower_pixel_rate ( const ni_load_query_t pQuery,
uint32_t  ui32CurrentLowest 
)

Definition at line 18211 of file ni_device_api_priv.c.

◆ ni_ai_alloc_dst_frame()

ni_retcode_t ni_ai_alloc_dst_frame ( ni_session_context_t p_ctx,
niFrameSurface1_t p_out_surface 
)

Definition at line 17125 of file ni_device_api_priv.c.

◆ ni_ai_alloc_hwframe()

ni_retcode_t ni_ai_alloc_hwframe ( ni_session_context_t p_ctx,
int  width,
int  height,
int  options,
int  pool_size,
int  frame_index 
)

Definition at line 17231 of file ni_device_api_priv.c.

◆ ni_ai_multi_config_frame()

ni_retcode_t ni_ai_multi_config_frame ( ni_session_context_t p_ctx,
ni_frame_config_t  p_cfg_in[],
int  numInCfgs,
ni_frame_config_t p_cfg_out 
)

Definition at line 17000 of file ni_device_api_priv.c.

◆ ni_ai_query_network_ready()

ni_retcode_t ni_ai_query_network_ready ( ni_session_context_t p_ctx)

Definition at line 16126 of file ni_device_api_priv.c.

◆ ni_ai_session_close()

ni_retcode_t ni_ai_session_close ( ni_session_context_t p_ctx,
int  eos_recieved 
)

Definition at line 16899 of file ni_device_api_priv.c.

◆ ni_ai_session_open()

ni_retcode_t ni_ai_session_open ( ni_session_context_t p_ctx)

Definition at line 16741 of file ni_device_api_priv.c.

◆ ni_ai_session_query_metrics()

ni_retcode_t ni_ai_session_query_metrics ( ni_session_context_t p_ctx,
ni_network_perf_metrics_t p_metrics 
)

Definition at line 17805 of file ni_device_api_priv.c.

◆ ni_ai_session_read()

ni_retcode_t ni_ai_session_read ( ni_session_context_t p_ctx,
ni_packet_t p_packet 
)

Definition at line 16332 of file ni_device_api_priv.c.

◆ ni_ai_session_read_hwdesc()

ni_retcode_t ni_ai_session_read_hwdesc ( ni_session_context_t p_ctx,
ni_frame_t p_frame 
)

read a hardware descriptor from a scaler session


Parameters
[in]p_ctxpointer to session context
[out]p_framepointer to frame to write hw descriptor
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_FAILURE

Definition at line 17425 of file ni_device_api_priv.c.

◆ ni_ai_session_write()

ni_retcode_t ni_ai_session_write ( ni_session_context_t p_ctx,
ni_frame_t p_frame 
)

Definition at line 16181 of file ni_device_api_priv.c.

◆ ni_check_common_params()

ni_retcode_t ni_check_common_params ( ni_t408_config_t p_param,
ni_xcoder_params_t p_src,
char *  p_param_err,
uint32_t  max_err_len 
)

Definition at line 12446 of file ni_device_api_priv.c.

◆ ni_check_ratecontrol_params()

ni_retcode_t ni_check_ratecontrol_params ( ni_encoder_config_t p_cfg,
char *  p_param_err,
uint32_t  max_err_len 
)

Definition at line 12731 of file ni_device_api_priv.c.

◆ ni_clear_instance_buf()

ni_retcode_t ni_clear_instance_buf ( niFrameSurface1_t surface)

clear a particular xcoder instance buffer/data


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_instance_buf_info_rw_type_trw_type
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_instance_buf_info_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 14003 of file ni_device_api_priv.c.

◆ ni_config_instance_eos()

ni_retcode_t ni_config_instance_eos ( ni_session_context_t p_ctx,
ni_device_type_t  device_type 
)

Send a p_config command for End Of Stream.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6925 of file ni_device_api_priv.c.

◆ ni_config_instance_flush()

ni_retcode_t ni_config_instance_flush ( ni_session_context_t p_ctx,
ni_device_type_t  device_type 
)

Send a p_config command to flush the stream.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6980 of file ni_device_api_priv.c.

◆ ni_config_instance_hvsplus()

ni_retcode_t ni_config_instance_hvsplus ( ni_session_context_t p_ctx)

Definition at line 16033 of file ni_device_api_priv.c.

◆ ni_config_instance_network_binary()

ni_retcode_t ni_config_instance_network_binary ( ni_session_context_t p_ctx,
void *  nb_data,
uint32_t  nb_size 
)

Definition at line 15766 of file ni_device_api_priv.c.

◆ ni_config_instance_set_decoder_params()

ni_retcode_t ni_config_instance_set_decoder_params ( ni_session_context_t p_ctx,
uint32_t  max_pkt_size 
)

Send a p_config command to configure decoding parameters.


Parameters
ni_session_context_tp_ctx - xcoder Context
uint32_tmax_pkt_size - overwrite maximum packet size if nonzero
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 15427 of file ni_device_api_priv.c.

◆ ni_config_instance_set_encoder_frame_params()

ni_retcode_t ni_config_instance_set_encoder_frame_params ( ni_session_context_t p_ctx,
ni_encoder_frame_params_t p_params 
)

Send a p_config command to configure encoding p_frame parameters.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_encoder_frame_params_t* params - pointer to the encoder ni_encoder_frame_params_t struct
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 7344 of file ni_device_api_priv.c.

◆ ni_config_instance_set_encoder_params()

ni_retcode_t ni_config_instance_set_encoder_params ( ni_session_context_t p_ctx)

Send a p_config command to configure encoding parameters.


Parameters
ni_session_context_tp_ctx - xcoder Context
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 7178 of file ni_device_api_priv.c.

◆ ni_config_instance_set_scaler_params()

ni_retcode_t ni_config_instance_set_scaler_params ( ni_session_context_t p_ctx,
ni_scaler_params_t p_params 
)

Send a p_config command to configure scaling parameters.

condif a scaler instance


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_scaler_params_t* params - pointer to the scaler ni_scaler_params_t struct
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 5325 of file ni_device_api_priv.c.

◆ ni_config_instance_set_sequence_change()

ni_retcode_t ni_config_instance_set_sequence_change ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
ni_resolution_t p_resolution 
)

Send a p_config command to inform encoder sequence change.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_resolution_tp_resolution - sequence change resolution
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 7112 of file ni_device_api_priv.c.

◆ ni_config_instance_set_uploader_params()

ni_retcode_t ni_config_instance_set_uploader_params ( ni_session_context_t p_ctx,
uint32_t  pool_size,
uint32_t  pool 
)

Send a p_config command to configure uploading parameters.


Parameters
ni_session_context_tp_ctx - xcoder Context
[in]pool_sizepool size to create
[in]pool0 = normal pool, 1 = P2P pool
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 15324 of file ni_device_api_priv.c.

◆ ni_config_instance_set_write_len()

ni_retcode_t ni_config_instance_set_write_len ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
uint32_t  len 
)

Send a p_config command to set the length for the incoming write packet.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder

Definition at line 7042 of file ni_device_api_priv.c.

◆ ni_config_instance_sos()

ni_retcode_t ni_config_instance_sos ( ni_session_context_t p_ctx,
ni_device_type_t  device_type 
)

Send a p_config command for Start Of Stream.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION. NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6871 of file ni_device_api_priv.c.

◆ ni_config_read_inout_layers()

ni_retcode_t ni_config_read_inout_layers ( ni_session_context_t p_ctx,
ni_network_data_t p_network 
)

Definition at line 16468 of file ni_device_api_priv.c.

◆ ni_config_session_rw()

ni_retcode_t ni_config_session_rw ( ni_session_context_t p_ctx,
ni_session_config_rw_type_t  rw_type,
uint8_t  enable,
uint8_t  hw_action,
uint16_t  frame_id 
)

Configure the read/write pipe for a session to control its behavior.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_session_config_rw_trw_type
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
uint8_tenable
uint8_thw_action
uint16_tframe_id
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6778 of file ni_device_api_priv.c.

◆ ni_create_frame()

int ni_create_frame ( ni_frame_t p_frame,
uint32_t  read_length,
uint64_t *  p_frame_offset,
bool  is_hw_frame 
)

Get info from received p_frame.


Parameters

Definition at line 7413 of file ni_device_api_priv.c.

◆ ni_decoder_session_close()

ni_retcode_t ni_decoder_session_close ( ni_session_context_t p_ctx,
int  eos_recieved 
)

Close a xcoder decoder instance.


Parameters

Definition at line 1579 of file ni_device_api_priv.c.

◆ ni_decoder_session_copy_internal()

ni_retcode_t ni_decoder_session_copy_internal ( ni_session_context_t src_p_ctx,
ni_session_context_t dst_p_ctx 
)

Copy a xcoder decoder worker thread info.

Copy a xcoder decoder worker thread info and card info.


Parameters

Definition at line 13323 of file ni_device_api_priv.c.

◆ ni_decoder_session_flush()

ni_retcode_t ni_decoder_session_flush ( ni_session_context_t p_ctx)

Flush decoder output.


Parameters

Definition at line 1534 of file ni_device_api_priv.c.

◆ ni_decoder_session_open()

ni_retcode_t ni_decoder_session_open ( ni_session_context_t p_ctx)

Open a xcoder decoder instance.


Parameters

Definition at line 1146 of file ni_device_api_priv.c.

◆ ni_decoder_session_read()

int ni_decoder_session_read ( ni_session_context_t p_ctx,
ni_frame_t p_frame 
)

Retrieve a YUV p_frame from decoder.


Parameters

Definition at line 2254 of file ni_device_api_priv.c.

◆ ni_decoder_session_read_desc()

ni_retcode_t ni_decoder_session_read_desc ( ni_session_context_t p_ctx,
ni_frame_t p_frame 
)

Retrieve a hw desc p_frame from decoder.

Copy a xcoder decoder worker thread info and card info.


Parameters

Definition at line 14055 of file ni_device_api_priv.c.

◆ ni_decoder_session_send_eos()

ni_retcode_t ni_decoder_session_send_eos ( ni_session_context_t p_ctx)

Send end of stream signal to the decoder.


Parameters

Definition at line 1489 of file ni_device_api_priv.c.

◆ ni_decoder_session_write()

int ni_decoder_session_write ( ni_session_context_t p_ctx,
ni_packet_t p_packet 
)

Send a video p_packet to decoder.


Parameters

Definition at line 1760 of file ni_device_api_priv.c.

◆ ni_device_config_ns_qos()

ni_retcode_t ni_device_config_ns_qos ( ni_device_handle_t  device_handle,
uint32_t  key,
uint32_t  value 
)

Send namespace num / Opmode and SRIOv index/value to the device with specified logic block address.


Parameters
[in]device_handleDevice handle obtained by calling ni_device_open
[in]KeyRepresents either namespace num or opmode
[in]ValueRepresents either SRIOv index or opmode value
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED

Definition at line 17879 of file ni_device_api_priv.c.

◆ ni_device_get_ddr_configuration()

ni_retcode_t ni_device_get_ddr_configuration ( ni_session_context_t p_ctx)

Get DDR configuration of Quadra device.


Parameters
[in/out]p_ctx pointer to a session context with valid file handle
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED

Definition at line 17517 of file ni_device_api_priv.c.

◆ ni_device_set_ddr_configuration()

ni_retcode_t ni_device_set_ddr_configuration ( ni_session_context_t p_ctx,
uint8_t  ddr_priority_mode 
)

Set DDR configuration of Quadra device.


Parameters
[in]p_ctxpointer to a session context with valid file handle
[in]ddr_priority_modeddr priority mode
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED

Definition at line 17602 of file ni_device_api_priv.c.

◆ ni_dump_log_all_cores()

ni_retcode_t ni_dump_log_all_cores ( ni_session_context_t p_ctx,
void *  p_data,
bool  gen_log_file 
)

Definition at line 18069 of file ni_device_api_priv.c.

◆ ni_dump_log_single_core()

ni_retcode_t ni_dump_log_single_core ( ni_session_context_t p_ctx,
void *  p_data,
uint32_t  core_id,
bool  gen_log_file 
)

Definition at line 17952 of file ni_device_api_priv.c.

◆ ni_encoder_metadata_buffer_alloc()

ni_retcode_t ni_encoder_metadata_buffer_alloc ( ni_frame_t p_frame,
int  extra_len 
)

Allocate memory for the metadata header and auxillary data for encoder input data.


Parameters
[in]p_framePointer to a caller allocated ni_frame_t struct
[in]extra_lenLength header and auxillary data
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC

Definition at line 17665 of file ni_device_api_priv.c.

◆ ni_encoder_session_close()

ni_retcode_t ni_encoder_session_close ( ni_session_context_t p_ctx,
int  eos_recieved 
)

Close a xcoder encoder instance.


Parameters

Definition at line 3761 of file ni_device_api_priv.c.

◆ ni_encoder_session_open()

ni_retcode_t ni_encoder_session_open ( ni_session_context_t p_ctx)

Open a xcoder encoder instance.


Parameters

Definition at line 3202 of file ni_device_api_priv.c.

◆ ni_encoder_session_read()

int ni_encoder_session_read ( ni_session_context_t p_ctx,
ni_packet_t p_packet 
)

Definition at line 4548 of file ni_device_api_priv.c.

◆ ni_encoder_session_send_eos()

ni_retcode_t ni_encoder_session_send_eos ( ni_session_context_t p_ctx)

Flush encoder output.


Parameters

Definition at line 3716 of file ni_device_api_priv.c.

◆ ni_encoder_session_sequence_change()

ni_retcode_t ni_encoder_session_sequence_change ( ni_session_context_t p_ctx,
ni_resolution_t p_resolution 
)

Send sequnce change to a xcoder encoder instance.


Parameters

Definition at line 4984 of file ni_device_api_priv.c.

◆ ni_encoder_session_write()

int ni_encoder_session_write ( ni_session_context_t p_ctx,
ni_frame_t p_frame 
)

Send a YUV p_frame to encoder.


Parameters

************ Sequence Change related stuff

************ Sequence Change related stuff end

Definition at line 4032 of file ni_device_api_priv.c.

◆ ni_encoder_start_buffer_alloc()

ni_retcode_t ni_encoder_start_buffer_alloc ( ni_frame_t p_frame)

Allocate memory for the non-4k-aligned part at the start of YUV data for encoder input data.


Parameters
[in]p_framePointer to a caller allocated ni_frame_t struct
[in]start_lenLength of non-4k-aligned part at the start of YUV data
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC

Definition at line 17752 of file ni_device_api_priv.c.

◆ ni_fix_VUI()

void ni_fix_VUI ( uint8_t *  vui,
int  pos,
int  value 
)

insert the 32 bits of integer value at bit position pos


Parameters
intpos, int value
Returns
void

Definition at line 8178 of file ni_device_api_priv.c.

◆ ni_get_bitdepth_factor_from_pixfmt()

int ni_get_bitdepth_factor_from_pixfmt ( int  pix_fmt)

Grab bitdepth factor from NI_PIX_FMT.


Parameters
[in]pix_fmtni_pix_fmt_t
Returns
1 or 2 for success, -1 for error

Definition at line 15673 of file ni_device_api_priv.c.

◆ ni_get_core_name()

char* ni_get_core_name ( ni_core_type_t  eCoreType)

Definition at line 17893 of file ni_device_api_priv.c.

◆ ni_get_log_lba()

uint32_t ni_get_log_lba ( ni_core_type_t  eCoreType)

Definition at line 17923 of file ni_device_api_priv.c.

◆ ni_get_memory_offset()

ni_retcode_t ni_get_memory_offset ( ni_session_context_t p_ctx,
const niFrameSurface1_t hwdesc,
uint32_t *  p_offset 
)

Get an address offset from a hw descriptor.


Parameters
[in]p_ctxni_session_context_t to be referenced
[in]hwdescPointer to caller allocated niFrameSurface1_t
[out]p_offsetValue of offset
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM

Definition at line 15739 of file ni_device_api_priv.c.

◆ ni_get_planar_from_pixfmt()

int ni_get_planar_from_pixfmt ( int  pix_fmt)

Grab planar info from NI_PIX_FMT.


Parameters
[in]pix_fmtni_pix_fmt_t
Returns
0 or 1 for success, -1 for error

Definition at line 15702 of file ni_device_api_priv.c.

◆ ni_hwdownload_by_frame_idx()

int ni_hwdownload_by_frame_idx ( niFrameSurface1_t hwdesc,
ni_frame_t p_frame,
int  is_auto_dl 
)

Retrieve a YUV p_frame by frame index.


Parameters

Definition at line 15115 of file ni_device_api_priv.c.

◆ ni_hwdownload_session_read()

int ni_hwdownload_session_read ( ni_session_context_t p_ctx,
ni_frame_t p_frame,
niFrameSurface1_t hwdesc 
)

Retrieve a YUV p_frame from decoder.


Parameters

Definition at line 14923 of file ni_device_api_priv.c.

◆ ni_hwframe_clone()

ni_retcode_t ni_hwframe_clone ( ni_session_context_t p_ctx,
ni_frameclone_desc_t p_frameclone_desc 
)

Copy a src hw frame to a dst hw frame.


Parameters

Definition at line 15233 of file ni_device_api_priv.c.

◆ ni_hwupload_session_query_buffer_avail()

ni_retcode_t ni_hwupload_session_query_buffer_avail ( ni_session_context_t p_ctx)

Query and acquire buffer from xcoder upload instance.


Parameters
p_ctxpointer to uploader session context
Returns
NI_RETCODE_SUCCESS NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_MEM_ALOC

Definition at line 13456 of file ni_device_api_priv.c.

◆ ni_hwupload_session_read_hwdesc()

int ni_hwupload_session_read_hwdesc ( ni_session_context_t p_ctx,
niFrameSurface1_t hwdesc 
)

Retrieve a HW descriptor of uploaded frame.


Parameters
p_ctxpointer to uploader session context hwdesc pointer to hw descriptor
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_FAILURE

Definition at line 13917 of file ni_device_api_priv.c.

◆ ni_hwupload_session_write()

int ni_hwupload_session_write ( ni_session_context_t p_ctx,
ni_frame_t p_frame,
niFrameSurface1_t hwdesc 
)

Send a YUV p_frame to upload session.


Parameters

Definition at line 13561 of file ni_device_api_priv.c.

◆ ni_params_print()

void ni_params_print ( ni_xcoder_params_t *const  p_encoder_params)

Print xcoder user configurations.


Parameters

Definition at line 12785 of file ni_device_api_priv.c.

◆ ni_populate_device_capability_struct()

void ni_populate_device_capability_struct ( ni_device_capability_t p_cap,
void *  p_data,
ni_device_handle_t  device_handle,
bool  device_in_ctxt 
)

Get info from received xcoder capability.


Parameters

Definition at line 7865 of file ni_device_api_priv.c.

◆ ni_query_detail_status()

int ni_query_detail_status ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
void *  p_detail_status,
int  ver 
)

Query a particular xcoder instance to get DetailStatus data.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_instance_mgr_detail_status_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6035 of file ni_device_api_priv.c.

◆ ni_query_eos()

int ni_query_eos ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
ni_instance_mgr_stream_complete_t p_stream_complete 
)

Query a particular xcoder instance to get End of Output data.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
InstMgrStreamComp*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6376 of file ni_device_api_priv.c.

◆ ni_query_general_status()

int ni_query_general_status ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
ni_instance_mgr_general_status_t p_gen_status 
)

Query a particular xcoder instance to get GeneralStatus data.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_instance_mgr_general_status_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 5967 of file ni_device_api_priv.c.

◆ ni_query_instance_buf_info()

ni_retcode_t ni_query_instance_buf_info ( ni_session_context_t p_ctx,
ni_instance_buf_info_rw_type_t  rw_type,
ni_device_type_t  device_type,
ni_instance_buf_info_t p_inst_buf_info 
)

Query a particular xcoder instance to get buffer/data Info data.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_instance_buf_info_rw_type_trw_type
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_instance_buf_info_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6647 of file ni_device_api_priv.c.

◆ ni_query_session_statistic_info()

ni_retcode_t ni_query_session_statistic_info ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
ni_session_statistic_t p_session_statistic 
)

Query a particular xcoder session to get session statistics.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_session_statistic_t*out- Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6544 of file ni_device_api_priv.c.

◆ ni_query_session_stats()

ni_retcode_t ni_query_session_stats ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
ni_session_stats_t p_session_stats,
int  rc,
int  opcode 
)

Query a particular session to get the stats info.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_session_stats_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6200 of file ni_device_api_priv.c.

◆ ni_query_stream_info()

ni_retcode_t ni_query_stream_info ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
ni_instance_mgr_stream_info_t p_stream_info 
)

Query a particular xcoder instance to get Stream Info data.


Parameters
ni_session_context_tp_ctx - xcoder Context
ni_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_instance_mgr_stream_info_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_RETCODE_SUCCESS on success, NI_RETCODE_ERROR_INVALID_SESSION, NI_RETCODE_ERROR_MEM_ALOC or NI_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 6117 of file ni_device_api_priv.c.

◆ ni_recv_from_target()

ni_retcode_t ni_recv_from_target ( ni_session_context_t p_ctx,
const ni_p2p_sgl_t dmaAddrs,
ni_frame_t pDstFrame 
)

Definition at line 18139 of file ni_device_api_priv.c.

◆ ni_scaler_alloc_frame()

ni_retcode_t ni_scaler_alloc_frame ( ni_session_context_t p_ctx,
int  width,
int  height,
int  format,
int  options,
int  rectangle_width,
int  rectangle_height,
int  rectangle_x,
int  rectangle_y,
int  rgba_color,
int  frame_index 
)

allocate a frame in the scaler


Parameters
[in]p_ctxpointer to session context
[in]widthwidth in pixels
[in]heightheight in pixels
[in]formatpixel format
[in]optionsoption flags
[in]rectangle_widthclipping rectangle width in pixels
[in]rectangle_heightclipping rectangle height in pixels
[in]rectangle_xclipping rectangle x position
[in]rectangle_yclipping rectangle y position
[in]rgba_colorbackground colour (only used by pad filter)
[in]frame_indexframe index (only for hardware frames)
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_MEM_ALOC

Definition at line 5478 of file ni_device_api_priv.c.

◆ ni_scaler_config_frame()

ni_retcode_t ni_scaler_config_frame ( ni_session_context_t p_ctx,
ni_frame_config_t p_cfg 
)

config a frame in the scaler

config frame in the scaler


Parameters
[in]p_ctxpointer to session context
[in]p_cfgpointer to frame config
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_MEM_ALOC

Definition at line 5715 of file ni_device_api_priv.c.

◆ ni_scaler_multi_config_frame()

ni_retcode_t ni_scaler_multi_config_frame ( ni_session_context_t p_ctx,
ni_frame_config_t  p_cfg_in[],
int  numInCfgs,
ni_frame_config_t p_cfg_out 
)

config multiple frames in the scaler

config multi frames in the scaler


Parameters
[in]p_ctxpointer to session context
[in]p_cfg_inpointer to input frame config array
[in]numInCfgsnumber of input frame configs in the p_cfg array
[in]p_cfg_outpointer to output frame config
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_MEM_ALOC

Definition at line 5837 of file ni_device_api_priv.c.

◆ ni_scaler_session_close()

ni_retcode_t ni_scaler_session_close ( ni_session_context_t p_ctx,
int  eos_received 
)

close a scaler session


Parameters
[in]p_ctxpointer to session context
[in]eos_received(not used)
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_NVME_CMD_FAILED

Definition at line 5237 of file ni_device_api_priv.c.

◆ ni_scaler_session_open()

int ni_scaler_session_open ( ni_session_context_t p_ctx)

Open a xcoder scaler instance.


Parameters
[in]p_ctxpointer to session context
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_MEM_ALOC

Definition at line 5027 of file ni_device_api_priv.c.

◆ ni_scaler_session_query_buffer_avail()

ni_retcode_t ni_scaler_session_query_buffer_avail ( ni_session_context_t p_ctx)

Query and acquire buffer from xcoder scaler instance.

Query and acquire buffer from xcoder scale instance.


Parameters
[in]p_ctxpointer to scaler session context
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_FAILURE

Definition at line 13364 of file ni_device_api_priv.c.

◆ ni_scaler_session_read_hwdesc()

ni_retcode_t ni_scaler_session_read_hwdesc ( ni_session_context_t p_ctx,
ni_frame_t p_frame 
)

read a hardware descriptor from a scaler session


Parameters
[in]p_ctxpointer to session context
[out]p_framepointer to frame to write hw descriptor
Returns
NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_FAILURE

Definition at line 15554 of file ni_device_api_priv.c.

◆ ni_send_session_keep_alive()

ni_retcode_t ni_send_session_keep_alive ( uint32_t  session_id,
ni_device_handle_t  device_handle,
ni_event_handle_t  event_handle,
void *  p_data 
)

send a keep alive message to firmware


Parameters

Definition at line 1437 of file ni_device_api_priv.c.

◆ ni_send_to_target()

ni_retcode_t ni_send_to_target ( ni_session_context_t p_ctx,
niFrameSurface1_t source,
uint64_t  ui64DestAddr,
uint32_t  ui32FrameSize 
)

Definition at line 18089 of file ni_device_api_priv.c.

◆ ni_session_keep_alive_thread()

void* ni_session_keep_alive_thread ( void *  arguments)

decoder keep alive thread function triggers every 1 second


Parameters
voidthread args
Returns
void

Definition at line 12908 of file ni_device_api_priv.c.

◆ ni_set_custom_dec_template()

void ni_set_custom_dec_template ( ni_session_context_t p_ctx,
ni_decoder_config_t p_cfg,
ni_xcoder_params_t p_src,
uint32_t  max_pkt_size 
)

Setup all xcoder configurations with custom parameters (Rev. B)


Parameters

Definition at line 8209 of file ni_device_api_priv.c.

◆ ni_set_custom_template()

void ni_set_custom_template ( ni_session_context_t p_ctx,
ni_encoder_config_t p_cfg,
ni_xcoder_params_t p_src 
)

Setup all xcoder configurations with custom parameters (Rev. B)


Parameters

Definition at line 8455 of file ni_device_api_priv.c.

◆ ni_set_default_template()

void ni_set_default_template ( ni_session_context_t p_ctx,
ni_encoder_config_t p_config 
)

Setup and initialize all xcoder configuration to default (Rev. B)


Parameters

Definition at line 9648 of file ni_device_api_priv.c.

◆ ni_uploader_session_close()

ni_retcode_t ni_uploader_session_close ( ni_session_context_t p_ctx)

Close an xcoder upload instance.


Parameters
p_ctxpointer to uploader session context
Returns
NI_RETCODE_SUCCESS

Definition at line 15297 of file ni_device_api_priv.c.

◆ ni_uploader_session_open()

ni_retcode_t ni_uploader_session_open ( ni_session_context_t p_ctx)

Open a xcoder upload instance.

Open a xcoder uploader instance.


Parameters
p_ctx- pointer to caller allocated uploader session context
Returns
On success NI_RETCODE_SUCCESS

On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_MEM_ALOC NI_RETCODE_ERROR_INVALID_SESSION NI_RETCODE_FAILURE

Definition at line 13122 of file ni_device_api_priv.c.

◆ ni_validate_custom_dec_template()

ni_retcode_t ni_validate_custom_dec_template ( ni_xcoder_params_t p_src,
ni_session_context_t p_ctx,
ni_decoder_config_t p_cfg,
char *  p_param_err,
uint32_t  max_err_len 
)

Perform validation on custom dec parameters (Rev. B)


Parameters

Definition at line 10030 of file ni_device_api_priv.c.

◆ ni_validate_custom_template()

ni_retcode_t ni_validate_custom_template ( ni_session_context_t p_ctx,
ni_encoder_config_t p_cfg,
ni_xcoder_params_t p_src,
char *  p_param_err,
uint32_t  max_err_len 
)

Perform validation on custom parameters (Rev. B)


Parameters

Definition at line 10332 of file ni_device_api_priv.c.

◆ ni_xcoder_session_query()

int ni_xcoder_session_query ( ni_session_context_t p_ctx,
ni_device_type_t  device_type 
)

Query current xcoder status.


Parameters

Definition at line 3077 of file ni_device_api_priv.c.

◆ ni_xcoder_session_query_detail()

int ni_xcoder_session_query_detail ( ni_session_context_t p_ctx,
ni_device_type_t  device_type,
void *  detail_data,
int  ver 
)

Query current xcoder status.


Parameters

Definition at line 3169 of file ni_device_api_priv.c.

◆ SwapSW16()

void SwapSW16 ( uint16_t *  buf,
uint32_t  bytes 
)

Definition at line 189 of file ni_device_api_priv.c.

◆ SwapSW32()

void SwapSW32 ( uint32_t *  buf,
uint32_t  bytes 
)

Definition at line 201 of file ni_device_api_priv.c.

◆ SwapSW64()

void SwapSW64 ( uint64_t *  buf,
uint64_t  bytes 
)

Definition at line 212 of file ni_device_api_priv.c.

◆ SwapSWBytes()

void SwapSWBytes ( uint8_t *  buf,
uint32_t  bytes 
)

Definition at line 178 of file ni_device_api_priv.c.

NI_RETCODE_ERROR_VPU_RECOVERY
@ NI_RETCODE_ERROR_VPU_RECOVERY
Definition: ni_defs.h:515
OPT_3
@ OPT_3
Definition: ni_device_api_priv.c:97
NI_LOG_ERROR
@ NI_LOG_ERROR
Definition: ni_log.h:60
NI_RETCODE_NVME_SC_VPU_RECOVERY
@ NI_RETCODE_NVME_SC_VPU_RECOVERY
Definition: ni_defs.h:547
LRETURN
#define LRETURN
Definition: ni_defs.h:323