MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / JsonValue

Method JsonValue

src/Profiles.cpp:270–292  ·  view source on GitHub ↗

Generate Json::Value for this object

Source from the content-addressed store, hash-verified

268
269// Generate Json::Value for this object
270Json::Value Profile::JsonValue() const {
271
272 // Create root json object
273 Json::Value root;
274 root["description"] = info.description;
275 root["height"] = info.height;
276 root["width"] = info.width;
277 root["pixel_format"] = info.pixel_format;
278 root["fps"] = Json::Value(Json::objectValue);
279 root["fps"]["num"] = info.fps.num;
280 root["fps"]["den"] = info.fps.den;
281 root["pixel_ratio"] = Json::Value(Json::objectValue);
282 root["pixel_ratio"]["num"] = info.pixel_ratio.num;
283 root["pixel_ratio"]["den"] = info.pixel_ratio.den;
284 root["display_ratio"] = Json::Value(Json::objectValue);
285 root["display_ratio"]["num"] = info.display_ratio.num;
286 root["display_ratio"]["den"] = info.display_ratio.den;
287 root["progressive"] = !info.interlaced_frame;
288 root["spherical"] = info.spherical;
289
290 // return JsonValue
291 return root;
292}
293
294// Load JSON string into this object
295void Profile::SetJson(const std::string value) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected