libxcoder  3.5.1
ni_enc_api_logan.c File Reference

NETINT encoder API file. More...

#include "ni_enc_api_logan.h"

Go to the source code of this file.

Functions

int ni_logan_encode_init (ni_logan_enc_context_t *p_enc_ctx)
 Initialize encode parameters, including ni_logan_enc_context_t, ni_logan_session_context_t and ni_logan_encoder_params_t. More...
 
int ni_logan_encode_params_parse (ni_logan_enc_context_t *p_enc_ctx)
 Parse encoder parameters Check whether the parameters are reasonable. More...
 
int ni_logan_encode_header (ni_logan_enc_context_t *p_enc_ctx)
 Get encoder headers from the hardware. More...
 
int ni_logan_encode_open (ni_logan_enc_context_t *p_enc_ctx)
 Open encoder. More...
 
int ni_logan_encode_close (ni_logan_enc_context_t *p_enc_ctx)
 Close encoder. More...
 
int ni_logan_encode_get_frame (ni_logan_enc_context_t *p_enc_ctx)
 Get allocated ni_frame from fifo pool. More...
 
void ni_logan_encode_reconfig_vfr (ni_logan_enc_context_t *p_enc_ctx, ni_logan_frame_t *ni_frame, int64_t pts)
 Fill reconfig vfr. More...
 
int ni_logan_encode_copy_frame_data (ni_logan_enc_context_t *p_enc_ctx, ni_logan_frame_t *p_dec_frame, uint8_t *p_data[NI_LOGAN_MAX_NUM_DATA_POINTERS], int linesize[NI_LOGAN_MAX_NUM_DATA_POINTERS])
 Copy frame data to NI frame. More...
 
int ni_logan_encode_send (ni_logan_enc_context_t *p_enc_ctx)
 Send encode data to NI device. More...
 
int ni_logan_encode_copy_packet_data (ni_logan_enc_context_t *p_enc_ctx, uint8_t *p_data, int first_packet, int sps_pps_attach)
 Copy NI packet to packet data buffer. More...
 
int ni_logan_encode_receive (ni_logan_enc_context_t *p_enc_ctx)
 Receive encoded data from NI device. More...
 

Detailed Description

NETINT encoder API file.


Definition in file ni_enc_api_logan.c.

Function Documentation

◆ ni_logan_encode_close()

int ni_logan_encode_close ( ni_logan_enc_context_t p_enc_ctx)

Close encoder.


Parameters
[in/out]p_enc_ctx Pointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM, NI_LOGAN_RETCODE_ERROR_MEM_ALOC, NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED, etc

Definition at line 817 of file ni_enc_api_logan.c.

◆ ni_logan_encode_copy_frame_data()

int ni_logan_encode_copy_frame_data ( ni_logan_enc_context_t p_enc_ctx,
ni_logan_frame_t p_dec_frame,
uint8_t *  p_data[NI_LOGAN_MAX_NUM_DATA_POINTERS],
int  linesize[NI_LOGAN_MAX_NUM_DATA_POINTERS] 
)

Copy frame data to NI frame.


Parameters
[in/out]p_enc_ctx Pointer to ni_logan_enc_context_t
[in]p_dec_framePointer to ni_logan_frame_t, contains aux data from NI decoder
[in]p_dataPointer to input frame data
[in]linesizePointer to linesize of input frame
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE, NI_LOGAN_RETCODE_ERROR_MEM_ALOC, etc

Definition at line 1116 of file ni_enc_api_logan.c.

◆ ni_logan_encode_copy_packet_data()

int ni_logan_encode_copy_packet_data ( ni_logan_enc_context_t p_enc_ctx,
uint8_t *  p_data,
int  first_packet,
int  sps_pps_attach 
)

Copy NI packet to packet data buffer.


Parameters
[in]p_enc_ctxPointer to ni_logan_enc_context_t
[out]p_dataPointer to output packet data buffer,
[in]first_packetflag of first packet
[in]sps_pps_attachflag of attached SPS/PPS
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE, NI_LOGAN_RETCODE_PARAM_ERROR_WIDTH_TOO_BIG, etc

Definition at line 1487 of file ni_enc_api_logan.c.

◆ ni_logan_encode_get_frame()

int ni_logan_encode_get_frame ( ni_logan_enc_context_t p_enc_ctx)

Get allocated ni_frame from fifo pool.


Parameters
[in]p_enc_ctxPointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE

Definition at line 1037 of file ni_enc_api_logan.c.

◆ ni_logan_encode_header()

int ni_logan_encode_header ( ni_logan_enc_context_t p_enc_ctx)

Get encoder headers from the hardware.


Parameters
[in/out]p_enc_ctx Pointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE, NI_LOGAN_RETCODE_ERROR_MEM_ALOC, etc

Definition at line 527 of file ni_enc_api_logan.c.

◆ ni_logan_encode_init()

int ni_logan_encode_init ( ni_logan_enc_context_t p_enc_ctx)

Initialize encode parameters, including ni_logan_enc_context_t, ni_logan_session_context_t and ni_logan_encoder_params_t.


Parameters
[in/out]p_enc_ctx Pointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM, NI_LOGAN_RETCODE_ERROR_MEM_ALOC, etc

Definition at line 172 of file ni_enc_api_logan.c.

◆ ni_logan_encode_open()

int ni_logan_encode_open ( ni_logan_enc_context_t p_enc_ctx)

Open encoder.


Parameters
[in/out]p_enc_ctx Pointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE NI_LOGAN_RETCODE_INVALID_PARAM, etc.

Definition at line 633 of file ni_enc_api_logan.c.

◆ ni_logan_encode_params_parse()

int ni_logan_encode_params_parse ( ni_logan_enc_context_t p_enc_ctx)

Parse encoder parameters Check whether the parameters are reasonable.


Parameters
[in/out]p_enc_ctx Pointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE, NI_LOGAN_RETCODE_INVALID_PARAM, etc.

Definition at line 313 of file ni_enc_api_logan.c.

◆ ni_logan_encode_receive()

int ni_logan_encode_receive ( ni_logan_enc_context_t p_enc_ctx)

Receive encoded data from NI device.


Parameters
[in]p_enc_ctxPointer to ni_logan_enc_context_t
Returns
0 when no packets received > 0 when new packet received, means the size of packet < 0 when failed, NI_LOGAN_RETCODE_FAILURE, NI_LOGAN_RETCODE_INVALID_PARAM, etc.

Definition at line 1702 of file ni_enc_api_logan.c.

◆ ni_logan_encode_reconfig_vfr()

void ni_logan_encode_reconfig_vfr ( ni_logan_enc_context_t p_enc_ctx,
ni_logan_frame_t ni_frame,
int64_t  pts 
)

Fill reconfig vfr.


Parameters
[in]p_ctxPointer to ni_logan_enc_context_t
[in/out]ni_frame aux_data may be updated
[in]ptsframe pts
Returns

Definition at line 1092 of file ni_enc_api_logan.c.

◆ ni_logan_encode_send()

int ni_logan_encode_send ( ni_logan_enc_context_t p_enc_ctx)

Send encode data to NI device.


Parameters
[in]p_enc_ctxPointer to ni_logan_enc_context_t
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE, NI_LOGAN_RETCODE_INVALID_PARAM, etc.

Definition at line 1269 of file ni_enc_api_logan.c.