版本 4.3.1。从 main 函数进入。
parse_loglevel
/**
* Find the '-loglevel' option in the command line args and apply it.
*/
void parse_loglevel(int argc, char **argv, const OptionDef *options);
这个用来设置输出信息的模式。 -loglevel 可以简写为 -v。
ffplay -v
ffplay -v quiet fpx.gif
ffplay -v info fpx.gif
init_opts
/**
* Initialize the cmdutils option system, in particular
* allocate the *_opts contexts.
*/
void init_opts(void);
初始化 cmdutils 中的选项系统,尤其是为 *_opts 内容分配空间。
signal
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
这是 C 库函数,查看用法
show_banner
/**
* Print the program banner to stderr. The banner contents depend on the
* current version of the repository and of the libav* libraries used by
* the program.
*/
void show_banner(int argc, char **argv, const OptionDef *options);
打印输出 FFmpeg 版本信息(编译时间,编译选项,类库信息等)。
parse_options
/**
* Parse the command line arguments.
*
* @param optctx an opaque options context
* @param argc number of command line arguments
* @param argv values of command line arguments
* @param options Array with the definitions required to interpret every
* option of the form: -option_name [argument]
* @param parse_arg_function Name of the function called to process every
* argument without a leading option name flag. NULL if such arguments do
* not have to be processed.
*/
void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
void (* parse_arg_function)(void *optctx, const char*));
解析命令行中的 option