MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / main

Function main

test/test.c:505–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505int main( int argc, char ** argv )
506{
507 hb_handle_t * h;
508
509 hb_global_init();
510 hb_presets_builtin_update();
511 hb_presets_cli_default_init();
512
513 /* Init libhb */
514 h = hb_init(4); // Show all logging until debug level is parsed
515
516 test_tty(); // Terminal detection
517
518 // Get utf8 command line if windows
519 get_argv_utf8(&argc, &argv);
520
521 /* Parse command line */
522 if( ParseOptions( argc, argv ) ||
523 CheckOptions( argc, argv ) )
524 {
525 hb_log_level_set(h, debug);
526 goto cleanup;
527 }
528
529 hb_log_level_set(h, debug);
530
531 /* Register our error handler */
532 hb_register_error_handler(&hb_cli_error_handler);
533
534 hb_dvd_set_dvdnav( dvdnav );
535
536 /* Show version */
537 fprintf( stderr, "%s - %s - %s\n",
538 HB_PROJECT_TITLE, HB_PROJECT_HOST_TITLE, HB_PROJECT_URL_WEBSITE );
539
540 /* Geeky */
541 fprintf( stderr, "%d CPU%s detected\n", hb_get_cpu_count(),
542 hb_get_cpu_count() > 1 ? "s" : "" );
543
544 /* Exit ASAP on Ctrl-C */
545 signal( SIGINT, SigHandler );
546
547 if (queue_import_name != NULL)
548 {
549 hb_system_sleep_prevent(h);
550 if (RunQueue(h, queue_import_name))
551 {
552 done_error = HB_ERROR_WRONG_INPUT;
553 goto cleanup;
554 }
555 }
556 else
557 {
558 // Apply all command line overrides to the preset that are possible.
559 // Some command line options are applied later to the job
560 // (e.g. chapter names, explicit audio & subtitle tracks).
561 hb_dict_t *preset_dict = PreparePreset(preset_name);
562 if (preset_dict == NULL)

Callers

nothing calls this directly

Calls 15

hb_global_initFunction · 0.85
hb_initFunction · 0.85
test_ttyFunction · 0.85
get_argv_utf8Function · 0.85
ParseOptionsFunction · 0.85
CheckOptionsFunction · 0.85
hb_log_level_setFunction · 0.85
hb_dvd_set_dvdnavFunction · 0.85
hb_get_cpu_countFunction · 0.85

Tested by

no test coverage detected