![]() |
libxcoder
5.2.0
|
NETINT filters API header file. More...
#include <assert.h>
#include <ctype.h>
#include <inttypes.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "ni_macro_defs_quadra.h"
Go to the source code of this file.
Data Structures | |
struct | _ni_fifo_buffer_t |
struct | _ni_quadra_frame_config |
struct | _ni_quadra_network_layer_params_t |
struct | _ni_quadra_network_layer_info |
struct | _ni_quadra_network_layer_offset |
struct | _ni_quadra_network_data |
struct | _ni_quadra_frameclone_desc |
struct | _ni_quadra_filter_t |
struct | _ni_quadra_split_context_t |
struct | _niquadraFrameSurface1 |
struct | NIFramesContext |
struct | AVNIDeviceContext |
struct | _ni_quadra_scaler_drawbox_params_t |
struct | _ni_quadra_scaler_watermark_params_t |
struct | _ni_quadra_scaler_multi_drawbox_params_t |
struct | _ni_quadra_scaler_multi_watermark_params_t |
struct | _ni_quadra_card_info |
struct | _ni_quadra_hw_device_info |
struct | _ni_quadra_hw_device_info_encoder_param |
struct | _ni_quadra_hw_device_info_decoder_param |
struct | _ni_quadra_hw_device_info_scaler_param |
struct | _ni_quadra_hw_device_info_ai_param |
struct | _ni_quadra_hw_device_info_threshold_param |
struct | _ni_quadra_hw_device_info_coder_param |
struct | _ni_quadra_device_queue |
struct | _ni_quadra_device_pool |
Macros | |
#define | LIB_API |
#define | NI_QUADRA_BEST_MODEL_LOAD_STR "bestmodelload" |
#define | NI_QUADRA_BEST_REAL_LOAD_STR "bestload" |
#define | NI_QUADRA_MAX_KEEP_ALIVE_TIMEOUT 100 |
#define | NI_QUADRA_MIN_KEEP_ALIVE_TIMEOUT 1 |
#define | NI_QUADRA_DEFAULT_KEEP_ALIVE_TIMEOUT 3 |
#define | MAX_QUADRA_NUM_FRAMEPOOL_HWAVFRAME 128 |
#define | NI_QUADRA_MAX_NUM_DATA_POINTERS 4 |
#define | NI_QUADRA_MAX_NUM_AUX_DATA_PER_FRAME 16 |
#define | NI_QUADRA_MAX_NUM_OF_DECODER_OUTPUTS 3 |
#define | NI_QUADRA_MAX_PPU_PARAM_EXPR_CHAR 20 |
#define | NI_QUADRA_MAX_FIFO_CAPACITY 120 |
#define | NI_QUADRA_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000)) |
#define | NI_QUADRA_MAX_WIDTH 8192 |
#define | NI_QUADRA_MIN_WIDTH 144 |
#define | NI_QUADRA_MAX_HEIGHT 8192 |
#define | NI_QUADRA_MIN_HEIGHT 128 |
#define | NIALIGN(x, a) (((x) + (a)-1) & ~((a)-1)) |
#define | NIMAX(a, b) ((a) > (b) ? (a) : (b)) |
#define | NIMIN(a, b) ((a) > (b) ? (b) : (a)) |
#define | NI_QUADRA_SCALER_FLAG_IO 0x0001 /* 0 = source frame, 1 = destination frame */ |
#define | NI_QUADRA_SCALER_FLAG_PC 0x0002 /* 0 = single allocation, 1 = create pool */ |
#define | NI_QUADRA_SCALER_FLAG_PA 0x0004 /* 0 = straight alpha, 1 = premultiplied alpha */ |
#define | NI_QUADRA_SCALER_FLAG_P2 0x0008 /* 0 = normal allocation, 1 = P2P allocation */ |
#define | NI_QUADRA_SCALER_FLAG_FCE 0x0010 /* 0 = no fill color, 1 = fill color enabled */ |
#define | NI_QUADRA_SCALER_FLAG_CS 0x0020 /* 0 = BT.709, 1 = BT.2020 */ |
#define | NI_QUADRA_SCALER_FLAG_CMP 0x0800 /* 0 = no compress, 1 = compress*/ |
#define | NI_QUADRA_AI_FLAG_IO 0x0001 /* 0 = source frame, 1 = destination frame */ |
#define | NI_QUADRA_AI_FLAG_PC 0x0002 /* 0 = single allocation, 1 = create pool */ |
#define | NI_QUADRA_MAX_RESOLUTION_WIDTH 8192 |
#define | NI_QUADRA_MAX_RESOLUTION_HEIGHT 8192 |
#define | NI_QUADRA_MIN_RESOLUTION_WIDTH_SCALER 32 |
#define | NI_QUADRA_MIN_RESOLUTION_HEIGHT_SCALER 32 |
#define | NI_QUADRA_MAX_SUPPORT_DRAWBOX_NUM 5 |
#define | NI_QUADRA_MAX_SUPPORT_WATERMARK_NUM 6 |
#define | NI_QUADRA_MAX_DEVICE_CNT 128 |
Functions | |
LIB_API int | ni_quadra_init_filters (ni_quadra_filter_t *nifilter) |
Init filter. More... | |
LIB_API int | ni_quadra_build_frame_pool (ni_quadra_filter_t *nifilter, int width, int height, int out_format, int pool_size) |
Alloc frame pool for filter. More... | |
LIB_API int | ni_quadra_filter_frame_buffer_alloc_hwenc (ni_quadra_filter_t *nifilter, int video_width, int video_height, int extra_len) |
Allocate memory for the hwDescriptor buffer based on provided parameters taking into account pic size and extra data. More... | |
LIB_API int | ni_quadra_filter_device_alloc_frame (ni_quadra_filter_t *nifilter, int width, int height, int format, int options, int rectangle_width, int rectangle_height, int rectangle_x, int rectangle_y, int rgba_color, int frame_index, int type) |
Allocate a frame on the device for 2D engine or AI engine to work on based on provided parameters. More... | |
LIB_API int | ni_quadra_filter_device_alloc_dst_frame (ni_quadra_filter_t *nifilter, niquadraFrameSurface1_t *p_hwdesc, int type) |
Allocate a frame on the device and return the frame index. More... | |
LIB_API int | ni_quadra_filter_device_clone_hwframe (ni_quadra_filter_t *nifilter, ni_quadra_frameclone_desc_t *p_frameclone_desc) |
Copy the data of src hwframe to dst hwframe. More... | |
LIB_API int | ni_quadra_device_session_read_hwdesc (void *p_ctx, void *p_data, int device_type) |
Read data from the device If device_type is NI_DEVICE_TYPE_DECODER reads data hwdesc from decoder If device_type is NI_DEVICE_TYPE_SCALER reads data hwdesc from scaler. More... | |
LIB_API int | ni_quadra_device_session_read (void *p_ctx, void *p_data, int device_type) |
Read data from the device If device_type is NI_DEVICE_TYPE_DECODER reads data packet from decoder If device_type is NI_DEVICE_TYPE_ENCODER reads data frame from encoder If device_type is NI_DEVICE_TYPE_AI reads data frame from AI engine. More... | |
LIB_API int | ni_quadra_scaler_set_drawbox_params (ni_quadra_filter_t *nifilter, ni_quadra_scaler_drawbox_params_t *p_params) |
Send a p_config command to configure scaling drawbox parameters. More... | |
LIB_API int | ni_quadra_scaler_set_watermark_params (ni_quadra_filter_t *nifilter, ni_quadra_scaler_watermark_params_t *p_params) |
Send a p_config command to configure watermark parameters. More... | |
LIB_API int | ni_quadra_filter_get_output_data (ni_quadra_filter_t *nifilter, uint8_t *data, int width, int height) |
Get data from device. More... | |
uint8_t * | ni_quadra_filter_get_data3 (void *p_frame) |
Get niframe data3 from device. More... | |
LIB_API int | ni_quadra_filter_drawtext_prep_frames (void **niframe) |
prepare frames for ni_drawtext filter More... | |
LIB_API int | ni_quadra_filter_frame_buffer_alloc_dl (void *niframe, int video_width, int video_height, int pixel_format) |
Allocate preliminary memory for the frame buffer based on provided parameters. More... | |
LIB_API void | ni_quadra_filter_close (ni_quadra_filter_t *nifilter) |
Close filter. More... | |
LIB_API int | ni_quadra_ai_config_network_binary (ni_quadra_filter_t *nifilter, ni_quadra_network_data_t *p_network, const char *file) |
configure a network context based with the network binary More... | |
LIB_API int | ni_quadra_ai_config_hvsplus (ni_quadra_filter_t *nifilter, ni_quadra_network_data_t *p_network, int nb_width, int nb_height, int level, int format) |
configure a hvsplus context based with the network binary More... | |
LIB_API int | ni_quadra_ai_frame_buffer_alloc (void *p_frame, ni_quadra_network_data_t *p_network) |
Allocate input layers memory for AI frame buffer based on provided parameters taking into account width, height, format defined by network. More... | |
LIB_API int | ni_quadra_ai_packet_buffer_alloc (void *p_pkt, ni_quadra_network_data_t *p_network) |
Allocate output layers memory for the packet buffer based on provided network. More... | |
LIB_API uint32_t | ni_quadra_ai_network_layer_dims (ni_quadra_network_layer_params_t *p_param) |
Get dims from ni_quadra_network_layer_params_t. More... | |
LIB_API int | ni_quadra_network_layer_convert_output (void *p_data, float *dst, uint32_t num, ni_quadra_network_data_t *p_network, uint32_t layer) |
Convert data from nipacket to dst data. More... | |
int | ni_quadra_frame_buffer_alloc_pixfmt (void *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 the pixel format, width, height, stride, alignment, and extra data. More... | |
int | ni_quadra_device_session_hwdl (void *p_ctx, void *p_data, niquadraFrameSurface1_t *hwdesc) |
Reads YUV data from hw descriptor stored location on device. More... | |
LIB_API int | ni_quadra_init_internal_session (NIFramesContext *ni_ctx) |
Init filter session context only malloc session. More... | |
LIB_API int | ni_quadra_init_split_rsrc (NIFramesContext *ni_ctx, int w, int h) |
Init filter split context malloc session and set it default. More... | |
LIB_API int | ni_quadra_filter_frames_init (NIFramesContext *ni_ctx, int *width, int *height, int ni_fmat, int keep_alive_time) |
Init filter frame context and set value to session context. More... | |
LIB_API int | ni_quadra_filter_frames_close (NIFramesContext *ni_ctx, int pool_size) |
Close filter context and frame. More... | |
LIB_API void | ni_quadra_filter_device_close (AVNIDeviceContext *ni_hw_ctx) |
Close device. More... | |
LIB_API int | ni_quadra_upload_device_session_open (NIFramesContext *ni_ctx) |
Open hwupload filter. More... | |
LIB_API int | ni_quadra_filter_device_session_init_framepool (NIFramesContext *ni_ctx, uint32_t pool_size, uint32_t pool) |
Sends frame pool setup info to device. More... | |
LIB_API int | ni_quadra_filter_device_create (AVNIDeviceContext *ni_hw_ctx, const char *device) |
Sends frame pool setup info to device. More... | |
LIB_API int | ni_quadra_filter_get_buffer (NIFramesContext *ni_ctx, uint8_t **dstbuf, uint8_t **dstdata, uint32_t *buf_size, int width, int height, int is_planar) |
Sends frame pool setup info to device. More... | |
LIB_API void | ni_quadra_filter_frame_free (void *opaque, uint8_t *data) |
Free filter frame. More... | |
LIB_API int | ni_quadra_filter_hwup_frame (NIFramesContext *ni_ctx, niquadraFrameSurface1_t *dst_surf, int width, int height, int ni_fmat, int nb_planes, const int *linesize, uint8_t **src_data) |
Upload frame. More... | |
LIB_API int | ni_quadra_filter_hwdl_frame (NIFramesContext *ni_ctx, niquadraFrameSurface1_t *src_surf, int width, int height, int ni_fmat, int nb_planes, const int *linesize, uint8_t **dst_data) |
Download frame. More... | |
LIB_API void | ni_quadra_split_ctx_set (NIFramesContext *ni_ctx, niquadraFrameSurface1_t *ni_surf, niquadraFrameSurface1_t *ni_surf_1, niquadraFrameSurface1_t *ni_surf_2, int num_extra_outputs) |
Split context set. More... | |
LIB_API int | ni_quadra_get_device_id (void *session_ctx) |
Get session device id. More... | |
LIB_API uint32_t | ni_quadra_get_session_id (void *session_ctx) |
Get session device session id. More... | |
LIB_API void | ni_quadra_device_close (int32_t handle) |
Close device handle. More... | |
LIB_API int32_t | ni_quadra_get_device_handle (void *session_ctx) |
Get session device handle id. More... | |
LIB_API void | ni_quadra_set_device_handle (void *session_ctx, int32_t handle) |
Set session device handle. More... | |
LIB_API void | ni_quadra_filter_session_dl_set (void *session_ctx, bool value) |
Set download filter session context. More... | |
LIB_API int | ni_quadra_device_session_copy (void *src_ctx, void *dst_ctx) |
Copy filter session context. More... | |
LIB_API void | ni_quadra_session_timestamp_copy (void *src_ctx, void *dst_ctx) |
Copy filter session context. More... | |
LIB_API int | ni_quadra_get_session_runstatus (void *session_ctx) |
Get session context run status. More... | |
LIB_API void | ni_quadra_set_session_runstatus (void *session_ctx, int status) |
Set session context run status. More... | |
LIB_API int | ni_quadra_get_session_status (void *session_ctx) |
Get session context status. More... | |
LIB_API int | ni_quadra_get_session_blkiohandle (void *session_ctx) |
Get session context blk_io_handle. More... | |
LIB_API uint16_t | ni_quadra_get_frame_idx (void *niframe) |
Get niframui16FrameIdxe. More... | |
LIB_API uint8_t * | ni_quadra_get_niframe (void *niframe) |
Get niframe address. More... | |
LIB_API uint8_t * | ni_quadra_get_frame_buffer (void *niframe) |
Get niframe buffer address. More... | |
LIB_API uint32_t | ni_quadra_get_frame_buffer_size (void *niframe) |
Get niframe buffer size. More... | |
LIB_API uint8_t ** | ni_quadra_get_frame_data (void *niframe) |
Get niframe data address. More... | |
LIB_API uint8_t * | ni_quadra_get_packet_data (void *nipacket) |
Get nipacket data address. More... | |
LIB_API uint32_t | ni_quadra_get_packet_data_len (void *nipacket) |
Get nipacket data len. More... | |
LIB_API void | ni_quadra_get_frame_data_len (void *niframe, uint32_t *dst_datalen) |
Get niframe data datalen. More... | |
LIB_API int | ni_quadra_filter_hwframe_recycle (void *session_ctx, void *niframe) |
Recycle a frame buffer on card. More... | |
LIB_API int | ni_quadra_filter_device_config_frame (void *p_ctx, ni_quadra_frame_config_t *p_cfg) |
Configure the 2D engine to work based on provided parameters. More... | |
LIB_API int | ni_quadra_hwframe_buffer_recycle (niquadraFrameSurface1_t *surface, int32_t device_handle) |
Recycle a frame buffer on card. More... | |
LIB_API void | ni_quadra_get_hw_yuv420p_dim (int width, int height, int factor, int is_semiplanar, int plane_stride[4], int plane_height[4]) |
Get dimension information of Netint HW YUV420p frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation. More... | |
LIB_API int | ni_quadra_get_seiset_size () |
Recycle a frame buffer on card. More... | |
LIB_API ni_fifo_buffer_t * | ni_fifo_initialize (uint32_t number_of_buffers, uint32_t size) |
Initialize a fifo buffer. More... | |
LIB_API void | ni_fifo_free (ni_fifo_buffer_t *p_fifo) |
Free a fifo. More... | |
LIB_API int | ni_fifo_is_full (ni_fifo_buffer_t *p_fifo) |
Check if a fifo is full. More... | |
LIB_API int | ni_fifo_is_empty (ni_fifo_buffer_t *p_fifo) |
Check if a fifo is empty. More... | |
LIB_API uint32_t | ni_fifo_number_of_buffers (ni_fifo_buffer_t *p_fifo) |
Get number of buffers used in fifo. More... | |
LIB_API uint8_t * | ni_fifo_generic_write (ni_fifo_buffer_t *p_fifo) |
Get free buffer to write in the fifo. More... | |
LIB_API uint8_t * | ni_fifo_generic_read (ni_fifo_buffer_t *p_fifo) |
Get first filled buffer to read in the fifo. More... | |
LIB_API int | ni_fifo_return_read (ni_fifo_buffer_t *p_fifo) |
Push back the last read buffer to the fifo. More... | |
const LIB_API uint8_t * | ni_find_start_code (const uint8_t *p, const uint8_t *end, uint32_t *state) |
Find the next start code. More... | |
LIB_API void | ni_quadra_log_set_level (int level) |
Set ni_log_level. More... | |
LIB_API void | ni_quadra_log_set_callback (void(*log_callback)(int, const char *, va_list)) |
Set ni_log() callback. More... | |
LIB_API ni_quadra_log_level_t | ni_quadra_ff_to_ni_log_level (int fflog_level) |
Convert ffmpeg log level integer to appropriate ni_quadra_log_level_t. More... | |
LIB_API ni_quadra_hw_device_info_coder_param_t * | ni_quadra_create_hw_device_info_coder_param (int mode) |
Create a pointer to hw_device_info_coder_param_t instance. This instance will be created and set to default vaule by param mode.You may change the resolution, fps, bit_8_10 and other vaule you want to set. More... | |
LIB_API void | ni_quadra_destory_hw_device_info_coder_param (ni_quadra_hw_device_info_coder_param_t *p_quadra_hw_device_info_coder_param) |
Release a pointer to hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param. More... | |
LIB_API ni_quadra_hw_device_info_t * | ni_quadra_hw_device_info_alloc (int device_type_num, int avaliable_card_num) |
Create a pointer to ni_hw_device_info_quadra_t instance . More... | |
LIB_API void | ni_quadra_hw_device_info_free (ni_quadra_hw_device_info_t *p_hw_device_info) |
Release a pointer to ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param. More... | |
LIB_API int | ni_quadra_check_hw_info (ni_quadra_hw_device_info_t **pointer_to_p_hw_device_info, int task_mode, ni_quadra_hw_device_info_threshold_param_t *hw_info_threshold_param, int preferential_device_type, ni_quadra_hw_device_info_coder_param_t *coder_param, int hw_mode, int consider_mem) |
check hw info, return the appropriate card number to use depends on the load&task_num&used resource More... | |
LIB_API int | ni_quadra_rsrc_get_device_by_block_name (const char *blk_name, ni_quadra_device_type_t device_type) |
Get GUID of the device by block device name and type. More... | |
LIB_API int | ni_quadra_device_session_open (void *p_ctx, ni_quadra_device_type_t device_type) |
Open a new device session depending on the device_type parameter If device_type is NI_DEVICE_TYPE_DECODER opens decoding session If device_type is NI_DEVICE_TYPE_ENCODER opens encoding session If device_type is NI_DEVICE_TYPE_SCALER opens scaling session. More... | |
LIB_API int | ni_quadra_device_session_write (void *p_ctx, void *p_data, ni_quadra_device_type_t device_type) |
Sends data to the device If device_type is NI_DEVICE_TYPE_DECODER sends data packet to decoder If device_type is NI_DEVICE_TYPE_ENCODER sends data frame to encoder If device_type is NI_DEVICE_TYPE_AI sends data frame to ai engine. More... | |
LIB_API int | ni_quadra_packet_buffer_free (void *p_data) |
Free packet buffer that was previously allocated with ni_packet_buffer_alloc. More... | |
LIB_API int | ni_quadra_frame_buffer_free (void *p_data) |
Free frame buffer that was previously allocated with either ni_frame_buffer_alloc or ni_encoder_frame_buffer_alloc or ni_frame_buffer_alloc_nv. More... | |
LIB_API ni_quadra_device_pool_t * | ni_quadra_rsrc_get_device_pool (void) |
Create and return the allocated ni_device_pool_t struct. More... | |
LIB_API int | ni_quadra_device_session_close (void *p_ctx, int eos_recieved, ni_quadra_device_type_t device_type) |
Close device session that was previously opened by calling ni_device_session_open() If device_type is NI_DEVICE_TYPE_DECODER closes decoding session If device_type is NI_DEVICE_TYPE_ENCODER closes encoding session If device_type is NI_DEVICE_TYPE_SCALER closes scaling session. More... | |
LIB_API void | ni_quadra_device_session_context_clear (void *p_ctx) |
Clear already allocated session context. More... | |
LIB_API int | ni_quadra_frame_buffer_alloc_hwenc (void *niframe, int video_width, int video_height, int extra_len) |
LIB_API void | ni_quadra_set_framerate (void *p_ctx, int num, int den) |
LIB_API int | ni_quadra_get_session_packet_num (void *session_ctx) |
Get session_ctx send/recive packet number. More... | |
LIB_API int | ni_quadra_get_session_frame_num (void *session_ctx) |
Get session_ctx send/recieve frame number. More... | |
#define LIB_API |
Definition at line 39 of file ni_quadra_filter_api.h.
#define MAX_QUADRA_NUM_FRAMEPOOL_HWAVFRAME 128 |
Definition at line 82 of file ni_quadra_filter_api.h.
#define NI_QUADRA_AI_FLAG_IO 0x0001 /* 0 = source frame, 1 = destination frame */ |
Definition at line 131 of file ni_quadra_filter_api.h.
#define NI_QUADRA_AI_FLAG_PC 0x0002 /* 0 = single allocation, 1 = create pool */ |
Definition at line 132 of file ni_quadra_filter_api.h.
#define NI_QUADRA_BEST_MODEL_LOAD_STR "bestmodelload" |
Definition at line 72 of file ni_quadra_filter_api.h.
#define NI_QUADRA_BEST_REAL_LOAD_STR "bestload" |
Definition at line 73 of file ni_quadra_filter_api.h.
#define NI_QUADRA_DEFAULT_KEEP_ALIVE_TIMEOUT 3 |
Definition at line 79 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_DEVICE_CNT 128 |
Definition at line 146 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_FIFO_CAPACITY 120 |
Definition at line 98 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_HEIGHT 8192 |
Definition at line 108 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_KEEP_ALIVE_TIMEOUT 100 |
Definition at line 77 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_NUM_AUX_DATA_PER_FRAME 16 |
Definition at line 89 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_NUM_DATA_POINTERS 4 |
Definition at line 86 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_NUM_OF_DECODER_OUTPUTS 3 |
Definition at line 92 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_PPU_PARAM_EXPR_CHAR 20 |
Definition at line 95 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_RESOLUTION_HEIGHT 8192 |
Definition at line 137 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_RESOLUTION_WIDTH 8192 |
Definition at line 136 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_SUPPORT_DRAWBOX_NUM 5 |
Definition at line 143 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_SUPPORT_WATERMARK_NUM 6 |
Definition at line 144 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MAX_WIDTH 8192 |
Definition at line 106 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MIN_HEIGHT 128 |
Definition at line 109 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MIN_KEEP_ALIVE_TIMEOUT 1 |
Definition at line 78 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MIN_RESOLUTION_HEIGHT_SCALER 32 |
Definition at line 140 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MIN_RESOLUTION_WIDTH_SCALER 32 |
Definition at line 139 of file ni_quadra_filter_api.h.
#define NI_QUADRA_MIN_WIDTH 144 |
Definition at line 107 of file ni_quadra_filter_api.h.
#define NI_QUADRA_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000)) |
Definition at line 101 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_CMP 0x0800 /* 0 = no compress, 1 = compress*/ |
Definition at line 128 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_CS 0x0020 /* 0 = BT.709, 1 = BT.2020 */ |
Definition at line 126 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_FCE 0x0010 /* 0 = no fill color, 1 = fill color enabled */ |
Definition at line 124 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_IO 0x0001 /* 0 = source frame, 1 = destination frame */ |
Definition at line 116 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_P2 0x0008 /* 0 = normal allocation, 1 = P2P allocation */ |
Definition at line 122 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_PA 0x0004 /* 0 = straight alpha, 1 = premultiplied alpha */ |
Definition at line 120 of file ni_quadra_filter_api.h.
#define NI_QUADRA_SCALER_FLAG_PC 0x0002 /* 0 = single allocation, 1 = create pool */ |
Definition at line 118 of file ni_quadra_filter_api.h.
#define NIALIGN | ( | x, | |
a | |||
) | (((x) + (a)-1) & ~((a)-1)) |
Definition at line 111 of file ni_quadra_filter_api.h.
#define NIMAX | ( | a, | |
b | |||
) | ((a) > (b) ? (a) : (b)) |
Definition at line 112 of file ni_quadra_filter_api.h.
#define NIMIN | ( | a, | |
b | |||
) | ((a) > (b) ? (b) : (a)) |
Definition at line 113 of file ni_quadra_filter_api.h.
typedef struct AVNIDeviceContext AVNIDeviceContext |
This struct is allocated as AVHWDeviceContext.hwctx
typedef struct _ni_fifo_buffer_t ni_fifo_buffer_t |
typedef struct _ni_quadra_card_info ni_quadra_card_info_t |
typedef enum _ni_quadra_codec_format ni_quadra_codec_format_t |
typedef enum ni_quadra_codec_hw_actions ni_quadra_codec_hw_actions_t |
This is an enumeration for hw actions.
typedef struct _ni_quadra_device_pool ni_quadra_device_pool_t |
typedef struct _ni_quadra_device_queue ni_quadra_device_queue_t |
typedef struct _ni_quadra_filter_t ni_quadra_filter_t |
typedef struct _ni_quadra_frame_config ni_quadra_frame_config_t |
typedef struct _ni_quadra_frameclone_desc ni_quadra_frameclone_desc_t |
typedef struct _ni_quadra_hw_device_info ni_quadra_hw_device_info_t |
typedef struct _ni_quadra_network_data ni_quadra_network_data_t |
typedef struct _ni_quadra_network_layer_info ni_quadra_network_layer_info_t |
typedef struct _ni_quadra_network_layer_offset ni_quadra_network_layer_offset_t |
typedef enum _ni_quadra_scaler_opcode ni_quadra_scaler_opcode_t |
typedef struct _ni_quadra_split_context_t ni_quadra_split_context_t |
typedef struct NIFramesContext NIFramesContext |
typedef struct _niquadraFrameSurface1 niquadraFrameSurface1_t |
typedef __gnuc_va_list va_list |
Definition at line 69 of file ni_quadra_filter_api.h.
Enumerator | |
---|---|
NI_QUADRA_CODEC_FORMAT_H264 | |
NI_QUADRA_CODEC_FORMAT_H265 | |
NI_QUADRA_CODEC_FORMAT_VP9 | |
NI_QUADRA_CODEC_FORMAT_JPEG | |
NI_QUADRA_CODEC_FORMAT_AV1 |
Definition at line 196 of file ni_quadra_filter_api.h.
Enumerator | |
---|---|
NI_QUADRA_PIXEL_PLANAR_FORMAT_SEMIPLANAR | |
NI_QUADRA_PIXEL_PLANAR_FORMAT_PLANAR | |
NI_QUADRA_PIXEL_PLANAR_FORMAT_TILED4X4 | |
NI_QUADRA_PIXEL_PLANAR_MAX |
Definition at line 171 of file ni_quadra_filter_api.h.
Definition at line 179 of file ni_quadra_filter_api.h.
This is an enumeration for hw actions.
Enumerator | |
---|---|
NI_QUADRA_CODEC_HW_NONE | |
NI_QUADRA_CODEC_HW_ENABLE | |
NI_QUADRA_CODEC_HW_DOWNLOAD | |
NI_QUADRA_CODEC_HW_UPLOAD | |
NI_QUADRA_CODEC_HW_RSVD | |
NI_QUADRA_CODEC_HW_PAYLOAD_OFFSET |
Definition at line 336 of file ni_quadra_filter_api.h.
Definition at line 217 of file ni_quadra_filter_api.h.
Enumerator | |
---|---|
NI_QUADRA_LOG_INVALID | |
NI_QUADRA_LOG_NONE | |
NI_QUADRA_LOG_FATAL | |
NI_QUADRA_LOG_ERROR | |
NI_QUADRA_LOG_INFO | |
NI_QUADRA_LOG_DEBUG | |
NI_QUADRA_LOG_TRACE |
Definition at line 159 of file ni_quadra_filter_api.h.
enum ni_quadra_pix_fmt_t |
Definition at line 235 of file ni_quadra_filter_api.h.
enum ni_quadra_retcode_t |
Enumerator | |
---|---|
NI_QUADRA_RET_SUCCESS | |
NI_QUADRA_SEQ_CHANGE_DRAINING | |
NI_QUADRA_ERROR_VPU_RECOVERY | |
NI_QUADRA_ERROR_INVALID_SESSION | |
NI_QUADRA_EAGAIN | |
NI_QUADRA_ERROR | |
NI_QUADRA_PARAM_WARNING_DEPRECATED |
Definition at line 205 of file ni_quadra_filter_api.h.
LIB_API void ni_fifo_free | ( | ni_fifo_buffer_t * | p_fifo | ) |
Free a fifo.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 85 of file ni_quadra_filter_api.c.
LIB_API uint8_t* ni_fifo_generic_read | ( | ni_fifo_buffer_t * | p_fifo | ) |
Get first filled buffer to read in the fifo.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 178 of file ni_quadra_filter_api.c.
LIB_API uint8_t* ni_fifo_generic_write | ( | ni_fifo_buffer_t * | p_fifo | ) |
Get free buffer to write in the fifo.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 148 of file ni_quadra_filter_api.c.
LIB_API ni_fifo_buffer_t* ni_fifo_initialize | ( | uint32_t | number_of_buffers, |
uint32_t | size | ||
) |
Initialize a fifo buffer.
[in] | number_of_buffers | Total number of buffers in this fifo |
[in] | size | The size of every buffer |
Definition at line 44 of file ni_quadra_filter_api.c.
LIB_API int ni_fifo_is_empty | ( | ni_fifo_buffer_t * | p_fifo | ) |
Check if a fifo is empty.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 123 of file ni_quadra_filter_api.c.
LIB_API int ni_fifo_is_full | ( | ni_fifo_buffer_t * | p_fifo | ) |
Check if a fifo is full.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 111 of file ni_quadra_filter_api.c.
LIB_API uint32_t ni_fifo_number_of_buffers | ( | ni_fifo_buffer_t * | p_fifo | ) |
Get number of buffers used in fifo.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 135 of file ni_quadra_filter_api.c.
LIB_API int ni_fifo_return_read | ( | ni_fifo_buffer_t * | p_fifo | ) |
Push back the last read buffer to the fifo.
[in] | p_fifo | The pointer of ni_fifo_buffer_t |
Definition at line 207 of file ni_quadra_filter_api.c.
const LIB_API uint8_t* ni_find_start_code | ( | const uint8_t * | p, |
const uint8_t * | end, | ||
uint32_t * | state | ||
) |
Find the next start code.
[in] | p | pointer to buffer start address. |
[in] | end | pointer to buffer end address. |
[state] | state pointer to nalu type address |
Definition at line 2897 of file ni_av_codec.c.
LIB_API int ni_quadra_ai_config_hvsplus | ( | ni_quadra_filter_t * | nifilter, |
ni_quadra_network_data_t * | p_network, | ||
int | nb_width, | ||
int | nb_height, | ||
int | level, | ||
int | format | ||
) |
configure a hvsplus context based with the network binary
[in] | nifilter | Pointer to ni_quadra_filter_t |
[in] | p_network | Pointer to caller allocated ni_quadra_network_data_t |
[in] | nb_width | Width for network binary |
[in] | nb_height | Height for network binary |
[in] | level | Hvsplus level |
[in] | format | Pixel format |
Definition at line 583 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_ai_config_network_binary | ( | ni_quadra_filter_t * | nifilter, |
ni_quadra_network_data_t * | p_network, | ||
const char * | file | ||
) |
configure a network context based with the network binary
[in] | nifilter | Pointer to ni_quadra_filter_t |
[in] | p_network | Pointer to caller allocated ni_quadra_network_data_t |
[in] | file | Pointer to caller network binary file path |
Definition at line 575 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_ai_frame_buffer_alloc | ( | void * | p_frame, |
ni_quadra_network_data_t * | p_network | ||
) |
Allocate input layers memory for AI frame buffer based on provided parameters taking into account width, height, format defined by network.
[out] | p_frame | Pointer to void * |
[in] | p_network | Pointer to caller allocated ni_network_data_t |
Definition at line 600 of file ni_quadra_filter_api.c.
LIB_API uint32_t ni_quadra_ai_network_layer_dims | ( | ni_quadra_network_layer_params_t * | p_param | ) |
Get dims from ni_quadra_network_layer_params_t.
[out] | p_param | Pointer to ni_quadra_network_layer_params_t |
Definition at line 615 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_ai_packet_buffer_alloc | ( | void * | p_pkt, |
ni_quadra_network_data_t * | p_network | ||
) |
Allocate output layers memory for the packet buffer based on provided network.
[out] | p_pkt | Pointer to void * |
[in] | p_network | Pointer to a caller allocated ni_quadra_network_data_t struct |
Definition at line 607 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_build_frame_pool | ( | ni_quadra_filter_t * | nifilter, |
int | width, | ||
int | height, | ||
int | out_format, | ||
int | pool_size | ||
) |
Alloc frame pool for filter.
[in/out] | nifilter Pointer ni_quadra_filter_t | |
[in] | width | frame width |
[in] | height | frame height |
[in] | out_format | frame format |
Definition at line 381 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_check_hw_info | ( | ni_quadra_hw_device_info_t ** | pointer_to_p_hw_device_info, |
int | task_mode, | ||
ni_quadra_hw_device_info_threshold_param_t * | hw_info_threshold_param, | ||
int | preferential_device_type, | ||
ni_quadra_hw_device_info_coder_param_t * | coder_param, | ||
int | hw_mode, | ||
int | consider_mem | ||
) |
check hw info, return the appropriate card number to use depends on the load&task_num&used resource
[out] | pointer_to_p_hw_device_info | : pointer to user-supplied ni_hw_device_info_quadra_t (allocated by ni_hw_device_info_alloc). May be a ponter to NULL ,in which case a ni_hw_device_info_quadra_coder_param_t is allocated by this function and written to pointer_to_p_hw_device_info. record the device info, including available card num and which card to select, and each card's informaton, such as, the load, task num, device type |
[in] | task_mode | affect the scheduling strategy, 1 - both the load_num and task_num should consider, usually applied to live scenes 0 - only consider the task_num, don not care the load_num |
[in] | hw_info_threshold_param | : an array of threshold including device type task threshold and load threshold in hw_mode fill the arry with both encoder and decoder threshold or fill the arry with preferential device type threshold when don not in hw_mode load threshold in range[0:100] task num threshold in range [0:32] |
[in] | preferential_device_type | : which device type is preferential 0:decode 1:encode . This need to set to encoder/decoder even if in sw_mode to check whether coder_param is wrong. |
[in] | coder_param | : encoder and decoder information that helps to choose card .This coder_param can be created and set to default value by function hw_device_info_coder_param_t * create_hw_device_info_coder_param(). You may change the resolution fps bit_8_10 or other vaule you want to use |
[in] | hw_mode:Set | 1 then this function will choose encoder and decoder in just one card . When no card meets the conditions ,NO card will be choosed. You can try to use set hw_mode 0 to use sw_mode to do encoder/decoder in different card when hw_mode reports an error In hw_mode set both encoder_param and decoder_param in coder_param. Set 0 then just consider sw_mode to choose which card to do encode/decode, In sw_mode set one param in coder_param the other one will be set to NULL. |
[in] | consider_mem | : set 1 this function will consider memory usage extra set 0 this function will not consider memory usage |
Definition at line 1870 of file ni_quadra_filter_api.c.
LIB_API ni_quadra_hw_device_info_coder_param_t* ni_quadra_create_hw_device_info_coder_param | ( | int | mode | ) |
Create a pointer to hw_device_info_coder_param_t instance. This instance will be created and set to default vaule by param mode.You may change the resolution, fps, bit_8_10 and other vaule you want to set.
[in] | mode:0:create | instance with decoder_param ,encoder_param, scaler_param and ai_param will be set to NULL 1:create instance with encoder_param ,decoder_param, scaler_param and ai_param will be set to NULL 2:create instance with scaler_param ,decoder_param, encoder_param and ai_param will be set to NULL 3:create instance with ai_param ,decoder_param, encoder_param and scaler_param will be set to NULL >= 4:create instance with decoder_param encoder_param, scaler_param and ai_param for ni_check_hw_info() hw_mode |
Definition at line 1850 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_destory_hw_device_info_coder_param | ( | ni_quadra_hw_device_info_coder_param_t * | p_quadra_hw_device_info_coder_param | ) |
Release a pointer to hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param.
[in] | p_hw_device_info_coder_param:pointer | to a hw_device_info_coder_param_t instance created by create_hw_device_info_coder_param |
Definition at line 1855 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_device_close | ( | int32_t | handle | ) |
Close device handle.
[in] | handle | Handle to close |
Definition at line 1662 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_device_session_close | ( | void * | p_ctx, |
int | eos_recieved, | ||
ni_quadra_device_type_t | device_type | ||
) |
Close device session that was previously opened by calling ni_device_session_open() If device_type is NI_DEVICE_TYPE_DECODER closes decoding session If device_type is NI_DEVICE_TYPE_ENCODER closes encoding session If device_type is NI_DEVICE_TYPE_SCALER closes scaling session.
[in] | p_ctx | Pointer to a caller allocated ni_session_context_t struct |
[in] | eos_received | Flag indicating if End Of Stream indicator was received |
[in] | device_type | NI_DEVICE_TYPE_DECODER, NI_DEVICE_TYPE_ENCODER, or NI_DEVICE_TYPE_SCALER |
Definition at line 2020 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_device_session_context_clear | ( | void * | p_ctx | ) |
Clear already allocated session context.
[in] | p_ctx | Pointer to an already allocated ni_session_context_t |
Definition at line 2035 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_device_session_copy | ( | void * | src_ctx, |
void * | dst_ctx | ||
) |
Copy filter session context.
[in/out] | src_ctx Pointer to void* |
[in/out] | dst_ctx Pointer to void* |
Definition at line 1685 of file ni_quadra_filter_api.c.
int ni_quadra_device_session_hwdl | ( | void * | p_ctx, |
void * | p_data, | ||
niquadraFrameSurface1_t * | hwdesc | ||
) |
Reads YUV data from hw descriptor stored location on device.
[in] | p_ctx | Pointer to a caller allocated |
[in] | p_data | Pointer to a caller allocated ni_session_data_io_t struct which contains either a ni_frame_t data frame or ni_packet_t data packet to send |
[in] | hwdesc | HW descriptor to find frame in XCODER |
Definition at line 646 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_device_session_open | ( | void * | p_ctx, |
ni_quadra_device_type_t | device_type | ||
) |
Open a new device session depending on the device_type parameter If device_type is NI_DEVICE_TYPE_DECODER opens decoding session If device_type is NI_DEVICE_TYPE_ENCODER opens encoding session If device_type is NI_DEVICE_TYPE_SCALER opens scaling session.
[in] | p_ctx | Pointer to a caller allocated ni_session_context_t struct |
[in] | device_type | NI_DEVICE_TYPE_DECODER, NI_DEVICE_TYPE_ENCODER, or NI_DEVICE_TYPE_SCALER |
Definition at line 1912 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_device_session_read | ( | void * | p_ctx, |
void * | p_data, | ||
int | device_type | ||
) |
Read data from the device If device_type is NI_DEVICE_TYPE_DECODER reads data packet from decoder If device_type is NI_DEVICE_TYPE_ENCODER reads data frame from encoder If device_type is NI_DEVICE_TYPE_AI reads data frame from AI engine.
[in/out] | p_ctx Pointer to void * ni_session_context_t struct | |
[in/out] | p_data Pointer to void * ni_session_data_io_t struct | |
[in] | device_type | NI_DEVICE_TYPE_DECODER, NI_DEVICE_TYPE_ENCODER, or NI_DEVICE_TYPE_SCALER If NI_DEVICE_TYPE_DECODER is specified, data that was read will be placed into ni_frame_t struct inside the p_data pointer If NI_DEVICE_TYPE_ENCODER is specified, data that was read will be placed into ni_packet_t struct inside the p_data pointer If NI_DEVICE_TYPE_AI is specified, data that was read will be placed into ni_frame_t struct inside the p_data pointer |
Definition at line 455 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_device_session_read_hwdesc | ( | void * | p_ctx, |
void * | p_data, | ||
int | device_type | ||
) |
Read data from the device If device_type is NI_DEVICE_TYPE_DECODER reads data hwdesc from decoder If device_type is NI_DEVICE_TYPE_SCALER reads data hwdesc from scaler.
[in/out] | p_ctx Pointer to void * ni_session_context_t struct | |
[in/out] | p_data Pointer to void * ni_session_data_io_t struct | |
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_SCALER If NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_SCALER is specified, hw descriptor info will be stored in p_data ni_frame |
Definition at line 447 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_device_session_write | ( | void * | p_ctx, |
void * | p_data, | ||
ni_quadra_device_type_t | device_type | ||
) |
Sends data to the device If device_type is NI_DEVICE_TYPE_DECODER sends data packet to decoder If device_type is NI_DEVICE_TYPE_ENCODER sends data frame to encoder If device_type is NI_DEVICE_TYPE_AI sends data frame to ai engine.
[in] | p_ctx | Pointer to a caller allocated ni_session_context_t struct |
[in] | p_data | Pointer to a caller allocated ni_session_data_io_t struct which contains either a ni_frame_t data frame or ni_packet_t data packet to send |
[in] | device_type | NI_DEVICE_TYPE_DECODER or NI_DEVICE_TYPE_ENCODER or NI_DEVICE_TYPE_AI If NI_DEVICE_TYPE_DECODER is specified, it is expected that the ni_packet_t struct inside the p_data pointer contains data to send. If NI_DEVICE_TYPE_ENCODER or NI_DEVICE_TYPE_AI is specified, it is expected that the ni_frame_t struct inside the p_data pointer contains data to send. |
Definition at line 1948 of file ni_quadra_filter_api.c.
LIB_API ni_quadra_log_level_t ni_quadra_ff_to_ni_log_level | ( | int | fflog_level | ) |
Convert ffmpeg log level integer to appropriate ni_quadra_log_level_t.
fflog_level | integer representation of FFmpeg log level |
Definition at line 1845 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_filter_close | ( | ni_quadra_filter_t * | nifilter | ) |
Close filter.
[in/out] | nifilter Pointer ni_quadra_filter_t |
Definition at line 529 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_device_alloc_dst_frame | ( | ni_quadra_filter_t * | nifilter, |
niquadraFrameSurface1_t * | p_hwdesc, | ||
int | type | ||
) |
Allocate a frame on the device and return the frame index.
[in] | p_ctx | pointer to session context |
[in] | p_out_surface | pointer to output frame surface |
[in] | device_type | currently only NI_DEVICE_TYPE_AI |
Definition at line 428 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_device_alloc_frame | ( | ni_quadra_filter_t * | nifilter, |
int | width, | ||
int | height, | ||
int | format, | ||
int | options, | ||
int | rectangle_width, | ||
int | rectangle_height, | ||
int | rectangle_x, | ||
int | rectangle_y, | ||
int | rgba_color, | ||
int | frame_index, | ||
int | type | ||
) |
Allocate a frame on the device for 2D engine or AI engine to work on based on provided parameters.
[in/out] | nifilter Pointer ni_quadra_filter_t | |
[in] | width | width, in pixels |
[in] | height | height, in pixels |
[in] | format | pixel format |
[in] | options | options bitmap flags, bit 0 (NI_SCALER_FLAG_IO) is 0=input frame or 1=output frame. Bit 1 (NI_SCALER_FLAG_PC) is 0=single allocation, 1=create pool. Bit 2 (NI_SCALER_FLAG_PA) is 0=straight alpha, 1=premultiplied alpha |
[in] | rectangle_width | clipping rectangle width |
[in] | rectangle_height | clipping rectangle height |
[in] | rectangle_x | horizontal position of clipping rectangle |
[in] | rectangle_y | vertical position of clipping rectangle |
[in] | rgba_color | RGBA fill colour (for padding only) |
[in] | frame_index | input hwdesc index |
[in] | device_type | only NI_DEVICE_TYPE_SCALER and NI_DEVICE_TYPE_AI (only needs p_ctx and frame_index) |
Definition at line 415 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_device_clone_hwframe | ( | ni_quadra_filter_t * | nifilter, |
ni_quadra_frameclone_desc_t * | p_frameclone_desc | ||
) |
Copy the data of src hwframe to dst hwframe.
[in] | p_ctx | pointer to session context |
[in] | p_frameclone_desc | pointer to the frameclone descriptor |
Definition at line 438 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_filter_device_close | ( | AVNIDeviceContext * | ni_hw_ctx | ) |
Close device.
[in/out] | ni_hw_ctx Pointer AVNIDeviceContext |
Definition at line 720 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_device_config_frame | ( | void * | p_ctx, |
ni_quadra_frame_config_t * | p_cfg | ||
) |
Configure the 2D engine to work based on provided parameters.
[in] | p_ctx | pointer to session context |
[in] | p_cfg | pointer to ni_quadra_frame_config_t |
Definition at line 1782 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_device_create | ( | AVNIDeviceContext * | ni_hw_ctx, |
const char * | device | ||
) |
Sends frame pool setup info to device.
[in] | ni_hw_ctx | Pointer to AVNIDeviceContext |
[in] | device | string device name |
Definition at line 958 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_device_session_init_framepool | ( | NIFramesContext * | ni_ctx, |
uint32_t | pool_size, | ||
uint32_t | pool | ||
) |
Sends frame pool setup info to device.
[in] | ni_ctx | Pointer to NIFramesContext |
[in] | pool_size | Upload session initial allocated frames count must be > 0, |
[in] | pool | 0 use the normal pool 1 use a dedicated P2P pool |
Definition at line 747 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_drawtext_prep_frames | ( | void ** | niframe | ) |
prepare frames for ni_drawtext filter
[in/out] | niframe Pointer void |
Definition at line 501 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_frame_buffer_alloc_dl | ( | void * | niframe, |
int | video_width, | ||
int | video_height, | ||
int | pixel_format | ||
) |
Allocate preliminary memory for the frame buffer based on provided parameters.
[in] | niframe | Pointer void |
[in] | video_width | Width of the video frame |
[in] | video_height | Height of the video frame |
[in] | alignment | Allignment requirement |
[in] | pixel_format | Format for input |
Definition at line 520 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_frame_buffer_alloc_hwenc | ( | ni_quadra_filter_t * | nifilter, |
int | video_width, | ||
int | video_height, | ||
int | extra_len | ||
) |
Allocate memory for the hwDescriptor buffer based on provided parameters taking into account pic size and extra data.
[in/out] | nifilter Pointer ni_quadra_filter_t | |
[in] | video_width | Width of the video frame |
[in] | video_height | Height of the video frame |
[in] | extra_len | Extra data size (incl. meta data) |
Definition at line 406 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_filter_frame_free | ( | void * | opaque, |
uint8_t * | data | ||
) |
Free filter frame.
[in] | opaque | Pointer to void* |
[in] | data | Pointer to void* |
Definition at line 1052 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_frames_close | ( | NIFramesContext * | ni_ctx, |
int | pool_size | ||
) |
Close filter context and frame.
[in/out] | ni_ctx Pointer NIFramesContext | |
[in] | pool_size | avctx width |
Definition at line 755 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_frames_init | ( | NIFramesContext * | ni_ctx, |
int * | width, | ||
int * | height, | ||
int | ni_fmat, | ||
int | keep_alive_time | ||
) |
Init filter frame context and set value to session context.
[in/out] | ni_ctx Pointer NIFramesContext | |
[in] | width | avctx width |
[in] | height | avctx height |
[in] | ni_fmat | avctx format |
[in] | keep_alive_time | keep_alive_time |
Definition at line 809 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_get_buffer | ( | NIFramesContext * | ni_ctx, |
uint8_t ** | dstbuf, | ||
uint8_t ** | dstdata, | ||
uint32_t * | buf_size, | ||
int | width, | ||
int | height, | ||
int | is_planar | ||
) |
Sends frame pool setup info to device.
[in/out] | ni_ctx Pointer to NIFramesContext | |
[in] | dstbuf | Pointer dst buf |
[in] | dstdata | Pointer dst data |
[in] | buf_size | Pointer dst buf_size |
[in] | width | frame width |
[in] | height | frame height |
[in] | is_planar | frame format is nv12 |
Definition at line 1025 of file ni_quadra_filter_api.c.
uint8_t* ni_quadra_filter_get_data3 | ( | void * | p_frame | ) |
Get niframe data3 from device.
[in/out] | p_frame Pointer void |
Definition at line 495 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_get_output_data | ( | ni_quadra_filter_t * | nifilter, |
uint8_t * | data, | ||
int | width, | ||
int | height | ||
) |
Get data from device.
[in/out] | nifilter Pointer ni_quadra_filter_t | |
[in] | data | frame data |
[in] | width | frame width |
[in] | height | frame height |
Definition at line 477 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_hwdl_frame | ( | NIFramesContext * | ni_ctx, |
niquadraFrameSurface1_t * | src_surf, | ||
int | width, | ||
int | height, | ||
int | ni_fmat, | ||
int | nb_planes, | ||
const int * | linesize, | ||
uint8_t ** | dst_data | ||
) |
Download frame.
[in/out] | ni_ctx Pointer to NIFramesContext | |
[in] | src_surf | Pointer to niquadraFrameSurface1_t |
[in] | width | frame width |
[in] | height | frame height |
[in] | ni_fmat | frame format |
[in] | nb_planes | frame plane |
[in] | linesize | frame linesize |
[in] | dst_data | pointer dst data |
Definition at line 1588 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_hwframe_recycle | ( | void * | session_ctx, |
void * | niframe | ||
) |
Recycle a frame buffer on card.
[in] | session_ctx | Pointer to void* |
[in] | niframe | Pointer to void* |
Definition at line 1766 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_filter_hwup_frame | ( | NIFramesContext * | ni_ctx, |
niquadraFrameSurface1_t * | dst_surf, | ||
int | width, | ||
int | height, | ||
int | ni_fmat, | ||
int | nb_planes, | ||
const int * | linesize, | ||
uint8_t ** | src_data | ||
) |
Upload frame.
[in/out] | ni_ctx Pointer to NIFramesContext | |
[in] | dst_surf | Pointer to niquadraFrameSurface1_t |
[in] | width | frame width |
[in] | height | frame height |
[in] | ni_fmat | frame format |
[in] | nb_planes | frame plane |
[in] | linesize | frame linesize |
[in] | src_data | pointer src data |
Definition at line 1416 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_filter_session_dl_set | ( | void * | session_ctx, |
bool | value | ||
) |
Set download filter session context.
[in/out] | session_ctx Pointer to void* | |
[in] | value | Bool need to set value |
Definition at line 1679 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_frame_buffer_alloc_hwenc | ( | void * | niframe, |
int | video_width, | ||
int | video_height, | ||
int | extra_len | ||
) |
Definition at line 2041 of file ni_quadra_filter_api.c.
int ni_quadra_frame_buffer_alloc_pixfmt | ( | void * | 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 the pixel format, width, height, stride, alignment, and extra data.
[in] | p_frame | Pointer to caller allocated void |
[in] | pixel_format | a pixel format in ni_pix_fmt_t enum |
[in] | video_width | width, in pixels |
[in] | video_height | height, in pixels |
[in] | linesize | horizontal stride |
[in] | alignment | apply a 16 pixel height alignment (T408 only) |
[in] | extra_len | meta data size |
Definition at line 635 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_frame_buffer_free | ( | void * | p_data | ) |
Free frame buffer that was previously allocated with either ni_frame_buffer_alloc or ni_encoder_frame_buffer_alloc or ni_frame_buffer_alloc_nv.
[in] | p_data | Pointer to void * ni_session_data_io_t struct |
Definition at line 1982 of file ni_quadra_filter_api.c.
LIB_API int32_t ni_quadra_get_device_handle | ( | void * | session_ctx | ) |
Get session device handle id.
[in/out] | session_ctx Pointer to void* |
Definition at line 1667 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_device_id | ( | void * | session_ctx | ) |
Get session device id.
[in/out] | session_ctx Pointer to void* |
Definition at line 1650 of file ni_quadra_filter_api.c.
LIB_API uint8_t* ni_quadra_get_frame_buffer | ( | void * | niframe | ) |
Get niframe buffer address.
[in/out] | niframe Pointer to void* |
Definition at line 1726 of file ni_quadra_filter_api.c.
LIB_API uint32_t ni_quadra_get_frame_buffer_size | ( | void * | niframe | ) |
Get niframe buffer size.
[in/out] | niframe Pointer to void* |
Definition at line 1732 of file ni_quadra_filter_api.c.
LIB_API uint8_t** ni_quadra_get_frame_data | ( | void * | niframe | ) |
Get niframe data address.
[in/out] | niframe Pointer to void* |
Definition at line 1738 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_get_frame_data_len | ( | void * | niframe, |
uint32_t * | dst_datalen | ||
) |
Get niframe data datalen.
[in/out] | niframe Pointer to void* | |
[in] | dst_datalen | Pointer to int* |
Definition at line 1756 of file ni_quadra_filter_api.c.
LIB_API uint16_t ni_quadra_get_frame_idx | ( | void * | niframe | ) |
Get niframui16FrameIdxe.
[in/out] | niframe Pointer to void* |
Definition at line 1713 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_get_hw_yuv420p_dim | ( | int | width, |
int | height, | ||
int | factor, | ||
int | is_semiplanar, | ||
int | plane_stride[4], | ||
int | plane_height[4] | ||
) |
Get dimension information of Netint HW YUV420p frame to be sent to encoder for encoding. Caller usually retrieves this info and uses it in the call to ni_encoder_frame_buffer_alloc for buffer allocation.
[in] | width | source YUV frame width |
[in] | height | source YUV frame height |
[in] | factor | 1 for 8 bit, 2 for 10 bit |
[in] | is_semiplanar | 1 for semiplanar frame, 0 otherwise |
[out] | plane_stride | size (in bytes) of each plane width |
[out] | plane_height | size of each plane height |
Definition at line 1795 of file ni_quadra_filter_api.c.
LIB_API uint8_t* ni_quadra_get_niframe | ( | void * | niframe | ) |
Get niframe address.
[in/out] | niframe Pointer to void* |
Definition at line 1720 of file ni_quadra_filter_api.c.
LIB_API uint8_t* ni_quadra_get_packet_data | ( | void * | nipacket | ) |
Get nipacket data address.
[in/out] | nipacket Pointer to void* |
Definition at line 1744 of file ni_quadra_filter_api.c.
LIB_API uint32_t ni_quadra_get_packet_data_len | ( | void * | nipacket | ) |
Get nipacket data len.
[in/out] | nipacket Pointer to void* |
Definition at line 1750 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_seiset_size | ( | ) |
Recycle a frame buffer on card.
[in] | surface | Struct containing device and frame location to clear out |
[in] | device_handle | handle to access device memory buffer is stored in |
Definition at line 1829 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_session_blkiohandle | ( | void * | session_ctx | ) |
Get session context blk_io_handle.
[in/out] | session_ctx Pointer to void* |
Definition at line 1707 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_session_frame_num | ( | void * | session_ctx | ) |
Get session_ctx send/recieve frame number.
[in] | p_ctx | Pointer to an already allocated ni_session_context_t |
Definition at line 2064 of file ni_quadra_filter_api.c.
LIB_API uint32_t ni_quadra_get_session_id | ( | void * | session_ctx | ) |
Get session device session id.
[in/out] | session_ctx Pointer to void* |
Definition at line 1656 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_session_packet_num | ( | void * | session_ctx | ) |
Get session_ctx send/recive packet number.
[in] | p_ctx | Pointer to an already allocated ni_session_context_t |
Definition at line 2058 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_session_runstatus | ( | void * | session_ctx | ) |
Get session context run status.
[in/out] | session_ctx Pointer to void* |
Definition at line 1702 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_get_session_status | ( | void * | session_ctx | ) |
Get session context status.
[in/out] | session_ctx Pointer to void* |
Definition at line 1697 of file ni_quadra_filter_api.c.
LIB_API ni_quadra_hw_device_info_t* ni_quadra_hw_device_info_alloc | ( | int | device_type_num, |
int | avaliable_card_num | ||
) |
Create a pointer to ni_hw_device_info_quadra_t instance .
[in] | device_type_num:number | of device type to be allocated in this function |
[in] | avaliable_card_num:number | of avaliable card per device to be allocated in this function |
Definition at line 1860 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_hw_device_info_free | ( | ni_quadra_hw_device_info_t * | p_hw_device_info | ) |
Release a pointer to ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param.
[in] | p_hw_device_info:pointer | to a ni_hw_device_info_quadra_t instance created by create_hw_device_info_coder_param |
Definition at line 1865 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_hwframe_buffer_recycle | ( | niquadraFrameSurface1_t * | surface, |
int32_t | device_handle | ||
) |
Recycle a frame buffer on card.
[in] | surface | Struct containing device and frame location to clear out |
[in] | device_handle | handle to access device memory buffer is stored in |
Definition at line 1789 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_init_filters | ( | ni_quadra_filter_t * | nifilter | ) |
Init filter.
[in/out] | nifilter Pointer ni_quadra_filter_t |
Definition at line 228 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_init_internal_session | ( | NIFramesContext * | ni_ctx | ) |
Init filter session context only malloc session.
[in/out] | ni_ctx Pointer NIFramesContext |
Definition at line 654 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_init_split_rsrc | ( | NIFramesContext * | ni_ctx, |
int | w, | ||
int | h | ||
) |
Init filter split context malloc session and set it default.
[in/out] | ni_ctx Pointer NIFramesContext | |
[in] | w | avctx width |
[in] | h | avctx height |
Definition at line 705 of file ni_quadra_filter_api.c.
Set ni_log() callback.
[in] | callback |
Definition at line 1839 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_log_set_level | ( | int | level | ) |
Set ni_log_level.
level | log level |
Definition at line 1834 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_network_layer_convert_output | ( | void * | p_data, |
float * | dst, | ||
uint32_t | num, | ||
ni_quadra_network_data_t * | p_network, | ||
uint32_t | layer | ||
) |
Convert data from nipacket to dst data.
[in/out] | p_data Pointer to void * ni_session_data_io_t struct | |
[in] | dst | Pointer to float |
[in] | num | output_number |
[in] | p_network | Pointer to ni_quadra_network_data_t |
[in] | layer | int value |
Definition at line 625 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_packet_buffer_free | ( | void * | p_data | ) |
Free packet buffer that was previously allocated with ni_packet_buffer_alloc.
[in] | p_data | Pointer to void * ni_session_data_io_t struct |
Definition at line 1965 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_rsrc_get_device_by_block_name | ( | const char * | blk_name, |
ni_quadra_device_type_t | device_type | ||
) |
Get GUID of the device by block device name and type.
[in] | blk_name | device's block name |
[in] | type | device type |
Definition at line 1888 of file ni_quadra_filter_api.c.
LIB_API ni_quadra_device_pool_t* ni_quadra_rsrc_get_device_pool | ( | void | ) |
Create and return the allocated ni_device_pool_t struct.
None |
Definition at line 1995 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_scaler_set_drawbox_params | ( | ni_quadra_filter_t * | nifilter, |
ni_quadra_scaler_drawbox_params_t * | p_params | ||
) |
Send a p_config command to configure scaling drawbox parameters.
[in/out] | nifilter Pointer ni_quadra_filter_t | |
[in] | p_params | Pointer ni_quadra_scaler_drawbox_params_t |
Definition at line 463 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_scaler_set_watermark_params | ( | ni_quadra_filter_t * | nifilter, |
ni_quadra_scaler_watermark_params_t * | p_params | ||
) |
Send a p_config command to configure watermark parameters.
[in/out] | nifilter Pointer ni_quadra_filter_t | |
[in] | p_params | Pointer ni_quadra_scaler_watermark_params_t |
Definition at line 470 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_session_timestamp_copy | ( | void * | src_ctx, |
void * | dst_ctx | ||
) |
Copy filter session context.
[in/out] | src_ctx Pointer to void* |
[in/out] | dst_ctx Pointer to void* |
Definition at line 1690 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_set_device_handle | ( | void * | session_ctx, |
int32_t | handle | ||
) |
Set session device handle.
[in] | session_ctx | Pointer to void* |
[in] | handle | Handle to set |
Definition at line 1673 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_set_framerate | ( | void * | p_ctx, |
int | num, | ||
int | den | ||
) |
Definition at line 2050 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_set_session_runstatus | ( | void * | session_ctx, |
int | status | ||
) |
Set session context run status.
[in/out] | session_ctx Pointer to void* |
Definition at line 1776 of file ni_quadra_filter_api.c.
LIB_API void ni_quadra_split_ctx_set | ( | NIFramesContext * | ni_ctx, |
niquadraFrameSurface1_t * | ni_surf, | ||
niquadraFrameSurface1_t * | ni_surf_1, | ||
niquadraFrameSurface1_t * | ni_surf_2, | ||
int | num_extra_outputs | ||
) |
Split context set.
[in/out] | ni_ctx Pointer to NIFramesContext | |
[in] | ni_surf | Pointer to niquadraFrameSurface1_t |
[in] | ni_surf1 | Pointer to niquadraFrameSurface1_t |
[in] | ni_surf2 | Pointer to niquadraFrameSurface1_t |
[in] | num_extra_outputs | split outputs number |
Definition at line 1628 of file ni_quadra_filter_api.c.
LIB_API int ni_quadra_upload_device_session_open | ( | NIFramesContext * | ni_ctx | ) |
Open hwupload filter.
[in/out] | ni_ctx Pointer NIFramesContext |
Definition at line 742 of file ni_quadra_filter_api.c.