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

Function presets_package

libhb/preset.c:4242–4276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4240}
4241
4242static hb_value_t * presets_package(const hb_value_t *presets)
4243{
4244 hb_dict_t *packaged_presets;
4245 if (hb_value_type(presets) != HB_VALUE_TYPE_DICT ||
4246 hb_dict_get(presets, "VersionMajor") == NULL)
4247 {
4248 // Preset is not packaged
4249 packaged_presets = hb_dict_init();
4250 hb_dict_set(packaged_presets, "VersionMajor",
4251 hb_value_int(hb_preset_version_major));
4252 hb_dict_set(packaged_presets, "VersionMinor",
4253 hb_value_int(hb_preset_version_minor));
4254 hb_dict_set(packaged_presets, "VersionMicro",
4255 hb_value_int(hb_preset_version_micro));
4256
4257 // TODO: What else do we want in the preset containers header?
4258 hb_dict_t *tmp = hb_value_dup(presets);
4259 if (hb_value_type(presets) == HB_VALUE_TYPE_DICT)
4260 {
4261 hb_value_array_t *array = hb_value_array_init();
4262 hb_value_array_append(array, tmp);
4263 tmp = array;
4264 }
4265 presets_clean(tmp, hb_preset_template);
4266 hb_dict_set(packaged_presets, "PresetList", tmp);
4267 }
4268 else
4269 {
4270 // Preset is already packaged
4271 hb_dict_t *tmp = hb_value_dup(presets);
4272 presets_clean(tmp, hb_preset_template);
4273 packaged_presets = tmp;
4274 }
4275 return packaged_presets;
4276}
4277
4278void hb_presets_builtin_init(void)
4279{

Callers 4

hb_presets_write_jsonFunction · 0.85
hb_presets_package_jsonFunction · 0.85
hb_presets_json_packageFunction · 0.85

Calls 9

hb_value_typeFunction · 0.85
hb_dict_getFunction · 0.85
hb_dict_initFunction · 0.85
hb_dict_setFunction · 0.85
hb_value_intFunction · 0.85
hb_value_dupFunction · 0.85
hb_value_array_initFunction · 0.85
hb_value_array_appendFunction · 0.85
presets_cleanFunction · 0.85

Tested by

no test coverage detected