 |
libxcoder
5.2.0
|
Go to the documentation of this file.
34 #if __linux__ || __APPLE__
36 #include <sys/types.h>
45 #define DEV_NAME_PREFIX "\\\\.\\Scsi"
47 #define DEV_NAME_PREFIX "/dev/nvme"
49 #define DEV_NAME_PREFIX "/dev/disk"
60 static int get_dev_name(
const char *in,
char *dev_name)
65 "Error: one or more of the given arguments is NULL.\n");
79 static void display_help(
void)
81 printf(
"Usage: ni_rsrc_update [OPTION]\n"
82 "Update NetInt xcoder resource (encoders and decoders) status.\n"
84 " -a device_file Create a resource entry for a newly active "
85 "transcoder card on host\n"
86 " -d device_file Delete the resource entry for a transcoder "
87 "card removed from host\n"
88 " -D Delete ALL the resource entries for transcoder "
90 " -r Init transcoder card resource regardless "
91 "firmware release version\n"
92 " Default is to only init cards matching current "
94 " -l Set loglevel of libxcoder API.\n"
95 " [none, fatal, error, info, debug, trace]\n"
97 " -h Display this help and exit\n"
98 " -v Print version info and exit\n");
101 int main(
int argc,
char *argv[])
104 char char_dev_name[64];
105 int should_match_rev = 1;
117 while ((opt =
getopt(argc, argv,
"hvrDa:d:l:")) != -1)
122 rc = get_dev_name(
optarg, char_dev_name);
125 fprintf(stderr,
"ERROR: get_dev_name() returned %d\n", rc);
132 rc = get_dev_name(
optarg, char_dev_name);
135 fprintf(stderr,
"ERROR: get_dev_name() returned %d\n", rc);
145 should_match_rev = 0;
153 fprintf(stderr,
"FATAL: invalid log level selected: %s\n",
159 printf(
"Release ver: %s\n"
174 if (add_dev && (del_dev || delete_all))
176 fprintf(stderr,
"Error: can not add and delete device at the same time\n\n");
180 if (!should_match_rev && !add_dev)
182 fprintf(stderr,
"Error: -r option must be used with -a option\n\n");
190 printf(
"%s not added as transcoder.\n", char_dev_name);
192 printf(
"Added transcoder %s successfully.\n", char_dev_name);
199 printf(
"Error removing all transcoder resources.\n");
201 printf(
"Removing all transcoder resources successfully.\n");
208 printf(
"%s not removed as transcoder.\n", char_dev_name);
210 printf(
"Removed transcoder %s successfully.\n", char_dev_name);
215 fprintf(stderr,
"Error: ni_rsrc_update option must be used with -a or -b or -D option\n\n");
int ni_rsrc_remove_device(const char *dev)
Remove an NetInt h/w device from resource pool on the host.
void ni_log_set_level(ni_log_level_t level)
Set ni_log_level.
Public definitions for managing NETINT video processing devices.
#define NI_XCODER_REVISION
int ni_rsrc_add_device(const char *dev, int should_match_rev)
Add an NetInt h/w device into resource pool on the host.
ni_log_level_t arg_to_ni_log_level(const char *arg_str)
Convert terminal arg string to ni_log_level_t.
Common NETINT definitions used by all modules.
#define NI_SW_RELEASE_TIME
void ni_log(ni_log_level_t level, const char *fmt,...)
print log message using ni_log_callback
int main(int argc, char *argv[])
Private definitions used by ni_rsrc_api.cpp for management of NETINT video processing devices.
int getopt(int argc, char *argv[], const char *optstring)
#define LIBXCODER_API_VERSION
int ni_rsrc_remove_all_devices(void)
Remove all NetInt h/w devices from resource pool on the host.
Implementation of getopt() and getopt_long() for Windows environment.