Remove server foveation config, rework defaults
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user