33 #elif defined(__linux__) || defined(__APPLE__)
35 #if defined(__linux__)
36 #include <sys/types.h>
38 #include <sys/ioctl.h>
41 #include <sys/ioctl.h>
57 #if defined(__linux__)
70 #if defined(__linux__) || defined(__APPLE__)
71 static struct stat g_nvme_stat = { 0 };
170 if (err == ni_logan_err2str_desc[i].err)
172 return ni_logan_err2str_desc[i].
str;
175 return "UNKNOWN_ERROR";
257 ni_logan_pthread_mutex_init(&p_ctx->
mutex);
265 #ifdef MEASURE_LATENCY
280 ni_logan_pthread_mutex_destroy(&p_ctx->
mutex);
293 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
304 event_handle = CreateEvent(NULL, FALSE, FALSE, NULL);
305 if (event_handle == NI_INVALID_EVENT_HANDLE)
309 return NI_INVALID_EVENT_HANDLE;
313 return NI_INVALID_EVENT_HANDLE;
327 if (NI_INVALID_EVENT_HANDLE == event_handle)
330 __FUNCTION__, (int64_t)event_handle);
338 retval = CloseHandle(event_handle);
342 __FUNCTION__,
NI_ERRNO, event_handle);
347 __FUNCTION__, event_handle);
349 #elif defined(__linux__) || defined(__APPLE__)
352 err = close(event_handle);
387 if (!p_dev || !p_max_io_size_out)
391 return NI_INVALID_DEVICE_HANDLE;
402 *p_max_io_size_out = 0;
404 HANDLE device_handle = CreateFile( p_dev,
405 GENERIC_READ | GENERIC_WRITE,
406 FILE_SHARE_READ | FILE_SHARE_WRITE,
409 FILE_FLAG_NO_BUFFERING,
413 if (INVALID_HANDLE_VALUE == device_handle)
422 return device_handle;
424 #elif defined(__linux__) || defined(__APPLE__)
427 ni_device_handle_t fd = NI_INVALID_DEVICE_HANDLE;
431 #if defined(__linux__)
432 *p_max_io_size_out = ni_logan_get_kernel_max_io_size(p_dev);
433 #elif defined(__APPLE__)
434 *p_max_io_size_out = MAX_IO_TRANSFER_SIZE;
440 #if defined(__linux__)
442 fd = open(p_dev, O_RDWR | O_SYNC | O_DIRECT);
443 #elif defined(__APPLE__)
445 fd = open(p_dev, O_RDWR | O_SYNC);
452 fd = NI_INVALID_DEVICE_HANDLE;
455 #if defined(__APPLE__)
457 retval = fcntl(fd, F_NOCACHE, 1);
463 fd = NI_INVALID_DEVICE_HANDLE;
467 retval = fstat(fd, &g_nvme_stat);
473 fd = NI_INVALID_DEVICE_HANDLE;
477 if (!S_ISCHR(g_nvme_stat.st_mode) && !S_ISBLK(g_nvme_stat.st_mode))
482 fd = NI_INVALID_DEVICE_HANDLE;
506 if ( NI_INVALID_DEVICE_HANDLE == device_handle )
517 retval = CloseHandle(device_handle);
521 "error: %d\n", __FUNCTION__, device_handle,
527 __FUNCTION__, device_handle);
529 #elif defined(__linux__) || defined(__APPLE__)
532 err = close(device_handle);
573 void * p_buffer = NULL;
575 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
579 if ( (NI_INVALID_DEVICE_HANDLE == device_handle) || (!p_cap) )
599 if (NI_INVALID_EVENT_HANDLE == event_handle)
659 int least_model_load = 0;
660 int least_real_load = 0;
661 int least_instance = 0;
663 int num_sw_instances = 0;
664 int user_handles =
false;
665 ni_lock_handle_t lock = NI_INVALID_LOCK_HANDLE;
666 ni_device_handle_t handle = NI_INVALID_DEVICE_HANDLE;
667 ni_device_handle_t handle1 = NI_INVALID_DEVICE_HANDLE;
669 uint32_t dummy_io_size = 0;
678 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
707 p_ctx->
hw_id = temphw_id;
717 if ((handle1 == NI_INVALID_DEVICE_HANDLE) && (handle == NI_INVALID_DEVICE_HANDLE))
719 if (p_ctx->
hw_id >=0)
751 #elif defined(__linux__) || defined(__APPLE__)
784 char str_fw_API_ver[3];
809 for (i = 0; i < num_coders; i++)
820 if (! p_device_context)
823 device_type, tmp_id);
831 if (NI_INVALID_DEVICE_HANDLE == p_session_context.
device_handle)
840 if (NI_INVALID_EVENT_HANDLE == p_session_context.
event_handle)
849 memcpy(str_fw_API_ver,
853 fw_API_ver =
atoi(str_fw_API_ver);
858 if (NI_INVALID_DEVICE_HANDLE != p_session_context.
device_handle)
864 if (NI_INVALID_EVENT_HANDLE != p_session_context.
event_handle)
884 ((p_dev_info->
load == least_real_load) && (p_dev_info->
active_num_inst < num_sw_instances))) &&
888 least_real_load = p_dev_info->
load;
925 "available %s device.\n",
956 #elif defined(__linux__) || defined(__APPLE__)
995 else if ((handle1 == NI_INVALID_DEVICE_HANDLE) || (handle == NI_INVALID_DEVICE_HANDLE))
1003 user_handles =
true;
1007 ni_log(
NI_LOG_TRACE,
"Finish open the session dev:%s blk:%s guid:%d handle:%p handle1:%p\n",
1011 ni_log(
NI_LOG_TRACE,
"Finish open the session dev:%s blk:%s guid:%d handle:%d handle1:%d\n",
1016 switch (device_type)
1035 if (user_handles !=
true)
1058 if (p_enc_params && p_enc_params->
hwframes &&
1084 if (user_handles !=
true)
1102 if (user_handles !=
true)
1119 if (user_handles !=
true)
1169 p_device_pool = NULL;
1174 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1208 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1231 switch (device_type)
1247 retval = ni_logan_uploader_session_close(p_ctx, eos_recieved);
1295 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1328 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1330 switch (device_type)
1350 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1378 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1382 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1404 uint8_t *hdr_data, uint8_t hdr_size)
1408 if (! p_ctx || ! hdr_data)
1415 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1418 0 == memcmp(p_ctx->
p_hdr_buf, hdr_data, hdr_size))
1430 memcpy(p_ctx->
p_hdr_buf, hdr_data, hdr_size);
1443 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1463 uint8_t *p_tmp_data = NULL;
1464 uint8_t tmp_data_size = 0;
1473 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1498 if (p_tmp_data && tmp_data_size && p_ctx->
p_leftover)
1510 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1545 if (!p_ctx || !p_data)
1552 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1562 "hw:%d, session:%d\n", __FUNCTION__, p_ctx->
hw_id, p_ctx->
session_id);
1567 switch (device_type)
1589 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1622 if (!p_ctx || !p_data)
1629 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1644 switch (device_type)
1648 int seq_change_read_count = 0;
1658 if ((0 == retval) && seq_change_read_count)
1667 else if (retval < 0)
1670 __FUNCTION__, retval);
1679 "%ux%u %dbits -> %ux%u %dbits, continue read \n", __FUNCTION__,
1687 seq_change_read_count++;
1711 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1745 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
1747 switch (device_type)
1767 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
1800 void* p_buffer = NULL;
1801 int metadata_size = 0;
1805 int width_aligned = video_width;
1806 int height_aligned = video_height;
1808 if ((!p_frame) || ((factor!=1) && (factor!=2))
1822 width_aligned = ((video_width + 31) / 32) * 32;
1823 height_aligned = ((video_height + 7) / 8) * 8;
1826 height_aligned = ((video_height + 15) / 16) * 16;
1830 width_aligned, height_aligned, video_width, video_height);
1832 int luma_size = width_aligned * height_aligned * factor;
1833 int chroma_b_size = luma_size / 4;
1834 int chroma_r_size = chroma_b_size;
1836 int buffer_size = 0;
1838 if (hw_frame_count == 0)
1840 buffer_size = luma_size + chroma_b_size + chroma_r_size + metadata_size;
1863 #ifndef XCODER_SIM_ENABLED
1872 buffer = malloc(buffer_size);
1902 p_frame->
data_len[1] = chroma_b_size;
1903 p_frame->
data_len[2] = chroma_r_size;
1958 void* p_buffer = NULL;
1960 int width_aligned = video_width;
1961 int height_aligned = video_height;
1963 if (!p_frame || (factor != 1 && factor != 2) ||
1972 width_aligned = ((video_width + 31) / 32) * 32;
1973 height_aligned = ((video_height + 7) / 8) * 8;
1976 height_aligned = ((video_height + 15) / 16) * 16;
1980 width_aligned, height_aligned, video_width, video_height);
1982 int luma_size = width_aligned * height_aligned * factor;
1983 int chroma_b_size = luma_size / 4;
1984 int chroma_r_size = chroma_b_size;
1985 int buffer_size = luma_size + chroma_b_size + chroma_r_size +
2026 p_frame->
p_data[1] = (uint8_t*)p_frame->
p_data[0] + luma_size;
2027 p_frame->
p_data[2] = (uint8_t*)p_frame->
p_data[1] + chroma_b_size;
2028 p_frame->
p_data[3] = (uint8_t*)p_frame->
p_data[2] + chroma_r_size;
2036 p_frame->
data_len[1] = chroma_b_size;
2037 p_frame->
data_len[2] = chroma_r_size;
2079 void* p_buffer = NULL;
2080 int height_aligned = video_height;
2083 if (!p_frame || !linesize || linesize[0] <= 0 ||
2095 height_aligned = ((video_height + 7) / 8) * 8;
2099 height_aligned = ((video_height + 15) / 16) * 16;
2108 "extra_len=%d\n", __FUNCTION__, video_width, height_aligned,
2109 video_width, video_height, linesize[0], linesize[1], linesize[2],
2112 int luma_size = linesize[0] * height_aligned;
2113 int chroma_b_size = luma_size / 4;
2114 int chroma_r_size = luma_size / 4;
2115 int buffer_size = luma_size + chroma_b_size + chroma_r_size + extra_len;
2131 #ifndef XCODER_SIM_ENABLED
2140 p_buffer = malloc(buffer_size);
2150 memset(p_buffer, 0, buffer_size);
2162 p_frame->
p_data[1] = (uint8_t*)p_frame->
p_data[0] + luma_size;
2163 p_frame->
p_data[2] = (uint8_t*)p_frame->
p_data[1] + chroma_b_size;
2164 p_frame->
p_data[3] = (uint8_t*)p_frame->
p_data[2] + chroma_r_size;
2167 p_frame->
data_len[1] = chroma_b_size;
2168 p_frame->
data_len[2] = chroma_r_size;
2223 p_frame->
p_data[i] = NULL;
2274 p_frame->
p_data[i] = NULL;
2313 void* p_buffer = NULL;
2314 int metadata_size = 0;
2322 __FUNCTION__, packet_size + metadata_size);
2324 if (!p_packet || !packet_size)
2349 __FUNCTION__, buffer_size);
2350 #ifndef XCODER_SIM_ENABLED
2359 p_buffer = malloc(buffer_size);
2360 if (p_buffer == NULL)
2368 memset(p_buffer, 0, buffer_size);
2442 const void*
const p_source,
2448 int padding_size = 0;
2449 int prev_size = p_prev_size == NULL? 0 : *p_prev_size;
2450 int total_size = cur_size + prev_size;
2451 uint8_t* p_src = (uint8_t*)p_source;
2452 uint8_t* p_dst = (uint8_t*)p_destination;
2453 uint8_t* p_lftover = (uint8_t*)p_leftover;
2456 __FUNCTION__, cur_size, copy_size, *p_prev_size);
2458 if (0 == cur_size && 0 == prev_size)
2463 if (((0 != cur_size) && (!p_source)) || (!p_destination) || (!p_leftover))
2470 if (copy_size > total_size)
2472 padding_size = copy_size - total_size;
2477 memcpy(p_dst, p_lftover, prev_size);
2482 memcpy(p_dst, p_src, cur_size);
2487 memset(p_dst, 0, padding_size);
2496 __FUNCTION__, cur_size, copy_size, *p_prev_size);
2748 char keyChar[10] =
"";
2750 char valChar[10] =
"";
2764 FILE *reconf = fopen(reconf_file,
"r");
2768 NI_ERRNO, __FUNCTION__, reconf_file);
2772 while ((readc = fgetc(reconf)) != EOF)
2779 strncat(keyChar, (
const char *)(&readc), 1);
2783 strncat(valChar, (
const char *)(&readc), 1);
2786 else if (readc ==
':')
2789 key =
atoi(keyChar);
2790 hash_map[idx][0] = key;
2792 else if (readc ==
',')
2794 val =
atoi(valChar);
2795 hash_map[idx][valIdx] = val;
2797 memset(valChar, 0, 10);
2799 else if (readc ==
'\n')
2802 val =
atoi (valChar);
2803 hash_map[idx][valIdx] = val;
2805 memset(keyChar,0,10);
2806 memset(valChar,0,10);
2812 "to mistaken reconfiguration values \n", readc);
2823 #define atoi(p_str) ni_logan_atoi(p_str, &b_error)
2824 #define atof(p_str) ni_logan_atof(p_str, &b_error)
2825 #define atobool(p_str) (ni_logan_atobool(p_str, &b_error))
2842 bool b_error =
false;
2843 bool bNameWasBool =
false;
2844 bool bValueWasNull = !value;
2846 char nameBuf[64] = { 0 };
2847 const char delim[2] =
",";
2848 const char xdelim[2] =
"x";
2865 if (name[0] ==
'-' && name[1] ==
'-')
2871 if (strlen(name) + 1 <
sizeof(nameBuf) && strchr(name,
'_'))
2874 strcpy(nameBuf, name);
2875 while ((c = strchr(nameBuf,
'_')) != 0)
2883 if (!strncmp(name,
"no-", 3))
2888 else if (!strncmp(name,
"no", 2))
2897 else if (value[0] ==
'=')
2903 #define OPT(STR) else if (!_stricmp(name, STR))
2904 #define OPT2(STR1, STR2) else if (!_stricmp(name, STR1) || !_stricmp(name, STR2))
2906 #define OPT(STR) else if (!strcasecmp(name, STR))
2907 #define OPT2(STR1, STR2) else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))
2913 if (!strncmp(value,
"hw", 2)){
2916 else if (!strncmp(value,
"sw", 2)) {
2921 __FUNCTION__, value);
2980 if (
atoi(value) != 0 &&
atoi(value) != 1 &&
atoi(value) != 2)
2988 if(
atoi(value) != 0 &&
atoi(value) != 1)
2996 if (
atoi(value) != 0 &&
atoi(value) != 1)
3011 b_error |= bValueWasNull && !bNameWasBool;
3013 ni_log(
NI_LOG_TRACE,
"ni_logan_decoder_params_set_value: exit, b_error=%d\n", b_error);
3021 #define atoi(p_str) ni_logan_atoi(p_str, &b_error)
3022 #define atof(p_str) ni_logan_atof(p_str, &b_error)
3023 #define atobool(p_str) (ni_logan_atobool(p_str, &b_error))
3027 const int l_levels_264[] = {10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 52, 60, 61, 62, 0};
3028 const int l_levels_265[] = {10, 20, 21, 30, 31, 40, 41, 50, 51, 52, 60, 61, 62, 0};
3029 const int *l_levels = l_levels_264;
3038 l_levels = l_levels_265;
3041 while( *l_levels != 0 )
3043 if ( *l_levels == level )
3074 bool b_error =
false;
3075 bool bNameWasBool =
false;
3076 bool bValueWasNull = !value;
3078 char nameBuf[64] = { 0 };
3097 if (name[0] ==
'-' && name[1] ==
'-')
3103 if (strlen(name) + 1 <
sizeof(nameBuf) && strchr(name,
'_'))
3107 strncat(nameBuf, name, strlen(name));
3108 while ((c = strchr(nameBuf,
'_')) != 0)
3116 if (!strncmp(name,
"no-", 3))
3121 else if (!strncmp(name,
"no", 2))
3130 else if (value[0] ==
'=')
3136 #define OPT(STR) else if (!_stricmp(name, STR))
3137 #define OPT2(STR1, STR2) else if (!_stricmp(name, STR1) || !_stricmp(name, STR2))
3139 #define OPT(STR) else if (!strcasecmp(name, STR))
3140 #define OPT2(STR1, STR2) else if (!strcasecmp(name, STR1) || !strcasecmp(name, STR2))
3142 #define COMPARE(STR1, STR2, STR3) \
3143 if ((atoi(STR1) > STR2) || (atoi(STR1) < STR3)) \
3145 ni_log(NI_LOG_ERROR, "Invalid %s: out of range\n", name); \
3146 return NI_LOGAN_RETCODE_PARAM_ERROR_OOR; \
3148 #define COMPARE_F(STR1, STR2, STR3) \
3149 if ((atof(STR1) > STR2) || (atof(STR1) < STR3)) \
3151 return NI_LOGAN_RETCODE_PARAM_ERROR_OOR; \
3153 #define CHECK2VAL(STR, VAL1, VAL2) \
3154 if (atoi(STR) != VAL1 && atoi(STR) != VAL2) \
3156 ni_log(NI_LOG_ERROR, "Invalid %s: out of range\n", name); \
3157 return NI_LOGAN_RETCODE_PARAM_ERROR_OOR; \
3223 p_enc->
level_idc = (int)(10 * strtof(value, NULL));
3224 if ( ( p_enc->
level_idc== 0 && strcmp(value,
"0") )||
3225 ( strlen(value) > 3 ) ||
3226 ( ni_logan_check_level(p_enc->
level_idc,
3341 if (
atoi(value) <= 0 )
3380 if (!_strnicmp(value,
"ratio", 5))
3382 if (!strncasecmp(value,
"ratio", 5))
3386 char value_buf[32] = {0};
3389 if((value[i+6]) ==
']')
3395 value_buf[i] = value[i+6];
3403 if (
atoi(value_buf) < 0)
3413 if (
atoi(value) < 0)
3426 if (!_strnicmp(value,
"ratio", 5))
3428 if (!strncasecmp(value,
"ratio", 5))
3432 char value_buf[32] = {0};
3435 if((value[i+6]) ==
']')
3441 value_buf[i] = value[i+6];
3449 if (
atoi(value_buf) < 0)
3459 if (
atoi(value) < 0)
3555 pTemp = strchr(value,
'.');
3558 if(strlen(pTemp) > 3)
3566 p_params->
crf = (float)
atof(value);
3571 pTemp = strchr(value,
'.');
3574 if(strlen(pTemp) > 3)
3587 pTemp = strchr(value,
'.');
3590 if(strlen(pTemp) > 3)
3663 if (
atoi(value) != 0 &&
atoi(value) != 1)
3672 if (
atoi(value) != 0 &&
atoi(value) != 1)
3681 if (
atoi(value) != 0 &&
atoi(value) != 1)
3705 if (
atoi(value) < -12 ||
atoi(value) > 12)
3723 b_error |= bValueWasNull && !bNameWasBool;
3772 "or roiEnable is enabled\n");
3786 #define atoi(p_str) ni_logan_atoi(p_str, &b_error)
3787 #define atof(p_str) ni_logan_atof(p_str, &b_error)
3788 #define atobool(p_str) (ni_logan_atobool(p_str, &b_error))
3808 bool b_error =
false;
3809 bool bNameWasBool =
false;
3810 bool bValueWasNull = !value;
3813 char nameBuf[64] = { 0 };
3817 if (!p_params || !name)
3826 if ((name[0] ==
'-') && (name[1] ==
'-'))
3832 if (strlen(name) + 1 <
sizeof(nameBuf) && strchr(name,
'_'))
3836 strncat(nameBuf, name, strlen(name));
3837 while ((c = strchr(nameBuf,
'_')) != 0)
3845 if (!strncmp(name,
"no-", 3))
3850 else if (!strncmp(name,
"no", 2))
3859 else if (value[0] ==
'=')
3865 #define OPT(STR) else if (!_stricmp(name, STR))
3867 #define OPT(STR) else if (!strcasecmp(name, STR))
4137 b_error |= bValueWasNull && !bNameWasBool;
4203 __FUNCTION__, gopPreset);
4254 __FUNCTION__, gopPreset);
4279 "aux_data number !\n");
4284 ret->
size = data_size;
4285 ret->
data = calloc(1, data_size);
4312 const uint8_t* raw_data,
4318 memcpy(ret->
data, raw_data, data_size);
4363 if (aux->
type == type)
4414 void * p_buffer = NULL;
4416 ni_event_handle_t event_handle = NI_INVALID_EVENT_HANDLE;
4420 if (NI_INVALID_DEVICE_HANDLE == device_handle || !p_serial_num)
4438 if (NI_INVALID_EVENT_HANDLE == event_handle)
4483 ni_logan_pthread_mutex_lock(&src_p_ctx->
mutex);
4488 ni_logan_pthread_mutex_unlock(&src_p_ctx->
mutex);
4514 int seq_change_read_count = 0;
4516 if (!p_ctx || !p_data)
4522 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
4536 "AVW x AVH %u x %u\n ", p_ctx->
frame_num,
4540 if (0 == retval && seq_change_read_count)
4549 else if (retval < 0)
4552 __FUNCTION__, retval);
4562 "bits -> %ux%u %dbits, continue read ...\n", __FUNCTION__,
4570 seq_change_read_count++;
4578 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
4603 if (!hwdesc || !p_data)
4610 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
4631 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
4654 unsigned int hwaddress = 0;
4656 if (!hwdesc || !p_src_data)
4662 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
4671 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
4701 void* p_buffer = NULL;
4702 int height_aligned = video_height;
4714 int chroma_b_size = 0;
4715 int chroma_r_size = 0;
4731 #ifndef XCODER_SIM_ENABLED
4739 p_buffer = malloc(buffer_size);
4748 memset(p_buffer, 0, buffer_size);
4759 p_frame->
p_data[0] = NULL;
4760 p_frame->
p_data[1] = NULL;
4761 p_frame->
p_data[2] = NULL;
4797 const int linesize[],
const int heightsize[])
4801 int luma, chroma_b, chroma_r;
4808 switch (pixel_format)
4827 switch (pixel_format)
4831 luma = linesize[0] * heightsize[0];
4832 chroma_b = linesize[1] * heightsize[1];
4833 chroma_r = linesize[2] * heightsize[2];
4867 unsigned int hwaddress = 0;
4874 if (p_ctx == NULL || p_frame == NULL || p_frame->
p_data[3] == NULL)
4883 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
4887 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
4914 uexp.
fn = p_ctx->
fn;
4920 ni_log(
NI_LOG_ERROR,
"%s: Failed to export dmabuf %d errno %d, offset %x, length %d\n",
4925 *p_surface = hwdesc;
4951 struct pollfd pfds[1] = {0};
4954 if (p_upl_ctx == NULL || p_frame == NULL)
4960 if (p_frame->
p_data[3] == NULL)
4969 pfds[0].events = POLLIN;
4970 pfds[0].revents = 0;
4972 ret = poll(pfds, 1, -1);
4985 "%s: failed to attach dmabuf read fence errno %d\n", __func__,
5011 if ((p_upl_ctx == NULL) || (p_frame == NULL))
5014 p_upl_ctx, p_frame);
5020 if (p_surface == NULL)
5053 uint8_t *p_data, uint32_t len,
5060 if (p_upl_ctx == NULL || p_data == NULL || p_hwframe == NULL)
5066 if (p_hwframe->
p_data[3] == NULL)
5083 "%s: Failed to request dmabuf rendering errno %d\n", __func__,
5111 int width,
int height,
int bit_depth,
int src_endian)
5116 if (p_enc_ctx == NULL || p_enc_params == NULL)
5122 if (!(bit_depth == 8) && !(bit_depth == 10))
5148 alignedw = ((width + 1) / 2) * 2;
5150 (alignedw - width) / 2 * 2;
5163 alignedh = ((height + 1) / 2) * 2;
5165 (alignedh - height) / 2 * 2;
5183 ni_device_handle_t device_handle,
5184 ni_event_handle_t event_handle)
5226 uint32_t pool_size, uint32_t p2p_pool)
5236 ni_logan_pthread_mutex_lock(&p_ctx->
mutex);
5240 ni_logan_pthread_mutex_unlock(&p_ctx->
mutex);
5264 int video_width,
int video_height,
5265 int linesize[],
int alignment,
int extra_len)
5268 void *p_buffer = NULL;
5271 int luma_size, chroma_b_size, chroma_r_size;
5279 switch (pixel_format)
5318 switch (pixel_format)
5324 luma_size = linesize[0] * height_aligned;
5325 chroma_b_size = luma_size / 4;
5326 chroma_r_size = luma_size / 4;
5328 buffer_size = luma_size + chroma_b_size + chroma_r_size + extra_len;
5355 memset(p_buffer, 0, buffer_size);
5365 switch (pixel_format)
5372 p_frame->
p_data[1] = (uint8_t*) p_frame->
p_data[0] + luma_size;
5373 p_frame->
p_data[2] = (uint8_t*) p_frame->
p_data[1] + chroma_b_size;
5374 p_frame->
p_data[3] = NULL;
5377 p_frame->
data_len[1] = chroma_b_size;
5378 p_frame->
data_len[2] = chroma_r_size;
5392 __FUNCTION__, video_width, video_height, buffer_size);
5431 void* p_buffer = NULL;
5434 if (!p_frame || !linesize || linesize[0] <= 0 ||
5438 !buffer[0] || !buffer[1] || !buffer[2])
5446 "extra_len=%d\n", __FUNCTION__, video_width, video_height,
5447 linesize[0], linesize[1], linesize[2],
5450 int buffer_size = extra_len;
5464 #ifndef XCODER_SIM_ENABLED
5472 p_buffer = malloc(buffer_size);
5481 memset(p_buffer, 0, buffer_size);
5492 p_frame->
p_data[0] = buffer[0];
5493 p_frame->
p_data[1] = buffer[1];
5494 p_frame->
p_data[2] = buffer[2];
5496 p_frame->
data_len[0] = linesize[0] * video_height;
5537 const int linesize[],
5538 const int dst_stride[],
5539 const int src_height[],
5540 const int dst_height[],
5541 const int bit_depth_factor,
5542 const uint8_t *
data[])
5545 width % 2 == 0 && dst_stride[0] == width * bit_depth_factor &&
5547 dst_height[0] == src_height[0] &&
5548 dst_height[1] == src_height[1] &&
5549 dst_height[2] == src_height[2] &&
5550 dst_stride[0] == linesize[0] &&
5551 dst_stride[1] == linesize[1] &&
5552 dst_stride[2] == linesize[2] &&
5553 data[1] ==
data[0] + dst_stride[0] * height &&
5554 data[2] ==
data[1] + dst_stride[1] * height / 2)
@ NI_LOGAN_RETCODE_PARAM_ERROR_MN_QP
@ NI_LOGAN_RETCODE_ERROR_INVALID_HANDLE
@ NI_LOGAN_RETCODE_NVME_SC_VPU_GENERAL_ERROR
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_R
@ NI_LOGAN_RETCODE_PARAM_ERROR_HEIGHT_TOO_SMALL
@ NI_LOGAN_RETCODE_ERROR_INVALID_SESSION
@ NI_LOGAN_RETCODE_PARAM_ERROR_ZERO
@ NI_LOGAN_RETCODE_PARAM_ERROR_FRATE
@ NI_LOGAN_RETCODE_PARAM_INVALID_VALUE
@ NI_LOGAN_RETCODE_PARAM_ERROR_TOO_SMALL
@ NI_LOGAN_RETCODE_PARAM_ERROR_OOR
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_TOP
@ NI_LOGAN_RETCODE_PARAM_ERROR_USR_RMD_ENC_PARAM
@ NI_LOGAN_RETCODE_PARAM_ERROR_CU_SIZE_MODE
@ NI_LOGAN_RETCODE_PARAM_ERROR_TRATE
@ NI_LOGAN_RETCODE_PARAM_ERROR_GOP_PRESET
@ NI_LOGAN_RETCODE_PARAM_ERROR_AREA_TOO_BIG
@ NI_LOGAN_RETCODE_PARAM_ERROR_RCENABLE
@ NI_LOGAN_RETCODE_PARAM_ERROR_WIDTH_TOO_SMALL
@ NI_LOGAN_RETCODE_NVME_SC_RESOURCE_IS_EMPTY
@ NI_LOGAN_RETCODE_ERROR_UNLOCK_DEVICE
@ NI_LOGAN_RETCODE_DEFAULT_SESSION_ERR_NO
@ NI_LOGAN_RETCODE_PARAM_GOP_INTRA_INCOMPATIBLE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_L
@ NI_LOGAN_RETCODE_NVME_SC_REQUEST_IN_PROGRESS
@ NI_LOGAN_RETCODE_PARAM_ERROR_TOO_BIG
@ NI_LOGAN_RETCODE_ERROR_RESOURCE_UNAVAILABLE
@ NI_LOGAN_RETCODE_PARAM_ERROR_MX_QP
@ NI_LOGAN_RETCODE_PARAM_ERROR_BRATE_LT_TRATE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSIZE_MODE_8X8_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_DY_MERGE_16X16_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSIZE_MODE_16X16_EN
@ NI_LOGAN_RETCODE_ERROR_NVME_CMD_FAILED
@ NI_LOGAN_RETCODE_INVALID_PARAM
@ NI_LOGAN_RETCODE_ERROR_MEM_ALOC
@ NI_LOGAN_RETCODE_PARAM_ERROR_DY_MERGE_8X8_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_PIC_HEIGHT
@ NI_LOGAN_RETCODE_PARAM_ERROR_INTRA_PERIOD
@ NI_LOGAN_RETCODE_ERROR_VPU_RECOVERY
@ NI_LOGAN_RETCODE_PARAM_INVALID_NAME
@ NI_LOGAN_RETCODE_ERROR_GET_DEVICE_POOL
@ NI_LOGAN_RETCODE_PARAM_ERROR_BRATE
@ NI_LOGAN_RETCODE_PARAM_ERROR_HEIGHT_TOO_BIG
@ NI_LOGAN_RETCODE_PARAM_ERROR_RCINITDELAY
@ NI_LOGAN_RETCODE_PARAM_ERROR_MAXNUMMERGE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CONF_WIN_BOT
@ NI_LOGAN_RETCODE_PARAM_ERROR_HVS_QP_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSTOM_GOP
@ NI_LOGAN_RETCODE_SUCCESS
@ NI_LOGAN_RETCODE_NVME_SC_WRITE_BUFFER_FULL
@ NI_LOGAN_RETCODE_FAILURE
@ NI_LOGAN_RETCODE_NVME_SC_VPU_RECOVERY
@ NI_LOGAN_RETCODE_PARAM_ERROR_PIC_WIDTH
@ NI_LOGAN_RETCODE_PARAM_ERROR_DY_MERGE_32X32_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_MX_DELTA_QP
@ NI_LOGAN_RETCODE_NVME_SC_RESOURCE_UNAVAILABLE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CUSIZE_MODE_32X32_EN
@ NI_LOGAN_RETCODE_PARAM_ERROR_HVS_QP_SCL
@ NI_LOGAN_RETCODE_PARAM_ERROR_INTRA_QP
@ NI_LOGAN_RETCODE_PARAM_ERROR_DECODING_REFRESH_TYPE
@ NI_LOGAN_RETCODE_PARAM_ERROR_CU_LVL_RC_EN
@ NI_LOGAN_RETCODE_ERROR_LOCK_DOWN_DEVICE
@ NI_LOGAN_RETCODE_PARAM_ERROR_WIDTH_TOO_BIG
@ NI_LOGAN_RETCODE_ERROR_INVALID_ALLOCATION_METHOD
@ NI_LOGAN_RETCODE_ERROR_OPEN_DEVICE
@ NI_LOGAN_RETCODE_ERROR_EXCEED_MAX_NUM_SESSIONS
@ NI_LOGAN_RETCODE_PARAM_ERROR_RC_INIT_DELAY
@ NI_LOGAN_RETCODE_NVME_SC_VPU_RSRC_INSUFFICIENT
@ NI_LOGAN_RETCODE_PARAM_ERROR_MX_NUM_MERGE
@ NI_LOGAN_RETCODE_NVME_SC_INVALID_PARAMETER
@ NI_LOGAN_RETCODE_NVME_SC_REQUEST_NOT_COMPLETED
@ NI_LOGAN_RETCODE_NVME_SC_RESOURCE_NOT_FOUND
#define NI_LOGAN_INVALID_SEI_TYPE
#define NI_LOGAN_APP_ENC_FRAME_META_DATA_SIZE
#define NI_INVALID_IO_SIZE
#define NI_LOGAN_MAX_NUM_DATA_POINTERS
#define NI_LOGAN_XCODER_API_VER_SZ
#define NI_LOGAN_XCODER_VER_SZ
#define NI_LOGAN_MEM_PAGE_ALIGNMENT
@ NI_LOGAN_DEVICE_TYPE_UPLOAD
@ NI_LOGAN_DEVICE_TYPE_ENCODER
@ NI_LOGAN_DEVICE_TYPE_DECODER
#define NI_LOGAN_MAX_PACKET_SZ
#define NI_LOGAN_XCODER_API_FLAVOR_SZ
#define NI_LOGAN_FW_META_DATA_SZ
#define COMPARE_F(STR1, STR2, STR3)
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.
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.
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.
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 ...
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.
#define COMPARE(STR1, STR2, STR3)
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.
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.
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_...
ni_logan_session_context_t * ni_logan_device_session_context_alloc_init(void)
Allocates and initializes a new ni_logan_session_context_t struct.
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...
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 f...
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.
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.
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_...
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 a...
const char *const g_logan_xcoder_preset_names[NI_LOGAN_XCODER_PRESET_NAMES_ARRAY_LEN]
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.
void ni_logan_frame_wipe_aux_data(ni_logan_frame_t *frame)
Free and remove all auxiliary data from the frame.
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.
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.
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_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...
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.
#define CHECK2VAL(STR, VAL1, VAL2)
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,...
void ni_logan_device_session_context_init(ni_logan_session_context_t *p_ctx)
Initialize already allocated session context to a known state.
int ni_logan_get_num_reorder_of_gop_structure(ni_logan_encoder_params_t *p_params)
Get GOP's max number of reorder frames.
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_e...
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.
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.
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.
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 ...
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.
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 t...
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()
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.
void ni_logan_close_event(ni_event_handle_t event_handle)
Closes event and releases resources.
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 ...
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.
int ni_logan_get_num_ref_frame_of_gop_structure(ni_logan_encoder_params_t *p_params)
Get GOP's number of reference frames.
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 I...
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.
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.
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 t...
void ni_logan_device_session_context_clear(ni_logan_session_context_t *p_ctx)
Clear already allocated session context to all zeros.
const char * ni_logan_err2str(int err)
Convert error numver into error messages.
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.
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.
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.
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.
void ni_logan_device_session_context_free(ni_logan_session_context_t *p_ctx)
Frees previously allocated session context.
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,...
const char *const g_logan_xcoder_log_names[NI_LOGAN_XCODER_LOG_NAMES_ARRAY_LEN]
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.
struct _ni_err_rc_txt_entry ni_logan_err2str_entry_t
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....
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_T...
ni_event_handle_t ni_logan_create_event(void)
Create event and returnes event handle if successful.
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.
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 ...
void ni_logan_device_close(ni_device_handle_t device_handle)
Closes device and releases resources.
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.
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.
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.
Main NETINT device API header file provides the ability to communicate with NI T-408 type hardware tr...
#define NI_LOGAN_ENC_PARAM_CONF_WIN_BOTTOM
#define NI_LOGAN_ENC_GOP_PARAMS_G4_TEMPORAL_ID
#define NI_LOGAN_ENC_GOP_PARAMS_G4_NUM_REF_PIC_L0
#define NI_LOGAN_MAX_INTRA_QP
#define NI_LOGAN_ENC_PARAM_FRAME_RATE_DENOM
#define NI_LOGAN_ENC_GOP_PARAMS_G3_NUM_REF_POC_L0
#define NI_LOGAN_XCODER_LOG_NAME_FULL
#define NI_LOGAN_ENC_PARAM_INTRA_QP
#define NI_LOGAN_ENC_PARAM_ENTROPY_CODING_MODE
#define NI_LOGAN_DEC_PARAM_LOW_DELAY_MODE
#define NI_LOGAN_ENC_GOP_PARAMS_G7_PIC_TYPE
#define NI_LOGAN_ENC_GOP_PARAMS_G0_NUM_REF_POC_L0
#define NI_LOGAN_ENC_PARAM_LEVEL
#define NI_LOGAN_ENC_PARAM_MAX_DELTA_QP
#define NI_LOGAN_MAX_MIN_QP
#define NI_LOGAN_ENC_GOP_PARAMS_G0_PIC_TYPE
#define NI_LOGAN_ENC_PARAM_ENABLE_HVS_QP
#define BEST_MODEL_LOAD_STR
#define NI_LOGAN_SESSION_OPEN_RETRY_INTERVAL_US
#define NI_LOGAN_ENC_PARAM_MIN_QP
#define NI_LOGAN_ENC_PARAM_INTRA_REFRESH_RESET
#define NI_LOGAN_ENC_GOP_PARAMS_G6_NUM_REF_PIC_L0
#define NI_LOGAN_ENC_PARAM_SAR_DENOM
#define LOGAN_AV_CODEC_DEFAULT_BITRATE
#define NI_LOGAN_DEFAULT_INTRA_QP
#define NI_LOGAN_ENC_GOP_PARAMS_G3_TEMPORAL_ID
#define NI_LOGAN_ENC_PARAM_DISABLE_TIMING_INFO
#define NI_LOGAN_ENC_GOP_PARAMS_G0_NUM_REF_POC_L1
#define NI_LOGAN_DEC_PARAM_SAVE_PKT
#define NI_LOGAN_ENC_PARAM_MAX_QP
#define NI_LOGAN_MAX_CUSTOM_SEI_PASSTHRU
#define NI_LOGAN_MIN_DECODING_REFRESH_TYPE
#define NI_LOGAN_ENC_PARAM_AVC_SLICE_MODE
#define NI_LOGAN_MIN_INTRA_PERIOD
#define NI_LOGAN_ENC_PARAM_HRD_ENABLE
#define NI_LOGAN_MAX_GOP_SIZE
#define NI_LOGAN_MIN_MAX_DELTA_QP
struct _ni_logan_hwframe_surface ni_logan_hwframe_surface_t
#define NI_LOGAN_ENC_GOP_PARAMS_G6_POC_OFFSET
#define NI_LOGAN_ENC_PARAM_ENABLE_VFR
#define NI_LOGAN_ENC_GOP_PARAMS_G2_PIC_QP
#define NI_LOGAN_ENC_PARAM_LOSSLESS_ENABLE
#define NI_LOGAN_ENC_PARAM_HIGH_TIER
#define NI_LOGAN_ENC_PARAM_PROFILE
#define NI_LOGAN_MAX_KEEP_ALIVE_TIMEOUT
#define NI_LOGAN_MIN_KEEP_ALIVE_TIMEOUT
#define NI_LOGAN_MAX_GOP_PRESET_IDX
#define NI_LOGAN_ENC_PARAM_CONF_WIN_LEFT
#define NI_LOGAN_ENC_GOP_PARAMS_G3_NUM_REF_POC_L1
#define NI_LOGAN_ENC_GOP_PARAMS_G2_PIC_TYPE
#define NI_LOGAN_ENC_PARAM_BITRATE
#define NI_LOGAN_MIN_PRIORITY
#define NI_LOGAN_ENC_PARAM_CHROMA_QP_OffSET
#define NI_LOGAN_ENC_PARAM_DOLBY_VISION_PROFILE
#define NI_LOGAN_ENABLE_USR_DATA_SEI_PASSTHRU
#define NI_LOGAN_ENC_GOP_PARAMS_G5_NUM_REF_POC_L0
#define NI_LOGAN_ENC_PARAM_LOW_DELAY
#define NI_LOGAN_ENC_GOP_PARAMS_G7_NUM_REF_POC_L0
#define NI_LOGAN_PARAM_MAX_HEIGHT
#define NI_LOGAN_ENC_PARAM_VIDEO_FULL_RANGE_FLAG
#define NI_LOGAN_ENC_PARAM_ENABLE_MB_LEVEL_RC
#define NI_LOGAN_ENC_PARAM_AVC_SLICE_ARG
#define NI_LOGAN_ENC_PARAM_CRF
#define NI_LOGAN_ENC_GOP_PARAMS_G2_NUM_REF_POC_L0
#define NI_LOGAN_ENC_PARAM_ROI_ENABLE
#define NI_LOGAN_DEC_PARAM_OUT
@ NI_LOGAN_CODEC_HW_DOWNLOAD
#define NI_LOGAN_ENC_PARAM_RC_INIT_DELAY
#define NI_LOGAN_KEEP_ALIVE_TIMEOUT
#define NI_LOGAN_MAX_MAX_QP
#define NI_LOGAN_ENC_GOP_PARAMS_G3_POC_OFFSET
#define NI_LOGAN_ENC_PARAM_ROI_DEMO_MODE
#define NI_LOGAN_ENC_GOP_PARAMS_G4_NUM_REF_POC_L1
#define NI_LOGAN_ENC_GOP_PARAMS_G7_POC_OFFSET
#define NI_LOGAN_MIN_INTRA_QP
#define NI_LOGAN_ENC_PARAM_FRAME_RATE
#define NI_LOGAN_ENC_PARAM_SLICE_ARG
#define NI_LOGAN_PARAM_MAX_WIDTH
#define NI_LOGAN_ENC_GOP_PARAMS_G6_NUM_REF_POC_L0
#define NI_LOGAN_ENC_PARAM_GOP_PRESET_IDX
#define NI_LOGAN_ENC_PARAM_DECODING_REFRESH_TYPE
#define NI_LOGAN_ENC_GOP_PARAMS_CUSTOM_GOP_SIZE
#define NI_LOGAN_DISABLE_USR_DATA_SEI_PASSTHRU
#define NI_LOGAN_ENC_PARAM_INTRA_MB_REFRESH_ARG
#define NI_LOGAN_ENC_PARAM_ENABLE_HVS_QP_SCALE
#define NI_LOGAN_ENC_PARAM_PREFERRED_TRANSFER_CHARACTERISTICS
#define NI_LOGAN_ENC_GOP_PARAMS_G5_NUM_REF_PIC_L0
#define NI_LOGAN_XCODER_PRESET_NAME_DEFAULT
#define NI_LOGAN_MIN_MIN_QP
#define NI_LOGAN_XCODER_LOG_NAME_DEBUG
#define NI_LOGAN_INVALID_HW_META_IDX
#define NI_LOGAN_ENC_GOP_PARAMS_G7_TEMPORAL_ID
#define NI_LOGAN_ENC_PARAM_COLOR_TRANSFER_CHARACTERISTIC
#define NI_LOGAN_ENC_PARAM_ENABLE_RATE_CONTROL
#define NI_LOGAN_ENC_PARAM_INTRA_REFRESH_MODE
#define NI_LOGAN_ENC_GOP_PARAMS_G1_PIC_TYPE
#define NI_LOGAN_ENC_PARAM_CRF_IP_RATIO
#define NI_LOGAN_XCODER_LOG_NAME_INFO
#define NI_LOGAN_MAX_INTRA_REFRESH_MIN_PERIOD
#define NI_LOGAN_ENC_GOP_PARAMS_G6_TEMPORAL_ID
#define NI_LOGAN_ENC_GOP_PARAMS_G2_NUM_REF_POC_L1
#define NI_LOGAN_ENC_GOP_PARAMS_G7_NUM_REF_POC_L1
#define NI_LOGAN_MIN_WIDTH
#define NI_LOGAN_ENC_PARAM_GEN_HDRS
#define NI_LOGAN_DISABLE_CHECK_PACKET
#define NI_LOGAN_ENC_PARAM_SAR_NUM
#define NI_LOGAN_ENC_GOP_PARAMS_G7_NUM_REF_PIC_L0
#define NI_LOGAN_ENC_PARAM_CACHE_ROI
#define NI_LOGAN_ENC_GOP_PARAMS_G5_TEMPORAL_ID
#define NI_LOGAN_ENC_GOP_PARAMS_G1_NUM_REF_PIC_L0
#define NI_LOGAN_MAX_DECODING_REFRESH_TYPE
#define NI_LOGAN_DEFAULT_MAX_QP
#define NI_LOGAN_MAX_RESOLUTION_HEIGHT
#define NI_LOGAN_XCODER_LOG_NAME_ERROR
#define NI_LOGAN_ENC_PARAM_USE_RECOMMENDED_ENC_PARAMS
#define NI_LOGAN_ENABLE_CHECK_PACKET
#define NI_LOGAN_ENC_GOP_PARAMS_G2_NUM_REF_PIC_L0
#define NI_LOGAN_ENC_PARAM_COLOR_PRIMARY
#define NI_LOGAN_ENC_PARAM_PADDING
#define NI_LOGAN_ENC_PARAM_ENABLE_8X8_TRANSFORM
#define NI_LOGAN_MAX_PRIORITY
#define NI_LOGAN_ENC_GOP_PARAMS_G0_POC_OFFSET
#define NI_LOGAN_ENC_PARAM_FLUSH_GOP
#define NI_LOGAN_MAX_INTRA_PERIOD
#define NI_LOGAN_ENC_GOP_PARAMS_G0_NUM_REF_PIC_L0
#define NI_LOGAN_PARAM_MIN_WIDTH
#define NI_LOGAN_ENC_GOP_PARAMS_G4_NUM_REF_POC_L0
#define NI_LOGAN_ENC_PARAM_FORCE_FRAME_TYPE
#define NI_LOGAN_ENC_GOP_PARAMS_G1_TEMPORAL_ID
#define NI_LOGAN_DEC_PARAM_CUSTOM_SEI_PASSTHRU
#define NI_LOGAN_MAX_SEI_DATA
#define NI_LOGAN_ENC_PARAM_TRANS_RATE
#define NI_LOGAN_DEC_PARAM_ENABLE_VUI_INFO_PASSTHRU
#define NI_LOGAN_XCODER_LOG_NAME_WARN
#define NI_LOGAN_ENC_PARAM_ENABLE_AUD
#define NI_LOGAN_ENC_PARAM_INTRA_REFRESH_MIN_PERIOD
#define NI_LOGAN_ENC_PARAM_SLICE_MODE
#define NI_LOGAN_XCODER_PRESET_NAME_CUSTOM
#define NI_LOGAN_ENC_PARAM_RECONF_FILE
#define NI_LOGAN_ENC_GOP_PARAMS_G7_PIC_QP
enum _ni_logan_frame_aux_data_type ni_aux_data_type_t
#define NI_LOGAN_ENC_GOP_PARAMS_G1_NUM_REF_POC_L0
#define NI_LOGAN_ENC_PARAM_LOG_LEVEL
#define NI_LOGAN_MIN_HEIGHT
#define NI_LOGAN_ENC_PARAM_CBR
#define NI_LOGAN_ENC_GOP_PARAMS_G1_POC_OFFSET
#define NI_LOGAN_XCODER_LOG_NAME_NONE
#define NI_LOGAN_VPU_CEIL(_data, _align)
#define NI_LOGAN_ENC_PARAM_INTRA_MB_REFRESH_MODE
#define NI_LOGAN_ENC_GOP_PARAMS_G1_PIC_QP
#define NI_LOGAN_ENC_PARAM_HVS_QP_SCALE
#define BEST_DEVICE_INST_STR
#define NI_LOGAN_SET_HIGH_PRIORITY
#define NI_LOGAN_ENC_GOP_PARAMS_G1_NUM_REF_POC_L1
#define NI_LOGAN_DEFAULT_KEEP_ALIVE_TIMEOUT
#define NI_LOGAN_MAX_SESSION_OPEN_RETRIES
#define NI_LOGAN_ENC_PARAM_MAX_FRAME_SIZE_BYTES
#define NI_LOGAN_XCODER_PRESET_NAMES_ARRAY_LEN
#define NI_LOGAN_DEFAULT_MIN_QP
#define NI_LOGAN_MIN_BITRATE
#define NI_LOGAN_MIN_MAX_QP
#define NI_LOGAN_ENC_PARAM_FORCE_PIC_QP_DEMO_MODE
#define NI_LOGAN_ENC_GOP_PARAMS_G6_NUM_REF_POC_L1
#define NI_LOGAN_ENC_GOP_PARAMS_G0_PIC_QP
#define NI_LOGAN_ENC_GOP_PARAMS_G4_PIC_TYPE
#define NI_LOGAN_MAX_BITRATE
#define NI_LOGAN_DEC_PARAM_CHECK_PACKET
#define NI_LOGAN_MAX_MAX_DELTA_QP
#define NI_LOGAN_INVALID_HWID
#define NI_LOGAN_VPU_ALIGN8(_x)
#define NI_LOGAN_ENC_GOP_PARAMS_G6_PIC_QP
#define NI_LOGAN_ENC_PARAM_LOG
#define NI_LOGAN_MIN_USE_RECOMMENDED_ENC_PARAMS
#define NI_LOGAN_MIN_GOP_SIZE
#define NI_LOGAN_ENC_GOP_PARAMS_G5_POC_OFFSET
#define NI_LOGAN_VPU_ALIGN16(_x)
#define NI_LOGAN_MAX_GOP_NUM
#define NI_LOGAN_ENC_GOP_PARAMS_G5_NUM_REF_POC_L1
@ LOGAN_SESSION_RUN_STATE_NORMAL
#define NI_LOGAN_DEC_PARAM_ENABLE_FOLLOW_IFRAME
#define NI_LOGAN_ENC_PARAM_CRF_PB_RATIO
#define NI_LOGAN_ENC_PARAM_MAX_FRAME_SIZE_BITS
#define NI_LOGAN_FRAME_LITTLE_ENDIAN
#define NI_LOGAN_DEFAULT_MAX_DELTA_QP
#define NI_LOGAN_ENC_GOP_PARAMS_G5_PIC_QP
#define NI_LOGAN_MIN_CUSTOM_SEI_PASSTHRU
#define NI_LOGAN_ENC_PARAM_ENABLE_CU_LEVEL_RATE_CONTROL
#define NI_LOGAN_ENC_REPEAT_HEADERS_ALL_KEY_FRAMES
enum _ni_logan_codec_format ni_logan_codec_format_t
This is an enumeration for supported codec formats.
#define NI_LOGAN_MIN_INTRA_REFRESH_MIN_PERIOD
#define NI_MAX_NUM_AUX_DATA_PER_FRAME
#define NI_LOGAN_ENC_PARAM_MAX_FRAME_SIZE
#define NI_LOGAN_DEC_PARAM_LOW_DELAY
#define NI_LOGAN_ENC_GOP_PARAMS_G2_POC_OFFSET
#define NI_LOGAN_ENC_GOP_PARAMS_G3_PIC_TYPE
#define NI_LOGAN_MAX_USE_RECOMMENDED_ENC_PARAMS
#define NI_LOGAN_ENC_PARAM_LONG_TERM_REFERENCE_ENABLE
#define NI_LOGAN_ENC_PARAM_USE_LOW_DELAY_POC_TYPE
#define NI_LOGAN_ENC_PARAM_INTRA_REFRESH_ARG
#define NI_LOGAN_ENC_PARAM_ENABLE_EXPLICIT_RPL
@ NI_LOGAN_CODEC_FORMAT_H265
@ NI_LOGAN_CODEC_FORMAT_H264
#define NI_LOGAN_ENC_GOP_PARAMS_G3_NUM_REF_PIC_L0
#define NI_LOGAN_MAX_RESOLUTION_AREA
@ NI_LOGAN_PIX_FMT_YUV420P
@ NI_LOGAN_PIX_FMT_YUV420P10BE
@ NI_LOGAN_PIX_FMT_YUV420P10LE
@ NI_LOGAN_PIX_FMT_YUVJ420P
#define NI_LOGAN_ENC_GOP_PARAMS_G4_PIC_QP
#define NI_LOGAN_ENC_PARAM_CONF_WIN_TOP
#define NI_LOGAN_INVALID_SESSION_ID
#define NI_LOGAN_DEC_PARAM_USR_DATA_SEI_PASSTHRU
#define NI_LOGAN_ENC_PARAM_RECONF_DEMO_MODE
#define NI_LOGAN_ENC_PARAM_COLOR_SPACE
#define NI_LOGAN_ENC_GOP_PARAMS_G4_POC_OFFSET
#define NI_LOGAN_ENC_PARAM_FORCED_HEADER_ENABLE
#define NI_LOGAN_ENC_PARAM_CONF_WIN_RIGHT
#define NI_LOGAN_PARAM_MIN_HEIGHT
#define NI_LOGAN_ENC_PARAM_STRICT_TIMEOUT_MODE
#define NI_LOGAN_ENC_PARAM_INTRA_PERIOD
#define NI_LOGAN_ENC_GOP_PARAMS_G0_TEMPORAL_ID
#define NI_LOGAN_MAX_RESOLUTION_WIDTH
#define NI_LOGAN_ENC_GOP_PARAMS_G5_PIC_TYPE
#define NI_LOGAN_XCODER_LOG_NAMES_ARRAY_LEN
#define NI_LOGAN_ENC_GOP_PARAMS_G2_TEMPORAL_ID
#define NI_LOGAN_ENC_GOP_PARAMS_G3_PIC_QP
#define NI_LOGAN_ENC_GOP_PARAMS_G6_PIC_TYPE
#define NI_LOGAN_FRAME_BIG_ENDIAN
#define NI_LOGAN_MIN_GOP_PRESET_IDX
ni_logan_retcode_t ni_logan_decoder_session_query(ni_logan_session_context_t *p_ctx)
Query current decoder status.
ni_logan_retcode_t ni_logan_encoder_session_close(ni_logan_session_context_t *p_ctx, int eos_recieved)
Close a xcoder encoder instance.
int ni_logan_encoder_session_read(ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
Retrieve an encoded packet from encoder.
ni_logan_retcode_t ni_get_memory_offset(ni_logan_session_context_t *p_ctx, const ni_logan_hwframe_surface_t *hwdesc, unsigned int *p_offset, unsigned int hwaddress)
Get an address offset from a hw descriptor.
int ni_logan_hwupload_session_write(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Send a YUV to hardware, hardware will store it.
int ni_logan_encoder_session_query(ni_logan_session_context_t *p_ctx)
Query current encoder status.
int ni_logan_decoder_session_write(ni_logan_session_context_t *p_ctx, ni_logan_packet_t *p_packet)
Send a video p_packet to decoder.
ni_logan_retcode_t ni_logan_clear_instance_buf(ni_logan_hwframe_surface_t *surface, ni_device_handle_t device_handle, ni_event_handle_t event_handle)
clear a particular xcoder instance buffer/data The device handle is got from decoder or uploader,...
ni_logan_retcode_t ni_logan_encoder_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder encoder instance.
ni_logan_retcode_t ni_logan_encoder_session_flush(ni_logan_session_context_t *p_ctx)
Flush encoder output.
int ni_logan_hwdownload_session_read(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame, ni_logan_hwframe_surface_t *hwdesc)
Retrieve a YUV through HW descriptor from decoder.
void ni_logan_populate_serial_number(ni_logan_serial_num_t *p_serial_num, void *p_data)
Get Card Serial Number from received Nvme Indentify info.
int ni_logan_hwupload_session_read_hwdesc(ni_logan_session_context_t *p_ctx, ni_logan_hwframe_surface_t *hwdesc, unsigned int *hwaddress)
Retrieve a HW descriptor of uploaded frame The HW descriptor will contain the YUV frame index,...
ni_logan_retcode_t ni_logan_hwupload_init_framepool(ni_logan_session_context_t *p_ctx, uint32_t pool_size, uint32_t p2p_pool)
Setup framepool for hwupload. Uses decoder framepool.
ni_logan_retcode_t ni_logan_decoder_session_copy_internal(ni_logan_session_context_t *src_p_ctx, ni_logan_session_context_t *dst_p_ctx)
Copy a xcoder decoder card info and create worker thread.
void ni_logan_change_priority(void)
Set up schedule priority. First try to run with RR mode. If fails, try to set nice value....
void * ni_logan_session_keep_alive_thread(void *arguments)
decoder keep alive thread function triggers every 1 second
ni_logan_retcode_t ni_logan_decoder_session_close(ni_logan_session_context_t *p_ctx, int eos_recieved)
Close a xcoder decoder instance.
void ni_logan_populate_device_capability_struct(ni_logan_device_capability_t *p_cap, void *p_data)
Get info from received xcoder capability.
ni_logan_retcode_t ni_logan_decoder_session_flush_buffers(ni_logan_session_context_t *p_ctx)
Flush decoder output.
ni_logan_retcode_t ni_logan_decoder_session_flush(ni_logan_session_context_t *p_ctx)
Flush decoder output.
ni_logan_retcode_t ni_logan_decoder_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder decoder instance.
ni_logan_retcode_t ni_logan_uploader_session_open(ni_logan_session_context_t *p_ctx)
Open a xcoder uploader instance.
int ni_logan_decoder_session_read(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Retrieve a YUV p_frame from decoder.
int ni_logan_encoder_session_write(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Send a YUV p_frame to encoder.
ni_logan_retcode_t ni_logan_decoder_session_read_desc(ni_logan_session_context_t *p_ctx, ni_logan_frame_t *p_frame)
Retrieve a hw desc p_frame from decoder When yuvbypass enabled, this is used for decoder to read hard...
Private definitions used by main ni_device_api_logan file.
void ni_log(ni_log_level_t level, const char *fmt,...)
print log message using ni_log_callback
Definitions related to NETINT P2P kernel driver interface.
#define NETINT_LOGAN_IOCTL_SIGNAL_RFENCE
#define NETINT_LOGAN_IOCTL_ISSUE_REQ
#define NETINT_LOGAN_IOCTL_EXPORT_DMABUF
#define NETINT_LOGAN_IOCTL_ATTACH_RFENCE
@ NI_DMABUF_WRITE_TO_DEVICE
int32_t ni_logan_nvme_send_read_cmd(ni_device_handle_t handle, ni_event_handle_t event_handle, void *p_data, uint32_t data_len, uint32_t lba)
Compose a io read command.
Definitions related to working with NI T-408 over NVME interface.
#define NI_LOGAN_NVME_IDENTITY_CMD_DATA_SZ
#define IDENTIFY_DEVICE_R
uint32_t ni_logan_nvme_result_t
ni_logan_device_context_t * ni_logan_rsrc_get_device_context(ni_logan_device_type_t device_type, int guid)
Allocates and returns a pointer to ni_logan_device_context_t struct based on provided device_type and...
void ni_logan_rsrc_free_device_pool(ni_logan_device_pool_t *p_device_pool)
Free all resources taken by the device pool.
int ni_logan_find_device_index_by_name(void *device_coders, ni_logan_device_type_t device_type, const char *dev_name)
the card with the card name like /dev/nvme0n1 get the device index.
void ni_logan_rsrc_free_device_context(ni_logan_device_context_t *p_device_context)
Free previously allocated device context.
ni_logan_device_context_t * ni_logan_rsrc_allocate_simple_direct(ni_logan_device_type_t device_type, int guid)
Allocate resources for decoding/encoding, by designating explicitly the device to use....
int ni_logan_rsrc_unlock(int device_type, ni_lock_handle_t lock)
unlock a file lock
ni_logan_device_pool_t * ni_logan_rsrc_get_device_pool(void)
Create and return the allocated ni_logan_device_pool_t struct.
int ni_logan_rsrc_lock_and_open(int device_type, ni_lock_handle_t *lock)
lock a file lock and open a session on a device
Exported definitions related to resource management of NI T-408 devices.
Private definitions related to resource management of NI T-408 devices.
void ni_logan_rsrc_update_record(ni_logan_device_context_t *p_device_context, ni_logan_session_context_t *p_session_ctx)
Updates the codec record.
int32_t ni_logan_posix_memalign(void **pp_memptr, size_t alignment, size_t size)
int32_t ni_logan_atobool(const char *p_str, bool *b_error)
Convert string to boolean.
int32_t ni_logan_parse_name(const char *arg, const char *const *names, bool *b_error)
Parse name.
void ni_logan_get_hw_yuv420p_dim(int width, int height, int bit_depth_factor, int is_h264, int plane_stride[NI_LOGAN_MAX_NUM_DATA_POINTERS], int plane_height[NI_LOGAN_MAX_NUM_DATA_POINTERS])
Get dimension information of Netint HW YUV420p frame to be sent to encoder for encoding....
void ni_logan_usleep(int64_t usec)
void ni_logan_buf_pool_return_buffer(ni_logan_buf_t *buf, ni_logan_buf_pool_t *p_buffer_pool)
return a used memory buffer to the pool
ni_logan_buf_t * ni_logan_buf_pool_get_buffer(ni_logan_buf_pool_t *p_buffer_pool)
get a free memory buffer from the pool
Exported utility routines definition.
#define ni_logan_aligned_free(p_memptr)
struct _ni_logan_buf_pool_t * pool
ni_logan_gop_params_t pic_param[NI_LOGAN_MAX_GOP_NUM]
ni_logan_decoder_input_params_t dec_input_params
ni_logan_device_info_t * p_device_info
char dev_name[NI_LOGAN_MAX_DEVICE_NAME_LEN]
char blk_name[NI_LOGAN_MAX_DEVICE_NAME_LEN]
ni_logan_device_queue_t * p_device_queue
int32_t decoders[LOGAN_MAX_DEVICE_CNT]
int32_t encoders[LOGAN_MAX_DEVICE_CNT]
int force_pic_qp_demo_mode
ni_logan_encoder_input_params_t enc_input_params
uint32_t ui32minIntraRefreshCycle
int use_low_delay_poc_type
int color_transfer_characteristic
ni_logan_frame_t * p_first_frame
int video_full_range_flag
uint32_t data_len[NI_LOGAN_MAX_NUM_DATA_POINTERS]
ni_aux_data_t * aux_data[NI_MAX_NUM_AUX_DATA_PER_FRAME]
void * p_data[NI_LOGAN_MAX_NUM_DATA_POINTERS]
int32_t device_handle_ext
ni_logan_encoder_change_params_t * enc_change_params
ni_event_handle_t thread_event_handle
uint64_t prev_read_frame_time
uint32_t set_high_priority
uint32_t keep_alive_timeout
uint32_t active_bit_depth
ni_logan_enc_avc_roi_custom_map_t * avc_roi_map
ni_device_handle_t sender_handle
ni_device_handle_t device_handle
ni_logan_lat_meas_q_t * frame_time_q
ni_logan_thread_arg_struct_t * keep_alive_thread_args
ni_logan_session_run_state_t session_run_state
void * p_master_display_meta_data
ni_pthread_t keep_alive_thread
ni_event_handle_t event_handle
char blk_xcoder_name[LOGAN_MAX_CHAR_IN_DEVICE_NAME]
ni_device_handle_t blk_io_handle
ni_logan_enc_hevc_roi_custom_map_t * hevc_roi_map
uint32_t max_nvme_io_size
uint64_t session_timestamp
char dev_xcoder[LOGAN_MAX_CHAR_IN_DEVICE_NAME]
ni_region_of_interest_t * av_rois
uint32_t active_video_width
uint32_t active_video_height
ni_logan_all_custom_sei_t * pkt_custom_sei[NI_LOGAN_FIFO_SZ]
uint8_t * hevc_sub_ctu_roi_buf
char dev_xcoder_name[LOGAN_MAX_CHAR_IN_DEVICE_NAME]
union _ni_logan_session_data_io::@4 data
ni_event_handle_t thread_event_handle
uint32_t keep_alive_timeout
ni_device_handle_t device_handle
uint64_t session_timestamp