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

Function hb_get_preview_params_json

libhb/hb_json.c:1994–2040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1992}
1993
1994char* hb_get_preview_params_json(int title_idx, int preview_idx,
1995 int deinterlace, hb_geometry_settings_t *settings)
1996{
1997 json_error_t error;
1998 hb_dict_t * dict;
1999
2000 dict = json_pack_ex(&error, 0,
2001 "{"
2002 "s:o, s:o, s:o,"
2003 "s:{"
2004 " s:{s:o, s:o, s:{s:o, s:o}},"
2005 " s:o, s:o, s:o, s:o, s:o, s:o"
2006 " s:[oooo]"
2007 " }"
2008 "}",
2009 "Title", hb_value_int(title_idx),
2010 "Preview", hb_value_int(preview_idx),
2011 "Deinterlace", hb_value_bool(deinterlace),
2012 "DestSettings",
2013 "Geometry",
2014 "Width", hb_value_int(settings->geometry.width),
2015 "Height", hb_value_int(settings->geometry.height),
2016 "PAR",
2017 "Num", hb_value_int(settings->geometry.par.num),
2018 "Den", hb_value_int(settings->geometry.par.den),
2019 "AnamorphicMode", hb_value_int(settings->mode),
2020 "Keep", hb_value_int(settings->keep),
2021 "ItuPAR", hb_value_bool(settings->itu_par),
2022 "Modulus", hb_value_int(settings->modulus),
2023 "MaxWidth", hb_value_int(settings->maxWidth),
2024 "MaxHeight", hb_value_int(settings->maxHeight),
2025 "Crop", hb_value_int(settings->crop[0]),
2026 hb_value_int(settings->crop[1]),
2027 hb_value_int(settings->crop[2]),
2028 hb_value_int(settings->crop[3])
2029 );
2030 if (dict == NULL)
2031 {
2032 hb_error("hb_get_preview_params_json: pack failure: %s", error.text);
2033 return NULL;
2034 }
2035
2036 char *result = hb_value_get_json(dict);
2037 hb_value_free(&dict);
2038
2039 return result;
2040}
2041
2042hb_image_t* hb_json_to_image(char *json_image)
2043{

Callers

nothing calls this directly

Calls 5

hb_value_intFunction · 0.85
hb_value_boolFunction · 0.85
hb_errorFunction · 0.85
hb_value_get_jsonFunction · 0.85
hb_value_freeFunction · 0.85

Tested by

no test coverage detected