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

Function ghb_finalize_job

gtk/src/title-add.c:165–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void ghb_finalize_job (GhbValue *settings)
166{
167 GhbValue *preset, *job;
168
169 preset = ghb_settings_to_preset(settings);
170 job = ghb_dict_get(settings, "Job");
171
172 // Add scale filter since the above does not
173 GhbValue *filter_settings, *filter_list, *filter_dict;
174 gint width, height, crop[4];
175
176 filter_settings = ghb_get_job_filter_settings(settings);
177 filter_list = ghb_array_new();
178 ghb_dict_set(filter_settings, "FilterList", filter_list);
179
180 width = ghb_dict_get_int(settings, "scale_width");
181 height = ghb_dict_get_int(settings, "scale_height");
182
183 crop[0] = ghb_dict_get_int(settings, "PictureTopCrop");
184 crop[1] = ghb_dict_get_int(settings, "PictureBottomCrop");
185 crop[2] = ghb_dict_get_int(settings, "PictureLeftCrop");
186 crop[3] = ghb_dict_get_int(settings, "PictureRightCrop");
187
188 hb_dict_t * dict = ghb_dict_new();
189 ghb_dict_set_int(dict, "width", width);
190 ghb_dict_set_int(dict, "height", height);
191 ghb_dict_set_int(dict, "crop-top", crop[0]);
192 ghb_dict_set_int(dict, "crop-bottom", crop[1]);
193 ghb_dict_set_int(dict, "crop-left", crop[2]);
194 ghb_dict_set_int(dict, "crop-right", crop[3]);
195
196 filter_dict = ghb_dict_new();
197 ghb_dict_set_int(filter_dict, "ID", HB_FILTER_CROP_SCALE);
198 ghb_dict_set(filter_dict, "Settings", dict);
199 hb_add_filter2(filter_list, filter_dict);
200
201 // Apply selected preset settings
202 hb_preset_apply_mux(preset, job);
203 hb_preset_apply_video(preset, job);
204 hb_preset_apply_filters(preset, job);
205
206 ghb_value_free(&preset);
207}
208
209gboolean
210ghb_add_title_to_queue (signal_user_data_t *ud, GhbValue *settings, gint batch)

Callers 3

ghb_get_preview_imageFunction · 0.85
ghb_add_title_to_queueFunction · 0.85

Calls 8

ghb_settings_to_presetFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_dict_set_intFunction · 0.85
hb_add_filter2Function · 0.85
hb_preset_apply_muxFunction · 0.85
hb_preset_apply_videoFunction · 0.85
hb_preset_apply_filtersFunction · 0.85

Tested by

no test coverage detected