| 979 | } |
| 980 | |
| 981 | int main(int argc, char **argv) |
| 982 | { |
| 983 | Scheduler *sch = NULL; |
| 984 | |
| 985 | int ret; |
| 986 | BenchmarkTimeStamps ti; |
| 987 | |
| 988 | init_dynload(); |
| 989 | |
| 990 | setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */ |
| 991 | |
| 992 | av_log_set_flags(AV_LOG_SKIP_REPEATED); |
| 993 | parse_loglevel(argc, argv, options); |
| 994 | |
| 995 | #if CONFIG_AVDEVICE |
| 996 | avdevice_register_all(); |
| 997 | #endif |
| 998 | avformat_network_init(); |
| 999 | |
| 1000 | show_banner(argc, argv, options); |
| 1001 | |
| 1002 | sch = sch_alloc(); |
| 1003 | if (!sch) { |
| 1004 | ret = AVERROR(ENOMEM); |
| 1005 | goto finish; |
| 1006 | } |
| 1007 | |
| 1008 | /* parse options and open all input/output files */ |
| 1009 | ret = ffmpeg_parse_options(argc, argv, sch); |
| 1010 | if (ret < 0) |
| 1011 | goto finish; |
| 1012 | |
| 1013 | if (nb_output_files <= 0 && nb_input_files == 0) { |
| 1014 | show_usage(); |
| 1015 | av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name); |
| 1016 | ret = 1; |
| 1017 | goto finish; |
| 1018 | } |
| 1019 | |
| 1020 | if (nb_output_files <= 0) { |
| 1021 | av_log(NULL, AV_LOG_FATAL, "At least one output file must be specified\n"); |
| 1022 | ret = 1; |
| 1023 | goto finish; |
| 1024 | } |
| 1025 | |
| 1026 | #if CONFIG_MEDIACODEC |
| 1027 | android_binder_threadpool_init_if_required(); |
| 1028 | #endif |
| 1029 | |
| 1030 | current_time = ti = get_benchmark_time_stamps(); |
| 1031 | ret = transcode(sch); |
| 1032 | if (ret >= 0 && do_benchmark) { |
| 1033 | int64_t utime, stime, rtime; |
| 1034 | current_time = get_benchmark_time_stamps(); |
| 1035 | utime = current_time.user_usec - ti.user_usec; |
| 1036 | stime = current_time.sys_usec - ti.sys_usec; |
| 1037 | rtime = current_time.real_usec - ti.real_usec; |
| 1038 | av_log(NULL, AV_LOG_INFO, |
nothing calls this directly
no test coverage detected