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

Function PreparePreset

test/test.c:3812–4877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3810}
3811
3812static hb_dict_t * PreparePreset(const char *preset_name)
3813{
3814 int ii;
3815 hb_dict_t *preset;
3816 int preset_mux;
3817 const char *preset_format;
3818
3819 if (preset_name != NULL)
3820 {
3821 preset = hb_preset_search(preset_name, 1 /*recurse*/,
3822 HB_PRESET_TYPE_ALL);
3823 if (preset == NULL)
3824 {
3825 fprintf(stderr, "Invalid preset %s\n"
3826 "Valid presets are:\n", preset_name);
3827 ShowPresets(NULL, 1, 1);
3828 return NULL;
3829 }
3830 }
3831 else
3832 {
3833 preset = hb_presets_get_default();
3834 }
3835 if (preset == NULL)
3836 {
3837 fprintf(stderr, "Error loading presets! Aborting.\n");
3838 return NULL;
3839 }
3840 preset = hb_value_dup(preset);
3841
3842 int subtitle_track_count = count_subtitles(subtracks);
3843 // Apply any overrides that can be made directly to the preset
3844 if (format != NULL)
3845 {
3846 hb_dict_set(preset, "FileFormat", hb_value_string(format));
3847 }
3848 preset_format = hb_dict_get_string(preset, "FileFormat");
3849 preset_mux = hb_container_get_from_name(preset_format);
3850 if (optimize != -1)
3851 {
3852 hb_dict_set(preset, "Optimize", hb_value_bool(optimize));
3853 }
3854 if (ipod_atom != -1)
3855 {
3856 hb_dict_set(preset, "Mp4iPodCompatible", hb_value_bool(ipod_atom));
3857 }
3858 if (chapter_markers != -1)
3859 {
3860 hb_dict_set(preset, "ChapterMarkers", hb_value_bool(chapter_markers));
3861 }
3862 if (align_av_start != -1)
3863 {
3864 hb_dict_set(preset, "AlignAVStart", hb_value_bool(align_av_start));
3865 }
3866 if (metadata_passthru != -1)
3867 {
3868 hb_dict_set(preset, "MetadataPassthru", hb_value_bool(metadata_passthru));
3869 }

Callers 1

mainFunction · 0.85

Calls 15

hb_preset_searchFunction · 0.85
ShowPresetsFunction · 0.85
hb_presets_get_defaultFunction · 0.85
hb_value_dupFunction · 0.85
count_subtitlesFunction · 0.85
hb_dict_setFunction · 0.85
hb_value_stringFunction · 0.85
hb_value_boolFunction · 0.85
hb_dict_getFunction · 0.85
hb_value_array_initFunction · 0.85
hb_value_array_clearFunction · 0.85

Tested by

no test coverage detected