libxcoder  3.5.1
ni_rsrc_api_logan.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * Copyright (C) 2022 NETINT Technologies
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18  * SOFTWARE.
19  *
20  ******************************************************************************/
21 
22 /*!*****************************************************************************
23 * \file ni_rsrc_api_logan.h
24 *
25 * \brief Exported definitions related to resource management of NI T-408
26 * devices
27 *
28 *******************************************************************************/
29 
30 #pragma once
31 
32 #include "ni_defs_logan.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #define NI_LOGAN_MAX_PROFILE_NAME_LEN 128
39 #define NI_LOGAN_MAX_LEVEL_NAME_LEN 64
40 #define NI_LOGAN_MAX_ADDITIONAL_INFO_LEN 64
41 
43 {
44  int width;
45  int height;
46  int fps;
48 
49 #ifndef QUADRA
50 typedef enum
51 {
53  EN_H265
55 
56 typedef enum
57 {
59  EN_ACTIVE
61 
62 typedef enum
63 {
67 #endif // #ifndef QUADRA
68 
69 typedef struct _ni_logan_device_queue
70 {
71  uint32_t decoders_cnt;
72  uint32_t encoders_cnt;
76 
78 {
87 
89 {
90  int id;
93  int width;
94  int height;
95  int fps;
97 
98 typedef struct _ni_logan_device_pool
99 {
100  ni_lock_handle_t lock;
103 
104 typedef struct _ni_logan_device_info
105 {
108  int hw_id;
109  int module_id;
110  int load;
112  unsigned long xcode_load_pixel;
113  int fw_ver_compat_warning; // fw revision is not supported by this libxcoder
114  uint8_t fw_rev[8]; // fw revision
115  uint8_t fw_commit_hash[41];
116  uint8_t fw_commit_time[26];
117  uint8_t fw_branch_name[256];
118 
128 
131 
134 
135 typedef struct _ni_logan_device
136 {
142 
144 {
146  ni_lock_handle_t lock;
149 
150 typedef struct _ni_logan_card_info
151 {
152  char *name;
153  int index;
154  bool isActive;
155  const char *fwVer;
156  const char *hwVer;
158 
159 typedef struct card_info
160 {
161  int card_idx;
162  int load;
163  int task_num;
166 
167 typedef struct hw_device_info
168 {
172  int err_code;
174 
175 /*!******************************************************************************
176  * \brief Initialize and create all resources required to work with NETINT NVMe
177  * transcoder devices. This is a high level API function which is used
178  * mostly with user application like FFMpeg that relies on those resources.
179  * In case of custom application integration, revised functionality might
180  * be necessary utilizing coresponding API functions.
181  *
182  * \param[in] should_match_rev 0: transcoder firmware revision matching the
183  * library's version is NOT required for placing
184  * the transcoder into resource pool; 1: otherwise
185  * timeout_seconds 0: No timeout amount, loop until init success
186  * or fail; else: timeout will fail init once reached
187  *
188  * \return
189  * NI_LOGAN_RETCODE_SUCCESS on success
190  * NI_LOGAN_RETCODE_FAILURE on failure
191  *
192  *******************************************************************************/
193 LIB_API int ni_logan_rsrc_init(int should_match_rev, int timeout_seconds);
194 
195 /*!*****************************************************************************
196  * \brief Scan and refresh all resources on the host, taking into account
197  * hot-plugged and pulled out cards.
198  *
199  * \param[in] should_match_rev 0: transcoder firmware revision matching the
200  * library's version is NOT required for placing
201  * the transcoder into resource pool; 1: otherwise
202  *
203  * \return
204  * NI_LOGAN_RETCODE_SUCCESS on success
205  * NI_LOGAN_RETCODE_FAILURE on failure
206  *
207  ******************************************************************************/
208 LIB_API ni_logan_retcode_t ni_logan_rsrc_refresh(int should_match_rev);
209 
210 /*!*****************************************************************************
211  * \brief the card with the card name like /dev/nvme0n1 get the device index.
212  *
213  * \param[in] p_device_pool Pointer to a caller allocated ni_logan_device_pool_t
214  * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
215  * \param[in] devicename device name
216  *
217  * \return On success valid device index
218  * On failure -1
219  ******************************************************************************/
220 LIB_API int ni_logan_find_device_index_by_name(void *device_pool,
221  ni_logan_device_type_t device_type,
222  const char *dev_name);
223 
224 /*!******************************************************************************
225  * \brief Scans system for all NVMe devices and returns the system device
226  * names to the user which were identified as NETINT transcoder deivices.
227  * Names are suitable for OpenFile api usage afterwards
228  *
229  *
230  * \param[out] ni_logan_devices List of device names identified as NETINT NVMe transcoders
231  * \param[in] max_handles Max number of device names to return
232  *
233  * \return Number if devices found if successfull operation completed
234  * 0 if no NETINT NVMe transcoder devices were found
235  * NI_LOGAN_RETCODE_ERROR_MEM_ALOC if memory allocation failed
236  *******************************************************************************/
237 LIB_API int ni_logan_rsrc_get_local_device_list(char ni_logan_devices[][NI_LOGAN_MAX_DEVICE_NAME_LEN],
238  int max_handles);
239 
240 /*!******************************************************************************
241 * \brief Allocates and returns a pointer to ni_logan_device_context_t struct
242 * based on provided device_type and guid.
243 * To be used for load update and codec query.
244 *
245  * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
246  * \param[in] guid GUID of the encoder or decoder device
247 *
248 * \return pointer to ni_logan_device_context_t if found, NULL otherwise
249 *
250 * Note: The returned ni_logan_device_context_t content is not supposed to be used by
251 * caller directly: should only be passed to API in the subsequent
252 * calls; also after its use, the context should be released by
253 * calling ni_logan_rsrc_free_device_context.
254 *******************************************************************************/
256 
257 /*!******************************************************************************
258  * \brief Free previously allocated device context
259  *
260  * \param p_device_context Pointer to previously allocated device context
261  *
262  * \return None
263  *******************************************************************************/
265 
266 /*!******************************************************************************
267 * \brief List device(s) based on device type with full information
268 * including s/w instances on the system.
269 *
270 * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
271 * \param[out] p_device The device information returned.
272 * \param[out] p_device_count The number of ni_logan_device_info_t structs returned.
273 *
274 * \return
275 * NI_LOGAN_RETCODE_SUCCESS
276 * NI_LOGAN_RETCODE_FAILURE
277 *
278 * Note: Caller is responsible for allocating memory for "p_device".
279 *******************************************************************************/
281  ni_logan_device_info_t* p_device_info,
282  int* p_device_count);
283 
284 /*!******************************************************************************
285 * \brief List all devices with full information including s/w instances
286 * on the system.
287 
288 * \param[out] p_device The device information returned.
289 *
290 * \return
291 * NI_LOGAN_RETCODE_SUCCESS
292 * NI_LOGAN_RETCODE_INVALID_PARAM
293 * NI_LOGAN_RETCODE_FAILURE
294 *
295 * Note: Caller is responsible for allocating memory for "p_device".
296 *******************************************************************************/
298 
299 /*!*****************************************************************************
300 * \brief Print detailed capability information of all devices
301 * on the system.
302 
303 * \param none
304 *
305 * \return none
306 *
307 *******************************************************************************/
309 
310 /*!******************************************************************************
311 * \brief Query a specific device with detailed information on the system
312 
313 * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
314 * \param[in] guid unique device(decoder or encoder) id
315 *
316 * \return
317 * pointer to ni_logan_device_info_t if found
318 * NULL otherwise
319 *
320 * Note: Caller is responsible for releasing memory that was allocated for the
321 * returned pointer
322 *******************************************************************************/
324 
325 /*!****************************************************************************
326 
327 * \brief Get the least used device that can handle decoding or encoding
328 * a video stream of certain resolution/frame-rate/codec.
329 *
330 * \param[in] width width of video resolution
331 * \param[in] height height of video resolution
332 * \param[in] frame_rate video stream frame rate
333 * \param[in] codec EN_H264 or EN_H265
334 * \param[in] type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
335 * \param[out] info detailed device information. If is non-NULL, the
336 * device info is stored in the memory pointed to by it.
337 *
338 * \return device GUID (>= 0) if found , -1 otherwise
339 *******************************************************************************/
340 LIB_API int ni_logan_rsrc_get_available_device(int width,
341  int height,
342  int frame_rate,
343  ni_codec_t codec,
344  ni_logan_device_type_t device_type,
345  ni_logan_device_info_t * p_device_info);
346 
347 /*!*****************************************************************************
348 * \brief Update the load value and s/w instances info of a specific decoder or
349 * encoder. This is used by resource management daemon to update periodically.
350 *
351 * \param[in] p_ctxt The device context returned by ni_logan_rsrc_get_device_context
352 * \param[in] p_load The latest load value to update
353 * \param[in] sw_instance_cnt Number of s/w instances
354 * \param[in] sw_instance_info Info of s/w instances
355 *
356 * \return
357 * NI_LOGAN_RETCODE_SUCCESS
358 * NI_LOGAN_RETCODE_FAILURE
359 *******************************************************************************/
361  int load,
362  int sw_instance_cnt,
363  const ni_logan_sw_instance_info_t sw_instance_info[]);
364 
365 /*!*****************************************************************************
366 * \brief Allocate resources for decoding/encoding, based on the provided rule
367 *
368 * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
369 * \param[in] rule allocation rule
370 * \param[in] codec EN_H264 or EN_H265
371 * \param[in] width width of video resolution
372 * \param[in] height height of video resolution
373 * \param[in] frame_rate video stream frame rate
374 * \param[out] p_load the load that will be generated by this encoding
375 * task. Returned *only* for encoder for now.
376 *
377 * \return pointer to ni_logan_device_context_t if found, NULL otherwise
378 *
379 * Note: codec, width, height, fps need to be supplied for NI_LOGAN_DEVICE_TYPE_ENCODER only,
380 * they are ignored otherwize.
381 * Note: the returned ni_logan_device_context_t content is not supposed to be used by
382 * caller directly: should only be passed to API in the subsequent
383 * calls; also after its use, the context should be released by
384 * calling ni_logan_rsrc_free_device_context.
385 *******************************************************************************/
387  ni_alloc_rule_t rule,
388  ni_codec_t codec,
389  int width,
390  int height,
391  int frame_rate,
392  unsigned long *p_load);
393 
394 /*!*****************************************************************************
395 * \brief Allocate resources for decoding/encoding, by designating explicitly
396 * the device to use.
397 *
398 * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
399 * \param[in] guid unique device (decoder or encoder) module id
400 * \param[in] codec EN_H264 or EN_H265
401 * \param[in] width width of video resolution
402 * \param[in] height height of video resolution
403 * \param[in] frame_rate video stream frame rate
404 * \param[out] p_load the load that will be generated by this encoding
405 * task. Returned *only* for encoder for now.
406 *
407 * \return pointer to ni_logan_device_context_t if found, NULL otherwise
408 *
409 * Note: codec, width, height, fps need to be supplied by encoder; they
410 * are ignored for decoder.
411 *
412 * Note: the returned ni_logan_device_context_t content is not supposed to be used by
413 * caller directly: should only be passed to API in the subsequent
414 * calls; also after its use, the context should be released by
415 * calling ni_logan_rsrc_free_device_context.
416 *******************************************************************************/
418  int guid,
419  ni_codec_t codec,
420  int width,
421  int height,
422  int frame_rate,
423  unsigned long *p_load);
424 
425 /*!*****************************************************************************
426 * \brief Allocate resources for decoding/encoding, by designating explicitly
427 * the device to use. do not track the load on the host side
428 *
429 * \param[in] device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
430 * \param[in] guid unique device (decoder or encoder) module id
431 * \return pointer to ni_logan_device_context_t if found, NULL otherwise
432 *
433 * Note: only need to specify the device type and guid and codec type
434 *
435 *
436 * Note: the returned ni_logan_device_context_t content is not supposed to be used by
437 * caller directly: should only be passed to API in the subsequent
438 * calls; also after its use, the context should be released by
439 * calling ni_logan_rsrc_free_device_context.
440 *******************************************************************************/
442  int guid);
443 
444 /*!*****************************************************************************
445 * \brief Release resources allocated for decoding/encoding.
446 * function This *must* be called at the end of transcoding
447 * with previously assigned load value by allocate* functions.
448 *
449 * \param[in/] p_ctxt the device context
450 * \param[in] codec EN_H264 or EN_H265
451 * \param[in] load the load value returned by allocate* functions
452 *
453 * \return None
454 *******************************************************************************/
456  ni_codec_t codec,
457  unsigned long load);
458 
459 /*!*****************************************************************************
460 * \brief check the NetInt h/w device in resource pool on the host.
461 *
462 * \param[in] guid the global unique device index in resource pool
463 * device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
464 *
465 * \return
466 * NI_LOGAN_RETCODE_SUCCESS
467 *******************************************************************************/
468 LIB_API int ni_logan_rsrc_check_hw_available(int guid, ni_logan_device_type_t device_type);
469 
470 /*!******************************************************************************
471  * \brief check hw info, return the appropriate card number to use depends on the load&task_num&used resource
472  *
473  * \param[out] p_hw_device_info : record the device info, including available card num and which card to select,
474  * and each card's informaton, such as, the load and task num
475  * \param[in] task_mode: affect the scheduling strategy,
476  * 1 - both the load_num and task_num should consider, usually applied to live scenes
477  * 0 - only consider the task_num, donnot care the load_num
478  * \param[in] load_threshold : load threshold [0 - 100]
479  * \param[in] task_num_threshold : task threshold [0 - max_task_num(32)]
480  * \param[in] device_type: 1:decode 2:encode
481  * \param[in] resolution:it is the product of width and height, i.e. widthxheight
482  *
483  * \return 0-error 1-success
484  *******************************************************************************/
485 
486 LIB_API int ni_logan_check_hw_info(hw_device_info_t *p_hw_device_info, int task_mode,
487  int load_threshold, int task_num_threshold,
488  ni_logan_device_type_t device_type, int resolution);
489 
490 /*!*****************************************************************************
491 * \brief check the NetInt h/w device in resource pool on the host.
492 *
493 * \param[in] guid the global unique device index in resource pool
494 * device_type NI_LOGAN_DEVICE_TYPE_DECODER or NI_LOGAN_DEVICE_TYPE_ENCODER
495 *
496 * \return
497 * NI_LOGAN_RETCODE_SUCCESS if codec is available,
498 * otherwise ni_logan_retcode_t errors (negative values)
499 *******************************************************************************/
500 LIB_API int ni_logan_rsrc_codec_is_available(int guid, ni_logan_device_type_t device_type);
501 
502 /*!*****************************************************************************
503 * \brief Remove an NetInt h/w device from resource pool on the host.
504 *
505 * \param[in] p_dev the NVMe device name
506 *
507 * \return
508 * NI_LOGAN_RETCODE_SUCCESS
509 * NI_LOGAN_RETCODE_FAILURE
510 *******************************************************************************/
511 LIB_API int ni_logan_rsrc_remove_device(const char* p_dev);
512 
513 /*!*****************************************************************************
514 * \brief Add an NetInt h/w device into resource pool on the host.
515 *
516 * \param[in] p_dev the NVMe device name
517 * \param[in] should_match_rev 0: transcoder firmware revision matching the
518 * library's version is NOT required for placing
519 * the transcoder into resource pool; 1: otherwise
520 *
521 * \return
522 * NI_LOGAN_RETCODE_SUCCESS
523 * NI_LOGAN_RETCODE_FAILURE
524 *******************************************************************************/
525 LIB_API int ni_logan_rsrc_add_device(const char* p_dev, int should_match_rev);
526 
527 /*!*****************************************************************************
528  * \brief Create and return the allocated ni_logan_device_pool_t struct
529  *
530  * \param None
531  *
532  * \return Pointer to ni_logan_device_pool_t struct on success, or NULL on failure
533  *******************************************************************************/
535 
536 /*!*****************************************************************************
537 * \brief Free all resources taken by the device pool
538 *
539 * \param[in] p_device_pool Poiner to a device pool struct
540 *
541 * \return None
542 *******************************************************************************/
543 LIB_API void ni_logan_rsrc_free_device_pool(ni_logan_device_pool_t* p_device_pool);
544 
545 /*!*****************************************************************************
546  * \brief Print the content of the ni_logan_device_info_t struct
547  *
548  * \param p_device_info - pointer to the ni_logan_device_info_t struct to print
549  *
550  * \return None
551  *******************************************************************************/
552 LIB_API void ni_logan_rsrc_print_device_info(const ni_logan_device_info_t* p_device_info);
553 
554 /*!*****************************************************************************
555  * \brief lock a file lock and open a session on a device
556  *
557  * \param device_type
558  * \param lock
559  *
560  * \return None
561  *******************************************************************************/
562 LIB_API int ni_logan_rsrc_lock_and_open(int device_type, ni_lock_handle_t* lock);
563 
564 /*!*****************************************************************************
565  * \brief unlock a file lock
566  *
567  * \param device_type
568  * \param lock
569  *
570  * \return None
571  *******************************************************************************/
572 LIB_API int ni_logan_rsrc_unlock(int device_type, ni_lock_handle_t lock);
573 
574 #ifdef __cplusplus
575 }
576 #endif
Common NETINT definitions used by all modules.
ni_logan_retcode_t
#define LOGAN_MAX_DEVICE_CNT
#define NI_LOGAN_MAX_CONTEXTS_PER_HW_INSTANCE
#define NI_LOGAN_MAX_DEVICE_NAME_LEN
ni_logan_device_type_t
LIB_API int ni_logan_rsrc_codec_is_available(int guid, ni_logan_device_type_t device_type)
check the NetInt h/w device in resource pool on the host.
LIB_API int ni_logan_rsrc_init(int should_match_rev, int timeout_seconds)
Initialize and create all resources required to work with NETINT NVMe transcoder devices....
struct _ni_logan_device_info ni_logan_device_info_t
LIB_API int ni_logan_check_hw_info(hw_device_info_t *p_hw_device_info, int task_mode, int load_threshold, int task_num_threshold, ni_logan_device_type_t device_type, int resolution)
check hw info, return the appropriate card number to use depends on the load&task_num&used resource
LIB_API void ni_logan_rsrc_free_device_pool(ni_logan_device_pool_t *p_device_pool)
Free all resources taken by the device pool.
struct hw_device_info hw_device_info_t
LIB_API int ni_logan_find_device_index_by_name(void *device_pool, ni_logan_device_type_t device_type, const char *dev_name)
the card with the card name like /dev/nvme0n1 get the device index.
LIB_API void ni_logan_rsrc_print_device_info(const ni_logan_device_info_t *p_device_info)
Print the content of the ni_logan_device_info_t struct.
struct _ni_logan_rsrc_video_ref_cap ni_logan_rsrc_device_video_ref_cap_t
struct _ni_logan_device_pool ni_logan_device_pool_t
struct _ni_logan_sw_instance_info ni_logan_sw_instance_info_t
LIB_API ni_logan_device_info_t * ni_logan_rsrc_get_device_info(ni_logan_device_type_t device_type, int guid)
Query a specific device with detailed information on the system.
#define NI_LOGAN_MAX_ADDITIONAL_INFO_LEN
LIB_API ni_logan_device_pool_t * ni_logan_rsrc_get_device_pool(void)
Create and return the allocated ni_logan_device_pool_t struct.
LIB_API int ni_logan_rsrc_remove_device(const char *p_dev)
Remove an NetInt h/w device from resource pool on the host.
LIB_API ni_logan_retcode_t ni_logan_rsrc_list_all_devices(ni_logan_device_t *p_device)
List all devices with full information including s/w instances on the system.
#define NI_LOGAN_MAX_LEVEL_NAME_LEN
LIB_API int ni_logan_rsrc_get_local_device_list(char ni_logan_devices[][NI_LOGAN_MAX_DEVICE_NAME_LEN], int max_handles)
Scans system for all NVMe devices and returns the system device names to the user which were identifi...
ni_sw_instance_status_t
@ EN_IDLE
@ EN_ACTIVE
struct _ni_logan_device ni_logan_device_t
#define NI_LOGAN_MAX_PROFILE_NAME_LEN
LIB_API ni_logan_device_context_t * ni_logan_rsrc_allocate_auto(ni_logan_device_type_t device_type, ni_alloc_rule_t rule, ni_codec_t codec, int width, int height, int frame_rate, unsigned long *p_load)
Allocate resources for decoding/encoding, based on the provided rule.
LIB_API int ni_logan_rsrc_update_device_load(ni_logan_device_context_t *p_ctxt, int load, int sw_instance_cnt, const ni_logan_sw_instance_info_t sw_instance_info[])
Update the load value and s/w instances info of a specific decoder or encoder. This is used by resour...
LIB_API 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....
LIB_API int ni_logan_rsrc_get_available_device(int width, int height, int frame_rate, ni_codec_t codec, ni_logan_device_type_t device_type, ni_logan_device_info_t *p_device_info)
Get the least used device that can handle decoding or encoding a video stream of certain resolution/f...
LIB_API int ni_logan_rsrc_check_hw_available(int guid, ni_logan_device_type_t device_type)
check the NetInt h/w device in resource pool on the host.
LIB_API ni_logan_device_context_t * ni_logan_rsrc_get_device_context(ni_logan_device_type_t type, int guid)
Allocates and returns a pointer to ni_logan_device_context_t struct based on provided device_type and...
LIB_API ni_logan_device_context_t * ni_logan_rsrc_allocate_direct(ni_logan_device_type_t device_type, int guid, ni_codec_t codec, int width, int height, int frame_rate, unsigned long *p_load)
Allocate resources for decoding/encoding, by designating explicitly the device to use.
ni_codec_t
@ EN_H264
@ EN_H265
struct _ni_logan_device_context ni_logan_device_context_t
struct _ni_logan_device_video_capability ni_logan_device_video_capability_t
LIB_API int ni_logan_rsrc_add_device(const char *p_dev, int should_match_rev)
Add an NetInt h/w device into resource pool on the host.
struct _ni_logan_card_info ni_logan_card_info_t
ni_alloc_rule_t
@ EN_ALLOC_LEAST_LOAD
@ EN_ALLOC_LEAST_INSTANCE
LIB_API void ni_logan_rsrc_print_all_devices_capability(void)
Print detailed capability information of all devices on the system.
LIB_API void ni_logan_rsrc_release_resource(ni_logan_device_context_t *p_ctxt, ni_codec_t codec, unsigned long load)
Release resources allocated for decoding/encoding. function This must be called at the end of transco...
LIB_API ni_logan_retcode_t ni_logan_rsrc_list_devices(ni_logan_device_type_t device_type, ni_logan_device_info_t *p_device_info, int *p_device_count)
List device(s) based on device type with full information including s/w instances on the system.
LIB_API int ni_logan_rsrc_unlock(int device_type, ni_lock_handle_t lock)
unlock a file lock
LIB_API void ni_logan_rsrc_free_device_context(ni_logan_device_context_t *p_ctxt)
Free previously allocated device context.
struct _ni_logan_device_queue ni_logan_device_queue_t
struct card_info card_info_t
LIB_API 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
LIB_API ni_logan_retcode_t ni_logan_rsrc_refresh(int should_match_rev)
Scan and refresh all resources on the host, taking into account hot-plugged and pulled out cards.
char shm_name[NI_LOGAN_MAX_DEVICE_NAME_LEN]
ni_logan_device_info_t * p_device_info
ni_logan_device_video_capability_t h264_cap
ni_logan_device_type_t device_type
char dev_name[NI_LOGAN_MAX_DEVICE_NAME_LEN]
ni_logan_device_video_capability_t h265_cap
char blk_name[NI_LOGAN_MAX_DEVICE_NAME_LEN]
ni_logan_sw_instance_info_t sw_instance[NI_LOGAN_MAX_CONTEXTS_PER_HW_INSTANCE]
unsigned long xcode_load_pixel
ni_logan_device_queue_t * p_device_queue
int32_t decoders[LOGAN_MAX_DEVICE_CNT]
int32_t encoders[LOGAN_MAX_DEVICE_CNT]
char level[NI_LOGAN_MAX_LEVEL_NAME_LEN]
char additional_info[NI_LOGAN_MAX_ADDITIONAL_INFO_LEN]
char profiles_supported[NI_LOGAN_MAX_PROFILE_NAME_LEN]
ni_logan_device_info_t encoders[LOGAN_MAX_DEVICE_CNT]
ni_logan_device_info_t decoders[LOGAN_MAX_DEVICE_CNT]
ni_sw_instance_status_t status
card_info_t * card_info