Rework wifi/multicast locks
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
#include "stream.h"
|
||||
#include "utils/contains.h"
|
||||
#include "version.h"
|
||||
#include "wifi_lock.h"
|
||||
#include "wivrn_client.h"
|
||||
#include "xr/passthrough.h"
|
||||
#include <glm/gtc/matrix_access.hpp>
|
||||
@@ -744,7 +743,7 @@ void scenes::lobby::on_focused()
|
||||
about_picture = imgui_ctx->load_texture("wivrn.png");
|
||||
}
|
||||
setup_passthrough();
|
||||
wifi_lock::want_multicast(true);
|
||||
multicast = application::get_wifi_lock().get_multicast_lock();
|
||||
}
|
||||
|
||||
void scenes::lobby::setup_passthrough()
|
||||
@@ -792,7 +791,7 @@ void scenes::lobby::on_unfocused()
|
||||
swapchains_controllers.clear();
|
||||
swapchain_imgui = xr::swapchain();
|
||||
passthrough.emplace<std::monostate>();
|
||||
wifi_lock::want_multicast(false);
|
||||
multicast.reset();
|
||||
}
|
||||
|
||||
void scenes::lobby::on_session_state_changed(XrSessionState state)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "render/scene_data.h"
|
||||
#include "scene.h"
|
||||
#include "scenes/hand_model.h"
|
||||
#include "wifi_lock.h"
|
||||
#include "wivrn_discover.h"
|
||||
#include <vulkan/vulkan_raii.hpp>
|
||||
|
||||
@@ -46,6 +47,7 @@ class stream;
|
||||
class lobby : public scene_impl<lobby>
|
||||
{
|
||||
std::optional<wivrn_discover> discover;
|
||||
wifi_lock::multicast multicast;
|
||||
|
||||
char add_server_window_prettyname[200];
|
||||
char add_server_window_hostname[200];
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "utils/ranges.h"
|
||||
#include "vk/pipeline.h"
|
||||
#include "vk/shader.h"
|
||||
#include "wifi_lock.h"
|
||||
#include "wivrn_packets.h"
|
||||
#include <algorithm>
|
||||
#include <mutex>
|
||||
@@ -215,7 +214,7 @@ void scenes::stream::on_focused()
|
||||
plots_toggle_2 = get_action("plots_toggle_2").first;
|
||||
}
|
||||
|
||||
wifi_lock::want_low_latency(true);
|
||||
wifi = application::get_wifi_lock().get_wifi_lock();
|
||||
assert(video_stream_description);
|
||||
setup_reprojection_swapchain();
|
||||
}
|
||||
@@ -224,7 +223,7 @@ void scenes::stream::on_unfocused()
|
||||
{
|
||||
imgui_ctx.reset();
|
||||
swapchain_imgui = xr::swapchain();
|
||||
wifi_lock::want_low_latency(false);
|
||||
wifi.reset();
|
||||
}
|
||||
|
||||
scenes::stream::~stream()
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "render/imgui_impl.h"
|
||||
#include "scene.h"
|
||||
#include "stream_reprojection.h"
|
||||
#include "wifi_lock.h"
|
||||
#include "wivrn_client.h"
|
||||
#include "wivrn_packets.h"
|
||||
#include <mutex>
|
||||
@@ -62,6 +63,8 @@ private:
|
||||
std::vector<uint64_t> frames() const;
|
||||
};
|
||||
|
||||
wifi_lock::wifi wifi;
|
||||
|
||||
// for frames inside accumulator images
|
||||
std::mutex frames_mutex;
|
||||
std::vector<std::shared_ptr<shard_accumulator::blit_handle>> common_frame(XrTime display_time);
|
||||
|
||||
Reference in New Issue
Block a user