Remove server foveation config, rework defaults

This commit is contained in:
Patrick Nicolas
2025-12-10 14:00:47 +01:00
parent 5c50b9a1ad
commit 5ab7731be3
14 changed files with 211 additions and 379 deletions
+5 -14
View File
@@ -140,7 +140,6 @@ configuration::encoder parse_encoder(const nlohmann::json & item)
if (item.contains(#property)) \
e.property = item[#property];
SET_IF(group);
SET_IF(codec);
if (e.codec == wivrn::video_codec(-1))
throw std::runtime_error("invalid codec value " + item["codec"].get<std::string>());
@@ -155,14 +154,6 @@ configuration::configuration()
{
auto json = read_configuration();
if (auto it = json.find("scale"); it != json.end())
{
if (it->is_number())
scale = std::array<double, 2>{*it, *it};
else
scale = *it;
}
if (auto it = json.find("grip-surface"); it != json.end())
{
grip_surface = *it;
@@ -173,17 +164,17 @@ configuration::configuration()
if (auto it = json.find("encoder"); it != json.end())
{
if (it->is_object())
{
std::ranges::fill(encoders, parse_encoder(*it));
}
else if (it->is_array())
if (it->is_array())
{
for (size_t i = 0; i < std::min(encoders.size(), it->size()); ++i)
{
encoders[i] = parse_encoder(it->at(i));
}
}
else
{
std::ranges::fill(encoders, parse_encoder(*it));
}
}
if (auto it = json.find("application"); it != json.end())
+1 -3
View File
@@ -44,7 +44,6 @@ struct configuration
struct encoder
{
std::string name;
std::optional<int> group;
std::optional<wivrn::video_codec> codec;
std::map<std::string, std::string> options;
std::optional<std::string> device;
@@ -52,8 +51,7 @@ struct configuration
std::array<encoder, 3> encoders; // left, right, alpha
std::optional<int> bitrate;
int bit_depth = 8;
std::optional<std::array<double, 2>> scale;
std::optional<int> bit_depth;
std::optional<std::array<float, 3>> grip_surface;
std::vector<std::string> application;
bool debug_gui = false;
+3 -2
View File
@@ -316,10 +316,11 @@ static bool comp_wivrn_init_post_vulkan(struct comp_target * ct, uint32_t prefer
{
cn->settings = get_encoder_settings(
*cn->wivrn_bundle,
cn->c->settings.preferred.width,
cn->c->settings.preferred.height,
cn->cnx.get_info());
print_encoders(cn->settings);
cn->c->settings.preferred.width = cn->settings[0].width;
cn->c->settings.preferred.height = cn->settings[0].height;
}
catch (const std::exception & e)
{
+2 -2
View File
@@ -90,9 +90,9 @@ wivrn_hmd::wivrn_hmd(wivrn::wivrn_session * cnx,
{
const auto config = configuration();
auto eye_width = info.recommended_eye_width;
auto eye_width = info.render_eye_width;
eye_width = ((eye_width + 3) / 4) * 4;
auto eye_height = info.recommended_eye_height;
auto eye_height = info.render_eye_height;
eye_height = ((eye_height + 3) / 4) * 4;
// Setup info.