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

Function presets_unpackage

libhb/preset.c:4224–4240  ·  view source on GitHub ↗

Note that unpackage does not make any copies. In one increases the reference count.

Source from the content-addressed store, hash-verified

4222// Note that unpackage does not make any copies.
4223// In one increases the reference count.
4224static hb_value_t * presets_unpackage(const hb_value_t *packaged_presets)
4225{
4226 // Do any legacy translations.
4227 hb_value_t * imported;
4228 hb_value_t * tmp = hb_value_dup(packaged_presets);
4229 hb_presets_import(tmp, &imported);
4230 hb_value_free(&tmp);
4231 if (imported == NULL)
4232 {
4233 // Invalid preset format, return an empty array
4234 return hb_value_array_init();
4235 }
4236 hb_value_t *presets = hb_dict_get(imported, "PresetList");
4237 hb_value_incref(presets);
4238 hb_value_free(&imported);
4239 return presets;
4240}
4241
4242static hb_value_t * presets_package(const hb_value_t *presets)
4243{

Callers 1

hb_presets_addFunction · 0.85

Calls 6

hb_value_dupFunction · 0.85
hb_presets_importFunction · 0.85
hb_value_freeFunction · 0.85
hb_value_array_initFunction · 0.85
hb_dict_getFunction · 0.85
hb_value_increfFunction · 0.85

Tested by

no test coverage detected