Drop xrt::drivers namespace

This commit is contained in:
Patrick Nicolas
2024-10-03 23:39:32 +02:00
parent 6946d5144a
commit fdb79b1939
78 changed files with 260 additions and 260 deletions
+2 -2
View File
@@ -42,12 +42,12 @@ void clock_offset_estimator::request_sample(wivrn_connection & connection)
next_sample = std::chrono::steady_clock::now() + sample_interval.load();
connection.send_stream(
xrt::drivers::wivrn::to_headset::timesync_query{
wivrn::to_headset::timesync_query{
.query = XrTime(os_monotonic_get_ns()),
});
}
void clock_offset_estimator::add_sample(const xrt::drivers::wivrn::from_headset::timesync_response & base_sample)
void clock_offset_estimator::add_sample(const wivrn::from_headset::timesync_response & base_sample)
{
XrTime now = os_monotonic_get_ns();
clock_offset_estimator::sample sample{base_sample, now};
+2 -2
View File
@@ -48,7 +48,7 @@ struct clock_offset
class clock_offset_estimator
{
struct sample : public xrt::drivers::wivrn::from_headset::timesync_response
struct sample : public wivrn::from_headset::timesync_response
{
XrTime received;
};
@@ -64,7 +64,7 @@ class clock_offset_estimator
public:
void reset();
void request_sample(wivrn_connection & connection);
void add_sample(const xrt::drivers::wivrn::from_headset::timesync_response & sample);
void add_sample(const wivrn::from_headset::timesync_response & sample);
clock_offset get_offset();
};
+2 -2
View File
@@ -36,7 +36,7 @@
static std::filesystem::path config_file = xdg_config_home() / "wivrn" / "config.json";
static std::filesystem::path cookie_file = xdg_config_home() / "wivrn" / "cookie";
namespace xrt::drivers::wivrn
namespace wivrn
{
NLOHMANN_JSON_SERIALIZE_ENUM(
video_codec,
@@ -102,7 +102,7 @@ configuration configuration::read_user_configuration()
SET_IF(offset_y);
SET_IF(group);
SET_IF(codec);
if (e.codec == xrt::drivers::wivrn::video_codec(-1))
if (e.codec == wivrn::video_codec(-1))
throw std::runtime_error("invalid codec value " + encoder["codec"].get<std::string>());
SET_IF(options);
SET_IF(device);
+1 -1
View File
@@ -37,7 +37,7 @@ struct configuration
std::optional<double> offset_x;
std::optional<double> offset_y;
std::optional<int> group;
std::optional<xrt::drivers::wivrn::video_codec> codec;
std::optional<wivrn::video_codec> codec;
std::map<std::string, std::string> options;
std::optional<std::string> device;
};
+1 -1
View File
@@ -22,7 +22,7 @@
#include "pose_list.h"
#include "xrt_cast.h"
using namespace xrt::drivers::wivrn;
using namespace wivrn;
static_assert(XRT_HAND_JOINT_COUNT == XR_HAND_JOINT_COUNT_EXT);
+1 -1
View File
@@ -33,5 +33,5 @@ public:
hand_joints_list(int hand_id) :
hand_id(hand_id) {}
bool update_tracking(const xrt::drivers::wivrn::from_headset::hand_tracking & tracking, const clock_offset & offset);
bool update_tracking(const wivrn::from_headset::hand_tracking & tracking, const clock_offset & offset);
};
+1 -1
View File
@@ -24,7 +24,7 @@
#include "xrt/xrt_defines.h"
#include "xrt_cast.h"
using namespace xrt::drivers::wivrn;
using namespace wivrn;
using namespace xrt::auxiliary::math;
xrt_space_relation pose_list::interpolate(const xrt_space_relation & a, const xrt_space_relation & b, float t)
+4 -4
View File
@@ -27,15 +27,15 @@
class pose_list : public history<pose_list, xrt_space_relation>
{
public:
const xrt::drivers::wivrn::device_id device;
const wivrn::device_id device;
static xrt_space_relation interpolate(const xrt_space_relation & a, const xrt_space_relation & b, float t);
static xrt_space_relation extrapolate(const xrt_space_relation & a, const xrt_space_relation & b, int64_t ta, int64_t tb, int64_t t);
pose_list(xrt::drivers::wivrn::device_id id) :
pose_list(wivrn::device_id id) :
device(id) {}
bool update_tracking(const xrt::drivers::wivrn::from_headset::tracking &, const clock_offset & offset);
bool update_tracking(const wivrn::from_headset::tracking &, const clock_offset & offset);
static xrt_space_relation convert_pose(const xrt::drivers::wivrn::from_headset::tracking::pose &);
static xrt_space_relation convert_pose(const wivrn::from_headset::tracking::pose &);
};
+2 -2
View File
@@ -29,7 +29,7 @@
#include <vulkan/vulkan_core.h>
#include <vulkan/vulkan_handles.hpp>
using namespace xrt::drivers::wivrn;
using namespace wivrn;
std::vector<const char *> wivrn_comp_target::wanted_instance_extensions = {};
std::vector<const char *> wivrn_comp_target::wanted_device_extensions = {
@@ -650,7 +650,7 @@ void wivrn_comp_target::render_dynamic_foveation(std::array<to_headset::foveatio
}
}
wivrn_comp_target::wivrn_comp_target(std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx, struct comp_compositor * c, float fps) :
wivrn_comp_target::wivrn_comp_target(std::shared_ptr<wivrn::wivrn_session> cnx, struct comp_compositor * c, float fps) :
comp_target{},
pacer(U_TIME_1S_IN_NS / fps),
cnx(cnx)
+4 -4
View File
@@ -35,7 +35,7 @@
#include <vector>
#include <vulkan/vulkan_raii.hpp>
namespace xrt::drivers::wivrn
namespace wivrn
{
class VideoEncoder;
@@ -97,10 +97,10 @@ struct wivrn_comp_target : public comp_target
std::list<std::jthread> encoder_threads;
std::vector<std::shared_ptr<VideoEncoder>> encoders;
std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx;
std::shared_ptr<wivrn::wivrn_session> cnx;
std::unique_ptr<wivrn_foveation_renderer> foveation_renderer = nullptr;
wivrn_comp_target(std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx, struct comp_compositor * c, float fps);
wivrn_comp_target(std::shared_ptr<wivrn::wivrn_session> cnx, struct comp_compositor * c, float fps);
~wivrn_comp_target();
void on_feedback(const from_headset::feedback &, const clock_offset &);
@@ -109,4 +109,4 @@ struct wivrn_comp_target : public comp_target
void render_dynamic_foveation(std::array<to_headset::foveation_parameter, 2> foveation);
};
} // namespace xrt::drivers::wivrn
} // namespace wivrn
+1 -1
View File
@@ -25,7 +25,7 @@
#include <optional>
#include <poll.h>
using namespace xrt::drivers::wivrn;
using namespace wivrn;
class wivrn_connection
{
+1 -1
View File
@@ -151,7 +151,7 @@ static void wivrn_controller_update_inputs(xrt_device * xdev);
wivrn_controller::wivrn_controller(int hand_id,
xrt_device * hmd,
xrt::drivers::wivrn::wivrn_session * cnx) :
wivrn::wivrn_session * cnx) :
xrt_device{},
grip(hand_id == 0 ? device_id::LEFT_GRIP : device_id::RIGHT_GRIP),
aim(hand_id == 0 ? device_id::LEFT_AIM : device_id::RIGHT_AIM),
+3 -3
View File
@@ -29,7 +29,7 @@
#include <mutex>
#include <vector>
namespace xrt::drivers::wivrn
namespace wivrn
{
class wivrn_session;
}
@@ -46,10 +46,10 @@ class wivrn_controller : public xrt_device
std::vector<xrt_input> inputs_array;
xrt_output haptic_output;
xrt::drivers::wivrn::wivrn_session * cnx;
wivrn::wivrn_session * cnx;
public:
wivrn_controller(int hand_id, xrt_device * hmd, xrt::drivers::wivrn::wivrn_session * cnx);
wivrn_controller(int hand_id, xrt_device * hmd, wivrn::wivrn_session * cnx);
void unregister()
{
+1 -1
View File
@@ -40,7 +40,7 @@ static void wivrn_eye_tracker_get_tracked_pose(xrt_device * xdev,
xrt_space_relation * out_relation);
wivrn_eye_tracker::wivrn_eye_tracker(xrt_device * hmd,
std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx) :
std::shared_ptr<wivrn::wivrn_session> cnx) :
xrt_device{}, gaze(device_id::EYE_GAZE), cnx(cnx)
{
xrt_device * base = this;
+2 -2
View File
@@ -38,10 +38,10 @@ class wivrn_eye_tracker : public xrt_device
xrt_input gaze_input;
pose_list gaze;
std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx;
std::shared_ptr<wivrn::wivrn_session> cnx;
public:
wivrn_eye_tracker(xrt_device * hmd, std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx);
wivrn_eye_tracker(xrt_device * hmd, std::shared_ptr<wivrn::wivrn_session> cnx);
void unregister()
{
cnx = nullptr;
+1 -1
View File
@@ -42,7 +42,7 @@ static xrt_result_t wivrn_fb_face2_tracker_get_face_tracking(struct xrt_device *
struct xrt_facial_expression_set * out_value);
wivrn_fb_face2_tracker::wivrn_fb_face2_tracker(xrt_device * hmd,
std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx) :
std::shared_ptr<wivrn::wivrn_session> cnx) :
xrt_device{}, cnx(cnx)
{
xrt_device * base = this;
+2 -2
View File
@@ -86,10 +86,10 @@ class wivrn_fb_face2_tracker : public xrt_device
fb_face2_list face_list;
xrt_input face_input;
std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx;
std::shared_ptr<wivrn::wivrn_session> cnx;
public:
wivrn_fb_face2_tracker(xrt_device * hmd, std::shared_ptr<xrt::drivers::wivrn::wivrn_session> cnx);
wivrn_fb_face2_tracker(xrt_device * hmd, std::shared_ptr<wivrn::wivrn_session> cnx);
void unregister()
{
cnx = nullptr;
+1 -1
View File
@@ -197,7 +197,7 @@ bool wivrn_hmd::wivrn_hmd_compute_distortion(xrt_device * xdev, uint32_t view_in
return true;
}
wivrn_hmd::wivrn_hmd(xrt::drivers::wivrn::wivrn_session * cnx,
wivrn_hmd::wivrn_hmd(wivrn::wivrn_session * cnx,
const from_headset::headset_info_packet & info) :
xrt_device{}, cnx(cnx)
{
+3 -3
View File
@@ -32,7 +32,7 @@
struct comp_target;
namespace xrt::drivers::wivrn
namespace wivrn
{
class wivrn_session;
}
@@ -55,12 +55,12 @@ class wivrn_hmd : public xrt_device
std::array<to_headset::foveation_parameter, 2> foveation_parameters{};
from_headset::battery battery{};
xrt::drivers::wivrn::wivrn_session * cnx;
wivrn::wivrn_session * cnx;
static bool wivrn_hmd_compute_distortion(xrt_device * xdev, uint32_t view_index, float u, float v, xrt_uv_triplet * result);
public:
wivrn_hmd(xrt::drivers::wivrn::wivrn_session * cnx,
wivrn_hmd(wivrn::wivrn_session * cnx,
const from_headset::headset_info_packet & info);
void unregister()
{
+1 -1
View File
@@ -68,7 +68,7 @@ void wivrn_pacer::predict(
out_present_slop_ns = 0;
}
void wivrn_pacer::on_feedback(const xrt::drivers::wivrn::from_headset::feedback & feedback, const clock_offset & offset)
void wivrn_pacer::on_feedback(const wivrn::from_headset::feedback & feedback, const clock_offset & offset)
{
std::lock_guard lock(mutex);
if (feedback.stream_index >= streams.size() or feedback.times_displayed > 1)
+2 -2
View File
@@ -56,7 +56,7 @@ private:
struct stream_data
{
// Last feedback for each encoder
xrt::drivers::wivrn::from_headset::feedback last_feedback;
wivrn::from_headset::feedback last_feedback;
std::vector<int64_t> times;
size_t next_times_index = 0;
};
@@ -78,7 +78,7 @@ public:
int64_t & out_present_slop_ns,
int64_t & out_predicted_display_time_ns);
void on_feedback(const xrt::drivers::wivrn::from_headset::feedback &, const clock_offset &);
void on_feedback(const wivrn::from_headset::feedback &, const clock_offset &);
void mark_timing_point(
comp_target_timing_point point,
+10 -10
View File
@@ -90,7 +90,7 @@ struct wivrn_comp_target_factory : public comp_target_factory
}
};
void xrt::drivers::wivrn::tracking_control_t::send(wivrn_connection & connection)
void wivrn::tracking_control_t::send(wivrn_connection & connection)
{
if (std::chrono::steady_clock::now() < next_sample)
return;
@@ -102,7 +102,7 @@ void xrt::drivers::wivrn::tracking_control_t::send(wivrn_connection & connection
next_sample += std::chrono::seconds(1);
}
void xrt::drivers::wivrn::tracking_control_t::set_enabled(to_headset::tracking_control::id id, bool enabled)
void wivrn::tracking_control_t::set_enabled(to_headset::tracking_control::id id, bool enabled)
{
std::lock_guard lock(mutex);
if (enabled != this->enabled[size_t(id)])
@@ -110,10 +110,10 @@ void xrt::drivers::wivrn::tracking_control_t::set_enabled(to_headset::tracking_c
this->enabled[size_t(id)] = enabled;
}
xrt::drivers::wivrn::wivrn_session::wivrn_session(xrt::drivers::wivrn::TCP && tcp, u_system & system) :
wivrn::wivrn_session::wivrn_session(wivrn::TCP && tcp, u_system & system) :
connection(std::move(tcp)),
info([](wivrn_connection & connection) {
std::optional<xrt::drivers::wivrn::from_headset::packets> control;
std::optional<wivrn::from_headset::packets> control;
while (not(control = connection.poll_control(-1)))
{
// FIXME: timeout
@@ -127,11 +127,11 @@ xrt::drivers::wivrn::wivrn_session::wivrn_session(xrt::drivers::wivrn::TCP && tc
{
}
xrt_result_t xrt::drivers::wivrn::wivrn_session::create_session(xrt::drivers::wivrn::TCP && tcp,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
xrt_system_compositor ** out_xsysc)
xrt_result_t wivrn::wivrn_session::create_session(wivrn::TCP && tcp,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
xrt_system_compositor ** out_xsysc)
{
std::shared_ptr<wivrn_session> self;
try
@@ -519,7 +519,7 @@ void wivrn_session::reconnect()
{
offset_est.reset();
connection.reset(std::move(*tcp));
std::optional<xrt::drivers::wivrn::from_headset::packets> control;
std::optional<wivrn::from_headset::packets> control;
while (not(control = connection.poll_control(100)))
{
// FIXME: timeout
+2 -2
View File
@@ -45,7 +45,7 @@ struct xrt_space_overseer;
struct xrt_system_compositor;
struct wivrn_comp_target_factory;
namespace xrt::drivers::wivrn
namespace wivrn
{
struct wivrn_comp_target;
@@ -175,4 +175,4 @@ private:
void reconnect();
};
} // namespace xrt::drivers::wivrn
} // namespace wivrn