WIP: fixed encoder layout
This commit is contained in:
@@ -140,10 +140,6 @@ configuration::encoder parse_encoder(const nlohmann::json & item)
|
||||
if (item.contains(#property)) \
|
||||
e.property = item[#property];
|
||||
|
||||
SET_IF(width);
|
||||
SET_IF(height);
|
||||
SET_IF(offset_x);
|
||||
SET_IF(offset_y);
|
||||
SET_IF(group);
|
||||
SET_IF(codec);
|
||||
if (e.codec == wivrn::video_codec(-1))
|
||||
@@ -175,15 +171,21 @@ configuration::configuration()
|
||||
if (auto it = json.find("bitrate"); it != json.end())
|
||||
bitrate = *it;
|
||||
|
||||
if (auto it = json.find("encoders"); it != json.end())
|
||||
if (auto it = json.find("encoder"); it != json.end())
|
||||
{
|
||||
for (const auto & encoder: *it)
|
||||
encoders.push_back(parse_encoder(encoder));
|
||||
if (it->is_object())
|
||||
{
|
||||
std::ranges::fill(encoders, parse_encoder(*it));
|
||||
}
|
||||
else if (it->is_array())
|
||||
{
|
||||
for (size_t i = 0; i < std::min(encoders.size(), it->size()); ++i)
|
||||
{
|
||||
encoders[i] = parse_encoder(it->at(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (auto it = json.find("encoder-passthrough"); it != json.end())
|
||||
encoder_passthrough = parse_encoder(*it);
|
||||
|
||||
if (auto it = json.find("application"); it != json.end())
|
||||
{
|
||||
if (it->is_string())
|
||||
|
||||
Reference in New Issue
Block a user