| 87 | } |
| 88 | |
| 89 | hb_thread_t * hb_scan_init( hb_handle_t * handle, volatile int * die, |
| 90 | hb_list_t * paths, int title_index, |
| 91 | hb_title_set_t * title_set, int preview_count, |
| 92 | int store_previews, uint64_t min_duration, uint64_t max_duration, |
| 93 | int crop_threshold_frames, int crop_threshold_pixels, |
| 94 | hb_list_t * exclude_extensions, int hw_decode, |
| 95 | int keep_duplicate_titles) |
| 96 | { |
| 97 | hb_scan_t * data = calloc( sizeof( hb_scan_t ), 1 ); |
| 98 | |
| 99 | data->h = handle; |
| 100 | data->die = die; |
| 101 | data->paths = hb_string_list_copy(paths); |
| 102 | data->title_index = title_index; |
| 103 | data->title_set = title_set; |
| 104 | |
| 105 | data->preview_count = preview_count; |
| 106 | data->store_previews = store_previews; |
| 107 | data->min_title_duration = min_duration; |
| 108 | data->max_title_duration = max_duration; |
| 109 | |
| 110 | data->crop_threshold_frames = crop_threshold_frames; |
| 111 | data->crop_threshold_pixels = crop_threshold_pixels; |
| 112 | data->exclude_extensions = hb_string_list_copy(exclude_extensions); |
| 113 | data->hw_decode = hw_decode; |
| 114 | data->keep_duplicate_titles = keep_duplicate_titles; |
| 115 | |
| 116 | // Initialize scan state |
| 117 | hb_state_t state; |
| 118 | hb_get_state2(handle, &state); |
| 119 | #define p state.param.scanning |
| 120 | state.state = HB_STATE_SCANNING; |
| 121 | p.title_cur = 1; |
| 122 | p.title_count = 1; |
| 123 | p.preview_cur = 0; |
| 124 | p.preview_count = 1; |
| 125 | p.progress = 0.0; |
| 126 | #undef p |
| 127 | hb_set_state(handle, &state); |
| 128 | |
| 129 | return hb_thread_init( "scan", ScanFunc, data, HB_NORMAL_PRIORITY ); |
| 130 | } |
| 131 | |
| 132 | static void ScanFunc( void * _data ) |
| 133 | { |
no test coverage detected