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

Method SetJsonValue

src/FFmpegReader.cpp:3058–3076  ·  view source on GitHub ↗

Load Json::Value into this object

Source from the content-addressed store, hash-verified

3056
3057// Load Json::Value into this object
3058void FFmpegReader::SetJsonValue(const Json::Value root) {
3059
3060 // Set parent data
3061 ReaderBase::SetJsonValue(root);
3062
3063 // Set data from Json (if key is found)
3064 if (!root["path"].isNull())
3065 path = root["path"].asString();
3066 if (!root["duration_strategy"].isNull()) {
3067 const std::string strategy = root["duration_strategy"].asString();
3068 if (strategy == "VideoPreferred") {
3069 duration_strategy = DurationStrategy::VideoPreferred;
3070 } else if (strategy == "AudioPreferred") {
3071 duration_strategy = DurationStrategy::AudioPreferred;
3072 } else {
3073 duration_strategy = DurationStrategy::LongestStream;
3074 }
3075 }
3076}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected