From bb07e5afd7b7382ffd4e4ff7a0910d9eb50efefb Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sat, 6 Dec 2025 15:43:44 -0600 Subject: [PATCH 1/5] Change resolution scale step size to 10% --- client/scenes/lobby_gui.cpp | 10 +++++----- locale/es/wivrn.po | 4 ++-- locale/fr/wivrn.po | 4 ++-- locale/it/wivrn.po | 4 ++-- locale/ja/wivrn.po | 4 ++-- locale/pl/wivrn.po | 4 ++-- locale/pt_BR/wivrn.po | 4 ++-- locale/ru/wivrn.po | 4 ++-- locale/sk/wivrn.po | 4 ++-- locale/tr/wivrn.po | 4 ++-- locale/zh_CN/wivrn.po | 4 ++-- locale/zh_TW/wivrn.po | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index 282c6d44..150649d6 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -646,16 +646,16 @@ void scenes::lobby::gui_settings() const auto current = config.resolution_scale; const auto width = stream_view.recommendedImageRectWidth; const auto height = stream_view.recommendedImageRectHeight; - auto intScale = int(current * 100); + auto intScale = int(current * 10); const auto slider = ImGui::SliderInt( _("Resolution scale").append("##resolution_scale").c_str(), &intScale, - 50, - 350, - fmt::format(_F("%d%% - {}x{} per eye"), int(width * current), int(height * current)).c_str()); + 5, + 35, + fmt::format(_F("{}%% - {}x{} per eye"), intScale * 10, int(width * current), int(height * current)).c_str()); if (slider) { - config.resolution_scale = intScale * 0.01; + config.resolution_scale = intScale * 0.1; config.save(); } imgui_ctx->vibrate_on_hover(); diff --git a/locale/es/wivrn.po b/locale/es/wivrn.po index f411930c..51d5335e 100644 --- a/locale/es/wivrn.po +++ b/locale/es/wivrn.po @@ -216,8 +216,8 @@ msgstr "Escala de resolución" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} por ojo" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} por ojo" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/fr/wivrn.po b/locale/fr/wivrn.po index a9747d63..be297964 100644 --- a/locale/fr/wivrn.po +++ b/locale/fr/wivrn.po @@ -217,8 +217,8 @@ msgstr "Échelle" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} par œil" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} par œil" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/it/wivrn.po b/locale/it/wivrn.po index 3b154efa..9ffe4c20 100644 --- a/locale/it/wivrn.po +++ b/locale/it/wivrn.po @@ -213,8 +213,8 @@ msgstr "Scala di risoluzione" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} per occhio" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} per occhio" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/ja/wivrn.po b/locale/ja/wivrn.po index 1d60600c..2763e490 100644 --- a/locale/ja/wivrn.po +++ b/locale/ja/wivrn.po @@ -204,8 +204,8 @@ msgstr "解像度" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - 目あたり{}x{}" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - 目あたり{}x{}" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/pl/wivrn.po b/locale/pl/wivrn.po index 2a303482..94e5d22e 100644 --- a/locale/pl/wivrn.po +++ b/locale/pl/wivrn.po @@ -212,8 +212,8 @@ msgstr "Skala rozdzielczości" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} na oko" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} na oko" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/pt_BR/wivrn.po b/locale/pt_BR/wivrn.po index e88af2e4..f9632a8c 100644 --- a/locale/pt_BR/wivrn.po +++ b/locale/pt_BR/wivrn.po @@ -218,8 +218,8 @@ msgstr "Escala de resolução" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} por olho" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} por olho" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/ru/wivrn.po b/locale/ru/wivrn.po index 199b62aa..27f91b4d 100644 --- a/locale/ru/wivrn.po +++ b/locale/ru/wivrn.po @@ -213,8 +213,8 @@ msgstr "Масштаб разрешения" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} на каждый глаз" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} на каждый глаз" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/sk/wivrn.po b/locale/sk/wivrn.po index 6a9082c8..cb6ccc84 100644 --- a/locale/sk/wivrn.po +++ b/locale/sk/wivrn.po @@ -199,8 +199,8 @@ msgstr "Rozlíšenie" #: client/scenes/lobby_gui.cpp:894 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - {}x{} na oko" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - {}x{} na oko" #: client/scenes/lobby_gui.cpp:905 #, c++-format diff --git a/locale/tr/wivrn.po b/locale/tr/wivrn.po index e337f433..9d79c0c3 100644 --- a/locale/tr/wivrn.po +++ b/locale/tr/wivrn.po @@ -214,8 +214,8 @@ msgstr "Çözünürlük ölçeği" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "göz başına %d%% - {}x{}" +msgid "{}%% - {}x{} per eye" +msgstr "göz başına {}%% - {}x{}" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/zh_CN/wivrn.po b/locale/zh_CN/wivrn.po index f27e1b92..311fcae5 100644 --- a/locale/zh_CN/wivrn.po +++ b/locale/zh_CN/wivrn.po @@ -213,8 +213,8 @@ msgstr "分辨率缩放比例" #: client/scenes/lobby_gui.cpp:655 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - 单眼 {}x{}" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - 单眼 {}x{}" #: client/scenes/lobby_gui.cpp:666 #, c++-format diff --git a/locale/zh_TW/wivrn.po b/locale/zh_TW/wivrn.po index f908615c..2db7d960 100644 --- a/locale/zh_TW/wivrn.po +++ b/locale/zh_TW/wivrn.po @@ -195,8 +195,8 @@ msgstr "解析度縮放比例" #: client/scenes/lobby_gui.cpp:638 #, c-format, c++-format -msgid "%d%% - {}x{} per eye" -msgstr "%d%% - 單眼 {}x{}" +msgid "{}%% - {}x{} per eye" +msgstr "{}%% - 單眼 {}x{}" #: client/scenes/lobby_gui.cpp:649 #, c++-format From fad0a8feee87ec8621d268ab8ad085aad1dfea5d Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sat, 6 Dec 2025 20:46:08 -0600 Subject: [PATCH 2/5] In-stream GUI bitrate adjustment --- client/scenes/stream.h | 3 +++ client/scenes/stream_gui.cpp | 19 +++++++++++----- client/scenes/stream_network.cpp | 5 +++++ common/wivrn_packets.h | 12 ++++++++++ server/driver/wivrn_comp_target.cpp | 6 +++-- server/driver/wivrn_comp_target.h | 3 ++- server/driver/wivrn_session.cpp | 35 ++++++++++++++++++++++++++--- server/driver/wivrn_session.h | 1 + server/encoder/video_encoder.cpp | 2 +- server/encoder/video_encoder.h | 5 +++-- 10 files changed, 77 insertions(+), 14 deletions(-) diff --git a/client/scenes/stream.h b/client/scenes/stream.h index 143f1eef..ba79c7d9 100644 --- a/client/scenes/stream.h +++ b/client/scenes/stream.h @@ -172,6 +172,8 @@ private: XrTime running_application_req = 0; thread_safe running_applications; + std::atomic_uint32_t bitrate = 0; + stream(std::string server_name, scene & parent_scene); bool forward_hid_input(from_headset::hid::input_t); @@ -207,6 +209,7 @@ public: void operator()(to_headset::tracking_control &&); void operator()(to_headset::audio_stream_description &&); void operator()(to_headset::video_stream_description &&); + void operator()(to_headset::settings &&); void operator()(to_headset::refresh_rate_change &&); void operator()(to_headset::application_list &&); void operator()(to_headset::application_icon &&); diff --git a/client/scenes/stream_gui.cpp b/client/scenes/stream_gui.cpp index 0924bfad..78dd142f 100644 --- a/client/scenes/stream_gui.cpp +++ b/client/scenes/stream_gui.cpp @@ -383,10 +383,12 @@ void scenes::stream::gui_compact_view() } } -static void send_settings_changed_packet(xr::session & session, wivrn_session * network, const configuration & config, float predicted_display_period) +static void send_settings_changed_packet(xr::session & session, wivrn_session * network, const configuration & config, uint32_t bitrate, float predicted_display_period) { const auto & refresh_rates = session.get_refresh_rates(); - from_headset::settings_changed packet{}; + from_headset::settings_changed packet{ + .bitrate_bps = bitrate, + }; if (config.preferred_refresh_rate and (config.preferred_refresh_rate == 0 or utils::contains(refresh_rates, *config.preferred_refresh_rate))) { packet.preferred_refresh_rate = *config.preferred_refresh_rate; @@ -418,7 +420,7 @@ void scenes::stream::gui_settings(float predicted_display_period) { session.set_refresh_rate(0); config.preferred_refresh_rate = 0; - send_settings_changed_packet(session, network_session.get(), config, predicted_display_period); + send_settings_changed_packet(session, network_session.get(), config, bitrate, predicted_display_period); config.save(); } if (ImGui::IsItemHovered()) @@ -429,7 +431,7 @@ void scenes::stream::gui_settings(float predicted_display_period) { session.set_refresh_rate(rate); config.preferred_refresh_rate = rate; - send_settings_changed_packet(session, network_session.get(), config, predicted_display_period); + send_settings_changed_packet(session, network_session.get(), config, bitrate, predicted_display_period); config.save(); } } @@ -447,7 +449,7 @@ void scenes::stream::gui_settings(float predicted_display_period) if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.minimum_refresh_rate, ImGuiSelectableFlags_SelectOnRelease)) { config.minimum_refresh_rate = rate; - send_settings_changed_packet(session, network_session.get(), config, predicted_display_period); + send_settings_changed_packet(session, network_session.get(), config, bitrate, predicted_display_period); config.save(); } } @@ -458,6 +460,13 @@ void scenes::stream::gui_settings(float predicted_display_period) } } + int bitrate_ = bitrate.load() / 1'000'000; + if (ImGui::SliderInt(_S("Bitrate (Mbps)"), &bitrate_, 1, 200)) + { + bitrate.store(bitrate_ * 1'000'000); + send_settings_changed_packet(session, network_session.get(), config, bitrate_ * 1'000'000, predicted_display_period); + } + if (application::get_openxr_post_processing_supported()) { ImGui::Text("%s", _S("OpenXR post-processing")); diff --git a/client/scenes/stream_network.cpp b/client/scenes/stream_network.cpp index 9bac8ba6..753a5714 100644 --- a/client/scenes/stream_network.cpp +++ b/client/scenes/stream_network.cpp @@ -74,6 +74,11 @@ void scenes::stream::operator()(to_headset::video_stream_description && desc) } } +void scenes::stream::operator()(to_headset::settings && settings) +{ + bitrate = settings.bitrate_bps; +} + void scenes::stream::operator()(to_headset::refresh_rate_change && rate) { session.set_refresh_rate(rate.fps); diff --git a/common/wivrn_packets.h b/common/wivrn_packets.h index 8d42de43..a27cdc27 100644 --- a/common/wivrn_packets.h +++ b/common/wivrn_packets.h @@ -248,11 +248,16 @@ struct headset_info_packet std::string variant; }; +struct settings_request +{}; + struct settings_changed { float preferred_refresh_rate; // for automatic float minimum_refresh_rate; + + uint32_t bitrate_bps; }; struct handshake @@ -542,6 +547,7 @@ using packets = std::variant< pin_check_1, pin_check_3, headset_info_packet, + settings_request, settings_changed, feedback, audio_data, @@ -749,6 +755,11 @@ struct tracking_control std::array enabled; }; +struct settings +{ + uint32_t bitrate_bps; +}; + struct refresh_rate_change { float fps; @@ -797,6 +808,7 @@ using packets = std::variant< haptics, timesync_query, tracking_control, + settings, refresh_rate_change, application_list, application_icon, diff --git a/server/driver/wivrn_comp_target.cpp b/server/driver/wivrn_comp_target.cpp index 934ef1a0..4f0b7546 100644 --- a/server/driver/wivrn_comp_target.cpp +++ b/server/driver/wivrn_comp_target.cpp @@ -838,14 +838,16 @@ void wivrn_comp_target::reset_encoders() cnx.send_control(to_headset::video_stream_description{desc}); } -void wivrn_comp_target::set_bitrate(int bitrate_bps) +void wivrn_comp_target::set_bitrate(uint32_t bitrate_bps) { + bitrate = 0; for (auto & encoder: encoders) { // Alpha will have multiplier of 0 and will be left unchanged. - auto encoder_bps = (int)(bitrate_bps * encoder->bitrate_multiplier); + auto encoder_bps = (uint32_t)(bitrate_bps * encoder->bitrate_multiplier); U_LOG_D("Encoder %d bitrate: %d", encoder->stream_idx, encoder_bps); encoder->set_bitrate(encoder_bps); + bitrate += encoder_bps; } } diff --git a/server/driver/wivrn_comp_target.h b/server/driver/wivrn_comp_target.h index a05e5f33..40f64fa7 100644 --- a/server/driver/wivrn_comp_target.h +++ b/server/driver/wivrn_comp_target.h @@ -93,6 +93,7 @@ struct wivrn_comp_target : public comp_target static std::vector wanted_instance_extensions; static std::vector wanted_device_extensions; + uint32_t bitrate = 0; std::vector settings; std::list encoder_threads; std::vector> encoders; @@ -107,7 +108,7 @@ struct wivrn_comp_target : public comp_target void on_feedback(const from_headset::feedback &, const clock_offset &); void reset_encoders(); - void set_bitrate(int bitrate_bps); + void set_bitrate(uint32_t bitrate_bps); void set_refresh_rate(float); }; diff --git a/server/driver/wivrn_session.cpp b/server/driver/wivrn_session.cpp index a4e58a83..4b7f644d 100644 --- a/server/driver/wivrn_session.cpp +++ b/server/driver/wivrn_session.cpp @@ -429,10 +429,29 @@ void wivrn_session::operator()(from_headset::headset_info_packet &&) U_LOG_W("unexpected headset info packet, ignoring"); } +void wivrn_session::operator()(from_headset::settings_request &&) +{ + to_headset::settings settings{}; + { + std::lock_guard lock(comp_target_mutex); + if (comp_target) + settings.bitrate_bps = comp_target->bitrate; + } + + send_control(std::move(settings)); +} + void wivrn_session::operator()(from_headset::settings_changed && settings) { connection->info().preferred_refresh_rate = settings.preferred_refresh_rate; connection->info().minimum_refresh_rate = settings.minimum_refresh_rate; + + if (settings.bitrate_bps != 0) + { + std::lock_guard lock(comp_target_mutex); + if (comp_target) + comp_target->set_bitrate(settings.bitrate_bps); + } } static xrt_device_name get_name(interaction_profile profile) @@ -937,9 +956,18 @@ void wivrn_session::operator()(to_monado::disconnect &&) void wivrn_session::operator()(to_monado::set_bitrate && data) { - std::shared_lock lock(comp_target_mutex); - if (comp_target) - comp_target->set_bitrate(data.bitrate_bps); + bool send_settings = false; + { + std::shared_lock lock(comp_target_mutex); + if (comp_target) + { + comp_target->set_bitrate(data.bitrate_bps); + send_settings = true; + } + } + + if (send_settings) + (*this)(from_headset::settings_request{}); } struct refresh_rate_adjuster @@ -1087,6 +1115,7 @@ void wivrn_session::reconnect() if (audio_handle) send_control(audio_handle->description()); + (*this)(from_headset::settings_request{}); event.state.visible = true; event.state.focused = true; result = push_event(event); diff --git a/server/driver/wivrn_session.h b/server/driver/wivrn_session.h index 0723caf9..4eec38c4 100644 --- a/server/driver/wivrn_session.h +++ b/server/driver/wivrn_session.h @@ -186,6 +186,7 @@ public: void operator()(from_headset::pin_check_1 &&) {} void operator()(from_headset::pin_check_3 &&) {} void operator()(from_headset::headset_info_packet &&); + void operator()(from_headset::settings_request &&); void operator()(from_headset::settings_changed &&); void operator()(from_headset::handshake &&) {} void operator()(from_headset::trackings &&); diff --git a/server/encoder/video_encoder.cpp b/server/encoder/video_encoder.cpp index 48b51f94..aae2526f 100644 --- a/server/encoder/video_encoder.cpp +++ b/server/encoder/video_encoder.cpp @@ -217,7 +217,7 @@ void video_encoder::reset() idr->reset(); } -void video_encoder::set_bitrate(int bitrate_bps) +void video_encoder::set_bitrate(uint32_t bitrate_bps) { pending_bitrate = bitrate_bps; } diff --git a/server/encoder/video_encoder.h b/server/encoder/video_encoder.h index 6530083e..fc89106f 100644 --- a/server/encoder/video_encoder.h +++ b/server/encoder/video_encoder.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -104,7 +105,7 @@ private: std::shared_ptr shared_sender; protected: - std::atomic_int pending_bitrate; + std::atomic_uint32_t pending_bitrate; std::atomic pending_framerate; std::unique_ptr idr; @@ -128,7 +129,7 @@ public: void on_feedback(const from_headset::feedback &); void reset(); - void set_bitrate(int bitrate_bps); + void set_bitrate(uint32_t bitrate_bps); void set_framerate(float framerate); void encode(wivrn_session & cnx, From ca45eed21ec9eb7ac8e4b0a23a5a442e7aa020ea Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sat, 6 Dec 2025 21:00:41 -0600 Subject: [PATCH 3/5] Change stream GUI bitrate step size to 10% --- client/scenes/stream_gui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/scenes/stream_gui.cpp b/client/scenes/stream_gui.cpp index 78dd142f..c032b55c 100644 --- a/client/scenes/stream_gui.cpp +++ b/client/scenes/stream_gui.cpp @@ -460,11 +460,11 @@ void scenes::stream::gui_settings(float predicted_display_period) } } - int bitrate_ = bitrate.load() / 1'000'000; - if (ImGui::SliderInt(_S("Bitrate (Mbps)"), &bitrate_, 1, 200)) + int bitrate_ = bitrate.load() / 10'000'000; + if (ImGui::SliderInt(_S("Bitrate (Mbps)"), &bitrate_, 1, 20, "%d0")) { - bitrate.store(bitrate_ * 1'000'000); - send_settings_changed_packet(session, network_session.get(), config, bitrate_ * 1'000'000, predicted_display_period); + bitrate.store(bitrate_ * 10'000'000); + send_settings_changed_packet(session, network_session.get(), config, bitrate_ * 10'000'000, predicted_display_period); } if (application::get_openxr_post_processing_supported()) From 4553379d74b239b4b435c482c9fca072ec285e55 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sun, 7 Dec 2025 04:31:35 -0600 Subject: [PATCH 4/5] Hide GUI and use thumbstick for in-stream bitrate adjustment --- client/scenes/stream.cpp | 9 ++++--- client/scenes/stream.h | 4 +++- client/scenes/stream_gui.cpp | 46 ++++++++++++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index eade56a9..1d3e6c0b 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -481,7 +481,7 @@ void scenes::stream::on_focused() } recenter_left = get_action("recenter_left").first; recenter_right = get_action("recenter_right").first; - foveation_pitch = get_action("foveation_pitch").first; + settings_adjust = get_action("settings_adjust").first; foveation_distance = get_action("foveation_distance").first; foveation_ok = get_action("foveation_ok").first; foveation_cancel = get_action("foveation_cancel").first; @@ -741,6 +741,7 @@ bool scenes::stream::is_gui_interactable() const { case gui_status::stats: case gui_status::settings: + case gui_status::bitrate_settings: case gui_status::foveation_settings: case gui_status::applications: case gui_status::application_launcher: @@ -1010,6 +1011,7 @@ void scenes::stream::render(const XrFrameState & frame_state) switch (gui_status) { case gui_status::hidden: + case gui_status::bitrate_settings: case gui_status::foveation_settings: case gui_status::compact: case gui_status::overlay_only: @@ -1109,6 +1111,7 @@ void scenes::stream::render(const XrFrameState & frame_state) case gui_status::stats: case gui_status::settings: + case gui_status::bitrate_settings: case gui_status::foveation_settings: case gui_status::applications: case gui_status::application_launcher: @@ -1207,7 +1210,7 @@ scene::meta & scenes::stream::get_meta_scene() {"recenter_left", XR_ACTION_TYPE_BOOLEAN_INPUT}, {"recenter_right", XR_ACTION_TYPE_BOOLEAN_INPUT}, - {"foveation_pitch", XR_ACTION_TYPE_FLOAT_INPUT}, + {"settings_adjust", XR_ACTION_TYPE_FLOAT_INPUT}, {"foveation_distance", XR_ACTION_TYPE_FLOAT_INPUT}, {"foveation_ok", XR_ACTION_TYPE_BOOLEAN_INPUT}, {"foveation_cancel", XR_ACTION_TYPE_BOOLEAN_INPUT}, @@ -1239,7 +1242,7 @@ scene::meta & scenes::stream::get_meta_scene() {"recenter_left", "/user/hand/left/input/squeeze/value"}, {"recenter_right", "/user/hand/right/input/squeeze/value"}, - {"foveation_pitch", "/user/hand/right/input/thumbstick/y"}, + {"settings_adjust", "/user/hand/right/input/thumbstick/y"}, {"foveation_distance", "/user/hand/left/input/thumbstick/y"}, {"foveation_ok", "/user/hand/right/input/a/click"}, {"foveation_cancel", "/user/hand/right/input/b/click"}, diff --git a/client/scenes/stream.h b/client/scenes/stream.h index ba79c7d9..17a0e21a 100644 --- a/client/scenes/stream.h +++ b/client/scenes/stream.h @@ -132,6 +132,7 @@ private: compact, stats, settings, + bitrate_settings, foveation_settings, applications, application_launcher, @@ -149,7 +150,7 @@ private: XrAction plots_toggle_2 = XR_NULL_HANDLE; XrAction recenter_left = XR_NULL_HANDLE; XrAction recenter_right = XR_NULL_HANDLE; - XrAction foveation_pitch = XR_NULL_HANDLE; + XrAction settings_adjust = XR_NULL_HANDLE; XrAction foveation_distance = XR_NULL_HANDLE; XrAction foveation_ok = XR_NULL_HANDLE; XrAction foveation_cancel = XR_NULL_HANDLE; @@ -315,6 +316,7 @@ private: void gui_performance_metrics(); void gui_compact_view(); void gui_settings(float predicted_display_period); + void gui_bitrate_settings(float predicted_display_period); void gui_foveation_settings(float predicted_display_period); void gui_applications(); void draw_gui(XrTime predicted_display_time, XrDuration predicted_display_period); diff --git a/client/scenes/stream_gui.cpp b/client/scenes/stream_gui.cpp index c032b55c..a1655844 100644 --- a/client/scenes/stream_gui.cpp +++ b/client/scenes/stream_gui.cpp @@ -404,6 +404,7 @@ static void send_settings_changed_packet(xr::session & session, wivrn_session * std::string openxr_post_processing_flag_name(XrCompositionLayerSettingsFlagsFB flag); // TODO declaration in a .h file void scenes::stream::gui_settings(float predicted_display_period) { + const ImGuiStyle & style = ImGui::GetStyle(); auto & config = application::get_config(); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(20, 20)); @@ -460,11 +461,18 @@ void scenes::stream::gui_settings(float predicted_display_period) } } - int bitrate_ = bitrate.load() / 10'000'000; - if (ImGui::SliderInt(_S("Bitrate (Mbps)"), &bitrate_, 1, 20, "%d0")) { - bitrate.store(bitrate_ * 10'000'000); - send_settings_changed_packet(session, network_session.get(), config, bitrate_ * 10'000'000, predicted_display_period); + const auto text = _("Bitrate:"); + const auto size = ImGui::CalcTextSize(text.c_str()); + ImGui::Text("%s", text.c_str()); + + ImGui::SameLine(0.f, 10.f); + ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (size.y / 4.f) - style.FramePadding.y * 3.f); + if (ImGui::Button(fmt::format("{}Mbit/s", bitrate / 1'000'000).c_str())) + gui_status = gui_status::bitrate_settings; + imgui_ctx->vibrate_on_hover(); + if (ImGui::IsItemHovered()) + imgui_ctx->tooltip(_("Click to adjust bitrate")); } if (application::get_openxr_post_processing_supported()) @@ -580,6 +588,27 @@ void scenes::stream::gui_settings(float predicted_display_period) ImGui::PopStyleVar(); } +void scenes::stream::gui_bitrate_settings(float predicted_display_period) +{ + ImGui::PushFont(nullptr, constants::gui::font_size_large); + ImGui::Text("%s", _S("Use the right thumbstick to adjust the bitrate")); + ImGui::Text("%s", _S("Press A to go back")); + ImGui::Text("%s", fmt::format(_F("Bitrate: {}Mbit/s"), bitrate / 1'000'000).c_str()); + ImGui::PopFont(); + + // Maximum speed of 20Mbit/s + float delta = application::read_action_float(settings_adjust).value_or(std::pair{0, 0}).second * 20'000'000.f * predicted_display_period; + + bitrate = std::clamp(bitrate + static_cast(delta), 1'000'000u, 200'000'000u); + + bool ok = application::read_action_bool(foveation_ok).value_or(std::pair{0, false}).second; + + if (ok) + gui_status = gui_status::settings; + + send_settings_changed_packet(session, network_session.get(), application::get_config(), bitrate, predicted_display_period); +} + void scenes::stream::gui_foveation_settings(float predicted_display_period) { ImGui::PushFont(nullptr, constants::gui::font_size_large); @@ -590,7 +619,7 @@ void scenes::stream::gui_foveation_settings(float predicted_display_period) ImGui::PopFont(); // Maximum speed 1 rad/s - float delta_pitch = application::read_action_float(foveation_pitch).value_or(std::pair{0, 0}).second * predicted_display_period; + float delta_pitch = application::read_action_float(settings_adjust).value_or(std::pair{0, 0}).second * predicted_display_period; // Maximum speed 2m/s @ 1m float delta_distance = std::exp(std::log(2) * application::read_action_float(foveation_distance).value_or(std::pair{0, 0}).second * predicted_display_period); @@ -735,6 +764,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte switch (gui_status) { case gui_status::hidden: + case gui_status::bitrate_settings: case gui_status::foveation_settings: case gui_status::overlay_only: case gui_status::compact: @@ -797,6 +827,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte glm::mat3 M = glm::mat3_cast(head_position->second); switch (gui_status) { + case gui_status::bitrate_settings: case gui_status::foveation_settings: imgui_ctx->layers()[0].orientation = head_position->second; imgui_ctx->layers()[0].position = head_position->first + M * glm::vec3{0, -override_foveation_distance * sin(override_foveation_pitch), -override_foveation_distance}; @@ -840,6 +871,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte break; case gui_status::hidden: + case gui_status::bitrate_settings: case gui_status::foveation_settings: ImGui::SetNextWindowPos(ImGui::GetMainViewport()->Size / 2, ImGuiCond_Always, ImVec2(0.5f, 0.5f)); always_auto_resize = true; @@ -914,6 +946,10 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte ImGui::EndChild(); break; + case gui_status::bitrate_settings: + gui_bitrate_settings(predicted_display_period * 1.e-9f); + break; + case gui_status::foveation_settings: gui_foveation_settings(predicted_display_period * 1.e-9f); break; From e394cb0dcb811c57822dbe40a9827ce9c609180d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udio=20=27Patola=27=20Sampaio?= Date: Sun, 7 Dec 2025 17:06:14 +0100 Subject: [PATCH 5/5] updated 4 pt_BT strings --- locale/pt_BR/wivrn.po | 133 ++++++++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 56 deletions(-) diff --git a/locale/pt_BR/wivrn.po b/locale/pt_BR/wivrn.po index f9632a8c..9ef5b2cd 100644 --- a/locale/pt_BR/wivrn.po +++ b/locale/pt_BR/wivrn.po @@ -11,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: WiVRn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-02 19:57+0100\n" -"PO-Revision-Date: 2025-12-03 19:23+0100\n" +"POT-Creation-Date: 2025-12-07 15:32+0100\n" +"PO-Revision-Date: 2025-12-07 17:05+0100\n" "Last-Translator: Claudio Sampaio (Patola) \n" "Language-Team: Portuguese <>\n" "Language: pt_BR\n" @@ -73,11 +73,11 @@ msgstr "Incapaz de conectar a {} ({}): {}" msgid "Waiting for connection" msgstr "Aguardando conexão" -#: client/scenes/lobby.cpp:1310 +#: client/scenes/lobby.cpp:1308 msgid "Passthrough" msgstr "Passthrough" -#: client/scenes/lobby.cpp:1322 +#: client/scenes/lobby.cpp:1320 msgid "Default environment" msgstr "Ambiente default" @@ -97,13 +97,13 @@ msgid "Disabled" msgstr "Desabilitado" #: client/scenes/lobby_gui.cpp:112 client/scenes/lobby_gui.cpp:256 -#: client/scenes/stream_gui.cpp:967 +#: client/scenes/stream_gui.cpp:1012 msgid "Disconnect" msgstr "Desconectar" #: client/scenes/lobby_gui.cpp:132 client/scenes/lobby_gui_customize.cpp:749 #: client/scenes/lobby_gui_customize.cpp:840 -#: client/scenes/lobby_gui_customize.cpp:896 client/scenes/stream_gui.cpp:963 +#: client/scenes/lobby_gui_customize.cpp:896 client/scenes/stream_gui.cpp:1008 msgid "Close" msgstr "Fechar" @@ -141,7 +141,7 @@ msgid "TCP only" msgstr "TCP somente" #: client/scenes/lobby_gui.cpp:317 client/scenes/lobby_gui_customize.cpp:651 -#: client/scenes/stream_gui.cpp:920 +#: client/scenes/stream_gui.cpp:965 msgid "Cancel" msgstr "Cancelar" @@ -186,17 +186,17 @@ msgstr "Linguagem" msgid "System language" msgstr "Linguagem do Sistema" -#: client/scenes/lobby_gui.cpp:577 client/scenes/stream_gui.cpp:415 +#: client/scenes/lobby_gui.cpp:577 client/scenes/stream_gui.cpp:418 msgid "Refresh rate" msgstr "Taxa de atualização" #: client/scenes/lobby_gui.cpp:577 client/scenes/lobby_gui.cpp:579 -#: client/scenes/stream_gui.cpp:415 client/scenes/stream_gui.cpp:417 +#: client/scenes/stream_gui.cpp:418 client/scenes/stream_gui.cpp:420 msgctxt "automatic refresh rate" msgid "Automatic" msgstr "Automático" -#: client/scenes/lobby_gui.cpp:586 client/scenes/stream_gui.cpp:425 +#: client/scenes/lobby_gui.cpp:586 client/scenes/stream_gui.cpp:428 msgid "" "Select refresh rate based on measured application performance.\n" "May cause flicker when a change happens." @@ -204,7 +204,7 @@ msgstr "" "Seleciona a taxa de atualização baseada no desempenho medido do aplicativo.\n" "Pode causar oscilações quando uma alteração ocorrer." -#: client/scenes/lobby_gui.cpp:603 client/scenes/stream_gui.cpp:443 +#: client/scenes/lobby_gui.cpp:603 client/scenes/stream_gui.cpp:446 msgid "Minimum refresh rate" msgstr "Taxa de atualização mínima" @@ -322,15 +322,15 @@ msgstr "" "streamado.\n" "Se habilitado, a janela é ativada clicando os dois joysticks simultaneamente." -#: client/scenes/lobby_gui.cpp:805 client/scenes/stream_gui.cpp:463 +#: client/scenes/lobby_gui.cpp:805 client/scenes/stream_gui.cpp:480 msgid "OpenXR post-processing" msgstr "Pós-processamento OpenXR" -#: client/scenes/lobby_gui.cpp:809 client/scenes/stream_gui.cpp:467 +#: client/scenes/lobby_gui.cpp:809 client/scenes/stream_gui.cpp:484 msgid "Supersampling" msgstr "Supersampling" -#: client/scenes/lobby_gui.cpp:829 client/scenes/stream_gui.cpp:488 +#: client/scenes/lobby_gui.cpp:829 client/scenes/stream_gui.cpp:505 msgid "" "Reduce flicker for high contrast edges.\n" "Useful when the input resolution is high compared to the headset display" @@ -338,11 +338,11 @@ msgstr "" "Reduz flicker para arestas de alto contraste.\n" "Útil quando a resolução de entrada é alta comparada ao display do headset" -#: client/scenes/lobby_gui.cpp:834 client/scenes/stream_gui.cpp:493 +#: client/scenes/lobby_gui.cpp:834 client/scenes/stream_gui.cpp:510 msgid "Sharpening" msgstr "Aumento de nitidez" -#: client/scenes/lobby_gui.cpp:854 client/scenes/stream_gui.cpp:514 +#: client/scenes/lobby_gui.cpp:854 client/scenes/stream_gui.cpp:531 msgid "" "Improve clarity of high contrast edges and counteract blur.\n" "Useful when the input resolution is low compared to the headset display" @@ -388,91 +388,91 @@ msgstr "Habilitar o rastreamento corporal?" msgid "Welcome to WiVRn" msgstr "Bem vindo(a) ao WiVRn" -#: client/scenes/lobby_gui.cpp:1169 +#: client/scenes/lobby_gui.cpp:1171 msgid "Yes" msgstr "Sim" -#: client/scenes/lobby_gui.cpp:1176 +#: client/scenes/lobby_gui.cpp:1178 msgid "No" msgstr "Não" -#: client/scenes/lobby_gui.cpp:1195 client/scenes/lobby_gui.cpp:1836 +#: client/scenes/lobby_gui.cpp:1197 client/scenes/lobby_gui.cpp:1843 msgid "Licenses" msgstr "Licenças" -#: client/scenes/lobby_gui.cpp:1470 +#: client/scenes/lobby_gui.cpp:1473 msgid "Microphone is enabled" msgstr "O microfone está ativado" -#: client/scenes/lobby_gui.cpp:1471 +#: client/scenes/lobby_gui.cpp:1474 msgid "Microphone is disabled" msgstr "O microfone está desativado" -#: client/scenes/lobby_gui.cpp:1480 +#: client/scenes/lobby_gui.cpp:1483 msgid "Hand tracking is enabled" msgstr "O rastreamento de mãos está ativado" -#: client/scenes/lobby_gui.cpp:1481 +#: client/scenes/lobby_gui.cpp:1484 msgid "Hand tracking is disabled" msgstr "O rastreamento de mãos está desativado" -#: client/scenes/lobby_gui.cpp:1490 +#: client/scenes/lobby_gui.cpp:1493 msgid "Eye tracking is enabled" msgstr "O rastreamento ocular está ativado" -#: client/scenes/lobby_gui.cpp:1491 +#: client/scenes/lobby_gui.cpp:1494 msgid "Eye tracking is disabled" msgstr "O rastreamento ocular está desativado" -#: client/scenes/lobby_gui.cpp:1501 +#: client/scenes/lobby_gui.cpp:1504 msgid "Face tracking is enabled" msgstr "O rastreamento facial está ativado" -#: client/scenes/lobby_gui.cpp:1502 +#: client/scenes/lobby_gui.cpp:1505 msgid "Face tracking is disabled" msgstr "O rastreamento facial está desativado" -#: client/scenes/lobby_gui.cpp:1512 +#: client/scenes/lobby_gui.cpp:1519 msgid "Body tracking is enabled" msgstr "O rastreamento corporal está ativado" -#: client/scenes/lobby_gui.cpp:1513 +#: client/scenes/lobby_gui.cpp:1520 msgid "Body tracking is disabled" msgstr "O rastreamento corporal está desativado" -#: client/scenes/lobby_gui.cpp:1529 +#: client/scenes/lobby_gui.cpp:1536 msgid "Add server" msgstr "Adicionar servidor" -#: client/scenes/lobby_gui.cpp:1815 +#: client/scenes/lobby_gui.cpp:1822 msgid "Server list" msgstr "Lista de servidores" -#: client/scenes/lobby_gui.cpp:1818 client/scenes/stream_gui.cpp:948 +#: client/scenes/lobby_gui.cpp:1825 client/scenes/stream_gui.cpp:993 msgid "Settings" msgstr "Ajustes" -#: client/scenes/lobby_gui.cpp:1821 +#: client/scenes/lobby_gui.cpp:1828 msgid "Post-processing" msgstr "Pós-processamento" -#: client/scenes/lobby_gui.cpp:1824 +#: client/scenes/lobby_gui.cpp:1831 msgid "Customize" msgstr "Personalizar" -#: client/scenes/lobby_gui.cpp:1828 +#: client/scenes/lobby_gui.cpp:1835 msgid "Debug" msgstr "Depurar" -#: client/scenes/lobby_gui.cpp:1833 +#: client/scenes/lobby_gui.cpp:1840 msgid "About" msgstr "Sobre" -#: client/scenes/lobby_gui.cpp:1839 +#: client/scenes/lobby_gui.cpp:1846 msgid "Exit" msgstr "Sair" -#: client/scenes/lobby_gui.cpp:1856 +#: client/scenes/lobby_gui.cpp:1863 msgid "" "Press the grip button or put your palm up\n" "to move the main window" @@ -480,7 +480,7 @@ msgstr "" "Pressione o botão de aderência ou coloque a palma da mão para cima\n" "para mover a janela principal" -#: client/scenes/lobby_gui.cpp:1858 +#: client/scenes/lobby_gui.cpp:1865 msgid "Press the grip button to move the main window" msgstr "Pressione o botão de aderência para mover a janela principal" @@ -625,7 +625,7 @@ msgstr "Movimento estimado para a latência de fótons: {}ms" msgid "Press the grip button to move the window" msgstr "Pressione o botão de aderência para mover a janela" -#: client/scenes/stream_gui.cpp:354 client/scenes/stream_gui.cpp:880 +#: client/scenes/stream_gui.cpp:354 client/scenes/stream_gui.cpp:921 msgid "Press both thumbsticks to display the WiVRn window" msgstr "Pressione ambos os thumbsticks para mostrar a janela do WiVRn" @@ -633,69 +633,90 @@ msgstr "Pressione ambos os thumbsticks para mostrar a janela do WiVRn" msgid "Motion to photon latency" msgstr "Latência (de movimento para fótons)" -#: client/scenes/stream_gui.cpp:521 +#: client/scenes/stream_gui.cpp:465 +msgid "Bitrate:" +msgstr "Bitrate:" + +#: client/scenes/stream_gui.cpp:475 +msgid "Click to adjust bitrate" +msgstr "Clique para ajustar a bitrate" + +#: client/scenes/stream_gui.cpp:538 msgid "Foveation center override" msgstr "Ajuste do centro de foveação" -#: client/scenes/stream_gui.cpp:524 +#: client/scenes/stream_gui.cpp:541 msgid "Enable" msgstr "Habilitar" -#: client/scenes/stream_gui.cpp:532 client/scenes/stream_gui.cpp:579 +#: client/scenes/stream_gui.cpp:549 client/scenes/stream_gui.cpp:617 #, c++-format msgid "Height {:.1f} deg" msgstr "Altura {:.1f} graus" -#: client/scenes/stream_gui.cpp:533 client/scenes/stream_gui.cpp:580 +#: client/scenes/stream_gui.cpp:550 client/scenes/stream_gui.cpp:618 #, c++-format msgid "Distance {:.2f} m" msgstr "Distância {:.2f} m" -#: client/scenes/stream_gui.cpp:534 +#: client/scenes/stream_gui.cpp:551 msgid "Default" msgstr "Padrão" -#: client/scenes/stream_gui.cpp:545 +#: client/scenes/stream_gui.cpp:562 msgid "Change" msgstr "Modificar" -#: client/scenes/stream_gui.cpp:577 +#: client/scenes/stream_gui.cpp:594 +msgid "Use the right thumbstick to adjust the bitrate" +msgstr "Use o analógico direito para ajustar a bitrate" + +#: client/scenes/stream_gui.cpp:595 +msgid "Press A to go back" +msgstr "Pressione A para voltar" + +#: client/scenes/stream_gui.cpp:596 +#, c++-format +msgid "Bitrate: {}Mbit/s" +msgstr "Bitrate: {}Mbit/s" + +#: client/scenes/stream_gui.cpp:615 msgid "Use the thumbsticks to move the foveation center" msgstr "Use os thumbsticks para mover o centro da foveação" -#: client/scenes/stream_gui.cpp:578 +#: client/scenes/stream_gui.cpp:616 msgid "Press A to save or B to cancel" msgstr "Pressione A para salvar ou B para cancelar" -#: client/scenes/stream_gui.cpp:636 +#: client/scenes/stream_gui.cpp:674 msgid "Running XR applications:" msgstr "Aplicativos XR rodando:" -#: client/scenes/stream_gui.cpp:653 +#: client/scenes/stream_gui.cpp:691 msgid "Overlays" msgstr "Overlays" -#: client/scenes/stream_gui.cpp:692 +#: client/scenes/stream_gui.cpp:730 msgid "Request to quit, may be ignored by the application" msgstr "Requisição para sair, pode ser ignorada pelo aplicativo" -#: client/scenes/stream_gui.cpp:935 +#: client/scenes/stream_gui.cpp:980 msgid "Applications" msgstr "Aplicativos" -#: client/scenes/stream_gui.cpp:938 +#: client/scenes/stream_gui.cpp:983 msgid "Start" msgstr "Iniciar" -#: client/scenes/stream_gui.cpp:951 +#: client/scenes/stream_gui.cpp:996 msgid "Stats" msgstr "Estatísticas" -#: client/scenes/stream_gui.cpp:957 +#: client/scenes/stream_gui.cpp:1002 msgid "Statistics overlay" msgstr "Overlay de estatísticas" -#: client/scenes/stream_gui.cpp:960 +#: client/scenes/stream_gui.cpp:1005 msgid "Compact view" msgstr "Visualização compacta"