libxcoder  3.5.1
ni_device_api_logan.c File Reference

Main NETINT device API file provides the ability to communicate with NI T-408 type hardware transcoder devices. More...

Go to the source code of this file.

Data Structures

struct  _ni_err_rc_txt_entry
 

Macros

#define atoi(p_str)   ni_logan_atoi(p_str, &b_error)
 
#define atof(p_str)   ni_logan_atof(p_str, &b_error)
 
#define atobool(p_str)   (ni_logan_atobool(p_str, &b_error))
 
#define OPT(STR)   else if (!strcasecmp(name, STR))
 
#define OPT2(STR1, STR2)   else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))
 
#define atoi(p_str)   ni_logan_atoi(p_str, &b_error)
 
#define atof(p_str)   ni_logan_atof(p_str, &b_error)
 
#define atobool(p_str)   (ni_logan_atobool(p_str, &b_error))
 
#define OPT(STR)   else if (!strcasecmp(name, STR))
 
#define OPT2(STR1, STR2)   else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))
 
#define COMPARE(STR1, STR2, STR3)
 
#define COMPARE_F(STR1, STR2, STR3)
 
#define CHECK2VAL(STR, VAL1, VAL2)
 
#define atoi(p_str)   ni_logan_atoi(p_str, &b_error)
 
#define atof(p_str)   ni_logan_atof(p_str, &b_error)
 
#define atobool(p_str)   (ni_logan_atobool(p_str, &b_error))
 
#define OPT(STR)   else if (!strcasecmp(name, STR))
 

Typedefs

typedef struct _ni_err_rc_txt_entry ni_logan_err2str_entry_t
 

Functions

const char * ni_logan_err2str (int err)
 Convert error numver into error messages. More...
 
ni_logan_session_context_tni_logan_device_session_context_alloc_init (void)
 Allocates and initializes a new ni_logan_session_context_t struct. More...
 
void ni_logan_device_session_context_free (ni_logan_session_context_t *p_ctx)
 Frees previously allocated session context. More...
 
void ni_logan_device_session_context_init (ni_logan_session_context_t *p_ctx)
 Initialize already allocated session context to a known state. More...
 
void ni_logan_device_session_context_clear (ni_logan_session_context_t *p_ctx)
 Clear already allocated session context to all zeros. More...
 
ni_event_handle_t ni_logan_create_event (void)
 Create event and returnes event handle if successful. More...
 
void ni_logan_close_event (ni_event_handle_t event_handle)
 Closes event and releases resources. More...
 
ni_device_handle_t ni_logan_device_open (const char *p_dev, uint32_t *p_max_io_size_out)
 Opens device and returnes device device_handle if successful. More...
 
void ni_logan_device_close (ni_device_handle_t device_handle)
 Closes device and releases resources. More...
 
ni_logan_retcode_t ni_logan_device_capability_query (ni_device_handle_t device_handle, ni_logan_device_capability_t *p_cap)
 Queries device and returns device capability structure. More...
 
ni_logan_retcode_t ni_logan_device_session_open (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
 Opens a new device session depending on the device_type parameter If device_type is NI_LOGAN_DEVICE_TYPE_DECODER opens decoding session If device_type is NI_LOGAN_DEVICE_TYPE_EECODER opens encoding session. More...
 
ni_logan_retcode_t ni_logan_device_session_close (ni_logan_session_context_t *p_ctx, int eos_recieved, ni_logan_device_type_t device_type)
 Closes device session that was previously opened by calling ni_logan_device_session_open() If device_type is NI_LOGAN_DEVICE_TYPE_DECODER closes decoding session If device_type is NI_LOGAN_DEVICE_TYPE_EECODER closes encoding session. More...
 
ni_logan_retcode_t ni_logan_device_session_flush (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
 Sends a flush command to the device ni_logan_device_session_open() If device_type is NI_LOGAN_DEVICE_TYPE_DECODER sends flush command to decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER sends flush command to decoder. More...
 
ni_logan_retcode_t ni_logan_decoder_session_send_flush (ni_logan_session_context_t *p_ctx)
 Sends a flush command to the decoder ni_logan_device_session_open() More...
 
ni_logan_retcode_t ni_logan_device_dec_session_save_hdrs (ni_logan_session_context_t *p_ctx, uint8_t *hdr_data, uint8_t hdr_size)
 Save a stream's headers in a decoder session that can be used later for continuous decoding from the same source. More...
 
LIB_API ni_logan_retcode_t ni_logan_device_dec_session_flush (ni_logan_session_context_t *p_ctx)
 Flush a decoder session to get ready to continue decoding. More...
 
int ni_logan_device_session_write (ni_logan_session_context_t *p_ctx, ni_logan_session_data_io_t *p_data, ni_logan_device_type_t device_type)
 Sends data the device If device_type is NI_LOGAN_DEVICE_TYPE_DECODER sends data packet to decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER sends data frame to encoder. More...
 
int ni_logan_device_session_read (ni_logan_session_context_t *p_ctx, ni_logan_session_data_io_t *p_data, ni_logan_device_type_t device_type)
 Reads data the device If device_type is NI_LOGAN_DEVICE_TYPE_DECODER reads data packet from decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER reads data frame from encoder. More...
 
ni_logan_retcode_t ni_logan_device_session_query (ni_logan_session_context_t *p_ctx, ni_logan_device_type_t device_type)
 Query session data from the device - Currently not implemented If device_type is NI_LOGAN_DEVICE_TYPE_DECODER query session data from decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER query session data from encoder. More...
 
ni_logan_retcode_t ni_logan_frame_buffer_alloc (ni_logan_frame_t *p_frame, int video_width, int video_height, int alignment, int metadata_flag, int factor, int hw_frame_count)
 Allocate preliminary memory for the frame buffer for encoding based on provided parameters. Applicable to YUV420 Planar pixel format only, 8 or 10 bit/pixel. More...
 
ni_logan_retcode_t ni_logan_decoder_frame_buffer_alloc (ni_logan_buf_pool_t *p_pool, ni_logan_frame_t *p_frame, int alloc_mem, int video_width, int video_height, int alignment, int factor)
 Allocate memory for decoder frame buffer based on provided parameters; the memory is retrieved from a buffer pool and will be returned to the same buffer pool by ni_logan_decoder_frame_buffer_free. Note: all attributes of ni_logan_frame_t will be set up except for memory and buffer, which rely on the pool being allocated; the pool will be allocated only after the frame resolution is known. More...
 
ni_logan_retcode_t ni_logan_encoder_frame_buffer_alloc (ni_logan_frame_t *p_frame, int video_width, int video_height, int linesize[], int alignment, int extra_len, int factor)
 Allocate memory for the frame buffer for encoding based on given parameters, taking into account pic line size and extra data. Applicable to YUV420p AVFrame only. 8 or 10 bit/pixel. Cb/Cr size matches that of Y. More...
 
ni_logan_retcode_t ni_logan_frame_buffer_free (ni_logan_frame_t *p_frame)
 Free frame buffer that was previously allocated with either ni_logan_frame_buffer_alloc or ni_logan_encoder_frame_buffer_alloc. More...
 
ni_logan_retcode_t ni_logan_decoder_frame_buffer_free (ni_logan_frame_t *p_frame)
 Free decoder frame buffer that was previously allocated with ni_logan_decoder_frame_buffer_alloc, returning memory to a buffer pool. More...
 
void ni_logan_decoder_frame_buffer_pool_return_buf (ni_logan_buf_t *buf, ni_logan_buf_pool_t *p_buffer_pool)
 Return a memory buffer to memory buffer pool. More...
 
ni_logan_retcode_t ni_logan_packet_buffer_alloc (ni_logan_packet_t *p_packet, int packet_size)
 Allocate memory for the packet buffer based on provided packet size. More...
 
ni_logan_retcode_t ni_logan_packet_buffer_free (ni_logan_packet_t *p_packet)
 Free packet buffer that was previously allocated with either ni_logan_packet_buffer_alloc. More...
 
int ni_logan_packet_copy (void *p_destination, const void *const p_source, int cur_size, void *p_leftover, int *p_prev_size)
 Copy video packet accounting for allighment. More...
 
ni_logan_retcode_t ni_logan_encoder_init_default_params (ni_logan_encoder_params_t *p_param, int fps_num, int fps_denom, long bit_rate, int width, int height)
 Initialize default encoder parameters. More...
 
ni_logan_retcode_t ni_logan_decoder_init_default_params (ni_logan_decoder_params_t *p_param, int fps_num, int fps_denom, long bit_rate, int width, int height)
 Initialize default decoder parameters. More...
 
ni_logan_retcode_t ni_logan_parse_reconf_file (const char *reconf_file, int hash_map[100][10])
 
ni_logan_retcode_t ni_logan_decoder_params_set_value (ni_logan_decoder_params_t *p_params, const char *name, char *value)
 Set value referenced by name in decoder parameters structure. More...
 
ni_logan_retcode_t ni_logan_encoder_params_set_value (ni_logan_encoder_params_t *p_params, const char *name, const char *value, ni_logan_session_context_t *ctx)
 Set value referenced by name in encoder parameters structure. More...
 
ni_logan_retcode_t ni_logan_encoder_params_check (ni_logan_encoder_params_t *p_params, ni_logan_codec_format_t codec)
 Validate relationship of some params in encoder parameters structure. More...
 
ni_logan_retcode_t ni_logan_encoder_gop_params_set_value (ni_logan_encoder_params_t *p_params, const char *name, const char *value)
 Set got parameter value referenced by name in encoder parameters structure. More...
 
int ni_logan_get_num_reorder_of_gop_structure (ni_logan_encoder_params_t *p_params)
 Get GOP's max number of reorder frames. More...
 
int ni_logan_get_num_ref_frame_of_gop_structure (ni_logan_encoder_params_t *p_params)
 Get GOP's number of reference frames. More...
 
ni_aux_data_tni_logan_frame_new_aux_data (ni_logan_frame_t *frame, ni_aux_data_type_t type, int data_size)
 Add a new auxiliary data to a frame. More...
 
ni_aux_data_tni_logan_frame_new_aux_data_from_raw_data (ni_logan_frame_t *frame, ni_aux_data_type_t type, const uint8_t *raw_data, int data_size)
 Add a new auxiliary data to a frame and copy in the raw data. More...
 
ni_aux_data_tni_logan_frame_get_aux_data (const ni_logan_frame_t *frame, ni_aux_data_type_t type)
 Retrieve from the frame auxiliary data of a given type if exists. More...
 
void ni_logan_frame_free_aux_data (ni_logan_frame_t *frame, ni_aux_data_type_t type)
 If auxiliary data of the given type exists in the frame, free it and remove it from the frame. More...
 
void ni_logan_frame_wipe_aux_data (ni_logan_frame_t *frame)
 Free and remove all auxiliary data from the frame. More...
 
ni_logan_retcode_t ni_logan_device_handle_map_SN (ni_device_handle_t device_handle, ni_logan_serial_num_t *p_serial_num)
 Queries device Serial number. More...
 
ni_logan_retcode_t ni_logan_device_session_copy (ni_logan_session_context_t *src_p_ctx, ni_logan_session_context_t *dst_p_ctx)
 Copies existing decoding session params for hw frame usage. More...
 
int ni_logan_device_session_read_hwdesc (ni_logan_session_context_t *p_ctx, ni_logan_session_data_io_t *p_data)
 Reads data from the device device_type should be NI_LOGAN_DEVICE_TYPE_DECODER, and reads data hwdesc from decoder when hw transcoding. More...
 
int ni_logan_device_session_hwdl (ni_logan_session_context_t *p_ctx, ni_logan_session_data_io_t *p_data, ni_logan_hwframe_surface_t *hwdesc)
 Reads data from hw descriptor from decoder output buffer. More...
 
int ni_logan_device_session_hwup (ni_logan_session_context_t *p_ctx, ni_logan_session_data_io_t *p_src_data, ni_logan_hwframe_surface_t *hwdesc)
 Writes data and reads back hw descriptor from decoder output buffer. More...
 
ni_logan_retcode_t ni_logan_frame_buffer_alloc_hwenc (ni_logan_frame_t *p_frame, int video_width, int video_height, int extra_len)
 Allocate memory for the frame buffer based on provided parameters taking into account pic line size and extra data. Applicable to YUV420p AVFrame for hw only. More...
 
int ni_calculate_total_frame_size (const ni_logan_session_context_t *p_upl_ctx, const int linesize[], const int heightsize[])
 Calculate the total size of a frame based on the upload context attributes and includes rounding up to the page size. More...
 
int ni_logan_device_session_acquire (ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
 Acquire a P2P frame buffer from the hwupload session. More...
 
ni_logan_retcode_t ni_logan_uploader_frame_buffer_lock (ni_logan_session_context_t *p_upl_ctx, ni_logan_frame_t *p_frame)
 Lock a hardware P2P frame prior to encoding. More...
 
ni_logan_retcode_t ni_logan_uploader_frame_buffer_unlock (ni_logan_session_context_t *p_upl_ctx, ni_logan_frame_t *p_frame)
 Unlock a hardware P2P frame after encoding. More...
 
ni_logan_retcode_t ni_logan_uploader_p2p_test_send (ni_logan_session_context_t *p_upl_ctx, uint8_t *p_data, uint32_t len, ni_logan_frame_t *p_hwframe)
 Special P2P test API function. Copies YUV data from the software frame to the hardware P2P frame on the T408 device. More...
 
LIB_API ni_logan_retcode_t ni_logan_encoder_set_input_frame_format (ni_logan_session_context_t *p_enc_ctx, ni_logan_encoder_params_t *p_enc_params, int width, int height, int bit_depth, int src_endian)
 Set the incoming frame format for the encoder. More...
 
ni_logan_retcode_t ni_logan_decode_buffer_free (ni_logan_hwframe_surface_t *surface, ni_device_handle_t device_handle, ni_event_handle_t event_handle)
 Recycle a frame buffer on card. More...
 
int ni_logan_device_session_init_framepool (ni_logan_session_context_t *p_ctx, uint32_t pool_size, uint32_t p2p_pool)
 Sends frame pool setup info to device. More...
 
ni_logan_retcode_t ni_logan_frame_buffer_alloc_v4 (ni_logan_frame_t *p_frame, int pixel_format, int video_width, int video_height, int linesize[], int alignment, int extra_len)
 Allocate memory for the frame buffer based on provided parameters taking into account width, height, format, stride, alignment, and extra data. More...
 
ni_logan_retcode_t ni_logan_frame_zerocopy_buffer_alloc (ni_logan_frame_t *p_frame, int video_width, int video_height, int linesize[], int extra_len, int factor, uint8_t *buffer[])
 Allocate memory for the frame buffer based on provided parameters Applicable to use YUV420p AVFrame for zerocopy case. Allocat extra_len only. More...
 
LIB_API ni_logan_retcode_t ni_logan_frame_zerocopy_check (const int width, const int height, const int linesize[], const int dst_stride[], const int src_height[], const int dst_height[], const int bit_depth_factor, const uint8_t *data[])
 Check if incoming frame is encoder zero copy compatible or not. More...
 
LIB_API ni_logan_retcode_t is_logan_fw_rev_higher (ni_logan_session_context_t *p_ctx, int fw_api_fla, int fw_api_ver)
 Check if logan firmware version is higher than expected api flavor and version. More...
 

Variables

const char *const g_logan_xcoder_preset_names [NI_LOGAN_XCODER_PRESET_NAMES_ARRAY_LEN]
 
const char *const g_logan_xcoder_log_names [NI_LOGAN_XCODER_LOG_NAMES_ARRAY_LEN]
 

Detailed Description

Main NETINT device API file provides the ability to communicate with NI T-408 type hardware transcoder devices.


Definition in file ni_device_api_logan.c.

Macro Definition Documentation

◆ atobool [1/3]

#define atobool (   p_str)    (ni_logan_atobool(p_str, &b_error))

Definition at line 3788 of file ni_device_api_logan.c.

◆ atobool [2/3]

#define atobool (   p_str)    (ni_logan_atobool(p_str, &b_error))

Definition at line 3788 of file ni_device_api_logan.c.

◆ atobool [3/3]

#define atobool (   p_str)    (ni_logan_atobool(p_str, &b_error))

Definition at line 3788 of file ni_device_api_logan.c.

◆ atof [1/3]

#define atof (   p_str)    ni_logan_atof(p_str, &b_error)

Definition at line 3787 of file ni_device_api_logan.c.

◆ atof [2/3]

#define atof (   p_str)    ni_logan_atof(p_str, &b_error)

Definition at line 3787 of file ni_device_api_logan.c.

◆ atof [3/3]

#define atof (   p_str)    ni_logan_atof(p_str, &b_error)

Definition at line 3787 of file ni_device_api_logan.c.

◆ atoi [1/3]

#define atoi (   p_str)    ni_logan_atoi(p_str, &b_error)

Definition at line 3786 of file ni_device_api_logan.c.

◆ atoi [2/3]

#define atoi (   p_str)    ni_logan_atoi(p_str, &b_error)

Definition at line 3786 of file ni_device_api_logan.c.

◆ atoi [3/3]

#define atoi (   p_str)    ni_logan_atoi(p_str, &b_error)

Definition at line 3786 of file ni_device_api_logan.c.

◆ CHECK2VAL

#define CHECK2VAL (   STR,
  VAL1,
  VAL2 
)
Value:
if (atoi(STR) != VAL1 && atoi(STR) != VAL2) \
{ \
ni_log(NI_LOG_ERROR, "Invalid %s: out of range\n", name); \
}
@ NI_LOGAN_RETCODE_PARAM_ERROR_OOR
#define atoi(p_str)
@ NI_LOG_ERROR
Definition: ni_log_logan.h:64

◆ COMPARE

#define COMPARE (   STR1,
  STR2,
  STR3 
)
Value:
if ((atoi(STR1) > STR2) || (atoi(STR1) < STR3)) \
{ \
ni_log(NI_LOG_ERROR, "Invalid %s: out of range\n", name); \
}

◆ COMPARE_F

#define COMPARE_F (   STR1,
  STR2,
  STR3 
)
Value:
if ((atof(STR1) > STR2) || (atof(STR1) < STR3)) \
{ \
}
#define atof(p_str)

◆ OPT [1/3]

#define OPT (   STR)    else if (!strcasecmp(name, STR))

◆ OPT [2/3]

#define OPT (   STR)    else if (!strcasecmp(name, STR))

◆ OPT [3/3]

#define OPT (   STR)    else if (!strcasecmp(name, STR))

◆ OPT2 [1/2]

#define OPT2 (   STR1,
  STR2 
)    else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))

◆ OPT2 [2/2]

#define OPT2 (   STR1,
  STR2 
)    else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))

Typedef Documentation

◆ ni_logan_err2str_entry_t

Function Documentation

◆ is_logan_fw_rev_higher()

LIB_API ni_logan_retcode_t is_logan_fw_rev_higher ( ni_logan_session_context_t p_ctx,
int  fw_api_fla,
int  fw_api_ver 
)

Check if logan firmware version is higher than expected api flavor and version.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]fw_api_flaexpected firmware api flavor
[in]fw_api_verexpected firmware api version
Returns
on success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE

Definition at line 5573 of file ni_device_api_logan.c.

◆ ni_calculate_total_frame_size()

int ni_calculate_total_frame_size ( const ni_logan_session_context_t p_upl_ctx,
const int  linesize[],
const int  heightsize[] 
)

Calculate the total size of a frame based on the upload context attributes and includes rounding up to the page size.


Parameters
[in]p_upl_ctxpointer to an uploader session context
[in]linesizearray of line stride
Returns
size NI_RETCODE_INVALID_PARAM

Definition at line 4796 of file ni_device_api_logan.c.

◆ ni_logan_close_event()

void ni_logan_close_event ( ni_event_handle_t  event_handle)

Closes event and releases resources.


Returns
NONE

Definition at line 323 of file ni_device_api_logan.c.

◆ ni_logan_create_event()

ni_event_handle_t ni_logan_create_event ( void  )

Create event and returnes event handle if successful.


Returns
On success returns a event handle On failure returns NI_INVALID_EVENT_HANDLE

Definition at line 290 of file ni_device_api_logan.c.

◆ ni_logan_decode_buffer_free()

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

Recycle a frame buffer on card.

POPULATE ME LATER.


Parameters
[in]surfaceStuct containing device and frame location to clear out
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 5182 of file ni_device_api_logan.c.

◆ ni_logan_decoder_frame_buffer_alloc()

ni_logan_retcode_t ni_logan_decoder_frame_buffer_alloc ( ni_logan_buf_pool_t p_pool,
ni_logan_frame_t p_frame,
int  alloc_mem,
int  video_width,
int  video_height,
int  alignment,
int  factor 
)

Allocate memory for decoder frame buffer based on provided parameters; the memory is retrieved from a buffer pool and will be returned to the same buffer pool by ni_logan_decoder_frame_buffer_free. Note: all attributes of ni_logan_frame_t will be set up except for memory and buffer, which rely on the pool being allocated; the pool will be allocated only after the frame resolution is known.


Parameters
[in]p_poolBuffer pool to get the memory from
[in]p_framePointer to a caller allocated ni_logan_frame_t struct
[in]alloc_memWhether to get memory from buffer pool
[in]video_widthWidth of the video frame
[in]video_heightHeight of the video frame
[in]alignmentAllignment requirement
[in]factor1 for 8 bits/pixel format, 2 for 10 bits/pixel
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 1950 of file ni_device_api_logan.c.

◆ ni_logan_decoder_frame_buffer_free()

ni_logan_retcode_t ni_logan_decoder_frame_buffer_free ( ni_logan_frame_t p_frame)

Free decoder frame buffer that was previously allocated with ni_logan_decoder_frame_buffer_alloc, returning memory to a buffer pool.


Parameters
[in]p_framePointer to a previously allocated ni_logan_frame_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 2243 of file ni_device_api_logan.c.

◆ ni_logan_decoder_frame_buffer_pool_return_buf()

void ni_logan_decoder_frame_buffer_pool_return_buf ( ni_logan_buf_t buf,
ni_logan_buf_pool_t p_buffer_pool 
)

Return a memory buffer to memory buffer pool.

Return a memory buffer to memory buffer pool, for a decoder frame.


Parameters
[in]bufBuffer to be returned.
[in]p_buffer_poolBuffer pool to return buffer to.
Returns
None

Definition at line 2293 of file ni_device_api_logan.c.

◆ ni_logan_decoder_init_default_params()

ni_logan_retcode_t ni_logan_decoder_init_default_params ( ni_logan_decoder_params_t p_param,
int  fps_num,
int  fps_denom,
long  bit_rate,
int  width,
int  height 
)

Initialize default decoder parameters.


Parameters
[out]paramPointer to a user allocated ni_logan_decoder_params_t to initialize to default parameters
[in]fps_numFrames per second
[in]fps_denomFPS denomination
[in]bit_ratebit rate
[in]widthwidth
[in]heightheight
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 2696 of file ni_device_api_logan.c.

◆ ni_logan_decoder_params_set_value()

ni_logan_retcode_t ni_logan_decoder_params_set_value ( ni_logan_decoder_params_t p_params,
const char *  name,
char *  value 
)

Set value referenced by name in decoder parameters structure.


Parameters
[in]p_paramsPointer to a user allocated ni_logan_decoder_params_t to find and set a particular parameter
[in]nameString represented parameter name to search
[in]valueParameter value to set
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 2840 of file ni_device_api_logan.c.

◆ ni_logan_decoder_session_send_flush()

ni_logan_retcode_t ni_logan_decoder_session_send_flush ( ni_logan_session_context_t p_ctx)

Sends a flush command to the decoder ni_logan_device_session_open()


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1368 of file ni_device_api_logan.c.

◆ ni_logan_device_capability_query()

ni_logan_retcode_t ni_logan_device_capability_query ( ni_device_handle_t  device_handle,
ni_logan_device_capability_t p_cap 
)

Queries device and returns device capability structure.


Parameters
[in]device_handleDevice handle obtained by calling ni_logan_device_open()
[in]p_capPointer to a caller allocated ni_logan_device_capability_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED

Definition at line 568 of file ni_device_api_logan.c.

◆ ni_logan_device_close()

void ni_logan_device_close ( ni_device_handle_t  device_handle)

Closes device and releases resources.


Parameters
[in]device_handleDevice handle obtained by calling ni_logan_device_open()
Returns
NONE

Definition at line 502 of file ni_device_api_logan.c.

◆ ni_logan_device_dec_session_flush()

LIB_API ni_logan_retcode_t ni_logan_device_dec_session_flush ( ni_logan_session_context_t p_ctx)

Flush a decoder session to get ready to continue decoding.

Flush a decoder session to get ready to continue decoding. Note: this is different from ni_logan_device_session_flush in that it closes the current decode session and opens a new one for continuous decoding.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1460 of file ni_device_api_logan.c.

◆ ni_logan_device_dec_session_save_hdrs()

ni_logan_retcode_t ni_logan_device_dec_session_save_hdrs ( ni_logan_session_context_t p_ctx,
uint8_t *  hdr_data,
uint8_t  hdr_size 
)

Save a stream's headers in a decoder session that can be used later for continuous decoding from the same source.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]hdr_dataPointer to header data
[in]hdr_sizeSize of header data in bytes
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1403 of file ni_device_api_logan.c.

◆ ni_logan_device_handle_map_SN()

ni_logan_retcode_t ni_logan_device_handle_map_SN ( ni_device_handle_t  device_handle,
ni_logan_serial_num_t p_serial_num 
)

Queries device Serial number.


Parameters
[in]device_handleDevice handle used to backtrace serial Num
[in]p_serial_numPointer to a caller allocated ni_logan_serial_num_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED

Definition at line 4409 of file ni_device_api_logan.c.

◆ ni_logan_device_open()

ni_device_handle_t ni_logan_device_open ( const char *  p_dev,
uint32_t *  p_max_io_size_out 
)

Opens device and returnes device device_handle if successful.


Parameters
[in]p_devDevice name represented as c string. ex: "/dev/nvme0"
[out]p_max_io_size_outMaximum IO Transfer size supported
Returns
On success returns a device device_handle On failure returns NI_INVALID_DEVICE_HANDLE

Definition at line 385 of file ni_device_api_logan.c.

◆ ni_logan_device_session_acquire()

int ni_logan_device_session_acquire ( ni_logan_session_context_t p_ctx,
ni_logan_frame_t p_frame 
)

Acquire a P2P frame buffer from the hwupload session.


Parameters
[in]p_ctxPointer to a caller allocated ni_session_context_t struct
[out]p_framePointer to a caller allocated hw frame
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_INVALID_PARAM NI_RETCODE_ERROR_NVME_CMD_FAILED NI_RETCODE_ERROR_INVALID_SESSION

Definition at line 4862 of file ni_device_api_logan.c.

◆ ni_logan_device_session_close()

ni_logan_retcode_t ni_logan_device_session_close ( ni_logan_session_context_t p_ctx,
int  eos_recieved,
ni_logan_device_type_t  device_type 
)

Closes device session that was previously opened by calling ni_logan_device_session_open() If device_type is NI_LOGAN_DEVICE_TYPE_DECODER closes decoding session If device_type is NI_LOGAN_DEVICE_TYPE_EECODER closes encoding session.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]eos_recievedFlag indicating if End Of Stream indicator was recieved
[in]device_typeNI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1196 of file ni_device_api_logan.c.

◆ ni_logan_device_session_context_alloc_init()

ni_logan_session_context_t* ni_logan_device_session_context_alloc_init ( void  )

Allocates and initializes a new ni_logan_session_context_t struct.

Allocate and initialize a new ni_logan_session_context_t struct.


Returns
On success returns a valid pointer to newly allocated context On failure returns NULL

Definition at line 185 of file ni_device_api_logan.c.

◆ ni_logan_device_session_context_clear()

void ni_logan_device_session_context_clear ( ni_logan_session_context_t p_ctx)

Clear already allocated session context to all zeros.

Clear already allocated session context to all zeros buffer.


Parameters
[in]p_ctxPointer to an already allocated ni_logan_session_context_t struct

Definition at line 278 of file ni_device_api_logan.c.

◆ ni_logan_device_session_context_free()

void ni_logan_device_session_context_free ( ni_logan_session_context_t p_ctx)

Frees previously allocated session context.


Parameters
[in]p_ctxPointer to an already allocated ni_logan_session_context_t struct

Definition at line 210 of file ni_device_api_logan.c.

◆ ni_logan_device_session_context_init()

void ni_logan_device_session_context_init ( ni_logan_session_context_t p_ctx)

Initialize already allocated session context to a known state.


Parameters
[in]p_ctxPointer to an already allocated ni_logan_session_context_t struct

Definition at line 226 of file ni_device_api_logan.c.

◆ ni_logan_device_session_copy()

ni_logan_retcode_t ni_logan_device_session_copy ( ni_logan_session_context_t src_p_ctx,
ni_logan_session_context_t dst_p_ctx 
)

Copies existing decoding session params for hw frame usage.


Parameters
[in]src_p_ctxPointer to a caller allocated source ni_logan_session_context_t struct
[in]dst_p_ctxPointer to a caller allocated destination ni_logan_session_context_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 4478 of file ni_device_api_logan.c.

◆ ni_logan_device_session_flush()

ni_logan_retcode_t ni_logan_device_session_flush ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type 
)

Sends a flush command to the device ni_logan_device_session_open() If device_type is NI_LOGAN_DEVICE_TYPE_DECODER sends flush command to decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER sends flush command to decoder.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]device_typeNI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1316 of file ni_device_api_logan.c.

◆ ni_logan_device_session_hwdl()

int ni_logan_device_session_hwdl ( ni_logan_session_context_t p_ctx,
ni_logan_session_data_io_t p_data,
ni_logan_hwframe_surface_t hwdesc 
)

Reads data from hw descriptor from decoder output buffer.


Parameters
[in]p_dataPointer to a caller allocated ni_logan_session_data_io_t struct which contains either a ni_logan_frame_t data frame or ni_logan_packet_t data packet to send
[in]hwdescHW descriptor to find frame in XCODER
Returns
On success Total number of bytes read On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 4597 of file ni_device_api_logan.c.

◆ ni_logan_device_session_hwup()

int ni_logan_device_session_hwup ( ni_logan_session_context_t p_ctx,
ni_logan_session_data_io_t p_src_data,
ni_logan_hwframe_surface_t hwdesc 
)

Writes data and reads back hw descriptor from decoder output buffer.


Parameters
[in]p_src_dataPointer to a caller allocated ni_logan_session_data_io_t struct which contains either a ni_logan_frame_t data frame or ni_logan_packet_t data packet to send
[in]hwdescHW descriptor to find frame in XCODER
Returns
On success Total number of bytes read On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 4650 of file ni_device_api_logan.c.

◆ ni_logan_device_session_init_framepool()

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

Sends frame pool setup info to device.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]p_dataPointer to a caller allocated ni_logan_session_data_io_t struct which contains either a ni_logan_frame_t data frame or ni_logan_packet_t data packet to send
Returns
On success Return code On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 5225 of file ni_device_api_logan.c.

◆ ni_logan_device_session_open()

ni_logan_retcode_t ni_logan_device_session_open ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type 
)

Opens a new device session depending on the device_type parameter If device_type is NI_LOGAN_DEVICE_TYPE_DECODER opens decoding session If device_type is NI_LOGAN_DEVICE_TYPE_EECODER opens encoding session.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]p_configPointer to a caller allocated ni_logan_session_config_t struct
[in]device_typeNI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

resource management context

Definition at line 645 of file ni_device_api_logan.c.

◆ ni_logan_device_session_query()

ni_logan_retcode_t ni_logan_device_session_query ( ni_logan_session_context_t p_ctx,
ni_logan_device_type_t  device_type 
)

Query session data from the device - Currently not implemented If device_type is NI_LOGAN_DEVICE_TYPE_DECODER query session data from decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER query session data from encoder.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]device_typeNI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1734 of file ni_device_api_logan.c.

◆ ni_logan_device_session_read()

int ni_logan_device_session_read ( ni_logan_session_context_t p_ctx,
ni_logan_session_data_io_t p_data,
ni_logan_device_type_t  device_type 
)

Reads data the device If device_type is NI_LOGAN_DEVICE_TYPE_DECODER reads data packet from decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER reads data frame from encoder.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]p_dataPointer to a caller allocated ni_logan_session_data_io_t struct which contains either a ni_logan_frame_t data frame or ni_logan_packet_t data packet to send
[in]device_typeNI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER If NI_LOGAN_DEVICE_TYPE_DECODER is specified, data that was read will be placed into ni_logan_frame_t struct inside the p_data pointer If NI_LOGAN_DEVICE_TYPE_ENCODER is specified, data that was read will be placed into ni_logan_packet_t struct inside the p_data pointer
Returns
On success Total number of bytes read On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1616 of file ni_device_api_logan.c.

◆ ni_logan_device_session_read_hwdesc()

int ni_logan_device_session_read_hwdesc ( ni_logan_session_context_t p_ctx,
ni_logan_session_data_io_t p_data 
)

Reads data from the device device_type should be NI_LOGAN_DEVICE_TYPE_DECODER, and reads data hwdesc from decoder when hw transcoding.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]p_dataPointer to a caller allocated ni_logan_session_data_io_t struct which contains either a ni_logan_frame_t data frame or ni_logan_packet_t data packet to send
Returns
On success Total number of bytes read On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 4510 of file ni_device_api_logan.c.

◆ ni_logan_device_session_write()

int ni_logan_device_session_write ( ni_logan_session_context_t p_ctx,
ni_logan_session_data_io_t p_data,
ni_logan_device_type_t  device_type 
)

Sends data the device If device_type is NI_LOGAN_DEVICE_TYPE_DECODER sends data packet to decoder If device_type is NI_LOGAN_DEVICE_TYPE_EECODER sends data frame to encoder.


Parameters
[in]p_ctxPointer to a caller allocated ni_logan_session_context_t struct
[in]p_dataPointer to a caller allocated ni_logan_session_data_io_t struct which contains either a ni_logan_frame_t data frame or ni_logan_packet_t data packet to send
[in]device_typeNI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER If NI_LOGAN_DEVICE_TYPE_DECODER is specified, it is expected that the ni_logan_packet_t struct inside the p_data pointer contains data to send. If NI_LOGAN_DEVICE_TYPE_ENCODER is specified, it is expected that the ni_logan_frame_t struct inside the p_data pointer contains data to send.
Returns
On success Total number of bytes written On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED NI_LOGAN_RETCODE_ERROR_INVALID_SESSION

Definition at line 1539 of file ni_device_api_logan.c.

◆ ni_logan_encoder_frame_buffer_alloc()

ni_logan_retcode_t ni_logan_encoder_frame_buffer_alloc ( ni_logan_frame_t p_frame,
int  video_width,
int  video_height,
int  linesize[],
int  alignment,
int  extra_len,
int  factor 
)

Allocate memory for the frame buffer for encoding based on given parameters, taking into account pic line size and extra data. Applicable to YUV420p AVFrame only. 8 or 10 bit/pixel. Cb/Cr size matches that of Y.


Parameters
[in]p_framePointer to a caller allocated ni_logan_frame_t struct
[in]video_widthWidth of the video frame
[in]video_heightHeight of the video frame
[in]linesizePicture line size
[in]alignmentAllignment requirement
[in]extra_lenExtra data size (incl. meta data)
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 2071 of file ni_device_api_logan.c.

◆ ni_logan_encoder_gop_params_set_value()

ni_logan_retcode_t ni_logan_encoder_gop_params_set_value ( ni_logan_encoder_params_t p_params,
const char *  name,
const char *  value 
)

Set got parameter value referenced by name in encoder parameters structure.

Set gop parameter value referenced by name in encoder parameters structure.


Parameters
[in]p_paramsPointer to a user allocated ni_logan_encoder_params_t to find and set a particular parameter
[in]nameString represented parameter name to search
[in]valueParameter value to set
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 3804 of file ni_device_api_logan.c.

◆ ni_logan_encoder_init_default_params()

ni_logan_retcode_t ni_logan_encoder_init_default_params ( ni_logan_encoder_params_t p_param,
int  fps_num,
int  fps_denom,
long  bit_rate,
int  width,
int  height 
)

Initialize default encoder parameters.


Parameters
[out]paramPointer to a user allocated ni_logan_encoder_params_t to initialize to default parameters
[in]fps_numFrames per second
[in]fps_denomFPS denomination
[in]bit_ratebit rate
[in]widthwidth
[in]heightheight
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 2518 of file ni_device_api_logan.c.

◆ ni_logan_encoder_params_check()

ni_logan_retcode_t ni_logan_encoder_params_check ( ni_logan_encoder_params_t p_params,
ni_logan_codec_format_t  codec 
)

Validate relationship of some params in encoder parameters structure.


Parameters
[in]p_paramsPointer to a user allocated ni_logan_encoder_params_t
[in]codecencoding codec
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_PARAM_ERROR_OOR and other error rc

Definition at line 3747 of file ni_device_api_logan.c.

◆ ni_logan_encoder_params_set_value()

ni_logan_retcode_t ni_logan_encoder_params_set_value ( ni_logan_encoder_params_t p_params,
const char *  name,
const char *  value,
ni_logan_session_context_t ctx 
)

Set value referenced by name in encoder parameters structure.


Parameters
[in]p_paramsPointer to a user allocated ni_logan_encoder_params_t to find and set a particular parameter
[in]nameString represented parameter name to search
[in]valueParameter value to set
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 3069 of file ni_device_api_logan.c.

◆ ni_logan_encoder_set_input_frame_format()

LIB_API ni_logan_retcode_t ni_logan_encoder_set_input_frame_format ( ni_logan_session_context_t p_enc_ctx,
ni_logan_encoder_params_t p_enc_params,
int  width,
int  height,
int  bit_depth,
int  src_endian 
)

Set the incoming frame format for the encoder.


Parameters
[in]p_enc_ctxpointer to encoder context [in] p_enc_params pointer to encoder parameters [in] width input width [in] height input height [in] bit_depth 8 for 8-bit YUV, 10 for 10-bit YUV [in] src_endian NI_FRAME_LITTLE_ENDIAN or NI_FRAME_BIG_ENDIAN
Returns
on success NI_RETCODE_SUCCESS

on failure NI_RETCODE_INVALID_PARAM

Definition at line 5109 of file ni_device_api_logan.c.

◆ ni_logan_err2str()

const char* ni_logan_err2str ( int  err)

Convert error numver into error messages.


Returns
the string of error message

Definition at line 164 of file ni_device_api_logan.c.

◆ ni_logan_frame_buffer_alloc()

ni_logan_retcode_t ni_logan_frame_buffer_alloc ( ni_logan_frame_t p_frame,
int  video_width,
int  video_height,
int  alignment,
int  metadata_flag,
int  factor,
int  hw_frame_count 
)

Allocate preliminary memory for the frame buffer for encoding based on provided parameters. Applicable to YUV420 Planar pixel format only, 8 or 10 bit/pixel.


Parameters
[in]p_framePointer to a caller allocated ni_logan_frame_t struct
[in]video_widthWidth of the video frame
[in]video_heightHeight of the video frame
[in]alignmentAllignment requirement
[in]metadata_flagFlag indicating if space for additional metadata should be allocated
[in]factor1 for 8 bits/pixel format, 2 for 10 bits/pixel
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 1792 of file ni_device_api_logan.c.

◆ ni_logan_frame_buffer_alloc_hwenc()

ni_logan_retcode_t ni_logan_frame_buffer_alloc_hwenc ( ni_logan_frame_t p_frame,
int  video_width,
int  video_height,
int  extra_len 
)

Allocate memory for the frame buffer based on provided parameters taking into account pic line size and extra data. Applicable to YUV420p AVFrame for hw only.

Allocate memory for the frame buffer based on provided parameters taking into account pic line size and extra data. Applicable to YUV420p AVFrame only. Cb/Cr size matches that of Y.


Parameters
[in]p_framePointer to a caller allocated ni_logan_frame_t struct
[in]video_widthWidth of the video frame
[in]video_heightHeight of the video frame
[in]linesizePicture line size
[in]alignmentAllignment requirement
[in]extra_lenExtra data size (incl. meta data)
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 4696 of file ni_device_api_logan.c.

◆ ni_logan_frame_buffer_alloc_v4()

ni_logan_retcode_t ni_logan_frame_buffer_alloc_v4 ( ni_logan_frame_t p_frame,
int  pixel_format,
int  video_width,
int  video_height,
int  linesize[],
int  alignment,
int  extra_len 
)

Allocate memory for the frame buffer based on provided parameters taking into account width, height, format, stride, alignment, and extra data.


Parameters
[in]p_framePointer to caller allocated ni_logan_frame_t
[in]pixel_formatpixel format
[in]video_widthwidth, in pixels
[in]video_heightheight, in pixels
[in]linesizehorizontal stride
[in]alignmentapply a 16 pixel height alignment (T408 only)
[in]extra_lenmeta data size
Returns
NI_LOGAN_RETCODE_SUCCESS NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 5263 of file ni_device_api_logan.c.

◆ ni_logan_frame_buffer_free()

ni_logan_retcode_t ni_logan_frame_buffer_free ( ni_logan_frame_t p_frame)

Free frame buffer that was previously allocated with either ni_logan_frame_buffer_alloc or ni_logan_encoder_frame_buffer_alloc.


Parameters
[in]p_framePointer to a previously allocated ni_logan_frame_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 2196 of file ni_device_api_logan.c.

◆ ni_logan_frame_free_aux_data()

void ni_logan_frame_free_aux_data ( ni_logan_frame_t frame,
ni_aux_data_type_t  type 
)

If auxiliary data of the given type exists in the frame, free it and remove it from the frame.


Parameters
[in/out]frame a frame from which the auxiliary data should be removed
[in]typetype of the auxiliary data to be removed
Returns
None

Definition at line 4354 of file ni_device_api_logan.c.

◆ ni_logan_frame_get_aux_data()

ni_aux_data_t* ni_logan_frame_get_aux_data ( const ni_logan_frame_t frame,
ni_aux_data_type_t  type 
)

Retrieve from the frame auxiliary data of a given type if exists.


Parameters
[in]framea frame from which the auxiliary data should be retrieved
[in]typetype of the auxiliary data to be retrieved
Returns
a pointer to the aux data of a given type on success, NULL otherwise

Definition at line 4331 of file ni_device_api_logan.c.

◆ ni_logan_frame_new_aux_data()

ni_aux_data_t* ni_logan_frame_new_aux_data ( ni_logan_frame_t frame,
ni_aux_data_type_t  type,
int  data_size 
)

Add a new auxiliary data to a frame.


Parameters
[in/out]frame a frame to which the auxiliary data should be added
[in]typetype of the added auxiliary data
[in]data_sizesize of the added auxiliary data
Returns
a pointer to the newly added aux data on success, NULL otherwise

Definition at line 4269 of file ni_device_api_logan.c.

◆ ni_logan_frame_new_aux_data_from_raw_data()

ni_aux_data_t* ni_logan_frame_new_aux_data_from_raw_data ( ni_logan_frame_t frame,
ni_aux_data_type_t  type,
const uint8_t *  raw_data,
int  data_size 
)

Add a new auxiliary data to a frame and copy in the raw data.


Parameters
[in/out]frame a frame to which the auxiliary data should be added
[in]typetype of the added auxiliary data
[in]raw_datathe raw data of the aux data
[in]data_sizesize of the added auxiliary data
Returns
a pointer to the newly added aux data on success, NULL otherwise

Definition at line 4310 of file ni_device_api_logan.c.

◆ ni_logan_frame_wipe_aux_data()

void ni_logan_frame_wipe_aux_data ( ni_logan_frame_t frame)

Free and remove all auxiliary data from the frame.


Parameters
[in/out]frame a frame from which the auxiliary data should be removed
Returns
None

Definition at line 4382 of file ni_device_api_logan.c.

◆ ni_logan_frame_zerocopy_buffer_alloc()

ni_logan_retcode_t ni_logan_frame_zerocopy_buffer_alloc ( ni_logan_frame_t p_frame,
int  video_width,
int  video_height,
int  linesize[],
int  extra_len,
int  factor,
uint8_t *  buffer[] 
)

Allocate memory for the frame buffer based on provided parameters Applicable to use YUV420p AVFrame for zerocopy case. Allocat extra_len only.

Allocate memory for the frame buffer for encoding based on given parameters, taking into account pic line size and extra data. Applicable to YUV420p AVFrame only. 8 or 10 bit/pixel. Cb/Cr size matches that of Y.


Parameters
[in]p_framePointer to a caller allocated ni_logan_frame_t struct
[in]video_widthWidth of the video frame
[in]video_heightHeight of the video frame
[in]linesizePicture line size
[in]extra_lenExtra data size (incl. meta data)
[in]buffer[]Buffer address of video frame.
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 5423 of file ni_device_api_logan.c.

◆ ni_logan_frame_zerocopy_check()

LIB_API ni_logan_retcode_t ni_logan_frame_zerocopy_check ( const int  width,
const int  height,
const int  linesize[],
const int  dst_stride[],
const int  src_height[],
const int  dst_height[],
const int  bit_depth_factor,
const uint8_t *  data[] 
)

Check if incoming frame is encoder zero copy compatible or not.


Parameters
[in]widthwidth of encoder frame.
[in]heightheight of encoder frame.
[in]linesizelinesizes (pointer to array).
[in]dst_stridedst_stride (produced by ni_logan_get_hw_yuv420p_dim).
[in]src_heightsrc height of every planar.
[in]dst_heightdst_height_aligned(produced by ni_logan_get_hw_yuv420p_dim).
[in]bit_depth_factorbit_depth of frame.
[in]dataCPU address of frame planar.
Returns
on success NI_LOGAN_RETCODE_SUCCESS

on failure NI_LOGAN_RETCODE_FAILURE

Definition at line 5535 of file ni_device_api_logan.c.

◆ ni_logan_get_num_ref_frame_of_gop_structure()

int ni_logan_get_num_ref_frame_of_gop_structure ( ni_logan_encoder_params_t p_params)

Get GOP's number of reference frames.


Parameters
[in]p_paramsPointer to a user allocated ni_logan_encoder_params_t
Returns
number of reference frames of the GOP

Definition at line 4215 of file ni_device_api_logan.c.

◆ ni_logan_get_num_reorder_of_gop_structure()

int ni_logan_get_num_reorder_of_gop_structure ( ni_logan_encoder_params_t p_params)

Get GOP's max number of reorder frames.


Parameters
[in]p_paramsPointer to a user allocated ni_logan_encoder_params_t
Returns
max number of reorder frames of the GOP, -1 on error

Definition at line 4156 of file ni_device_api_logan.c.

◆ ni_logan_packet_buffer_alloc()

ni_logan_retcode_t ni_logan_packet_buffer_alloc ( ni_logan_packet_t p_packet,
int  packet_size 
)

Allocate memory for the packet buffer based on provided packet size.


Parameters
[in]p_packetPointer to a caller allocated ni_logan_packet_t struct
[in]packet_sizeRequired allocation size
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM NI_LOGAN_RETCODE_ERROR_MEM_ALOC

Definition at line 2311 of file ni_device_api_logan.c.

◆ ni_logan_packet_buffer_free()

ni_logan_retcode_t ni_logan_packet_buffer_free ( ni_logan_packet_t p_packet)

Free packet buffer that was previously allocated with either ni_logan_packet_buffer_alloc.


Parameters
[in]p_packetPointer to a previously allocated ni_logan_packet_t struct
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_INVALID_PARAM

Definition at line 2395 of file ni_device_api_logan.c.

◆ ni_logan_packet_copy()

int ni_logan_packet_copy ( void *  p_destination,
const void *const  p_source,
int  cur_size,
void *  p_leftover,
int *  p_prev_size 
)

Copy video packet accounting for allighment.


Parameters
[in]p_destinationDestination to where to copy to
[in]p_sourceSource from where to copy from
[in]cur_sizecurrent size
[out]p_leftoverPointer to the data that was left over
[out]p_prev_sizeSize of the data leftover ??
Returns
On success Total number of bytes that were copied On failure NI_LOGAN_RETCODE_FAILURE

Definition at line 2441 of file ni_device_api_logan.c.

◆ ni_logan_parse_reconf_file()

ni_logan_retcode_t ni_logan_parse_reconf_file ( const char *  reconf_file,
int  hash_map[100][10] 
)

Definition at line 2746 of file ni_device_api_logan.c.

◆ ni_logan_uploader_frame_buffer_lock()

ni_logan_retcode_t ni_logan_uploader_frame_buffer_lock ( ni_logan_session_context_t p_upl_ctx,
ni_logan_frame_t p_frame 
)

Lock a hardware P2P frame prior to encoding.


Parameters
[in]p_upl_ctxpointer to caller allocated upload context [in] p_frame pointer to caller allocated hardware P2P frame
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_FAILURE NI_RETCODE_INVALID_PARAM

Definition at line 4946 of file ni_device_api_logan.c.

◆ ni_logan_uploader_frame_buffer_unlock()

ni_logan_retcode_t ni_logan_uploader_frame_buffer_unlock ( ni_logan_session_context_t p_upl_ctx,
ni_logan_frame_t p_frame 
)

Unlock a hardware P2P frame after encoding.


Parameters
[in]p_upl_ctxpointer to caller allocated upload context [in] p_frame pointer to caller allocated hardware P2P frame
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_FAILURE NI_RETCODE_INVALID_PARAM

Definition at line 5004 of file ni_device_api_logan.c.

◆ ni_logan_uploader_p2p_test_send()

ni_logan_retcode_t ni_logan_uploader_p2p_test_send ( ni_logan_session_context_t p_upl_ctx,
uint8_t *  p_data,
uint32_t  len,
ni_logan_frame_t p_hwframe 
)

Special P2P test API function. Copies YUV data from the software frame to the hardware P2P frame on the T408 device.

Special P2P test API call. Copies YUV data from the software frame to the hardware P2P frame on the Quadra device.


Parameters
[in]p_upl_ctxpointer to caller allocated uploader session context [in] p_swframe pointer to a caller allocated software frame [in] p_hwframe pointer to a caller allocated hardware frame
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_FAILURE NI_RETCODE_INVALID_PARAM

Definition at line 5052 of file ni_device_api_logan.c.

Variable Documentation

◆ g_logan_xcoder_log_names

const char* const g_logan_xcoder_log_names[NI_LOGAN_XCODER_LOG_NAMES_ARRAY_LEN]
Initial value:

Definition at line 65 of file ni_device_api_logan.c.

◆ g_logan_xcoder_preset_names

const char* const g_logan_xcoder_preset_names[NI_LOGAN_XCODER_PRESET_NAMES_ARRAY_LEN]
Initial value:

Definition at line 61 of file ni_device_api_logan.c.