36 #if defined(__linux__) || defined(__APPLE__)
38 #include <sys/types.h>
92 "Baseline, Constrained Baseline, Main, High, High10",
194 const char* l = (
const char *)p_str;
195 const char* r = (
const char *)p_str1;
198 while (!isdigit(*l) && (*l) !=
'\0')
202 while (!isdigit(*r) && (*r) !=
'\0')
237 snprintf(p_name, max_name_len,
"%s/NI_LOGAN_lck_%c%d",
LOCK_DIR, type, guid);
257 snprintf(p_name, max_name_len,
"NI_LOGAN_shm_%c%d", type, guid);
273 char str_fw_ver[4], str_fw_API_fla[3], str_fw_API_ver[3];
277 const char str_API_flavor_list_delim[2] =
",";
278 int api_flavor_matched = 0;
293 fw_API_ver =
atoi(str_fw_API_ver);
296 strtok_token = strtok(str_fw_API_flav_support, str_API_flavor_list_delim);
297 while(strtok_token != NULL)
299 if (0 == strcmp(str_fw_API_fla, strtok_token))
301 api_flavor_matched = 1;
304 strtok_token = strtok(NULL, str_API_flavor_list_delim);
307 if (! (api_flavor_matched &&
350 char shm_name[32] = { 0 };
351 char lck_name[32] = { 0 };
354 HANDLE map_file_handle = NULL;
355 ni_lock_handle_t mutex_handle = NULL;
356 SECURITY_DESCRIPTOR security_descriptor = { 0 };
367 InitializeSecurityDescriptor(&security_descriptor, SECURITY_DESCRIPTOR_REVISION);
370 map_file_handle = CreateFileMapping(
371 INVALID_HANDLE_VALUE,
379 if (NULL == map_file_handle)
382 ni_log(
NI_LOG_INFO,
"ERROR %d: ni_logan_rsrc_get_one_device_info() CreateFileMapping failed for %s\n",
389 if (ERROR_ALREADY_EXISTS == rc)
391 ni_log(
NI_LOG_INFO,
"CreateFileMapping returned existing handle for %s ..\n", shm_name);
395 ni_log(
NI_LOG_INFO,
"CreateFileMapping created a new mapFile for %s, handle: %p ..\n",
396 shm_name, map_file_handle);
408 if (NULL == p_coder_info_map)
411 ni_log(
NI_LOG_INFO,
"ERROR %d: ni_logan_rsrc_get_one_device_info() Could not map view of file\n", rc);
419 if (p_coder_info_map)
421 UnmapViewOfFile(p_coder_info_map);
442 if( (!p_device_context) || (!p_session_context) )
472 #elif defined(__linux__) || defined(__APPLE__)
484 char shm_name[32] = { 0 };
485 char lck_name[32] = { 0 };
498 ni_log(
NI_LOG_INFO,
"Creating shm_name: %s , lck_name %s\n", shm_name, lck_name);
508 string param = shm_name;
509 Return<void> retvalue =
service_logan->GetAppFlag(param, [&](int32_t ret, hidl_handle handle) {
512 shm_fd = dup(handle->data[0]);
518 if(!retvalue.isOk()) {
527 native_handle_t *handle = native_handle_create(1, 0);
528 handle->data[0] = fd;
554 shm_fd = shm_open(shm_name, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
576 MAP_SHARED, shm_fd, 0);
577 if (MAP_FAILED == p_coder_info_dst)
596 lock = open(lck_name, O_RDWR | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP );
631 if (!p_device_context || !p_session_context)
@ NI_LOGAN_RETCODE_INVALID_PARAM
@ NI_LOGAN_RETCODE_SUCCESS
@ NI_LOGAN_RETCODE_FAILURE
#define NI_LOGAN_XCODER_API_VER_SZ
#define NI_LOGAN_MAX_LEVEL_NAME_LEN
#define NI_LOGAN_XCODER_VER_SZ
#define NI_LOGAN_MAX_PROFILE_NAME_LEN
#define NI_LOGAN_XCODER_FW_API_VER_SUPPORTED_MIN
#define NI_LOGAN_XCODER_FW_VER_SUPPORTED_MIN
#define NI_LOGAN_MAX_DEVICE_NAME_LEN
@ NI_LOGAN_DEVICE_TYPE_DECODER
#define NI_LOGAN_XCODER_API_FLAVOR_SZ
#define NI_LOGAN_XCODER_FW_API_FLAVORS_SUPPORTED
Main NETINT device API header file provides the ability to communicate with NI T-408 type hardware tr...
void ni_log(ni_log_level_t level, const char *fmt,...)
print log message using ni_log_callback
Definitions related to working with NI T-408 over NVME interface.
int ni_logan_nvme_enumerate_devices(char ni_logan_devices[][NI_LOGAN_MAX_DEVICE_NAME_LEN], int max_handles)
prints a report on detected nvme devices
int ni_logan_rsrc_android_init()
Init android net.int.SharedBuffer service for binder using.
android::sp< INidec > service_logan
Exported definitions related to resource management of NI T-408 devices.
void ni_logan_rsrc_get_lock_name(ni_logan_device_type_t device_type, int32_t guid, char *p_name, size_t max_name_len)
Returns the device lock name.
ni_logan_retcode_t ni_logan_rsrc_fill_device_info(ni_logan_device_info_t *p_device_info, ni_codec_t fmt, ni_logan_device_type_t type, ni_logan_hw_capability_t *p_hw_cap)
Update codec record info with retrieved device info from HW.
void ni_logan_rsrc_get_shm_name(ni_logan_device_type_t device_type, int32_t guid, char *p_name, size_t max_name_len)
Returns the name of shared memory of the codec record.
uint32_t g_logan_xcoder_stop_process
int ni_logan_is_fw_compatible(uint8_t fw_rev[8])
Check if a FW_rev retrieved from card is supported by libxcoder. Support is checked for API flavor,...
int ni_logan_rsrc_strcmp(const void *p_str, const void *p_str1)
String comparison function.
Private definitions related to resource management of NI T-408 devices.
void ni_logan_rsrc_get_one_device_info(ni_logan_device_info_t *p_device_info)
Retrieve codec record info.
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.
int ni_logan_rsrc_enumerate_devices(char ni_logan_devices[][NI_LOGAN_MAX_DEVICE_NAME_LEN], int max_handles)
List NETINT nvme devices.
Exported utility routines definition.
ni_logan_device_info_t * p_device_info
ni_logan_device_video_capability_t h264_cap
ni_logan_device_type_t device_type
ni_logan_device_video_capability_t h265_cap
ni_logan_sw_instance_info_t sw_instance[NI_LOGAN_MAX_CONTEXTS_PER_HW_INSTANCE]
char level[NI_LOGAN_MAX_LEVEL_NAME_LEN]
char profiles_supported[NI_LOGAN_MAX_PROFILE_NAME_LEN]
uint16_t min_video_height
uint16_t max_video_height
ni_logan_context_query_t context_status[NI_LOGAN_MAX_CONTEXTS_PER_HW_INSTANCE]
ni_logan_load_query_t load_query
ni_sw_instance_status_t status