libxcoder  3.5.1
ni_device_api_priv_logan.h File Reference

Private definitions used by main ni_device_api_logan file. More...

#include "ni_defs_logan.h"

Go to the source code of this file.

Data Structures

struct  _ni_logan_inst_config_rw
 
struct  _ni_logan_instance_mgr_general_status
 
struct  _ni_logan_instance_debugInfo
 
struct  _ni_logan_instance_mgr_stream_info
 
struct  _ni_logan_instance_mgr_stream_complete
 
struct  _ni_logan_get_session_id
 
struct  _ni_logan_encoder_session_open_info
 
struct  _ni_logan_decoder_session_open_info
 
struct  _ni_logan_session_closed_status
 
struct  _ni_logan_instance_dec_packet_info
 
struct  _ni_logan_instance_upload_ret_hwdesc
 
struct  _ni_logan_instance_buf_info
 
struct  _ni_logan_encoder_frame_params
 
struct  _ni_logan_metadata_common
 
struct  _ni_logan_metadata_dec_frame
 
struct  _ni_logan_metadata_enc_frame
 
struct  _ni_logan_metadata_enc_bstream
 
struct  _ni_logan_t408_config_t
 
struct  _ni_logan_encoder_config_t
 
struct  _ni_logan_init_frames_params_t
 
struct  _ni_logan_recycle_buffer_t
 

Typedefs

typedef enum _ni_logan_xcoder_mgr_retcode ni_logan_xcoder_mgr_retcode_t
 
typedef struct _ni_logan_inst_config_rw ni_logan_inst_config_rw_t
 
typedef struct _ni_logan_instance_mgr_general_status ni_logan_instance_mgr_general_status_t
 
typedef struct _ni_logan_instance_debugInfo ni_logan_instance_debugInfo_t
 
typedef struct _ni_logan_instance_mgr_stream_info ni_logan_instance_mgr_stream_info_t
 
typedef struct _ni_logan_instance_mgr_stream_complete ni_logan_instance_mgr_stream_complete_t
 
typedef struct _ni_logan_get_session_id ni_logan_get_session_id_t
 
typedef struct _ni_logan_encoder_session_open_info ni_logan_encoder_session_open_info_t
 
typedef struct _ni_logan_decoder_session_open_info ni_logan_decoder_session_open_info_t
 
typedef struct _ni_logan_session_closed_status ni_logan_session_closed_status_t
 
typedef struct _ni_logan_instance_dec_packet_info ni_logan_instance_dec_packet_info_t
 
typedef struct _ni_logan_instance_upload_ret_hwdesc ni_logan_instance_upload_ret_hwdesc_t
 
typedef struct _ni_logan_instance_buf_info ni_logan_instance_buf_info_t
 
typedef struct _ni_logan_encoder_frame_params ni_logan_encoder_frame_params_t
 
typedef struct _ni_logan_metadata_common ni_logan_metadata_common_t
 
typedef struct _ni_logan_metadata_dec_frame ni_logan_metadata_dec_frame_t
 
typedef struct _ni_logan_metadata_enc_frame ni_logan_metadata_enc_frame_t
 
typedef struct _ni_logan_metadata_enc_bstream ni_logan_metadata_enc_bstream_t
 
typedef enum _ni_logan_gop_preset_idx ni_logan_gop_preset_idx_t
 
typedef struct _ni_logan_t408_config_t ni_logan_t408_config_t
 
typedef struct _ni_logan_encoder_config_t ni_logan_encoder_config_t
 
typedef struct _ni_logan_init_frames_params_t ni_logan_init_frames_params_t
 
typedef struct _ni_logan_recycle_buffer_t ni_logan_recycle_buffer_t
 

Enumerations

enum  ni_logan_inst_config_rw_type_t { INST_READ_CONFIG = 0 , INST_WRITE_CONFIG = 1 }
 
enum  ni_logan_instance_buf_info_rw_type_t { INST_BUF_INFO_RW_READ = 0 , INST_BUF_INFO_RW_WRITE = 1 , INST_BUF_INFO_RW_UPLOAD = 2 , INST_BUF_INFO_R_ACQUIRE = 3 }
 
enum  _ni_logan_xcoder_mgr_retcode {
  ni_logan_xcoder_request_success = 0 , ni_logan_xcoder_request_pending = 1 , ni_logan_xcoder_resource_recovery = 0xFFFD , ni_logan_xcoder_resource_insufficient = 0xFFFE ,
  ni_logan_xcoder_general_error = 0xFFFF
}
 
enum  _ni_logan_gop_preset_idx {
  GOP_PRESET_IDX_CUSTOM = 0 , GOP_PRESET_IDX_ALL_I = 1 , GOP_PRESET_IDX_IPP = 2 , GOP_PRESET_IDX_IBBB = 3 ,
  GOP_PRESET_IDX_IBPBP = 4 , GOP_PRESET_IDX_IBBBP = 5 , GOP_PRESET_IDX_IPPPP = 6 , GOP_PRESET_IDX_IBBBB = 7 ,
  GOP_PRESET_IDX_RA_IB = 8 , GOP_PRESET_IDX_SP = 9 , GOP_PRESET_IDX_17 = 17 , GOP_PRESET_IDX_18 = 18 ,
  GOP_PRESET_IDX_19 = 19 , GOP_PRESET_IDX_20 = 20 , GOP_PRESET_IDX_21 = 21 , GOP_PRESET_IDX_22 = 22
}
 
enum  ni_logan_bitstream_format_t {
  STD_AVC , STD_VC1 , STD_MPEG2 , STD_MPEG4 ,
  STD_H263 , STD_DIV3 , STD_RV , STD_AVS ,
  STD_THO = 9 , STD_VP3 , STD_VP8 , STD_HEVC ,
  STD_VP9 , STD_AVS2 , STD_SVAC , STD_MAX
}
 
enum  ni_logan_set_param_option_t { OPT_COMMON = 0 , OPT_CUSTOM_GOP = 1 , OPT_SEI = 2 , OPT_VUI = 3 }
 

Functions

int ni_logan_create_frame (ni_logan_frame_t *p_frame, uint32_t read_length, uint64_t *frame_offset, bool is_hw_frame)
 Get info from received p_frame. More...
 
void ni_logan_set_custom_template (ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_cfg, ni_logan_encoder_params_t *p_src)
 Setup all xcoder configurations with custom parameters (Rev. B) More...
 
void ni_logan_set_default_template (ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_config)
 Setup and initialize all xcoder configuration to default (Rev. B) More...
 
ni_logan_retcode_t ni_logan_validate_custom_template (ni_logan_session_context_t *p_ctx, ni_logan_encoder_config_t *p_cfg, ni_logan_encoder_params_t *p_src, char *p_param_err, uint32_t max_err_len)
 Perform validation on custom parameters (Rev. B) More...
 
ni_logan_retcode_t ni_logan_check_common_params (ni_logan_t408_config_t *p_param, ni_logan_encoder_params_t *p_src, char *param_err, uint32_t max_err_len)
 check the range of common parameters More...
 
ni_logan_retcode_t ni_logan_check_ratecontrol_params (ni_logan_encoder_config_t *p_cfg, char *param_err, uint32_t max_err_len)
 check the range of rate control parameters More...
 
void ni_logan_params_print (void *const p_params, ni_logan_device_type_t device_type)
 Print xcoder user configurations. More...
 
void ni_logan_populate_device_capability_struct (ni_logan_device_capability_t *p_cap, void *p_data)
 Get info from received xcoder capability. More...
 
ni_logan_retcode_t ni_logan_decoder_session_open (ni_logan_session_context_t *p_ctx)
 Open a xcoder decoder instance. More...
 
ni_logan_retcode_t ni_logan_decoder_session_close (ni_logan_session_context_t *p_ctx, int eos_recieved)
 Close a xcoder decoder instance. More...
 
ni_logan_retcode_t ni_logan_decoder_session_flush (ni_logan_session_context_t *p_ctx)
 Flush decoder output. More...
 
ni_logan_retcode_t ni_logan_decoder_session_flush_buffers (ni_logan_session_context_t *p_ctx)
 Flush decoder output. More...
 
int ni_logan_decoder_session_write (ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
 Send a video p_packet to decoder. More...
 
int ni_logan_decoder_session_read (ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
 Retrieve a YUV p_frame from decoder. More...
 
int ni_logan_decoder_session_query (ni_logan_session_context_t *p_ctx)
 Query current decoder status. More...
 
ni_logan_retcode_t ni_logan_encoder_session_open (ni_logan_session_context_t *p_ctx)
 Open a xcoder encoder instance. More...
 
ni_logan_retcode_t ni_logan_encoder_session_close (ni_logan_session_context_t *p_ctx, int eos_recieved)
 Close a xcoder encoder instance. More...
 
ni_logan_retcode_t ni_logan_encoder_session_flush (ni_logan_session_context_t *p_ctx)
 Flush encoder output. More...
 
int ni_logan_encoder_session_write (ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
 Send a YUV p_frame to encoder. More...
 
int ni_logan_encoder_session_read (ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
 Retrieve an encoded packet from encoder. More...
 
int ni_logan_encoder_session_query (ni_logan_session_context_t *p_ctx)
 Query current encoder status. More...
 
ni_logan_retcode_t ni_logan_query_general_status (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_mgr_general_status_t *p_gen_status)
 Query a particular xcoder instance to get GeneralStatus data. More...
 
ni_logan_retcode_t ni_logan_query_stream_info (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_mgr_stream_info_t *p_stream_info, bool is_hw)
 Query a particular xcoder instance to get Stream Info data. More...
 
ni_logan_retcode_t ni_logan_query_status_info (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type, ni_logan_instance_status_info_t *p_status_info, int rc, int opcode)
 Query a particular xcoder instance to get status Info data. More...
 
ni_logan_retcode_t ni_logan_query_instance_buf_info (ni_logan_session_context_t *p_ctx, ni_logan_instance_buf_info_rw_type_t rw_type, ni_logan_device_type_t device_type, ni_logan_instance_buf_info_t *p_inst_buf_info, bool is_hw)
 Query a particular xcoder instance to get buffer/data Info data. More...
 
ni_logan_retcode_t ni_logan_config_instance_sos (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
 Send a p_config command for Start Of Stream. More...
 
ni_logan_retcode_t ni_logan_config_instance_eos (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
 Send a p_config command for End Of Stream. More...
 
ni_logan_retcode_t ni_logan_config_instance_flush (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
 Send a p_config command Flush Of Stream. More...
 
ni_logan_retcode_t ni_logan_config_instance_set_encoder_params (ni_logan_session_context_t *p_ctx)
 Send a p_config command to configure encoding parameters. More...
 
ni_logan_retcode_t ni_logan_config_instance_update_encoder_params (ni_logan_session_context_t *p_ctx, ni_logan_param_change_flags_t change_flags)
 updates encoder parameters based on change flags structure More...
 
void * ni_logan_session_keep_alive_thread (void *arguments)
 decoder keep alive thread function triggers every 1 second More...
 
ni_logan_retcode_t ni_logan_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...
 
void ni_logan_fix_VUI (uint8_t *vui, int pos, int value)
 insert the 32 bits of integer value at bit position pos More...
 
ni_logan_retcode_t ni_logan_decoder_session_copy_internal (ni_logan_session_context_t *src_p_ctx, ni_logan_session_context_t *dst_p_ctx)
 Copy a xcoder decoder card info and create worker thread. More...
 
int ni_logan_decoder_session_read_desc (ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
 Retrieve a hw desc p_frame from decoder When yuvbypass enabled, this is used for decoder to read hardware frame index, extra data and meta data. More...
 
void ni_logan_populate_serial_number (ni_logan_serial_num_t *p_serial_num, void *p_data)
 Get Card Serial Number from received Nvme Indentify info. More...
 
ni_logan_retcode_t ni_logan_uploader_session_open (ni_logan_session_context_t *p_ctx)
 Open a xcoder uploader instance. More...
 
int ni_logan_hwupload_init_framepool (ni_logan_session_context_t *p_ctx, uint32_t pool_size, uint32_t p2p_pool)
 Setup framepool for hwupload. Uses decoder framepool. More...
 
int ni_logan_hwupload_session_write (ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
 Send a YUV to hardware, hardware will store it. More...
 
int ni_logan_hwupload_session_read_hwdesc (ni_logan_session_context_t *p_ctx, ni_logan_hwframe_surface_t *hwdesc, unsigned int *hwaddress)
 Retrieve a HW descriptor of uploaded frame The HW descriptor will contain the YUV frame index, which stored in HW through ni_logan_hwupload_session_write(). More...
 
int ni_logan_hwdownload_session_read (ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame, ni_logan_hwframe_surface_t *hwdesc)
 Retrieve a YUV through HW descriptor from decoder. More...
 
ni_logan_retcode_t ni_logan_clear_instance_buf (ni_logan_hwframe_surface_t *surface, ni_device_handle_t device_handle, ni_event_handle_t event_handle)
 clear a particular xcoder instance buffer/data More...
 
void ni_logan_change_priority (void)
 Set up schedule priority. First try to run with RR mode. If fails, try to set nice value. If fails either, ignore it and run with default priority. More...
 
ni_logan_retcode_t ni_get_memory_offset (ni_logan_session_context_t *p_ctx, const ni_logan_hwframe_surface_t *hwdesc, unsigned int *p_offset, unsigned int hwaddress)
 Get an address offset from a hw descriptor. More...
 

Detailed Description

Private definitions used by main ni_device_api_logan file.


Date
April 1, 2018
Author

Definition in file ni_device_api_priv_logan.h.

Typedef Documentation

◆ ni_logan_decoder_session_open_info_t

◆ ni_logan_encoder_config_t

◆ ni_logan_encoder_frame_params_t

◆ ni_logan_encoder_session_open_info_t

◆ ni_logan_get_session_id_t

◆ ni_logan_gop_preset_idx_t

****** encoder paramters

◆ ni_logan_init_frames_params_t

****** hwuploader initialization paramters

◆ ni_logan_inst_config_rw_t

◆ ni_logan_instance_buf_info_t

◆ ni_logan_instance_debugInfo_t

◆ ni_logan_instance_dec_packet_info_t

◆ ni_logan_instance_mgr_general_status_t

◆ ni_logan_instance_mgr_stream_complete_t

◆ ni_logan_instance_mgr_stream_info_t

◆ ni_logan_instance_upload_ret_hwdesc_t

◆ ni_logan_metadata_common_t

◆ ni_logan_metadata_dec_frame_t

◆ ni_logan_metadata_enc_bstream_t

◆ ni_logan_metadata_enc_frame_t

◆ ni_logan_recycle_buffer_t

****** paramters of clearing hardware frames

◆ ni_logan_session_closed_status_t

◆ ni_logan_t408_config_t

◆ ni_logan_xcoder_mgr_retcode_t

Enumeration Type Documentation

◆ _ni_logan_gop_preset_idx

****** encoder paramters

Enumerator
GOP_PRESET_IDX_CUSTOM 
GOP_PRESET_IDX_ALL_I 
GOP_PRESET_IDX_IPP 

*< All Intra, gopsize = 1

GOP_PRESET_IDX_IBBB 

*< Consecutive P, cyclic gopsize = 1

GOP_PRESET_IDX_IBPBP 

*< Consecutive B, cyclic gopsize = 1

GOP_PRESET_IDX_IBBBP 

*< gopsize = 2

GOP_PRESET_IDX_IPPPP 

*< gopsize = 4

GOP_PRESET_IDX_IBBBB 

*< Consecutive P, cyclic gopsize = 4

GOP_PRESET_IDX_RA_IB 

*< Consecutive B, cyclic gopsize = 4

GOP_PRESET_IDX_SP 

*< Random Access, cyclic gopsize = 8

GOP_PRESET_IDX_17 

*< Consecutive P, gopsize=1, similar to 2 but

GOP_PRESET_IDX_18 

*< GOP_PRESET_IDX_ALL_I, poc_type=2

GOP_PRESET_IDX_19 

*< GOP_PRESET_IDX_IPP, poc_type=2

GOP_PRESET_IDX_20 

*< GOP_PRESET_IDX_IBBB, poc_type=2

GOP_PRESET_IDX_21 

*< GOP_PRESET_IDX_IPPPP, poc_type=2

GOP_PRESET_IDX_22 

*< GOP_PRESET_IDX_IBBBB, poc_type=2

Definition at line 256 of file ni_device_api_priv_logan.h.

◆ _ni_logan_xcoder_mgr_retcode

Enumerator
ni_logan_xcoder_request_success 
ni_logan_xcoder_request_pending 
ni_logan_xcoder_resource_recovery 
ni_logan_xcoder_resource_insufficient 
ni_logan_xcoder_general_error 

Definition at line 60 of file ni_device_api_priv_logan.h.

◆ ni_logan_bitstream_format_t

  • This is an enumeration for declaring codec standard type variables. Currently,
    VPU supports many different video standards such as H.265/HEVC, MPEG4 SP/ASP, H.263 Profile 3, H.264/AVC
    BP/MP/HP, VC1 SP/MP/AP, Divx3, MPEG1, MPEG2, RealVideo 8/9/10, AVS Jizhun/Guangdian profile, AVS2,
     Theora, VP3, VP8/VP9 and SVAC.
    
    NOTE: MPEG-1 decoder operation is handled as a special case of MPEG2 decoder.
    STD_THO must be always 9.
    
Enumerator
STD_AVC 
STD_VC1 
STD_MPEG2 
STD_MPEG4 
STD_H263 
STD_DIV3 
STD_RV 
STD_AVS 
STD_THO 
STD_VP3 
STD_VP8 
STD_HEVC 
STD_VP9 
STD_AVS2 
STD_SVAC 
STD_MAX 

Definition at line 290 of file ni_device_api_priv_logan.h.

◆ ni_logan_inst_config_rw_type_t

Enumerator
INST_READ_CONFIG 
INST_WRITE_CONFIG 

Definition at line 44 of file ni_device_api_priv_logan.h.

◆ ni_logan_instance_buf_info_rw_type_t

Enumerator
INST_BUF_INFO_RW_READ 
INST_BUF_INFO_RW_WRITE 
INST_BUF_INFO_RW_UPLOAD 
INST_BUF_INFO_R_ACQUIRE 

Definition at line 50 of file ni_device_api_priv_logan.h.

◆ ni_logan_set_param_option_t

  • This is an enumeration for declaring SET_PARAM command options. (_T400_ENC encoder only)
    Depending on this, SET_PARAM command parameter registers from 0x15C have different meanings.
Enumerator
OPT_COMMON 
OPT_CUSTOM_GOP 
OPT_SEI 
OPT_VUI 

Definition at line 559 of file ni_device_api_priv_logan.h.

Function Documentation

◆ ni_get_memory_offset()

ni_logan_retcode_t ni_get_memory_offset ( ni_logan_session_context_t p_ctx,
const ni_logan_hwframe_surface_t hwdesc,
unsigned int *  p_offset,
unsigned int  hwaddress 
)

Get an address offset from a hw descriptor.


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

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

Definition at line 8149 of file ni_device_api_priv_logan.c.

◆ ni_logan_change_priority()

void ni_logan_change_priority ( void  )

Set up schedule priority. First try to run with RR mode. If fails, try to set nice value. If fails either, ignore it and run with default priority.


Parameters

Definition at line 8105 of file ni_device_api_priv_logan.c.

◆ ni_logan_check_common_params()

ni_logan_retcode_t ni_logan_check_common_params ( ni_logan_t408_config_t p_param,
ni_logan_encoder_params_t p_src,
char *  param_err,
uint32_t  max_err_len 
)

check the range of common parameters


Parameters

Definition at line 6231 of file ni_device_api_priv_logan.c.

◆ ni_logan_check_ratecontrol_params()

ni_logan_retcode_t ni_logan_check_ratecontrol_params ( ni_logan_encoder_config_t p_cfg,
char *  param_err,
uint32_t  max_err_len 
)

check the range of rate control parameters


Parameters

Definition at line 6486 of file ni_device_api_priv_logan.c.

◆ ni_logan_clear_instance_buf()

ni_logan_retcode_t ni_logan_clear_instance_buf ( ni_logan_hwframe_surface_t surface,
ni_device_handle_t  device_handle,
ni_event_handle_t  event_handle 
)

clear a particular xcoder instance buffer/data


Parameters
ni_logan_frame_surface1_t*surface - target hardware descriptor
ni_device_handle_tdevice_handle - device handle
ni_event_handle_tevent_handle - event handle
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

clear a particular xcoder instance buffer/data


Parameters
ni_logan_hwframe_surface_t*hwdesc - xcoder hardware descriptor
ni_device_handle_tdevice_handle - device handle
ni_event_handle_tevent_handle - event handle
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 7325 of file ni_device_api_priv_logan.c.

◆ ni_logan_config_instance_eos()

ni_logan_retcode_t ni_logan_config_instance_eos ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type 
)

Send a p_config command for End Of Stream.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 4027 of file ni_device_api_priv_logan.c.

◆ ni_logan_config_instance_flush()

ni_logan_retcode_t ni_logan_config_instance_flush ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type 
)

Send a p_config command Flush Of Stream.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Send a p_config command Flush Of Stream.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 4082 of file ni_device_api_priv_logan.c.

◆ ni_logan_config_instance_set_encoder_params()

ni_logan_retcode_t ni_logan_config_instance_set_encoder_params ( ni_logan_session_context_t p_ctx)

Send a p_config command to configure encoding parameters.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 4134 of file ni_device_api_priv_logan.c.

◆ ni_logan_config_instance_sos()

ni_logan_retcode_t ni_logan_config_instance_sos ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type 
)

Send a p_config command for Start Of Stream.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION. NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder, Decoder or Uploader
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION. NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 3971 of file ni_device_api_priv_logan.c.

◆ ni_logan_config_instance_update_encoder_params()

ni_logan_retcode_t ni_logan_config_instance_update_encoder_params ( ni_logan_session_context_t p_ctx,
ni_logan_param_change_flags_t  change_flags 
)

updates encoder parameters based on change flags structure


Parameters

◆ ni_logan_create_frame()

int ni_logan_create_frame ( ni_logan_frame_t p_frame,
uint32_t  read_length,
uint64_t *  p_frame_offset,
bool  is_hw_frame 
)

Get info from received p_frame.


Parameters
ni_logan_frame_t*p_frame - ni_logan_frame_t
uint32_tread_length - buffer length in p_frame
uint64_t*frame_offset - frame offset
boolis_hw_frame - 0: software frame, 1: hardware frame
Returns
frame size

Parameters

Definition at line 4382 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_close()

ni_logan_retcode_t ni_logan_decoder_session_close ( ni_logan_session_context_t p_ctx,
int  eos_recieved 
)

Close a xcoder decoder instance.


Parameters

Definition at line 1055 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_copy_internal()

ni_logan_retcode_t ni_logan_decoder_session_copy_internal ( ni_logan_session_context_t src_p_ctx,
ni_logan_session_context_t dst_p_ctx 
)

Copy a xcoder decoder card info and create worker thread.


Parameters
ni_logan_session_context_tp_ctx - source xcoder Context
ni_logan_session_context_tp_ctx - destination xcoder Context
Returns
NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_INVALID_PARAM on failure

Definition at line 7080 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_flush()

ni_logan_retcode_t ni_logan_decoder_session_flush ( ni_logan_session_context_t p_ctx)

Flush decoder output.


Parameters

Definition at line 964 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_flush_buffers()

ni_logan_retcode_t ni_logan_decoder_session_flush_buffers ( ni_logan_session_context_t p_ctx)

Flush decoder output.


Parameters
ni_logan_session_context_t*p_ctx - xcoder Context
Returns
NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_INVALID_PARAM or NI_LOGAN_RETCODE_ERROR_INVALID_SESSION on failure

Definition at line 1010 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_open()

ni_logan_retcode_t ni_logan_decoder_session_open ( ni_logan_session_context_t p_ctx)

Open a xcoder decoder instance.


Parameters

Definition at line 631 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_query()

int ni_logan_decoder_session_query ( ni_logan_session_context_t p_ctx)

Query current decoder status.


Parameters

Definition at line 2210 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_read()

int ni_logan_decoder_session_read ( ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_frame 
)

Retrieve a YUV p_frame from decoder.


Parameters

Definition at line 1537 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_read_desc()

int ni_logan_decoder_session_read_desc ( ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_frame 
)

Retrieve a hw desc p_frame from decoder When yuvbypass enabled, this is used for decoder to read hardware frame index, extra data and meta data.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_frame_t*p_frame - xcoder frame
ni_logan_hwframe_surface_t*hwdesc - xcoder hardware descriptor
Returns
rx_size on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_frame_t*p_frame - xcoder frame
Returns
rx_size on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Definition at line 7423 of file ni_device_api_priv_logan.c.

◆ ni_logan_decoder_session_write()

int ni_logan_decoder_session_write ( ni_logan_session_context_t p_ctx,
ni_logan_packet_t p_packet 
)

Send a video p_packet to decoder.


Parameters

Definition at line 1216 of file ni_device_api_priv_logan.c.

◆ ni_logan_encoder_session_close()

ni_logan_retcode_t ni_logan_encoder_session_close ( ni_logan_session_context_t p_ctx,
int  eos_recieved 
)

Close a xcoder encoder instance.


Parameters

Definition at line 2607 of file ni_device_api_priv_logan.c.

◆ ni_logan_encoder_session_flush()

ni_logan_retcode_t ni_logan_encoder_session_flush ( ni_logan_session_context_t p_ctx)

Flush encoder output.


Parameters

Definition at line 2559 of file ni_device_api_priv_logan.c.

◆ ni_logan_encoder_session_open()

ni_logan_retcode_t ni_logan_encoder_session_open ( ni_logan_session_context_t p_ctx)

Open a xcoder encoder instance.


Parameters

Definition at line 2250 of file ni_device_api_priv_logan.c.

◆ ni_logan_encoder_session_query()

int ni_logan_encoder_session_query ( ni_logan_session_context_t p_ctx)

Query current encoder status.


Parameters

Definition at line 3406 of file ni_device_api_priv_logan.c.

◆ ni_logan_encoder_session_read()

int ni_logan_encoder_session_read ( ni_logan_session_context_t p_ctx,
ni_logan_packet_t p_packet 
)

Retrieve an encoded packet from encoder.


Parameters

Definition at line 3110 of file ni_device_api_priv_logan.c.

◆ ni_logan_encoder_session_write()

int ni_logan_encoder_session_write ( ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_frame 
)

Send a YUV p_frame to encoder.


Parameters

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

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

Definition at line 2758 of file ni_device_api_priv_logan.c.

◆ ni_logan_fix_VUI()

void ni_logan_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

◆ ni_logan_hwdownload_session_read()

int ni_logan_hwdownload_session_read ( ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_frame,
ni_logan_hwframe_surface_t hwdesc 
)

Retrieve a YUV through HW descriptor from decoder.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_frame_t*p_frame - xcoder frame
ni_logan_hwframe_surface_t*hwdesc - xcoder hardware descriptor
Returns
rx_size on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Definition at line 7873 of file ni_device_api_priv_logan.c.

◆ ni_logan_hwupload_init_framepool()

int ni_logan_hwupload_init_framepool ( ni_logan_session_context_t p_ctx,
uint32_t  pool_size,
uint32_t  p2p_pool 
)

Setup framepool for hwupload. Uses decoder framepool.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
uint32_tpool_size - buffer pool in HW
Returns
NI_LOGAN_RETCODE_SUCCESS on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Definition at line 8033 of file ni_device_api_priv_logan.c.

◆ ni_logan_hwupload_session_read_hwdesc()

int ni_logan_hwupload_session_read_hwdesc ( ni_logan_session_context_t p_ctx,
ni_logan_hwframe_surface_t hwdesc,
unsigned int *  hwaddress 
)

Retrieve a HW descriptor of uploaded frame The HW descriptor will contain the YUV frame index, which stored in HW through ni_logan_hwupload_session_write().


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_hwframe_surface_t*hwdesc - xcoder hardware descriptor
Returns
NI_LOGAN_RETCODE_SUCCESS on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Definition at line 7250 of file ni_device_api_priv_logan.c.

◆ ni_logan_hwupload_session_write()

int ni_logan_hwupload_session_write ( ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_frame 
)

Send a YUV to hardware, hardware will store it.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_frame_t*p_frame - xcoder frame
Returns
NI_LOGAN_RETCODE_SUCCESS on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Definition at line 7107 of file ni_device_api_priv_logan.c.

◆ ni_logan_params_print()

void ni_logan_params_print ( void *const  p_codec_params,
ni_logan_device_type_t  device_type 
)

Print xcoder user configurations.


Parameters

Definition at line 6534 of file ni_device_api_priv_logan.c.

◆ ni_logan_populate_device_capability_struct()

void ni_logan_populate_device_capability_struct ( ni_logan_device_capability_t p_cap,
void *  p_data 
)

Get info from received xcoder capability.


Parameters

Definition at line 4617 of file ni_device_api_priv_logan.c.

◆ ni_logan_populate_serial_number()

void ni_logan_populate_serial_number ( ni_logan_serial_num_t p_serial_num,
void *  p_data 
)

Get Card Serial Number from received Nvme Indentify info.


Parameters

Definition at line 7386 of file ni_device_api_priv_logan.c.

◆ ni_logan_query_general_status()

ni_logan_retcode_t ni_logan_query_general_status ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type,
ni_logan_instance_mgr_general_status_t p_gen_status 
)

Query a particular xcoder instance to get GeneralStatus data.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_logan_instance_mgr_general_status_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 3454 of file ni_device_api_priv_logan.c.

◆ ni_logan_query_instance_buf_info()

ni_logan_retcode_t ni_logan_query_instance_buf_info ( ni_logan_session_context_t p_ctx,
ni_logan_instance_buf_info_rw_type_t  rw_type,
ni_logan_device_type_t  device_type,
ni_logan_instance_buf_info_t p_inst_buf_info,
bool  is_hw 
)

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


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_instance_buf_info_rw_type_trw_type
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_logan_instance_buf_info_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 3773 of file ni_device_api_priv_logan.c.

◆ ni_logan_query_status_info()

ni_logan_retcode_t ni_logan_query_status_info ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type,
ni_logan_instance_status_info_t p_status_info,
int  rc,
int  opcode 
)

Query a particular xcoder instance to get status Info data.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_logan_instance_status_info_t*out - Struct preallocated from the caller where the resulting data will be placed
intrc - rc returned by the last call
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_logan_instance_status_info_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 3609 of file ni_device_api_priv_logan.c.

◆ ni_logan_query_stream_info()

ni_logan_retcode_t ni_logan_query_stream_info ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type,
ni_logan_instance_mgr_stream_info_t p_stream_info,
bool  is_hw 
)

Query a particular xcoder instance to get Stream Info data.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
ni_logan_device_type_tdevice_type - xcoder type Encoder or Decoder
ni_logan_instance_mgr_stream_info_t*out - Struct preallocated from the caller where the resulting data will be placed
Returns
- NI_LOGAN_RETCODE_SUCCESS on success, NI_LOGAN_RETCODE_ERROR_INVALID_SESSION, NI_LOGAN_RETCODE_ERROR_MEM_ALOC or NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED on failure

Definition at line 3526 of file ni_device_api_priv_logan.c.

◆ ni_logan_send_session_keep_alive()

ni_logan_retcode_t ni_logan_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 912 of file ni_device_api_priv_logan.c.

◆ ni_logan_session_keep_alive_thread()

void* ni_logan_session_keep_alive_thread ( void *  arguments)

decoder keep alive thread function triggers every 1 second


Parameters
voidthread args
Returns
void

Definition at line 6664 of file ni_device_api_priv_logan.c.

◆ ni_logan_set_custom_template()

void ni_logan_set_custom_template ( ni_logan_session_context_t p_ctx,
ni_logan_encoder_config_t p_cfg,
ni_logan_encoder_params_t p_src 
)

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


Parameters

Definition at line 4785 of file ni_device_api_priv_logan.c.

◆ ni_logan_set_default_template()

void ni_logan_set_default_template ( ni_logan_session_context_t p_ctx,
ni_logan_encoder_config_t p_config 
)

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


Parameters

Definition at line 5436 of file ni_device_api_priv_logan.c.

◆ ni_logan_uploader_session_open()

ni_logan_retcode_t ni_logan_uploader_session_open ( ni_logan_session_context_t p_ctx)

Open a xcoder uploader instance.


Parameters
ni_logan_session_context_tp_ctx - xcoder Context
Returns
NI_LOGAN_RETCODE_SUCCESS on success, negative value like NI_LOGAN_RETCODE_FAILURE in ni_logan_retcode_t on failure

Definition at line 6780 of file ni_device_api_priv_logan.c.

◆ ni_logan_validate_custom_template()

ni_logan_retcode_t ni_logan_validate_custom_template ( ni_logan_session_context_t p_ctx,
ni_logan_encoder_config_t p_cfg,
ni_logan_encoder_params_t p_src,
char *  p_param_err,
uint32_t  max_err_len 
)

Perform validation on custom parameters (Rev. B)


Parameters

Definition at line 5689 of file ni_device_api_priv_logan.c.