libxcoder  5.2.0
ni_quadra_dec_api.h File Reference

NETINT decoder API header file. More...

#include <errno.h>
#include <stddef.h>
#include <unistd.h>
#include "ni_quadra_filter_api.h"

Go to the source code of this file.

Data Structures

struct  _ni_quadra_frame
 
struct  _ni_dec_input_params_t
 
struct  _ni_quadra_ppu_config
 
struct  _ni_quadra_dec_context_t
 

Macros

#define NI_NAL_VPS_BIT   (0x01)
 
#define NI_NAL_SPS_BIT   (0x01 << 1)
 
#define NI_NAL_PPS_BIT   (0x01 << 2)
 
#define NI_GENERATE_ALL_NAL_HEADER_BIT   (0x01 << 3)
 
#define NI_PKT_FLAG_KEY   0x0001
 The packet contains a keyframe. More...
 
#define NI_PKT_FLAG_CORRUPT   0x0002
 The packet content is corrupted. More...
 

Typedefs

typedef enum _ni_quadra_session_run_state ni_quadra_session_run_state_t
 Session running state type. More...
 
typedef struct _ni_quadra_frame ni_quadra_frame_t
 
typedef struct _ni_dec_input_params_t ni_dec_input_params_t
 
typedef struct _ni_quadra_ppu_config ni_quadra_ppu_config_t
 
typedef struct _ni_quadra_dec_context_t ni_quadra_dec_context_t
 

Enumerations

enum  _ni_quadra_session_run_state {
  QUADRA_SESSION_RUN_STATE_NORMAL = 0, QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_DRAINING = 1, QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_OPENING = 2, QUADRA_SESSION_RUN_STATE_RESETTING = 3,
  QUADRA_SESSION_RUN_STATE_NORMAL = 0, QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_DRAINING = 1, QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_OPENING = 2, QUADRA_SESSION_RUN_STATE_RESETTING = 3
}
 Session running state type. More...
 

Functions

LIB_API int ni_quadra_dec_init (ni_quadra_dec_context_t *ni_dec_ctx)
 Initialize decode parameters and open decoder device including ni_quadra_dec_context_t, ni_session_context_t, ni_xcoder_params_t. More...
 
LIB_API int ni_quadra_setup_decoder (ni_quadra_dec_context_t *ni_dec_ctx)
 Initialize init device session_context and init default params including ni_quadra_dec_context_t, ni_session_context_t, ni_decoder_params_t. More...
 
LIB_API int ni_quadra_dec_send (ni_quadra_dec_context_t *ni_dec_ctx, int pkt_flags, uint8_t *data, int pkt_size, uint8_t *lonedata, int lone_size, int64_t pkt_pts, int64_t pkt_dts, int pkt_pos, int width, int height, uint8_t *extradata, int extradata_size)
 Parse the packet and send the packet to decode device. More...
 
LIB_API int ni_quadra_dec_is_flushing (ni_quadra_dec_context_t *ni_dec_ctx)
 Decode is flushing or not, including ni_quadra_dec_context_t,. More...
 
LIB_API int ni_quadra_dec_receive (ni_quadra_dec_context_t *ni_dec_ctx, int avctx_width, int avctx_height, int frame_planar)
 Receive decoded data from decoder, including ni_quadra_dec_context_t,. More...
 
LIB_API void ni_quadra_dec_close (ni_quadra_dec_context_t *ni_dec_ctx)
 Decode close, including ni_quadra_dec_context_t,. More...
 
LIB_API void ni_quadra_align_free (void *opaque, uint8_t *data)
 buffer free, including void* More...
 
LIB_API void ni_quadra_frame_free (void *opaque, uint8_t *data)
 frame free, including void* More...
 
LIB_API void ni_quadra_dec_wipe_aux_data (ni_quadra_dec_context_t *ni_dec_ctx)
 Free and remove all auxiliary data from the ni_dec_ctx frame. More...
 
LIB_API int ni_quadra_frame_get_aux_size (ni_quadra_dec_context_t *ni_dec_ctx, int type)
 get size from the frame auxiliary data of a given type if exists More...
 
LIB_API void ni_quadra_frame_copy_aux_data (ni_quadra_dec_context_t *ni_dec_ctx, uint8_t *dst_data, int type, int size)
 Retrieve from the frame auxiliary data of a given type if exists. More...
 
LIB_API int ni_quadra_dec_params_set_value (ni_quadra_dec_context_t *ni_dec_ctx, const char *name, char *value)
 Set value referenced by name in decoder parameters structure. More...
 
LIB_API int ni_quadra_symbolic_decoder_param (ni_quadra_dec_context_t *ni_dec_ctx, int type)
 sync ni_decoder_input_params_t and ni_xcoder_params_t More...
 
LIB_API uint8_t * ni_quadra_dec_frame_buffer_alloc (ni_quadra_dec_context_t *ni_dec_ctx, void *p_session_data)
 alloc session p_data More...
 

Detailed Description

NETINT decoder API header file.


Definition in file ni_quadra_dec_api.h.

Macro Definition Documentation

◆ NI_GENERATE_ALL_NAL_HEADER_BIT

#define NI_GENERATE_ALL_NAL_HEADER_BIT   (0x01 << 3)

Definition at line 46 of file ni_quadra_dec_api.h.

◆ NI_NAL_PPS_BIT

#define NI_NAL_PPS_BIT   (0x01 << 2)

Definition at line 45 of file ni_quadra_dec_api.h.

◆ NI_NAL_SPS_BIT

#define NI_NAL_SPS_BIT   (0x01 << 1)

Definition at line 44 of file ni_quadra_dec_api.h.

◆ NI_NAL_VPS_BIT

#define NI_NAL_VPS_BIT   (0x01)

Definition at line 43 of file ni_quadra_dec_api.h.

◆ NI_PKT_FLAG_CORRUPT

#define NI_PKT_FLAG_CORRUPT   0x0002

The packet content is corrupted.

Definition at line 48 of file ni_quadra_dec_api.h.

◆ NI_PKT_FLAG_KEY

#define NI_PKT_FLAG_KEY   0x0001

The packet contains a keyframe.

Definition at line 47 of file ni_quadra_dec_api.h.

Typedef Documentation

◆ ni_dec_input_params_t

◆ ni_quadra_dec_context_t

◆ ni_quadra_frame_t

◆ ni_quadra_ppu_config_t

◆ ni_quadra_session_run_state_t

Session running state type.

Enumeration Type Documentation

◆ _ni_quadra_session_run_state

Session running state type.

Enumerator
QUADRA_SESSION_RUN_STATE_NORMAL 
QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_DRAINING 
QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_OPENING 
QUADRA_SESSION_RUN_STATE_RESETTING 
QUADRA_SESSION_RUN_STATE_NORMAL 
QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_DRAINING 
QUADRA_SESSION_RUN_STATE_SEQ_CHANGE_OPENING 
QUADRA_SESSION_RUN_STATE_RESETTING 

Definition at line 53 of file ni_quadra_dec_api.h.

Function Documentation

◆ ni_quadra_align_free()

LIB_API void ni_quadra_align_free ( void *  opaque,
uint8_t *  data 
)

buffer free, including void*


Parameters
[in]opaqueparameter to be got for processing or passed to free
[in]datadata array

Definition at line 51 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_close()

LIB_API void ni_quadra_dec_close ( ni_quadra_dec_context_t ni_dec_ctx)

Decode close, including ni_quadra_dec_context_t,.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t

Definition at line 87 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_frame_buffer_alloc()

LIB_API uint8_t* ni_quadra_dec_frame_buffer_alloc ( ni_quadra_dec_context_t ni_dec_ctx,
void *  p_session_data 
)

alloc session p_data


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in]p_session_dataPointer to void*
Returns
uint8_t *p_data

Definition at line 1532 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_init()

LIB_API int ni_quadra_dec_init ( ni_quadra_dec_context_t ni_dec_ctx)

Initialize decode parameters and open decoder device including ni_quadra_dec_context_t, ni_session_context_t, ni_xcoder_params_t.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_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 350 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_is_flushing()

LIB_API int ni_quadra_dec_is_flushing ( ni_quadra_dec_context_t ni_dec_ctx)

Decode is flushing or not, including ni_quadra_dec_context_t,.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
Returns
On 1 HW dosn't do decode flushing On 0 HW is doing decode flushing

Definition at line 1405 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_params_set_value()

LIB_API int ni_quadra_dec_params_set_value ( ni_quadra_dec_context_t ni_dec_ctx,
const char *  name,
char *  value 
)

Set value referenced by name in decoder parameters structure.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in]nameString represented parameter name to search
[in]valueParameter value to set
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_FAILURE NI_QUADRA_PARAM_WARNING_DEPRECATED

Definition at line 1419 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_receive()

LIB_API int ni_quadra_dec_receive ( ni_quadra_dec_context_t ni_dec_ctx,
int  avctx_width,
int  avctx_height,
int  frame_planar 
)

Receive decoded data from decoder, including ni_quadra_dec_context_t,.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in/out]p_session_data Pointer to ni_session_data_io_t
[in]avctx_widthavctx width
[in]avctx_heightavctx height
Returns
On success NI_LOGAN_RETCODE_SUCCESS On failure NI_LOGAN_RETCODE_FAILURE

Definition at line 1117 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_send()

LIB_API int ni_quadra_dec_send ( ni_quadra_dec_context_t ni_dec_ctx,
int  pkt_flags,
uint8_t *  data,
int  pkt_size,
uint8_t *  lonedata,
int  lone_size,
int64_t  pkt_pts,
int64_t  pkt_dts,
int  pkt_pos,
int  width,
int  height,
uint8_t *  extradata,
int  extradata_size 
)

Parse the packet and send the packet to decode device.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in/out]flag flag=0 or 1 to do something.
[in]pkt_dataPointer to input packet data
[in]pkt_sizepacket size
[in]pkt_flagspacket flags
[in]pkt_ptspacket pts
[in]pkt_dtspacket dts
[in]avctx_widthavctx width
[in]avctx_heightavctx height
[in]extradataPointer to uint8_t
[in]extradata_sizeextradata size
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 662 of file ni_quadra_dec_api.c.

◆ ni_quadra_dec_wipe_aux_data()

LIB_API void ni_quadra_dec_wipe_aux_data ( ni_quadra_dec_context_t ni_dec_ctx)

Free and remove all auxiliary data from the ni_dec_ctx frame.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
Returns
None

Definition at line 1033 of file ni_quadra_dec_api.c.

◆ ni_quadra_frame_copy_aux_data()

LIB_API void ni_quadra_frame_copy_aux_data ( ni_quadra_dec_context_t ni_dec_ctx,
uint8_t *  dst_data,
int  type,
int  size 
)

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


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in/out]dst_data copy the auxiliary data
[in]typetype of the auxiliary data
[in]sizesize of the auxiliary data
Returns
a pointer to the aux data of a given type on success, NULL otherwise

Definition at line 1051 of file ni_quadra_dec_api.c.

◆ ni_quadra_frame_free()

LIB_API void ni_quadra_frame_free ( void *  opaque,
uint8_t *  data 
)

frame free, including void*


Parameters
[in]opaqueparameter to be got for processing or passed to free
[in]datadata array

Definition at line 61 of file ni_quadra_dec_api.c.

◆ ni_quadra_frame_get_aux_size()

LIB_API int ni_quadra_frame_get_aux_size ( ni_quadra_dec_context_t ni_dec_ctx,
int  type 
)

get size from the frame auxiliary data of a given type if exists


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in]typetype of the auxiliary data to be retrieved
Returns
aux data size

Definition at line 1040 of file ni_quadra_dec_api.c.

◆ ni_quadra_setup_decoder()

LIB_API int ni_quadra_setup_decoder ( ni_quadra_dec_context_t ni_dec_ctx)

Initialize init device session_context and init default params including ni_quadra_dec_context_t, ni_session_context_t, ni_decoder_params_t.


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_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 185 of file ni_quadra_dec_api.c.

◆ ni_quadra_symbolic_decoder_param()

LIB_API int ni_quadra_symbolic_decoder_param ( ni_quadra_dec_context_t ni_dec_ctx,
int  type 
)

sync ni_decoder_input_params_t and ni_xcoder_params_t


Parameters
[in/out]ni_dec_ctx Pointer to ni_quadra_dec_context_t
[in]type0:sync ni_dec_input_params_t to ni_decoder_input_params_t 1:sync ni_decoder_input_params_t to ni_xcoder_params_t 2:copy semi_planar force_8_bit to ni_dec_input_params_t
Returns
On success NI_RETCODE_SUCCESS On failure NI_RETCODE_FAILURE NI_QUADRA_PARAM_WARNING_DEPRECATED

Definition at line 1461 of file ni_quadra_dec_api.c.