Compare commits

...
Author SHA1 Message Date
Vindicus999 1d9fb638a5 Merge remote-tracking branch 'upstream/master' 2025-09-27 23:17:07 +00:00
Patola 46a36fcd55 Updated pt_BR strings (#506)
* Updated pt_BR strings

* Better tranlation

* Better tranlation 2
2025-09-27 22:40:28 +02:00
Vindicus999 c679d94fbd Merge remote-tracking branch 'upstream/master' 2025-09-27 17:14:46 +00:00
Patrick Nicolas a5bb9c2678 Fix imgui error for duplicate app name 2025-09-27 17:11:17 +02:00
Patrick Nicolas 5b6e20bdbe fr, it locales 2025-09-27 16:58:20 +02:00
Patrick Nicolas 1667065084 Add app launcher in stream gui 2025-09-27 16:57:23 +02:00
Patrick Nicolas 67918b7fe7 Move app launcher out of lobby_gui 2025-09-27 16:53:25 +02:00
Patrick Nicolas f03c460aa6 Return to last screen on thumbstick press 2025-09-27 16:28:59 +02:00
Patrick Nicolas e7c69e9464 Support stopping application 2025-09-27 16:28:59 +02:00
Patrick Nicolas 6e64dd03b3 Select active application from stream GUI 2025-09-27 10:08:51 +02:00
Patrick Nicolas 7fb8f4c1a8 List running applications 2025-09-27 10:08:51 +02:00
Patrick Nicolas fcbdda9908 Don't fake user presence, use focused instead 2025-09-27 10:08:51 +02:00
Vindicus999 bb05aef061 Merge remote-tracking branch 'upstream/master' 2025-09-26 17:16:46 +00:00
Patrick Nicolas 4e5eca204f Disable fragment shading rate
Causes artifacts due to triangle edges, the performance gain is not
worth it
2025-09-26 16:33:01 +02:00
Patrick Nicolas 6932f9461d Add support for raw video 2025-09-26 16:33:01 +02:00
51 changed files with 2494 additions and 1034 deletions
+11 -17
View File
@@ -759,13 +759,12 @@ void application::initialize_vulkan()
spdlog::info(" {} (version {})", extension_name, spec_version);
vk_device_extensions.push_back(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME);
vk_device_extensions.push_back(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME);
optional_device_extensions.emplace(VK_IMG_FILTER_CUBIC_EXTENSION_NAME);
optional_device_extensions.emplace(VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME);
optional_device_extensions.emplace(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME);
optional_device_extensions.emplace(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME);
#ifdef __ANDROID__
vk_device_extensions.push_back(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME);
vk_device_extensions.push_back(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME);
vk_device_extensions.push_back(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
vk_device_extensions.push_back(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME);
vk_device_extensions.push_back(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME);
@@ -880,28 +879,23 @@ void application::initialize_vulkan()
.ppEnabledExtensionNames = vk_device_extensions.data(),
.pEnabledFeatures = &device_features,
},
vk::PhysicalDeviceFragmentShadingRateFeaturesKHR{},
#ifdef __ANDROID__
vk::PhysicalDeviceSamplerYcbcrConversionFeaturesKHR{
.samplerYcbcrConversion = VK_TRUE,
.samplerYcbcrConversion = true,
},
vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR{
.timelineSemaphore = true,
},
#endif
};
if (utils::contains(vk_device_extensions, VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME) and
utils::contains(vk_device_extensions, VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME))
if (utils::contains(vk_device_extensions, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME))
{
auto [feat, fragment_feat] = vk_physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceFragmentShadingRateFeaturesKHR>();
auto & create_feat = device_create_info.get<vk::PhysicalDeviceFragmentShadingRateFeaturesKHR>();
create_feat.primitiveFragmentShadingRate = fragment_feat.primitiveFragmentShadingRate;
create_feat.attachmentFragmentShadingRate = fragment_feat.attachmentFragmentShadingRate;
spdlog::info("Fragment shading rate features: primitive={} attachment={}",
create_feat.primitiveFragmentShadingRate,
create_feat.attachmentFragmentShadingRate);
auto [_, feat] = vk_physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR>();
auto & create_feat = device_create_info.get<vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR>();
create_feat.timelineSemaphore = feat.timelineSemaphore;
}
else
{
device_create_info.unlink<vk::PhysicalDeviceFragmentShadingRateFeaturesKHR>();
device_create_info.unlink<vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR>();
}
vk_device = xr_system_id.create_device(vk_physical_device, device_create_info.get());
+3 -1
View File
@@ -59,6 +59,8 @@ const char * mime(wivrn::video_codec codec)
return "video/hevc";
case c::av1:
return "video/av01";
case c::raw:
break;
}
assert(false);
__builtin_unreachable();
@@ -562,7 +564,7 @@ static bool hardware_accelerated(AMediaCodec * media_codec)
void decoder::supported_codecs(std::vector<wivrn::video_codec> & result)
{
// Make sure we update this code when codecs are changed
static_assert(magic_enum::enum_count<wivrn::video_codec>() == 3);
static_assert(magic_enum::enum_count<wivrn::video_codec>() == 4);
// In order or preference, from preferred to least preferred
for (auto codec: {
+34 -15
View File
@@ -23,36 +23,54 @@
#else
#include "decoder/ffmpeg/ffmpeg_decoder.h"
#endif
#include "decoder/raw_decoder.h"
wivrn::decoder::~decoder() = default;
std::shared_ptr<wivrn::decoder> wivrn::decoder::make(
vk::raii::Device & device,
vk::raii::PhysicalDevice & phys_dev,
uint32_t vk_queue_family_index,
const wivrn::to_headset::video_stream_description::item & description,
float fps,
uint8_t stream_index,
std::weak_ptr<scenes::stream> scene,
shard_accumulator * acc)
{
switch (description.codec)
{
case h264:
case h265:
case av1:
#ifdef __ANDROID__
return std::make_shared<wivrn::android::decoder>(
device,
phys_dev,
description,
fps,
stream_index,
scene,
acc);
return std::make_shared<wivrn::android::decoder>(
device,
phys_dev,
description,
fps,
stream_index,
scene,
acc);
#else
return std::make_shared<wivrn::ffmpeg::decoder>(
device,
phys_dev,
description,
stream_index,
scene,
acc);
return std::make_shared<wivrn::ffmpeg::decoder>(
device,
phys_dev,
description,
stream_index,
scene,
acc);
#endif
case raw:
return std::make_shared<wivrn::raw_decoder>(
device,
phys_dev,
vk_queue_family_index,
description,
stream_index,
scene,
acc);
}
__builtin_unreachable();
}
std::vector<wivrn::video_codec> wivrn::decoder::supported_codecs()
@@ -63,5 +81,6 @@ std::vector<wivrn::video_codec> wivrn::decoder::supported_codecs()
#else
ffmpeg::decoder::supported_codecs(res);
#endif
res.push_back(video_codec::raw);
return res;
}
+3
View File
@@ -43,6 +43,8 @@ public:
vk::ImageView image_view = nullptr;
vk::Image image = nullptr;
vk::ImageLayout & current_layout;
vk::Semaphore semaphore = nullptr;
uint64_t * semaphore_val = nullptr;
};
const wivrn::to_headset::video_stream_description::item description;
@@ -56,6 +58,7 @@ public:
static std::shared_ptr<decoder> make(
vk::raii::Device &,
vk::raii::PhysicalDevice &,
uint32_t vk_queue_family_index,
const wivrn::to_headset::video_stream_description::item & description,
float fps,
uint8_t stream_index,
+2
View File
@@ -56,6 +56,8 @@ static AVCodecID codec_id(wivrn::video_codec codec)
return AV_CODEC_ID_HEVC;
case c::av1:
return AV_CODEC_ID_AV1;
case c::raw:
break;
}
assert(false);
__builtin_unreachable();
+353
View File
@@ -0,0 +1,353 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "raw_decoder.h"
#include "application.h"
#include "scenes/stream.h"
namespace
{
struct raw_blit_handle : public wivrn::decoder::blit_handle
{
std::atomic_bool & free;
raw_blit_handle(
const wivrn::from_headset::feedback & feedback,
const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info,
vk::ImageView image_view,
vk::Image image,
vk::ImageLayout & current_layout,
vk::Semaphore semaphore,
uint64_t & semaphore_val,
std::atomic_bool & free) :
wivrn::decoder::blit_handle{feedback, view_info, image_view, image, current_layout, semaphore, &semaphore_val},
free(free) {}
~raw_blit_handle()
{
free = true;
};
};
vk::raii::Sampler make_sampler(
vk::raii::Device & device,
vk::raii::SamplerYcbcrConversion & ycbcr_conversion,
to_headset::video_stream_description::channels_t channels)
{
vk::StructureChain info{
vk::SamplerCreateInfo{
.magFilter = vk::Filter::eNearest,
.minFilter = vk::Filter::eNearest,
.mipmapMode = vk::SamplerMipmapMode::eNearest,
.addressModeU = vk::SamplerAddressMode::eClampToEdge,
.addressModeV = vk::SamplerAddressMode::eClampToEdge,
.addressModeW = vk::SamplerAddressMode::eClampToEdge,
.maxAnisotropy = 1,
},
vk::SamplerYcbcrConversionInfo{
.conversion = *ycbcr_conversion,
},
};
switch (channels)
{
case wivrn::to_headset::video_stream_description::channels_t::colour:
break;
case wivrn::to_headset::video_stream_description::channels_t::alpha:
info.unlink<vk::SamplerYcbcrConversionInfo>();
break;
}
return vk::raii::Sampler(device, info.get());
}
} // namespace
namespace wivrn
{
raw_decoder::raw_decoder(
vk::raii::Device & device,
vk::raii::PhysicalDevice & physical_device,
uint32_t vk_queue_family_index,
const wivrn::to_headset::video_stream_description::item & description,
uint8_t stream_index,
std::weak_ptr<scenes::stream> scene,
shard_accumulator * accumulator) :
decoder(description),
device(device),
ycbcr_conversion(device,
{
.format = vk::Format::eG8B8R82Plane420Unorm,
.ycbcrModel = vk::SamplerYcbcrModelConversion(description.color_model.value_or(VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709)),
.ycbcrRange = vk::SamplerYcbcrRange(description.range.value_or(VK_SAMPLER_YCBCR_RANGE_ITU_FULL)),
.chromaFilter = vk::Filter::eNearest,
}),
sampler_(make_sampler(device, ycbcr_conversion, description.channels)),
command_pool(device, vk::CommandPoolCreateInfo{
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer,
.queueFamilyIndex = vk_queue_family_index,
}),
cmd(device.allocateCommandBuffers(vk::CommandBufferAllocateInfo{
.commandPool = *command_pool,
.commandBufferCount = 1,
})[0]
.release()),
fence(device, vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled}),
weak_scene(scene),
accumulator(accumulator)
{
extent_ = vk::Extent2D{
.width = description.width,
.height = description.height,
};
vk::DeviceSize buffer_size = description.width * description.height;
vk::Format format{};
switch (description.channels)
{
case to_headset::video_stream_description::channels_t::colour:
buffer_size += (description.width * description.height) / 2;
format = vk::Format::eG8B8R82Plane420Unorm;
break;
case to_headset::video_stream_description::channels_t::alpha:
format = vk::Format::eR8Unorm;
break;
}
for (auto & i: input)
{
i = buffer_allocation(
device,
{
.size = buffer_size,
.usage = vk::BufferUsageFlagBits::eTransferSrc,
},
{
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
.usage = VMA_MEMORY_USAGE_AUTO,
},
"raw stream buffer");
}
input_pos = (uint8_t *)input[0].map();
for (auto & item: image_pool)
{
item.image = image_allocation(
device,
vk::ImageCreateInfo{
.imageType = vk::ImageType::e2D,
.format = format,
.extent = {
.width = description.width,
.height = description.height,
.depth = 1,
},
.mipLevels = 1,
.arrayLayers = 1,
.tiling = vk::ImageTiling::eOptimal,
.usage = vk::ImageUsageFlagBits::eSampled | vk::ImageUsageFlagBits::eTransferDst,
},
{
.usage = VMA_MEMORY_USAGE_AUTO,
},
"raw image");
vk::SamplerYcbcrConversionInfo conv{
.conversion = *ycbcr_conversion,
};
vk::ImageViewCreateInfo view_info{
.pNext = format == vk::Format::eG8B8R82Plane420Unorm ? &conv : nullptr,
.image = item.image,
.viewType = vk::ImageViewType::e2D,
.format = format,
.subresourceRange = {
.aspectMask = vk::ImageAspectFlagBits::eColor,
.levelCount = 1,
.layerCount = 1,
},
};
item.view_full = vk::raii::ImageView(device, view_info);
item.semaphore = vk::raii::Semaphore(
device,
vk::StructureChain{
vk::SemaphoreCreateInfo{},
vk::SemaphoreTypeCreateInfo{
.semaphoreType = vk::SemaphoreType::eTimeline,
},
}
.get());
}
}
void raw_decoder::push_data(std::span<std::span<const uint8_t>> data, uint64_t frame_index, bool partial)
{
if (frame_index != current_frame)
{
input_pos = (uint8_t *)input[0].map();
current_frame = frame_index;
}
for (const auto & item: data)
{
memcpy(input_pos, item.data(), item.size_bytes());
input_pos += item.size();
}
}
void raw_decoder::frame_completed(
const from_headset::feedback & feedback,
const to_headset::video_stream_data_shard::view_info_t & view_info)
{
auto item = get_free();
if (not item)
{
spdlog::warn("No image available in pool, discard frame");
return;
}
auto handle = std::make_shared<raw_blit_handle>(
feedback,
view_info,
*item->view_full,
item->image,
item->current_layout,
*item->semaphore,
item->semaphore_val,
item->free);
auto res = device.waitForFences(*fence, true, UINT64_MAX);
if (res != vk::Result::eSuccess)
spdlog::warn("waitForFences failed");
cmd.reset();
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
if (item->current_layout != vk::ImageLayout::eTransferDstOptimal)
{
item->current_layout = vk::ImageLayout::eTransferDstOptimal;
vk::ImageMemoryBarrier barrier{
.srcAccessMask = vk::AccessFlagBits::eNone,
.dstAccessMask = vk::AccessFlagBits::eMemoryWrite,
.oldLayout = vk::ImageLayout::eUndefined,
.newLayout = item->current_layout,
.image = item->image,
.subresourceRange = {
.aspectMask = vk::ImageAspectFlagBits::eColor,
.levelCount = 1,
.layerCount = 1,
},
};
cmd.pipelineBarrier(
vk::PipelineStageFlagBits::eAllCommands,
vk::PipelineStageFlagBits::eTransfer,
{},
{},
{},
barrier);
}
std::array regions{
vk::BufferImageCopy{
.imageSubresource = {
.aspectMask = vk::ImageAspectFlagBits::ePlane0,
.layerCount = 1,
},
.imageExtent = {
.width = description.width,
.height = description.height,
.depth = 1,
},
},
vk::BufferImageCopy{
.bufferOffset = vk::DeviceSize(description.width * description.height),
.imageSubresource = {
.aspectMask = vk::ImageAspectFlagBits::ePlane1,
.layerCount = 1,
},
.imageExtent = {
.width = description.width / 2u,
.height = description.height / 2u,
.depth = 1,
},
},
};
cmd.copyBufferToImage(
input[0],
item->image,
item->current_layout,
description.channels == to_headset::video_stream_description::channels_t::colour ? 2 : 1,
regions.data());
vk::ImageMemoryBarrier barrier{
.srcAccessMask = vk::AccessFlagBits::eMemoryWrite,
.dstAccessMask = vk::AccessFlagBits::eMemoryRead,
.oldLayout = item->current_layout,
.newLayout = vk::ImageLayout::eShaderReadOnlyOptimal,
.image = item->image,
.subresourceRange = {
.aspectMask = vk::ImageAspectFlagBits::eColor,
.levelCount = 1,
.layerCount = 1,
},
};
item->current_layout = barrier.newLayout;
cmd.pipelineBarrier(
vk::PipelineStageFlagBits::eTransfer,
vk::PipelineStageFlagBits::eFragmentShader,
{},
{},
{},
barrier);
cmd.end();
device.resetFences(*fence);
application::get_queue().lock()->submit(
vk::StructureChain{
vk::SubmitInfo{
.commandBufferCount = 1,
.pCommandBuffers = &cmd,
.signalSemaphoreCount = 1,
.pSignalSemaphores = &*item->semaphore,
},
vk::TimelineSemaphoreSubmitInfo{
.signalSemaphoreValueCount = 1,
.pSignalSemaphoreValues = &++item->semaphore_val,
},
}
.get(),
*fence);
if (auto scene = weak_scene.lock())
scene->push_blit_handle(accumulator, std::move(handle));
std::swap(input[0], input[1]);
input_pos = (uint8_t *)input[0].map();
}
raw_decoder::image * raw_decoder::get_free()
{
for (auto & item: image_pool)
{
if (item.free.exchange(false))
return &item;
}
return nullptr;
}
std::vector<wivrn::video_codec> raw_decoder::supported_codecs()
{
return {video_codec::raw};
}
} // namespace wivrn
+96
View File
@@ -0,0 +1,96 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "decoder.h"
#include "vk/allocation.h"
#include <atomic>
namespace wivrn
{
class raw_decoder : public decoder
{
private:
static const int image_count = 5;
struct image
{
image_allocation image;
vk::raii::ImageView view_full = nullptr;
vk::ImageLayout current_layout = vk::ImageLayout::eUndefined;
std::atomic_bool free = true;
vk::raii::Semaphore semaphore = nullptr;
uint64_t semaphore_val = 0;
};
vk::raii::Device & device;
vk::raii::SamplerYcbcrConversion ycbcr_conversion;
vk::raii::Sampler sampler_;
vk::raii::CommandPool command_pool;
vk::CommandBuffer cmd;
vk::raii::Fence fence;
std::array<image, image_count> image_pool;
std::weak_ptr<scenes::stream> weak_scene;
shard_accumulator * accumulator;
uint64_t current_frame = 0;
std::array<buffer_allocation, 2> input;
uint8_t * input_pos;
from_headset::feedback feedback;
to_headset::video_stream_data_shard::view_info_t view_info;
public:
raw_decoder(vk::raii::Device & device,
vk::raii::PhysicalDevice & physical_device,
uint32_t vk_queue_family_index,
const wivrn::to_headset::video_stream_description::item & description,
uint8_t stream_index,
std::weak_ptr<scenes::stream> scene,
shard_accumulator * accumulator);
void push_data(std::span<std::span<const uint8_t>> data, uint64_t frame_index, bool partial) override;
void frame_completed(
const wivrn::from_headset::feedback & feedback,
const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info) override;
vk::Sampler sampler() override
{
return *sampler_;
}
vk::Extent2D image_size()
{
return {
description.width,
description.height,
};
}
static std::vector<wivrn::video_codec> supported_codecs();
private:
image * get_free();
};
} // namespace wivrn
+2 -1
View File
@@ -80,11 +80,12 @@ public:
vk::raii::Device & device,
vk::raii::PhysicalDevice & physical_device,
xr::instance & instance,
uint32_t vk_queue_family_index,
const wivrn::to_headset::video_stream_description::item & description,
float fps,
std::weak_ptr<scenes::stream> scene,
uint8_t stream_index) :
decoder_(decoder::make(device, physical_device, description, fps, stream_index, scene, this)),
decoder_(decoder::make(device, physical_device, vk_queue_family_index, description, fps, stream_index, scene, this)),
current(stream_index),
next(stream_index),
weak_scene(scene),
+112 -32
View File
@@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define IMGUI_DEFINE_MATH_OPERATORS
#include "imgui_impl.h"
#include "implot.h"
@@ -25,6 +26,7 @@
#include "image_loader.h"
#include "openxr/openxr.h"
#include "utils/ranges.h"
#include "utils/strings.h"
#include "vulkan/vulkan_enums.hpp"
#include "vulkan/vulkan_handles.hpp"
#include "vulkan/vulkan_to_string.hpp"
@@ -43,8 +45,6 @@
#include <spdlog/spdlog.h>
#include <string_view>
#include "IconsFontAwesome6.h"
#ifdef __ANDROID__
#include <android/font.h>
#include <android/font_matcher.h>
@@ -178,6 +178,31 @@ static float distance_to_window(ImGuiWindow * window, ImVec2 position)
return std::hypot(dx, dy);
}
static const std::array layout_bindings = {
vk::DescriptorSetLayoutBinding{
.binding = 0,
.descriptorType = vk::DescriptorType::eCombinedImageSampler,
.descriptorCount = 1,
.stageFlags = vk::ShaderStageFlagBits::eFragment,
}};
imgui_textures::imgui_textures(
vk::raii::PhysicalDevice physical_device,
vk::raii::Device & device,
uint32_t queue_family_index,
thread_safe<vk::raii::Queue> & queue) :
physical_device(physical_device),
device(device),
queue(queue),
ds_layout(device, vk::DescriptorSetLayoutCreateInfo{.bindingCount = layout_bindings.size(), .pBindings = layout_bindings.data()}),
command_pool(device,
vk::CommandPoolCreateInfo{
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
.queueFamilyIndex = queue_family_index,
}),
descriptor_pool(device, ds_layout, layout_bindings)
{}
std::vector<std::pair<ImVec2, float>> imgui_context::ray_plane_intersection(const imgui_context::controller_state & in) const
{
if (!in.active)
@@ -289,14 +314,6 @@ imgui_context::imgui_frame & imgui_context::get_frame(vk::Image destination)
return frame;
}
static const std::array layout_bindings = {
vk::DescriptorSetLayoutBinding{
.binding = 0,
.descriptorType = vk::DescriptorType::eCombinedImageSampler,
.descriptorCount = 1,
.stageFlags = vk::ShaderStageFlagBits::eFragment,
}};
imgui_context::imgui_context(
vk::raii::PhysicalDevice physical_device,
vk::raii::Device & device,
@@ -305,18 +322,13 @@ imgui_context::imgui_context(
std::span<controller> controllers_,
xr::swapchain & swapchain,
std::vector<viewport> layers) :
physical_device(physical_device),
device(device),
imgui_textures(
physical_device,
device,
queue_family_index,
queue),
queue_family_index(queue_family_index),
queue(queue),
ds_layout(device, vk::DescriptorSetLayoutCreateInfo{.bindingCount = layout_bindings.size(), .pBindings = layout_bindings.data()}),
descriptor_pool(device, ds_layout, layout_bindings),
renderpass(create_renderpass(device, swapchain.format(), true)),
command_pool(device,
vk::CommandPoolCreateInfo{
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
.queueFamilyIndex = queue_family_index,
}),
command_buffers(swapchain.images().size()),
size(swapchain.extent().width, swapchain.extent().height),
format(swapchain.format()),
@@ -1020,12 +1032,12 @@ imgui_context::~imgui_context()
ImGui::DestroyContext(context);
}
ImTextureID imgui_context::load_texture(const std::string & filename, vk::raii::Sampler && sampler)
ImTextureID imgui_textures::load_texture(const std::string & filename, vk::raii::Sampler && sampler)
{
return load_texture(std::span<const std::byte>{asset{filename}}, std::move(sampler));
}
ImTextureID imgui_context::load_texture(const std::span<const std::byte> & bytes, vk::raii::Sampler && sampler)
ImTextureID imgui_textures::load_texture(const std::span<const std::byte> & bytes, vk::raii::Sampler && sampler)
{
bool srgb = true;
image_loader loader(physical_device, device, queue, command_pool);
@@ -1061,7 +1073,7 @@ ImTextureID imgui_context::load_texture(const std::span<const std::byte> & bytes
return id;
}
ImTextureID imgui_context::load_texture(const std::span<const std::byte> & bytes)
ImTextureID imgui_textures::load_texture(const std::span<const std::byte> & bytes)
{
return load_texture(
bytes,
@@ -1079,7 +1091,7 @@ ImTextureID imgui_context::load_texture(const std::span<const std::byte> & bytes
});
}
ImTextureID imgui_context::load_texture(const std::string & filename)
ImTextureID imgui_textures::load_texture(const std::string & filename)
{
return load_texture(
filename,
@@ -1097,15 +1109,8 @@ ImTextureID imgui_context::load_texture(const std::string & filename)
});
}
void imgui_context::free_texture(ImTextureID texture)
void imgui_textures::free_texture(ImTextureID texture)
{
// Make sure we are done using the texture
std::vector<vk::Fence> fences;
for (auto & f: command_buffers)
fences.push_back(*f.fence);
if (auto result = device.waitForFences(fences, true, 1'000'000'000); result != vk::Result::eSuccess)
spdlog::error("vkWaitForfences: {}", vk::to_string(result));
textures.erase(texture);
}
@@ -1182,3 +1187,78 @@ void imgui_context::tooltip(std::string_view text)
viewport->Pos = pos_backup;
viewport->Size = size_backup;
}
// https://github.com/ocornut/imgui/issues/3379#issuecomment-2943903877
void ScrollWhenDragging()
{
ImVec2 delta{0.0f, -ImGui::GetIO().MouseDelta.y};
const ImGuiMouseButton mouse_button = ImGuiMouseButton_Left;
ImGuiContext & g = *ImGui::GetCurrentContext();
ImGuiWindow * window = g.CurrentWindow;
ImGuiID id = window->GetID("##scrolldraggingoverlay");
ImGui::KeepAliveID(id);
static int active_id;
static ImVec2 cumulated_delta;
bool HoveredIdAllowOverlap_backup = std::exchange(g.HoveredIdAllowOverlap, true);
bool ActiveIdAllowOverlap_backup = std::exchange(g.ActiveIdAllowOverlap, true);
if (active_id == 0 and ImGui::ItemHoverable(window->Rect(), 0, g.CurrentItemFlags) and ImGui::IsMouseClicked(mouse_button, ImGuiInputFlags_None, /*id*/ ImGuiKeyOwner_Any))
{
active_id = id;
// Don't scroll on the first step, in case the active controller just changed
delta = {};
cumulated_delta = {};
}
if (not g.IO.MouseDown[mouse_button])
active_id = 0;
if (active_id == id)
{
if (delta.x != 0.0f)
ImGui::SetScrollX(window, window->Scroll.x + delta.x);
if (delta.y != 0.0f)
ImGui::SetScrollY(window, window->Scroll.y + delta.y);
cumulated_delta += delta;
if (std::max(std::abs(cumulated_delta.x), std::abs(cumulated_delta.y)) > 50)
ImGui::ClearActiveID();
}
g.HoveredIdAllowOverlap = HoveredIdAllowOverlap_backup;
g.ActiveIdAllowOverlap = ActiveIdAllowOverlap_backup;
}
void CenterTextH(const std::string & text)
{
float win_width = ImGui::GetWindowSize().x;
float text_width = ImGui::CalcTextSize(text.c_str()).x;
ImGui::SetCursorPosX((win_width - text_width) / 2);
ImGui::Text("%s", text.c_str());
}
void CenterTextHV(const std::string & text)
{
ImVec2 size = ImGui::GetWindowSize();
std::vector<std::string> lines = utils::split(text);
float text_height = 0;
for (const auto & i: lines)
text_height += ImGui::CalcTextSize(i.c_str()).y;
ImGui::SetCursorPosY((size.y - text_height) / 2);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {0, 0});
for (const auto & i: lines)
{
float text_width = ImGui::CalcTextSize(i.c_str()).x;
ImGui::SetCursorPosX((size.x - text_width) / 2);
ImGui::Text("%s", i.c_str());
}
ImGui::PopStyleVar();
}
+37 -20
View File
@@ -36,14 +36,8 @@
#include <vulkan/vulkan_raii.hpp>
#include <openxr/openxr.h>
class imgui_context
class imgui_textures
{
struct command_buffer
{
vk::raii::CommandBuffer command_buffer = nullptr;
vk::raii::Fence fence = nullptr;
};
struct texture_data
{
vk::raii::Sampler sampler;
@@ -51,6 +45,38 @@ class imgui_context
std::shared_ptr<vk::raii::DescriptorSet> descriptor_set;
};
protected:
vk::raii::PhysicalDevice physical_device;
vk::raii::Device & device;
thread_safe<vk::raii::Queue> & queue;
vk::raii::DescriptorSetLayout ds_layout;
vk::raii::CommandPool command_pool;
private:
growable_descriptor_pool descriptor_pool;
std::unordered_map<ImTextureID, texture_data> textures;
public:
imgui_textures(
vk::raii::PhysicalDevice physical_device,
vk::raii::Device & device,
uint32_t queue_family_index,
thread_safe<vk::raii::Queue> & queue);
ImTextureID load_texture(const std::string & filename, vk::raii::Sampler && sampler);
ImTextureID load_texture(const std::string & filename);
ImTextureID load_texture(const std::span<const std::byte> & bytes, vk::raii::Sampler && sampler);
ImTextureID load_texture(const std::span<const std::byte> & bytes);
void free_texture(ImTextureID);
};
class imgui_context : public imgui_textures
{
struct command_buffer
{
vk::raii::CommandBuffer command_buffer = nullptr;
vk::raii::Fence fence = nullptr;
};
public:
struct imgui_frame
{
@@ -117,18 +143,10 @@ public:
};
private:
vk::raii::PhysicalDevice physical_device;
vk::raii::Device & device;
uint32_t queue_family_index;
thread_safe<vk::raii::Queue> & queue;
vk::raii::Pipeline pipeline = nullptr;
vk::raii::DescriptorSetLayout ds_layout;
growable_descriptor_pool descriptor_pool;
vk::raii::RenderPass renderpass;
vk::raii::CommandPool command_pool;
std::unordered_map<ImTextureID, texture_data> textures;
std::vector<imgui_frame> frames;
imgui_frame & get_frame(vk::Image destination);
@@ -207,11 +225,6 @@ public:
// Convert position from viewport coordinates to real-world
glm::vec3 rw_from_vp(const ImVec2 & position);
ImTextureID load_texture(const std::string & filename, vk::raii::Sampler && sampler);
ImTextureID load_texture(const std::string & filename);
ImTextureID load_texture(const std::span<const std::byte> & bytes, vk::raii::Sampler && sampler);
ImTextureID load_texture(const std::span<const std::byte> & bytes);
void free_texture(ImTextureID);
void set_current();
bool is_modal_popup_shown() const;
@@ -221,3 +234,7 @@ public:
void set_controllers_enabled(bool value);
void tooltip(std::string_view text);
};
void ScrollWhenDragging();
void CenterTextH(const std::string & text);
void CenterTextHV(const std::string & text);
+1 -1
View File
@@ -47,8 +47,8 @@ scene::scene(key, const meta & current_meta, std::span<const vk::Format> support
device(application::instance().vk_device),
physical_device(application::instance().vk_physical_device),
queue(application::instance().vk_queue),
commandpool(application::instance().vk_cmdpool),
queue_family_index(application::instance().vk_queue_family_index),
commandpool(application::instance().vk_cmdpool),
current_meta(current_meta)
{
swapchain_format = vk::Format::eUndefined;
+4 -1
View File
@@ -86,13 +86,16 @@ protected:
XrViewConfigurationType viewconfig;
bool focused = false;
public:
vk::raii::Instance & vk_instance;
vk::raii::Device & device;
vk::raii::PhysicalDevice & physical_device;
thread_safe<vk::raii::Queue> & queue;
vk::raii::CommandPool & commandpool;
uint32_t queue_family_index;
protected:
vk::raii::CommandPool & commandpool;
const meta & current_meta;
std::optional<scene_renderer> renderer;
+284
View File
@@ -0,0 +1,284 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define IMGUI_DEFINE_MATH_OPERATORS
#include "app_launcher.h"
#include "constants.h"
#include "imgui.h"
#include "imgui_internal.h"
#include "scenes/stream.h"
#include "utils/i18n.h"
#include "utils/ranges.h"
#include <imspinner.h>
#include <spdlog/fmt/fmt.h>
#include <uni_algo/case.h>
using namespace std::chrono_literals;
// Display a button with an image and a text centred horizontally
static bool icon(
const std::string & text,
ImTextureRef tex_ref,
const ImVec2 & image_size,
ImGuiButtonFlags flags = 0,
const ImVec2 & size_arg = ImVec2(0, 0),
const ImVec2 & uv0 = ImVec2(0, 0),
const ImVec2 & uv1 = ImVec2(1, 1),
const ImVec4 & tint_col = ImVec4(1, 1, 1, 1))
{
// Based on ImGui::ButtonEx and ImGui::ImageButtonEx
ImGuiWindow * window = ImGui::GetCurrentWindow();
const ImGuiStyle & style = ImGui::GetStyle();
if (window->SkipItems)
return false;
const ImVec2 label_size = ImGui::CalcTextSize(text.c_str(), nullptr, true);
ImVec2 size = ImGui::CalcItemSize(
size_arg,
std::max(image_size.x, label_size.x) + style.FramePadding.x * 2.0f,
image_size.y + style.ItemInnerSpacing.y + label_size.y + style.FramePadding.y * 2.0f);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
ImRect image_pos(
{(bb.Min.x + bb.Max.x - image_size.x) / 2, bb.Min.y + style.FramePadding.y},
{(bb.Min.x + bb.Max.x + image_size.x) / 2, bb.Min.y + style.FramePadding.y + image_size.y});
ImRect label_pos(
{bb.Min.x + style.FramePadding.x, image_pos.Max.y + style.ItemInnerSpacing.y},
{bb.Max.x - style.FramePadding.x, bb.Max.y - style.FramePadding.y});
ImGui::ItemSize(bb);
ImGuiID id = window->GetID(text.c_str());
if (!ImGui::ItemAdd(bb, id))
return false;
bool hovered, held;
bool pressed = ImGui::ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 col = ImGui::GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered
: ImGuiCol_Button);
ImGui::RenderNavCursor(bb, id);
ImGui::RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
window->DrawList->AddImage(tex_ref, image_pos.Min, image_pos.Max, uv0, uv1, ImGui::GetColorU32(tint_col));
ImGui::RenderTextClipped(label_pos.Min, label_pos.Max, text.c_str(), NULL, &label_size, style.ButtonTextAlign, &bb);
return pressed;
}
app_launcher::app_launcher(
scenes::stream & stream,
std::string server_name) :
server_name(std::move(server_name)),
stream(stream),
textures(
stream.physical_device,
stream.device,
stream.queue_family_index,
stream.queue)
{
try
{
default_icon = textures.load_texture("default_icon.ktx2");
}
catch (...)
{
default_icon = textures.load_texture("default_icon.png");
}
}
app_launcher::~app_launcher()
{
stream.device.waitIdle();
for (const auto & [app_id, app_icon]: app_icons)
textures.free_texture(app_icon);
textures.free_texture(default_icon);
}
app_launcher::clicked app_launcher::draw_gui(imgui_context & imgui_ctx, const std::string & cancel)
{
auto res = clicked::None;
auto t0 = std::chrono::steady_clock::now();
bool app_starting = start_time != std::chrono::steady_clock::time_point{} and
t0 - start_time < 10s and
stream.current_state() != scenes::stream::state::streaming;
auto cancel_size = ImGui::CalcTextSize(cancel.c_str());
auto apps = applications.lock();
ImGui::PushFont(nullptr, constants::gui::font_size_large);
if (server_name.empty())
CenterTextH(_("Connected to WiVRn server"));
else
CenterTextH(fmt::format(_F("Connected to {}"), server_name));
ImGui::PopFont();
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {20, 20});
if (apps->empty())
{
CenterTextHV(_("Start an application on the server to start streaming."));
}
else
{
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, {20, 0});
ImGui::BeginDisabled(app_starting);
ImGui::BeginChild("Main", ImGui::GetWindowSize() - ImGui::GetCursorPos() - ImVec2(0, cancel_size.y + 80), 0, app_starting ? ImGuiWindowFlags_NoScrollWithMouse : 0);
ImGui::Indent(20);
if (server_name.empty())
ImGui::Text("%s", _S("Start an application on your computer or select one to start streaming."));
else
ImGui::Text("%s", fmt::format(_F("Start an application on {} or select one to start streaming."), server_name).c_str());
ImGui::Unindent();
float icon_width = 400;
float icon_spacing = ImGui::GetStyle().ItemSpacing.x;
float usable_window_width = ImGui::GetWindowSize().x - ImGui::GetCurrentWindow()->ScrollbarSizes.x;
int icons_per_line = (usable_window_width + icon_spacing) / (icon_width + icon_spacing);
float icon_line_width = icons_per_line * icon_width + (icons_per_line - 1) * icon_spacing;
ImGui::Indent((usable_window_width - icon_line_width) / 2);
for (const auto [index, app]: utils::enumerate(*apps))
{
ImTextureID texture = [&]() -> ImTextureID {
if (app.image.empty())
return default_icon;
else
{
auto it = app_icons.find(app.id);
if (it == app_icons.end())
{
// Don't load too many textures at the same time to keep the GUI responsive
if (std::chrono::steady_clock::now() - t0 > 10ms)
return default_icon;
try
{
it = app_icons.emplace(app.id, textures.load_texture(app.image)).first;
}
catch (std::exception & e)
{
spdlog::warn("Unable to load icon for \"{}\": {}", app.id, e.what());
app.image.clear();
return default_icon;
}
}
return it->second;
}
}();
ImGui::PushStyleColor(ImGuiCol_Button, 0);
if (icon(app.name + "##" + app.id, texture, {256, 256}, ImGuiButtonFlags_PressedOnClickRelease, {icon_width, 0}))
{
res = clicked::Start;
start_time = t0;
stream.start_application(app.id);
}
imgui_ctx.vibrate_on_hover();
ImGui::PopStyleColor(); // ImGuiCol_Button
if ((index + 1) % icons_per_line)
ImGui::SameLine();
}
ImGui::Unindent();
std::vector<std::pair<std::string, ImTextureID>> to_be_removed;
for (const auto & [app_id, app_icon]: app_icons)
{
if (not std::ranges::contains(*apps, app_id, &app::id))
to_be_removed.emplace_back(app_id, app_icon);
}
for (const auto & [app_id, app_icon]: to_be_removed)
{
imgui_ctx.free_texture(app_icon);
app_icons.erase(app_id);
}
ScrollWhenDragging();
ImGui::EndChild();
ImGui::EndDisabled();
if (app_starting)
{
ImGui::SetCursorPos(ImGui::GetWindowSize() / 2 - ImVec2{200, 200} - ImGui::GetStyle().FramePadding);
ImSpinner::SpinnerAng("App starting spinner",
200, // Radius
40, // Thickness
ImColor{1.f, 1.f, 1.f, 1.f}, // Colour
ImColor{1.f, 1.f, 1.f, 0.f}, // Background
6, // Velocity
0.75f * 2 * M_PI // Angle
);
}
ImGui::PopStyleVar(); // ImGuiStyleVar_WindowPadding
}
ImGui::PopStyleVar();
ImGui::SetCursorPos(ImGui::GetWindowSize() - cancel_size - ImVec2{50, 50});
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 10);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {10, 10});
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.8f, 0.2f, 0.2f, 0.40f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.8f, 0.2f, 0.2f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 0.1f, 0.1f, 1.00f));
if (ImGui::Button(cancel.c_str()))
res = clicked::Cancel;
imgui_ctx.vibrate_on_hover();
ImGui::PopStyleColor(3); // ImGuiCol_Button, ImGuiCol_ButtonHovered, ImGuiCol_ButtonActive
ImGui::PopStyleVar(2);
return res;
}
void app_launcher::operator()(to_headset::application_list && apps)
{
std::ranges::sort(apps.applications, [](auto & l, auto & r) {
return una::casesens::collate_utf8(l.name, r.name) < 0;
});
auto locked = applications.lock();
locked->clear();
locked->reserve(apps.applications.size());
for (const auto & i: apps.applications)
{
locked->push_back(app{
.id = std::move(i.id),
.name = std::move(i.name),
});
}
}
void app_launcher::operator()(to_headset::application_icon && icon)
{
auto locked = applications.lock();
if (auto it = std::ranges::find(*locked, icon.id, &app::id); it != locked->end())
it->image = std::move(icon.image);
}
+65
View File
@@ -0,0 +1,65 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "imgui.h"
#include "render/imgui_impl.h"
#include "wivrn_packets.h"
#include <chrono>
#include <unordered_map>
namespace scenes
{
class stream;
}
class app_launcher
{
struct app
{
std::string id;
std::string name;
std::vector<std::byte> image;
};
std::chrono::steady_clock::time_point start_time{};
std::string server_name;
scenes::stream & stream;
imgui_textures textures;
ImTextureID default_icon;
std::unordered_map<std::string, ImTextureID> app_icons;
// Last application list received from server
thread_safe<std::vector<app>> applications;
public:
app_launcher(scenes::stream &, std::string server_name);
~app_launcher();
enum clicked
{
None,
Cancel,
Start,
};
// cancel: text to display on the quit/disconnect/cancel button
clicked draw_gui(imgui_context &, const std::string & cancel);
void operator()(wivrn::to_headset::application_list && apps);
void operator()(wivrn::to_headset::application_icon && icon);
};
+1 -12
View File
@@ -572,7 +572,7 @@ void scenes::lobby::render(const XrFrameState & frame_state)
{
auto session = async_session.get();
if (session)
next_scene = stream::create(std::move(session), 1'000'000'000.f / frame_state.predictedDisplayPeriod);
next_scene = stream::create(std::move(session), 1'000'000'000.f / frame_state.predictedDisplayPeriod, server_name);
async_session.reset();
}
@@ -923,15 +923,6 @@ void scenes::lobby::on_focused()
about_picture = imgui_ctx->load_texture(image + ".png");
}
try
{
default_icon = imgui_ctx->load_texture("default_icon.ktx2");
}
catch (...)
{
default_icon = imgui_ctx->load_texture("default_icon.png");
}
setup_passthrough();
session.set_refresh_rate(application::get_config().preferred_refresh_rate.value_or(0));
multicast = application::get_wifi_lock().get_multicast_lock();
@@ -952,8 +943,6 @@ void scenes::lobby::on_unfocused()
renderer->wait_idle(); // Must be before the scene data because the renderer uses its descriptor sets
about_picture = 0;
default_icon = 0;
app_icons.clear();
imgui_ctx.reset();
world.clear(); // Must be cleared before the renderer so that the descriptor sets are freed before their pools
-3
View File
@@ -127,9 +127,6 @@ class lobby : public scene_impl<lobby>
tab last_current_tab = tab::server_list;
int optional_feature_index = 0; // Which step of the first run screen are we in
ImTextureID about_picture;
ImTextureID default_icon;
std::unordered_map<std::string, ImTextureID> app_icons;
std::optional<XrTime> timestamp_start_application;
virtual_keyboard keyboard;
+2 -258
View File
@@ -30,15 +30,13 @@
#include "imgui.h"
#include "imgui_internal.h"
#include "lobby.h"
#include "stream.h"
#include "scenes/stream.h"
#include "utils/i18n.h"
#include "utils/overloaded.h"
#include "utils/ranges.h"
#include "version.h"
#include "xr/body_tracker.h"
#include <algorithm>
#include <cassert>
#include <chrono>
#include <filesystem>
#include <glm/gtc/quaternion.hpp>
#include <imspinner.h>
@@ -52,81 +50,6 @@
using namespace std::chrono_literals;
// https://github.com/ocornut/imgui/issues/3379#issuecomment-2943903877
static void ScrollWhenDragging()
{
ImVec2 delta{0.0f, -ImGui::GetIO().MouseDelta.y};
const ImGuiMouseButton mouse_button = ImGuiMouseButton_Left;
ImGuiContext & g = *ImGui::GetCurrentContext();
ImGuiWindow * window = g.CurrentWindow;
ImGuiID id = window->GetID("##scrolldraggingoverlay");
ImGui::KeepAliveID(id);
static int active_id;
static ImVec2 cumulated_delta;
bool HoveredIdAllowOverlap_backup = std::exchange(g.HoveredIdAllowOverlap, true);
bool ActiveIdAllowOverlap_backup = std::exchange(g.ActiveIdAllowOverlap, true);
if (active_id == 0 and ImGui::ItemHoverable(window->Rect(), 0, g.CurrentItemFlags) and ImGui::IsMouseClicked(mouse_button, ImGuiInputFlags_None, /*id*/ ImGuiKeyOwner_Any))
{
active_id = id;
// Don't scroll on the first step, in case the active controller just changed
delta = {};
cumulated_delta = {};
}
if (not g.IO.MouseDown[mouse_button])
active_id = 0;
if (active_id == id)
{
if (delta.x != 0.0f)
ImGui::SetScrollX(window, window->Scroll.x + delta.x);
if (delta.y != 0.0f)
ImGui::SetScrollY(window, window->Scroll.y + delta.y);
cumulated_delta += delta;
if (std::max(std::abs(cumulated_delta.x), std::abs(cumulated_delta.y)) > 50)
ImGui::ClearActiveID();
}
g.HoveredIdAllowOverlap = HoveredIdAllowOverlap_backup;
g.ActiveIdAllowOverlap = ActiveIdAllowOverlap_backup;
}
static void CenterTextH(const std::string & text)
{
float win_width = ImGui::GetWindowSize().x;
float text_width = ImGui::CalcTextSize(text.c_str()).x;
ImGui::SetCursorPosX((win_width - text_width) / 2);
ImGui::Text("%s", text.c_str());
}
static void CenterTextHV(const std::string & text)
{
ImVec2 size = ImGui::GetWindowSize();
std::vector<std::string> lines = utils::split(text);
float text_height = 0;
for (const auto & i: lines)
text_height += ImGui::CalcTextSize(i.c_str()).y;
ImGui::SetCursorPosY((size.y - text_height) / 2);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {0, 0});
for (const auto & i: lines)
{
float text_width = ImGui::CalcTextSize(i.c_str()).x;
ImGui::SetCursorPosX((size.x - text_width) / 2);
ImGui::Text("%s", i.c_str());
}
ImGui::PopStyleVar();
}
static void InputText(const char * label, std::string & text, const ImVec2 & size, ImGuiInputTextFlags flags)
{
auto callback = [](ImGuiInputTextCallbackData * data) -> int {
@@ -175,54 +98,6 @@ static void display_recentering_tip(imgui_context & ctx, const std::string & tip
ImGui::PopFont();
}
// Display a button with an image and a text centred horizontally
static bool icon(const std::string & text, ImTextureRef tex_ref, const ImVec2 & image_size, ImGuiButtonFlags flags = 0, const ImVec2 & size_arg = ImVec2(0, 0), const ImVec2 & uv0 = ImVec2(0, 0), const ImVec2 & uv1 = ImVec2(1, 1), const ImVec4 & tint_col = ImVec4(1, 1, 1, 1))
{
// Based on ImGui::ButtonEx and ImGui::ImageButtonEx
ImGuiWindow * window = ImGui::GetCurrentWindow();
const ImGuiStyle & style = ImGui::GetStyle();
if (window->SkipItems)
return false;
const ImVec2 label_size = ImGui::CalcTextSize(text.c_str(), nullptr, true);
ImVec2 size = ImGui::CalcItemSize(
size_arg,
std::max(image_size.x, label_size.x) + style.FramePadding.x * 2.0f,
image_size.y + style.ItemInnerSpacing.y + label_size.y + style.FramePadding.y * 2.0f);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
ImRect image_pos(
{(bb.Min.x + bb.Max.x - image_size.x) / 2, bb.Min.y + style.FramePadding.y},
{(bb.Min.x + bb.Max.x + image_size.x) / 2, bb.Min.y + style.FramePadding.y + image_size.y});
ImRect label_pos(
{bb.Min.x + style.FramePadding.x, image_pos.Max.y + style.ItemInnerSpacing.y},
{bb.Max.x - style.FramePadding.x, bb.Max.y - style.FramePadding.y});
ImGui::ItemSize(bb);
ImGuiID id = window->GetID(text.c_str());
if (!ImGui::ItemAdd(bb, id))
return false;
bool hovered, held;
bool pressed = ImGui::ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 col = ImGui::GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered
: ImGuiCol_Button);
ImGui::RenderNavCursor(bb, id);
ImGui::RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
window->DrawList->AddImage(tex_ref, image_pos.Min, image_pos.Max, uv0, uv1, ImGui::GetColorU32(tint_col));
ImGui::RenderTextClipped(label_pos.Min, label_pos.Max, text.c_str(), NULL, &label_size, style.ButtonTextAlign, &bb);
return pressed;
}
std::string openxr_post_processing_flag_name(XrCompositionLayerSettingsFlagsFB flag)
{
switch (flag)
@@ -248,7 +123,6 @@ void scenes::lobby::gui_connecting(locked_notifiable<pin_request_data> & pin_req
if (next_scene)
{
current_tab = tab::connected;
timestamp_start_application.reset();
ImGui::CloseCurrentPopup();
return;
}
@@ -384,144 +258,14 @@ void scenes::lobby::gui_connected(XrTime predicted_display_time)
if (not next_scene)
{
current_tab = tab::server_list;
for (const auto & [app_id, app_icon]: app_icons)
imgui_ctx->free_texture(app_icon);
app_icons.clear();
return;
}
ImGui::PushFont(nullptr, constants::gui::font_size_large);
if (server_name.empty())
CenterTextH(_("Connected to WiVRn server"));
else
CenterTextH(fmt::format(_F("Connected to {}"), server_name));
ImGui::PopFont();
auto disconnect = _("Disconnect");
auto disconnect_size = ImGui::CalcTextSize(disconnect.c_str());
auto apps = next_scene->get_applications();
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, {20, 20});
if (apps->empty())
{
CenterTextHV(_("Start an application on the server to start streaming."));
}
else
{
bool app_starting = timestamp_start_application and (predicted_display_time - *timestamp_start_application < 10'000'000'000);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, {20, 0});
ImGui::BeginDisabled(app_starting);
ImGui::BeginChild("Main", ImGui::GetWindowSize() - ImGui::GetCursorPos() - ImVec2(0, disconnect_size.y + 80), 0, app_starting ? ImGuiWindowFlags_NoScrollWithMouse : 0);
ImGui::Indent(20);
if (server_name.empty())
ImGui::Text("%s", _S("Start an application on your computer or select one to start streaming."));
else
ImGui::Text("%s", fmt::format(_F("Start an application on {} or select one to start streaming."), server_name).c_str());
ImGui::Unindent();
float icon_width = 400;
float icon_spacing = ImGui::GetStyle().ItemSpacing.x;
float usable_window_width = ImGui::GetWindowSize().x - ImGui::GetCurrentWindow()->ScrollbarSizes.x;
int icons_per_line = (usable_window_width + icon_spacing) / (icon_width + icon_spacing);
float icon_line_width = icons_per_line * icon_width + (icons_per_line - 1) * icon_spacing;
ImGui::Indent((usable_window_width - icon_line_width) / 2);
auto t0 = std::chrono::steady_clock::now();
for (const auto [index, app]: utils::enumerate(*apps))
{
ImTextureID texture = [&]() -> ImTextureID {
if (app.image.empty())
return default_icon;
else
{
auto it = app_icons.find(app.id);
if (it == app_icons.end())
{
// Don't load too many textures at the same time to keep the GUI responsive
if (std::chrono::steady_clock::now() - t0 > 10ms)
return default_icon;
try
{
it = app_icons.emplace(app.id, imgui_ctx->load_texture(app.image)).first;
}
catch (std::exception & e)
{
spdlog::warn("Unable to load icon for \"{}\": {}", app.id, e.what());
app.image.clear();
return default_icon;
}
}
return it->second;
}
}();
ImGui::PushStyleColor(ImGuiCol_Button, 0);
if (icon(app.name + "##" + app.id, texture, {256, 256}, ImGuiButtonFlags_PressedOnClickRelease, {icon_width, 0}))
{
timestamp_start_application = predicted_display_time;
next_scene->start_application(app.id);
}
imgui_ctx->vibrate_on_hover();
ImGui::PopStyleColor(); // ImGuiCol_Button
if (index % 3 != 2)
ImGui::SameLine();
}
ImGui::Unindent();
std::vector<std::pair<std::string, ImTextureID>> to_be_removed;
for (const auto & [app_id, app_icon]: app_icons)
{
if (not std::ranges::contains(*apps, app_id, &scenes::stream::app::id))
to_be_removed.emplace_back(app_id, app_icon);
}
for (const auto & [app_id, app_icon]: to_be_removed)
{
imgui_ctx->free_texture(app_icon);
app_icons.erase(app_id);
}
ScrollWhenDragging();
ImGui::EndChild();
ImGui::EndDisabled();
if (app_starting)
{
ImGui::SetCursorPos(ImGui::GetWindowSize() / 2 - ImVec2{200, 200} - ImGui::GetStyle().FramePadding);
ImSpinner::SpinnerAng("App starting spinner",
200, // Radius
40, // Thickness
ImColor{1.f, 1.f, 1.f, 1.f}, // Colour
ImColor{1.f, 1.f, 1.f, 0.f}, // Background
6, // Velocity
0.75f * 2 * M_PI // Angle
);
}
ImGui::PopStyleVar(); // ImGuiStyleVar_WindowPadding
}
ImGui::PopStyleVar();
ImGui::SetCursorPos(ImGui::GetWindowSize() - disconnect_size - ImVec2{50, 50});
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.8f, 0.2f, 0.2f, 0.40f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.8f, 0.2f, 0.2f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 0.1f, 0.1f, 1.00f));
if (ImGui::Button(disconnect.c_str()))
if (next_scene->apps.draw_gui(*imgui_ctx, _("Disconnect")) == app_launcher::Cancel)
{
next_scene.reset();
current_tab = tab::server_list;
}
imgui_ctx->vibrate_on_hover();
ImGui::PopStyleColor(3); // ImGuiCol_Button, ImGuiCol_ButtonHovered, ImGuiCol_ButtonActive
}
void scenes::lobby::gui_new_server()
+35 -5
View File
@@ -151,8 +151,9 @@ static const std::array supported_depth_formats{
vk::Format::eX8D24UnormPack32,
};
scenes::stream::stream() :
scenes::stream::stream(std::string server_name) :
scene_impl<stream>(supported_color_formats, supported_depth_formats),
apps{*this, std::move(server_name)},
blitters{blitter(device, 0), blitter(device, 1)}
{
}
@@ -185,9 +186,9 @@ static from_headset::visibility_mask_changed::masks get_visibility_mask(xr::inst
return res;
}
std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_session> network_session, float guessed_fps)
std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_session> network_session, float guessed_fps, std::string server_name)
{
std::shared_ptr<stream> self{new stream};
std::shared_ptr<stream> self{new stream{std::move(server_name)}};
self->network_session = std::move(network_session);
self->network_session->send_control([&]() {
@@ -730,6 +731,8 @@ bool scenes::stream::is_gui_interactable() const
case gui_status::stats:
case gui_status::settings:
case gui_status::foveation_settings:
case gui_status::applications:
case gui_status::application_launcher:
return true;
case gui_status::hidden:
@@ -777,6 +780,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
.variant = application::get_messages_info().variant,
});
gui_status = stream::gui_status::hidden;
application::pop_scene();
}
@@ -927,6 +931,28 @@ void scenes::stream::render(const XrFrameState & frame_state)
command_buffer.end();
vk::SubmitInfo submit_info;
submit_info.setCommandBuffers(*command_buffer);
std::vector<vk::Semaphore> semaphores;
std::vector<uint64_t> semaphore_vals;
std::vector<vk::PipelineStageFlags> wait_stages;
for (auto b: current_blit_handles)
{
if (b and b->semaphore)
{
assert(b->semaphore_val);
semaphores.push_back(b->semaphore);
semaphore_vals.push_back(*b->semaphore_val);
wait_stages.push_back(vk::PipelineStageFlagBits::eFragmentShader);
}
}
submit_info.setWaitDstStageMask(wait_stages);
submit_info.setWaitSemaphores(semaphores);
vk::TimelineSemaphoreSubmitInfo sem_info{
.waitSemaphoreValueCount = uint32_t(semaphore_vals.size()),
.pWaitSemaphoreValues = semaphore_vals.data(),
};
submit_info.pNext = &sem_info;
queue.lock()->submit(submit_info, *fence);
#if WIVRN_FEATURE_RENDERDOC
renderdoc_end(*vk_instance);
@@ -978,6 +1004,8 @@ void scenes::stream::render(const XrFrameState & frame_state)
break;
case gui_status::stats:
case gui_status::settings:
case gui_status::applications:
case gui_status::application_launcher:
dimming = dimming + frame_state.predictedDisplayPeriod / (1e9 * constants::stream::fade_duration);
break;
}
@@ -1063,12 +1091,14 @@ void scenes::stream::render(const XrFrameState & frame_state)
case gui_status::hidden:
case gui_status::compact:
case gui_status::overlay_only:
gui_status = gui_status::stats;
gui_status = next_gui_status;
break;
case gui_status::stats:
case gui_status::settings:
case gui_status::foveation_settings:
case gui_status::applications:
case gui_status::application_launcher:
gui_status = gui_status::hidden;
break;
}
@@ -1105,7 +1135,7 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript
spdlog::info("Creating decoder size {}x{} offset {},{}", item.width, item.height, item.offset_x, item.offset_y);
decoders.push_back(accumulator_images{
.decoder = std::make_unique<shard_accumulator>(device, physical_device, instance, item, description.fps, shared_from_this(), stream_index),
.decoder = std::make_unique<shard_accumulator>(device, physical_device, instance, queue_family_index, item, description.fps, shared_from_this(), stream_index),
});
}
}
+15 -16
View File
@@ -19,6 +19,7 @@
#pragma once
#include "app_launcher.h"
#include "audio/audio.h"
#include "decoder/shard_accumulator.h"
#include "render/imgui_impl.h"
@@ -49,12 +50,7 @@ public:
};
static const size_t image_buffer_size = 3;
struct app
{
std::string id;
std::string name;
std::vector<std::byte> image;
};
app_launcher apps;
private:
static const size_t view_count = 2;
@@ -136,13 +132,16 @@ private:
compact,
stats,
settings,
foveation_settings
foveation_settings,
applications,
application_launcher,
};
bool is_gui_interactable() const;
std::atomic<gui_status> gui_status = gui_status::hidden;
enum gui_status last_gui_status = gui_status::hidden;
enum gui_status next_gui_status = gui_status::stats;
XrTime gui_status_last_change;
float dimming = 0;
@@ -170,15 +169,18 @@ private:
// Keep a reference to the resources needed to blit the images until vkWaitForFences
std::vector<std::shared_ptr<wivrn::shard_accumulator::blit_handle>> current_blit_handles;
// Last application list received from server
thread_safe<std::vector<app>> applications;
XrTime running_application_req = 0;
thread_safe<to_headset::running_applications> running_applications;
stream();
stream(std::string server_name);
public:
~stream();
static std::shared_ptr<stream> create(std::unique_ptr<wivrn_session> session, float guessed_fps);
static std::shared_ptr<stream> create(
std::unique_ptr<wivrn_session> session,
float guessed_fps,
std::string server_name);
void render(const XrFrameState &) override;
void on_focused() override;
@@ -198,6 +200,7 @@ public:
void operator()(to_headset::refresh_rate_change &&);
void operator()(to_headset::application_list &&);
void operator()(to_headset::application_icon &&);
void operator()(to_headset::running_applications &&);
void operator()(audio_data &&);
void push_blit_handle(wivrn::shard_accumulator * decoder, std::shared_ptr<wivrn::shard_accumulator::blit_handle> handle);
@@ -214,11 +217,6 @@ public:
return !exiting;
}
auto get_applications()
{
return applications.lock();
}
void start_application(std::string appid);
static meta & get_meta_scene();
@@ -305,6 +303,7 @@ private:
void gui_compact_view();
void gui_settings();
void gui_foveation_settings(float predicted_display_period);
void gui_applications();
void draw_gui(XrTime predicted_display_time, XrDuration predicted_display_period);
};
} // namespace scenes
+5 -74
View File
@@ -19,7 +19,6 @@
#include "stream_defoveator.h"
#include "application.h"
#include "utils/contains.h"
#include "utils/ranges.h"
#include "vk/allocation.h"
#include "vk/pipeline.h"
@@ -36,7 +35,7 @@ struct stream_defoveator::vertex
{
// output image position
alignas(8) glm::vec2 position;
// input texture coordinates + shading rate in the first 4 bits of x
// input texture coordinates
alignas(8) glm::uvec2 uv;
};
@@ -119,19 +118,9 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
target.layout = vk::raii::PipelineLayout(device, pipeline_layout_info);
const auto & vk_device_extensions = application::get_vk_device_extensions();
bool fragment_shading_rate = false;
if (utils::contains(vk_device_extensions, VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME) and
utils::contains(vk_device_extensions, VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME))
{
const auto & [prop, rate_prop] = physical_device.getProperties2<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceFragmentShadingRatePropertiesKHR>();
const auto & [feat, fragment_feat] = physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceFragmentShadingRateFeaturesKHR>();
fragment_shading_rate = rate_prop.fragmentShadingRateNonTrivialCombinerOps and
fragment_feat.primitiveFragmentShadingRate and
fragment_feat.attachmentFragmentShadingRate;
}
// Vertex shader
vk::raii::ShaderModule vertex_shader = load_shader(device, fragment_shading_rate ? "reprojection_vsr.vert" : "reprojection.vert");
vk::raii::ShaderModule vertex_shader = load_shader(device, "reprojection.vert");
// Fragment shader
auto specialization = make_specialization_constants(
@@ -139,7 +128,7 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
VkBool32(need_srgb_conversion(guess_model())));
vk::raii::ShaderModule fragment_shader = load_shader(device, "reprojection.frag");
vk::pipeline_builder pipeline_info_builder{
vk::pipeline_builder pipeline_info{
.flags = {},
.Stages = {
{
@@ -197,48 +186,6 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
.subpass = 0,
};
vk::GraphicsPipelineCreateInfo pipeline_info(pipeline_info_builder);
// Variable fragment shading
std::array combiner{
vk::FragmentShadingRateCombinerOpKHR::eMax,
vk::FragmentShadingRateCombinerOpKHR::eMax,
};
vk::PipelineFragmentShadingRateStateCreateInfoKHR shading{
.fragmentSize = vk::Extent2D{1, 1},
.combinerOps = combiner,
};
if (fragment_shading_rate)
{
pipeline_info.pNext = &shading;
spdlog::info("Available fragment shading rates:");
for (const auto rate: physical_device.getFragmentShadingRatesKHR())
{
if (rate.sampleCounts & vk::SampleCountFlagBits::e1)
{
spdlog::info("\tfragment size: {}x{}", rate.fragmentSize.width, rate.fragmentSize.height);
int flags = 0;
if (rate.fragmentSize.width == 4)
flags |= 8;
else if (rate.fragmentSize.width == 2)
flags |= 4;
if (rate.fragmentSize.height == 4)
flags |= 2;
else if (rate.fragmentSize.height == 2)
flags |= 1;
for (int y = std::bit_width(rate.fragmentSize.height) - 1; y < 3; ++y)
{
for (int x = std::bit_width(rate.fragmentSize.width) - 1; x < 3; ++x)
{
if (fragment_sizes[x][y] == 0)
fragment_sizes[x][y] = flags << 28;
}
}
}
}
}
target.pipeline = device.createGraphicsPipeline(application::get_pipeline_cache(), pipeline_info);
return target;
}
@@ -346,21 +293,6 @@ static size_t required_vertices(const wivrn::to_headset::foveation_parameter & p
return (2 * (p.x.size() + 1) + 1) * p.y.size();
}
uint32_t stream_defoveator::shading_rate(int pixels_x, int pixels_y)
{
int x = 0;
if (pixels_x >= 2)
x = 1;
if (pixels_x >= 4)
x = 2;
int y = 0;
if (pixels_y >= 2)
y = 1;
if (pixels_y >= 4)
y = 2;
return fragment_sizes[x][y];
}
void stream_defoveator::defoveate(vk::raii::CommandBuffer & command_buffer,
const std::array<wivrn::to_headset::foveation_parameter, 2> & foveation,
std::span<wivrn::blitter::output> inputs,
@@ -410,14 +342,13 @@ void stream_defoveator::defoveate(vk::raii::CommandBuffer & command_buffer,
for (auto [ix, n_out_x]: utils::enumerate_range(px))
{
const int ratio_x = std::abs(n_ratio_x - int(ix)) + 1;
glm::uvec2 rate = glm::uvec2(shading_rate(ratio_x, ratio_y), 0);
*vertices++ = {
.position = out * out_pixel_size,
.uv = in | rate,
.uv = in,
};
*vertices++ = {
.position = (out + glm::vec2(0, n_out_y * ratio_y)) * out_pixel_size,
.uv = (in + glm::uvec2(0, n_out_y)) | rate,
.uv = (in + glm::uvec2(0, n_out_y)),
};
in.x += n_out_x;
out.x += n_out_x * ratio_x;
-8
View File
@@ -49,13 +49,6 @@ class stream_defoveator
pipeline_t pipeline_rgb[view_count];
pipeline_t pipeline_a[view_count];
// Allowed sizes for variable shading rate
// indices are for x, y
// 0 is 1 pixel
// 1 is 2 or 3 pixels
// 2 is 4 pixels or more
uint32_t fragment_sizes[3][3] = {};
// Destination images
std::vector<vk::Image> output_images;
std::vector<vk::raii::ImageView> output_image_views;
@@ -65,7 +58,6 @@ class stream_defoveator
void ensure_vertices(size_t num_vertices);
vertex * get_vertices(size_t view);
uint32_t shading_rate(int pixels_x, int pixels_y);
pipeline_t & ensure_pipeline(size_t view, vk::Sampler rgb, vk::Sampler a);
public:
+106
View File
@@ -603,6 +603,85 @@ void scenes::stream::gui_foveation_settings(float predicted_display_period)
});
}
void scenes::stream::gui_applications()
{
auto now = instance.now();
if (now - running_application_req > 1'000'000'000)
{
running_application_req = now;
network_session->send_control(from_headset::get_running_applications{});
}
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 10);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {10, 10});
ImGui::PushFont(nullptr, constants::gui::font_size_large);
CenterTextH(_("Running XR applications:"));
ImGui::PopFont();
auto apps = running_applications.lock();
ImVec2 button_size(ImGui::GetWindowSize().x - ImGui::GetCursorPosX() - 20, 0);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(ImGui::GetStyle().ItemSpacing.x, 20));
ImGui::Spacing();
std::ranges::sort(apps->applications, [](auto & l, auto & r) {
if (l.overlay == r.overlay)
return false;
return r.overlay;
});
bool overlay = false;
for (const auto & app: apps->applications)
{
if (app.overlay and not overlay)
{
ImGui::Separator();
CenterTextH(_S("Overlays"));
overlay = true;
}
int colors = 1;
ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32_BLACK_TRANS);
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10, 20));
if (app.active or app.overlay)
{
ImGui::PushStyleColor(ImGuiCol_ButtonActive, IM_COL32_BLACK_TRANS);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, IM_COL32_BLACK_TRANS);
colors += 2;
}
ImGui::SetNextItemAllowOverlap();
const bool clicked = RadioButtonWithoutCheckBox(
std::format("{}{}##{}", app.active ? ICON_FA_CHEVRON_RIGHT " " : " ", app.name, app.id).c_str(),
app.active,
button_size);
if (clicked and not(app.active or app.overlay))
{
network_session->send_control(from_headset::set_active_application{.id = app.id});
imgui_ctx->vibrate_on_hover();
}
ImGui::PopStyleColor(colors);
ImGui::PopStyleVar(2);
ImGui::SameLine();
auto right = ImGui::GetWindowSize().x;
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10);
ImGui::SetCursorPosX(right - ImGui::CalcTextSize(ICON_FA_XMARK).x - ImGui::GetStyle().FramePadding.x - 40);
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.8f, 0.2f, 0.2f, 0.40f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.8f, 0.2f, 0.2f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 0.1f, 0.1f, 1.00f));
if (ImGui::Button(std::format(ICON_FA_XMARK "##{}", app.id).c_str()))
network_session->send_control(from_headset::stop_application{.id = app.id});
imgui_ctx->vibrate_on_hover();
ImGui::PopStyleColor(3);
if (ImGui::IsItemHovered())
imgui_ctx->tooltip(_S("Request to quit, may be ignored by the application"));
}
auto btn = _("Start");
ImGui::SetCursorPos(ImGui::GetWindowSize() - ImGui::CalcTextSize(btn.c_str()) - ImVec2(50, 50));
if (ImGui::Button(btn.c_str()))
gui_status = gui_status::application_launcher;
imgui_ctx->vibrate_on_hover();
ImGui::PopStyleVar(3);
}
// Return the vector v such that dot(v, x) > 0 iff x is on the side where the composition layer is visible
static glm::vec4 compute_ray_limits(const XrPosef & pose, float margin = 0)
{
@@ -642,6 +721,8 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
break;
case gui_status::stats:
case gui_status::settings:
case gui_status::applications:
case gui_status::application_launcher:
break;
}
imgui_ctx->set_controllers_enabled(interactable);
@@ -662,6 +743,8 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
if (gui_status != last_gui_status)
{
last_gui_status = gui_status;
if (is_gui_interactable())
next_gui_status = gui_status;
gui_status_last_change = predicted_display_time;
// Override session state if the GUI is interactable
@@ -708,6 +791,8 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::compact:
case gui_status::stats:
case gui_status::settings:
case gui_status::applications:
case gui_status::application_launcher:
imgui_ctx->layers()[0].orientation = head_position->second * head_gui_orientation;
imgui_ctx->layers()[0].position = head_position->first + M * head_gui_position;
break;
@@ -748,11 +833,18 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::stats:
case gui_status::settings:
case gui_status::applications:
ImGui::SetNextWindowPos(margin_around_window);
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size - margin_around_window * 2);
always_auto_resize = false;
display_tabs = true;
break;
case gui_status::application_launcher:
ImGui::SetNextWindowPos(margin_around_window);
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size - margin_around_window * 2);
always_auto_resize = false;
display_tabs = false;
break;
}
ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0);
@@ -804,6 +896,17 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::foveation_settings:
gui_foveation_settings(predicted_display_period * 1.e-9f);
break;
case gui_status::applications:
ImGui::SetCursorPos({tab_width + 20, 20});
ImGui::BeginChild("Main", ImVec2(ImGui::GetWindowSize().x - ImGui::GetCursorPosX(), 0));
gui_applications();
ImGui::EndChild();
break;
case gui_status::application_launcher:
if (apps.draw_gui(*imgui_ctx, _("Cancel")) != app_launcher::None)
gui_status = gui_status::applications;
}
ImGui::PopStyleVar(2); // ImGuiStyleVar_WindowPadding, ImGuiStyleVar_FrameRounding
@@ -822,6 +925,9 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
RadioButtonWithoutCheckBox(ICON_FA_GEARS " " + _("Settings"), gui_status, gui_status::settings, {tab_width, 0});
imgui_ctx->vibrate_on_hover();
RadioButtonWithoutCheckBox(ICON_FA_LIST " " + _("Applications"), gui_status, gui_status::applications, {tab_width, 0});
imgui_ctx->vibrate_on_hover();
int n_items_at_end = 4;
ImGui::SetCursorPosY(ImGui::GetContentRegionMax().y - n_items_at_end * ImGui::GetCurrentContext()->FontSize - (n_items_at_end * 2) * style.FramePadding.y - (n_items_at_end - 1) * style.ItemSpacing.y - style.WindowPadding.y);
+7 -19
View File
@@ -106,31 +106,19 @@ void scenes::stream::send_feedback(const wivrn::from_headset::feedback & feedbac
}
}
void scenes::stream::operator()(to_headset::application_list && apps)
void scenes::stream::operator()(to_headset::application_list && l)
{
std::ranges::sort(apps.applications, [](auto & l, auto & r) {
return una::casesens::collate_utf8(l.name, r.name) < 0;
});
auto locked = applications.lock();
locked->clear();
locked->reserve(apps.applications.size());
for (const auto & i: apps.applications)
{
locked->push_back(app{
.id = std::move(i.id),
.name = std::move(i.name),
});
}
apps(std::move(l));
}
void scenes::stream::operator()(to_headset::application_icon && icon)
{
auto locked = applications.lock();
apps(std::move(icon));
}
if (auto it = std::ranges::find(*locked, icon.id, &app::id); it != locked->end())
it->image = std::move(icon.image);
void scenes::stream::operator()(to_headset::running_applications && apps)
{
*running_applications.lock() = std::move(apps);
}
void scenes::stream::start_application(std::string appid)
+82 -3
View File
@@ -1,4 +1,83 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_ARB_shading_language_include : require
#define VSR 0
#include "reprojection.glsl.inc"
#ifdef VERT_SHADER
layout (location = 0) in vec2 vPosition;
layout (location = 1) in uvec2 vUV;
layout(location = 0) out vec4 outUV;
layout(push_constant) uniform pc
{
ivec4 rgb_rect;
ivec4 a_rect;
};
void main()
{
gl_Position = vec4(vPosition, 0.0, 1.0);
vec2 uv = vUV;
outUV.xy = (uv + rgb_rect.xy) / rgb_rect.zw;
outUV.zw = (uv + a_rect.xy) / a_rect.zw;
}
#endif
#ifdef FRAG_SHADER
layout(constant_id = 0) const int alpha = 1;
layout(constant_id = 1) const bool do_srgb = false;
layout(set = 0, binding = 0) uniform sampler2D rgb[alpha + 1];
layout(location = 0) in vec4 inUV;
layout(location = 0) out vec4 outColor;
float sRGB_to_linear(float x)
{
if (x <= 0.04045)
return x / 12.92;
return pow((x + 0.055) / 1.055, 2.4);
}
vec4 sRGB_to_linear_rgba(vec4 x)
{
return vec4(
sRGB_to_linear(x.r),
sRGB_to_linear(x.g),
sRGB_to_linear(x.b),
x.a);
}
void main()
{
if (alpha == 1)
outColor = vec4(texture(rgb[0], inUV.xy).rgb, texture(rgb[1], inUV.zw).r);
else
outColor = texture(rgb[0], inUV.xy).rgba;
if (do_srgb)
{
outColor = sRGB_to_linear_rgba(outColor);
}
}
#endif
-92
View File
@@ -1,92 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifdef VERT_SHADER
#if VSR
#extension GL_EXT_fragment_shading_rate: enable
#endif
layout (location = 0) in vec2 vPosition;
layout (location = 1) in uvec2 vUV;
layout(location = 0) out vec4 outUV;
layout(push_constant) uniform pc
{
ivec4 rgb_rect;
ivec4 a_rect;
};
void main()
{
gl_Position = vec4(vPosition, 0.0, 1.0);
#if VSR
gl_PrimitiveShadingRateEXT = int(bitfieldExtract(vUV.x, 28, 4));
vec2 uv = bitfieldInsert(vUV, uvec2(0), 28, 4);
#else
vec2 uv = vUV;
#endif
outUV.xy = (uv + rgb_rect.xy) / rgb_rect.zw;
outUV.zw = (uv + a_rect.xy) / a_rect.zw;
}
#endif
#ifdef FRAG_SHADER
layout(constant_id = 0) const int alpha = 1;
layout(constant_id = 1) const bool do_srgb = false;
layout(set = 0, binding = 0) uniform sampler2D rgb[alpha + 1];
layout(location = 0) in vec4 inUV;
layout(location = 0) out vec4 outColor;
float sRGB_to_linear(float x)
{
if (x <= 0.04045)
return x / 12.92;
return pow((x + 0.055) / 1.055, 2.4);
}
vec4 sRGB_to_linear_rgba(vec4 x)
{
return vec4(
sRGB_to_linear(x.r),
sRGB_to_linear(x.g),
sRGB_to_linear(x.b),
x.a);
}
void main()
{
if (alpha == 1)
outColor = vec4(texture(rgb[0], inUV.xy).rgb, texture(rgb[1], inUV.zw).r);
else
outColor = texture(rgb[0], inUV.xy).rgba;
if (do_srgb)
{
outColor = sRGB_to_linear_rgba(outColor);
}
}
#endif
-5
View File
@@ -1,5 +0,0 @@
#version 450
#extension GL_ARB_shading_language_include : require
#define VSR 1
#include "reprojection.glsl.inc"
+34 -3
View File
@@ -41,7 +41,7 @@ namespace wivrn
// Default port for server to listen, both TCP and UDP
static const int default_port = 9757;
static constexpr int protocol_revision = 1;
static constexpr int protocol_revision = 2;
enum class device_id : uint8_t
{
@@ -168,6 +168,7 @@ enum video_codec
h265,
hevc = h265,
av1,
raw,
};
struct audio_data
@@ -234,6 +235,7 @@ struct headset_info_packet
bool hand_tracking;
bool eye_gaze;
bool palm_pose;
bool user_presence;
bool passthrough;
face_type face_tracking;
uint32_t num_generic_trackers;
@@ -460,6 +462,19 @@ struct start_app
std::string app_id;
};
struct get_running_applications
{};
struct set_active_application
{
uint32_t id;
};
struct stop_application
{
uint32_t id;
};
using packets = std::variant<
crypto_handshake,
pin_check_1,
@@ -482,7 +497,10 @@ using packets = std::variant<
user_presence_changed,
override_foveation_center,
get_application_list,
start_app>;
start_app,
get_running_applications,
set_active_application,
stop_application>;
} // namespace from_headset
namespace to_headset
@@ -690,6 +708,18 @@ struct application_icon
std::vector<std::byte> image; // In PNG
};
struct running_applications
{
struct application
{
std::string name;
uint32_t id;
bool overlay;
bool active;
};
std::vector<application> applications;
};
using packets = std::variant<
crypto_handshake,
pin_check_2,
@@ -704,6 +734,7 @@ using packets = std::variant<
tracking_control,
refresh_rate_change,
application_list,
application_icon>;
application_icon,
running_applications>;
} // namespace to_headset
} // namespace wivrn
+2 -2
View File
@@ -61,8 +61,8 @@ Identifier of the encoder, one of
### `codec`
Default value: first supported by both headset and encoder of `av1`, `h264`, `h265`.
One of `h264`, `h265` or `av1`.
Not all encoders support every codec, `x264` and `vulkan` only support `h264`.
One of `h264`, `h265`, `av1`, `raw`.
Not all encoders support every codec, `x264` and `vulkan` only support `h264`. For `raw` codec, only `raw` encoder can be used.
### `width`, `height`, `offset_x`, `offset_y` (advanced)
Default values: full image (`width` = 1, `height` = 1, `offset_x` = 0, `offset_y` = 0)
+138 -118
View File
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn 0.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-18 00:05+0200\n"
"PO-Revision-Date: 2025-09-18 00:05+0200\n"
"POT-Creation-Date: 2025-09-27 16:57+0200\n"
"PO-Revision-Date: 2025-09-27 16:57+0200\n"
"Last-Translator: Guillaume Meunier <guillaume.meunier@centraliens.net>\n"
"Language-Team: French <>\n"
"Language: French\n"
@@ -19,6 +19,33 @@ msgstr ""
msgid "No supported swapchain format"
msgstr "Aucun format de swapchain supporté"
#: client/scenes/app_launcher.cpp:135
msgid "Connected to WiVRn server"
msgstr "Connecté au serveur WiVRn"
#: client/scenes/app_launcher.cpp:137
#, c++-format
msgid "Connected to {}"
msgstr "Connecté à {}"
#: client/scenes/app_launcher.cpp:143
msgid "Start an application on the server to start streaming."
msgstr ""
"Démarrez une application sur le serveur pour commencer la transmission."
#: client/scenes/app_launcher.cpp:153
msgid "Start an application on your computer or select one to start streaming."
msgstr ""
"Démarrez une application sur le serveur ou depuis la liste pour commencer la "
"transmission."
#: client/scenes/app_launcher.cpp:155
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr ""
"Démarrez une application sur {} ou depuis la liste pour commencer la "
"transmission."
#: client/scenes/lobby.cpp:185
msgid "Incompatible WiVRn server: no protocol field in TXT"
msgstr "Serveur WiVRn incompatible : pas de champ protocol dans le TXT"
@@ -43,99 +70,72 @@ msgstr "Impossible de se connecter à {} ({}): {}"
msgid "Waiting for connection"
msgstr "Attente de connexion"
#: client/scenes/lobby_gui.cpp:232
#: client/scenes/lobby_gui.cpp:107
msgctxt "openxr_post_processing"
msgid "Normal"
msgstr "Normal"
#: client/scenes/lobby_gui.cpp:235
#: client/scenes/lobby_gui.cpp:110
msgctxt "openxr_post_processing"
msgid "Quality"
msgstr "Qualité"
#: client/scenes/lobby_gui.cpp:237
#: client/scenes/lobby_gui.cpp:112
msgctxt "openxr_post_processing"
msgid "Disabled"
msgstr "Désactivé"
#: client/scenes/lobby_gui.cpp:245 client/scenes/lobby_gui.cpp:402
#: client/scenes/stream_gui.cpp:838
#: client/scenes/lobby_gui.cpp:120 client/scenes/lobby_gui.cpp:264
#: client/scenes/stream_gui.cpp:944
msgid "Disconnect"
msgstr "Déconnecter"
#: client/scenes/lobby_gui.cpp:266 client/scenes/stream_gui.cpp:834
#: client/scenes/lobby_gui.cpp:140 client/scenes/stream_gui.cpp:940
msgid "Close"
msgstr "Fermer"
#: client/scenes/lobby_gui.cpp:272
#: client/scenes/lobby_gui.cpp:146
msgid "Connection"
msgstr "Connexion en cours"
#: client/scenes/lobby_gui.cpp:274
#: client/scenes/lobby_gui.cpp:148
#, c++-format
msgid "Connection to {}"
msgstr "Connexion à {}"
#: client/scenes/lobby_gui.cpp:304
#: client/scenes/lobby_gui.cpp:178
msgid "PIN"
msgstr "Code PIN"
#: client/scenes/lobby_gui.cpp:326
#: client/scenes/lobby_gui.cpp:200
msgid "Input the PIN displayed on the dashboard"
msgstr "Entrez le code PIN affiché sur le tableau de bord"
#: client/scenes/lobby_gui.cpp:397
msgid "Connected to WiVRn server"
msgstr "Connecté au serveur WiVRn"
#: client/scenes/lobby_gui.cpp:399
#, c++-format
msgid "Connected to {}"
msgstr "Connecté à {}"
#: client/scenes/lobby_gui.cpp:409
msgid "Start an application on the server to start streaming."
msgstr ""
"Démarrez une application sur le serveur pour commencer la transmission."
#: client/scenes/lobby_gui.cpp:421
msgid "Start an application on your computer or select one to start streaming."
msgstr ""
"Démarrez une application sur le serveur ou depuis la liste pour commencer la "
"transmission."
#: client/scenes/lobby_gui.cpp:423
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr ""
"Démarrez une application sur {} ou depuis la liste pour commencer la "
"transmission."
#: client/scenes/lobby_gui.cpp:546
#: client/scenes/lobby_gui.cpp:290
msgid "Name"
msgstr "Nom"
#: client/scenes/lobby_gui.cpp:557
#: client/scenes/lobby_gui.cpp:301
msgid "Address"
msgstr "Adresse"
#: client/scenes/lobby_gui.cpp:566
#: client/scenes/lobby_gui.cpp:310
msgid "Port"
msgstr "Port"
#: client/scenes/lobby_gui.cpp:574
#: client/scenes/lobby_gui.cpp:318
msgid "TCP only"
msgstr "TCP seulement"
#: client/scenes/lobby_gui.cpp:581
#: client/scenes/lobby_gui.cpp:325 client/scenes/stream_gui.cpp:908
msgid "Cancel"
msgstr "Annuler"
#: client/scenes/lobby_gui.cpp:595
#: client/scenes/lobby_gui.cpp:339
msgid "Save"
msgstr "Enregistrer"
#: client/scenes/lobby_gui.cpp:648
#: client/scenes/lobby_gui.cpp:392
msgid ""
"Start a WiVRn server on your\n"
"local network"
@@ -143,45 +143,45 @@ msgstr ""
"Démarrez un serveur WiVRn sur\n"
"le réseau local"
#: client/scenes/lobby_gui.cpp:680
#: client/scenes/lobby_gui.cpp:424
msgid "Autoconnect"
msgstr "Autoconnexion"
#: client/scenes/lobby_gui.cpp:706
#: client/scenes/lobby_gui.cpp:450
msgid "Connect"
msgstr "Connexion"
#: client/scenes/lobby_gui.cpp:716 client/wivrn_client.cpp:186
#: client/scenes/lobby_gui.cpp:460 client/wivrn_client.cpp:186
msgid "Incompatible server version"
msgstr "Version du serveur incompatible"
#: client/scenes/lobby_gui.cpp:718
#: client/scenes/lobby_gui.cpp:462
msgid "Server not available"
msgstr "Serveur non disponible"
#: client/scenes/lobby_gui.cpp:800
#: client/scenes/lobby_gui.cpp:544
msgctxt "language selection, replace with the name of the language"
msgid "English"
msgstr "Français"
#: client/scenes/lobby_gui.cpp:814
#: client/scenes/lobby_gui.cpp:558
msgid "Language"
msgstr "Langue"
#: client/scenes/lobby_gui.cpp:814 client/scenes/lobby_gui.cpp:816
#: client/scenes/lobby_gui.cpp:558 client/scenes/lobby_gui.cpp:560
msgid "System language"
msgstr "Langue système"
#: client/scenes/lobby_gui.cpp:841
#: client/scenes/lobby_gui.cpp:585
msgid "Refresh rate"
msgstr "Taux de rafraichissement"
#: client/scenes/lobby_gui.cpp:841 client/scenes/lobby_gui.cpp:843
#: client/scenes/lobby_gui.cpp:585 client/scenes/lobby_gui.cpp:587
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "Automatique"
#: client/scenes/lobby_gui.cpp:850
#: client/scenes/lobby_gui.cpp:594
msgid ""
"Select refresh rate based on measured application performance.\n"
"May cause flicker when a change happens."
@@ -190,59 +190,59 @@ msgstr ""
"des performances mesurées.\n"
"Peut causer des clignotements lors du changement de fréquence."
#: client/scenes/lobby_gui.cpp:867
#: client/scenes/lobby_gui.cpp:611
msgid "Minimum refresh rate"
msgstr "Taux minimal"
#: client/scenes/lobby_gui.cpp:890
#: client/scenes/lobby_gui.cpp:634
msgid "Resolution scale"
msgstr "Échelle"
#: client/scenes/lobby_gui.cpp:894
#: client/scenes/lobby_gui.cpp:638
#, c-format, c++-format
msgid "%d%% - {}x{} per eye"
msgstr "%d%% - {}x{} par œil"
#: client/scenes/lobby_gui.cpp:905
#: client/scenes/lobby_gui.cpp:649
#, c++-format
msgid "Resolution larger than {}x{} may not be supported by the headset"
msgstr "Les résolutions plus grandes que {}x{} pourraient ne pas fonctionner"
#: client/scenes/lobby_gui.cpp:911
#: client/scenes/lobby_gui.cpp:655
msgid "Enable microphone"
msgstr "Activer le micro"
#: client/scenes/lobby_gui.cpp:920
#: client/scenes/lobby_gui.cpp:664
msgid "Unprocessed Microphone Audio"
msgstr "Utiliser les données brutes du micro"
#: client/scenes/lobby_gui.cpp:926
#: client/scenes/lobby_gui.cpp:670
msgid "Force disable audio filters, such as noise cancellation"
msgstr "Désactive les traitements tels que la suppression du bruit"
#: client/scenes/lobby_gui.cpp:933
#: client/scenes/lobby_gui.cpp:677
msgid "Enable hand tracking"
msgstr "Activer le suivi des mains"
#: client/scenes/lobby_gui.cpp:939 client/scenes/lobby_gui.cpp:951
#: client/scenes/lobby_gui.cpp:963 client/scenes/lobby_gui.cpp:980
#: client/scenes/lobby_gui.cpp:1025
#: client/scenes/lobby_gui.cpp:683 client/scenes/lobby_gui.cpp:695
#: client/scenes/lobby_gui.cpp:707 client/scenes/lobby_gui.cpp:724
#: client/scenes/lobby_gui.cpp:769
msgid "This feature is not supported by your headset"
msgstr "Cette fonctionnalité n'est pas supportée par le casque"
#: client/scenes/lobby_gui.cpp:945
#: client/scenes/lobby_gui.cpp:689
msgid "Enable eye tracking"
msgstr "Activer le suivi des yeux"
#: client/scenes/lobby_gui.cpp:957
#: client/scenes/lobby_gui.cpp:701
msgid "Enable face tracking"
msgstr "Activer le suivi du visage"
#: client/scenes/lobby_gui.cpp:971
#: client/scenes/lobby_gui.cpp:715
msgid "Enable body tracking"
msgstr "Activer le suivi du corps"
#: client/scenes/lobby_gui.cpp:985
#: client/scenes/lobby_gui.cpp:729
msgid ""
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
"tracking settings,\n"
@@ -253,11 +253,11 @@ msgstr ""
"suivi des mouvements du casque.\n"
"Sinon les positions seront déduites de celles des manettes et casque."
#: client/scenes/lobby_gui.cpp:995
#: client/scenes/lobby_gui.cpp:739
msgid "Enable lower body tracking"
msgstr "Activer le suivi du bas du corps"
#: client/scenes/lobby_gui.cpp:1001
#: client/scenes/lobby_gui.cpp:745
msgid ""
"Estimate lower body joint positions using Generative Legs\n"
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
@@ -268,11 +268,11 @@ msgstr ""
"paramètres\n"
"de suivi de mouvements du casque."
#: client/scenes/lobby_gui.cpp:1004
#: client/scenes/lobby_gui.cpp:748
msgid "Enable hip tracking"
msgstr "Activer le suivi des hanches"
#: client/scenes/lobby_gui.cpp:1010
#: client/scenes/lobby_gui.cpp:754
msgid ""
"Only takes affect with lower body tracking enabled\n"
"May be desired when using another source of hip tracking"
@@ -280,15 +280,15 @@ msgstr ""
"N'a d'effet que si le suivi du bas du corps est activé.\n"
"Peut être utile si les hanches sont suivies via un autre moyen."
#: client/scenes/lobby_gui.cpp:1018
#: client/scenes/lobby_gui.cpp:762
msgid "Enable video passthrough in lobby"
msgstr "Activer la vue réelle dans l'accueil"
#: client/scenes/lobby_gui.cpp:1029
#: client/scenes/lobby_gui.cpp:773
msgid "Enable in-stream window"
msgstr "Activer la fenêtre WiVRn lors de la transmission"
#: client/scenes/lobby_gui.cpp:1032
#: client/scenes/lobby_gui.cpp:776
msgid ""
"Enables the configuration window to be shown while the game is streaming.\n"
"If enabled, the window is activated by pressing both thumbsticks."
@@ -298,15 +298,15 @@ msgstr ""
"Lorsque activé, la fenêtre peut être affichée en appuyant sur les deux "
"sticks."
#: client/scenes/lobby_gui.cpp:1046 client/scenes/stream_gui.cpp:445
#: client/scenes/lobby_gui.cpp:790 client/scenes/stream_gui.cpp:445
msgid "OpenXR post-processing"
msgstr "Post-traitement OpenXR"
#: client/scenes/lobby_gui.cpp:1050 client/scenes/stream_gui.cpp:449
#: client/scenes/lobby_gui.cpp:794 client/scenes/stream_gui.cpp:449
msgid "Supersampling"
msgstr "Suréchantillonnage"
#: client/scenes/lobby_gui.cpp:1070 client/scenes/stream_gui.cpp:470
#: client/scenes/lobby_gui.cpp:814 client/scenes/stream_gui.cpp:470
msgid ""
"Reduce flicker for high contrast edges.\n"
"Useful when the input resolution is high compared to the headset display"
@@ -314,11 +314,11 @@ msgstr ""
"Réduit le scintillement des contours à haut contraste.\n"
"Utile quand la résolution d’entrée est haute comparée à l’écran du casque"
#: client/scenes/lobby_gui.cpp:1075 client/scenes/stream_gui.cpp:475
#: client/scenes/lobby_gui.cpp:819 client/scenes/stream_gui.cpp:475
msgid "Sharpening"
msgstr "Affinage de netteté"
#: client/scenes/lobby_gui.cpp:1095 client/scenes/stream_gui.cpp:496
#: client/scenes/lobby_gui.cpp:839 client/scenes/stream_gui.cpp:496
msgid ""
"Improve clarity of high contrast edges and counteract blur.\n"
"Useful when the input resolution is low compared to the headset display"
@@ -326,125 +326,125 @@ msgstr ""
"Améliore la clarté des contours à haut contraste et réduit le flou.\n"
"Utile quand la résolution d’entrée est basse comparée à l’écran du casque"
#: client/scenes/lobby_gui.cpp:1191 client/scenes/lobby_gui.cpp:1199
#: client/scenes/lobby_gui.cpp:935 client/scenes/lobby_gui.cpp:943
#: client/scenes/stream_gui.cpp:222 client/scenes/stream_gui.cpp:424
msgid "CPU time"
msgstr "Temps CPU"
#: client/scenes/lobby_gui.cpp:1195
#: client/scenes/lobby_gui.cpp:939
msgid "CPU time [ms]"
msgstr "Temps CPU [ms]"
#: client/scenes/lobby_gui.cpp:1205 client/scenes/lobby_gui.cpp:1213
#: client/scenes/lobby_gui.cpp:949 client/scenes/lobby_gui.cpp:957
#: client/scenes/stream_gui.cpp:224 client/scenes/stream_gui.cpp:425
msgid "GPU time"
msgstr "Temps GPU"
#: client/scenes/lobby_gui.cpp:1209
#: client/scenes/lobby_gui.cpp:953
msgid "GPU time [ms]"
msgstr "Temps GPU [ms]"
#: client/scenes/lobby_gui.cpp:1252
#: client/scenes/lobby_gui.cpp:996
msgid "Enable the microphone?"
msgstr "Activer le micro ?"
#: client/scenes/lobby_gui.cpp:1257
#: client/scenes/lobby_gui.cpp:1001
msgid "Enable eye tracking?"
msgstr "Activer le suivi des yeux ?"
#: client/scenes/lobby_gui.cpp:1262
#: client/scenes/lobby_gui.cpp:1006
msgid "Enable face tracking?"
msgstr "Activer le suivi du visage ?"
#: client/scenes/lobby_gui.cpp:1267
#: client/scenes/lobby_gui.cpp:1011
msgid "Enable body tracking?"
msgstr "Activer le suivi du corps ?"
#: client/scenes/lobby_gui.cpp:1275
#: client/scenes/lobby_gui.cpp:1019
msgid "Welcome to WiVRn"
msgstr "Bienvenue sur WiVRn"
#: client/scenes/lobby_gui.cpp:1299
#: client/scenes/lobby_gui.cpp:1043
msgid "Yes"
msgstr "Oui"
#: client/scenes/lobby_gui.cpp:1306
#: client/scenes/lobby_gui.cpp:1050
msgid "No"
msgstr "Non"
#: client/scenes/lobby_gui.cpp:1325 client/scenes/lobby_gui.cpp:1972
#: client/scenes/lobby_gui.cpp:1069 client/scenes/lobby_gui.cpp:1716
msgid "Licenses"
msgstr "Licences"
#: client/scenes/lobby_gui.cpp:1650
#: client/scenes/lobby_gui.cpp:1394
msgid "Microphone is enabled"
msgstr "Le micro est activé"
#: client/scenes/lobby_gui.cpp:1651
#: client/scenes/lobby_gui.cpp:1395
msgid "Microphone is disabled"
msgstr "Le micro est désactivé"
#: client/scenes/lobby_gui.cpp:1660
#: client/scenes/lobby_gui.cpp:1404
msgid "Hand tracking is enabled"
msgstr "Le suivi des mains est activé"
#: client/scenes/lobby_gui.cpp:1661
#: client/scenes/lobby_gui.cpp:1405
msgid "Hand tracking is disabled"
msgstr "Le suivi des mains est désactivé"
#: client/scenes/lobby_gui.cpp:1670
#: client/scenes/lobby_gui.cpp:1414
msgid "Eye tracking is enabled"
msgstr "Le suivi des yeux est activé"
#: client/scenes/lobby_gui.cpp:1671
#: client/scenes/lobby_gui.cpp:1415
msgid "Eye tracking is disabled"
msgstr "Le suivi des yeux est désactivé"
#: client/scenes/lobby_gui.cpp:1681
#: client/scenes/lobby_gui.cpp:1425
msgid "Face tracking is enabled"
msgstr "Le suivi du visage est activé"
#: client/scenes/lobby_gui.cpp:1682
#: client/scenes/lobby_gui.cpp:1426
msgid "Face tracking is disabled"
msgstr "Le suivi du visage est désactivé"
#: client/scenes/lobby_gui.cpp:1692
#: client/scenes/lobby_gui.cpp:1436
msgid "Body tracking is enabled"
msgstr "Le suivi du corps est activé"
#: client/scenes/lobby_gui.cpp:1693
#: client/scenes/lobby_gui.cpp:1437
msgid "Body tracking is disabled"
msgstr "Le suivi du corps est désactivé"
#: client/scenes/lobby_gui.cpp:1709
#: client/scenes/lobby_gui.cpp:1453
msgid "Add server"
msgstr "Ajouter un serveur"
#: client/scenes/lobby_gui.cpp:1954
#: client/scenes/lobby_gui.cpp:1698
msgid "Server list"
msgstr "Serveurs"
#: client/scenes/lobby_gui.cpp:1957 client/scenes/stream_gui.cpp:822
#: client/scenes/lobby_gui.cpp:1701 client/scenes/stream_gui.cpp:925
msgid "Settings"
msgstr "Paramètres"
#: client/scenes/lobby_gui.cpp:1960
#: client/scenes/lobby_gui.cpp:1704
msgid "Post-processing"
msgstr "Post-traitement"
#: client/scenes/lobby_gui.cpp:1964
#: client/scenes/lobby_gui.cpp:1708
msgid "Debug"
msgstr "Debug"
#: client/scenes/lobby_gui.cpp:1969
#: client/scenes/lobby_gui.cpp:1713
msgid "About"
msgstr "À propos"
#: client/scenes/lobby_gui.cpp:1975
#: client/scenes/lobby_gui.cpp:1719
msgid "Exit"
msgstr "Quitter"
#: client/scenes/lobby_gui.cpp:1992
#: client/scenes/lobby_gui.cpp:1736
msgid ""
"Press the grip button or put your palm up\n"
"to move the main window"
@@ -452,7 +452,7 @@ msgstr ""
"Serrez la gâchette latérale ou pointez la paume\n"
"vers le haut pour bouger la fenêtre principale"
#: client/scenes/lobby_gui.cpp:1994
#: client/scenes/lobby_gui.cpp:1738
msgid "Press the grip button to move the main window"
msgstr "Serrez la gâchette latérale pour bouger la fenêtre principale"
@@ -522,7 +522,7 @@ msgstr "Latence mouvement à photons estimée: {}ms"
msgid "Press the grip button to move the window"
msgstr "Serrez la gâchette latérale pour bouger la fenêtre"
#: client/scenes/stream_gui.cpp:404 client/scenes/stream_gui.cpp:776
#: client/scenes/stream_gui.cpp:404 client/scenes/stream_gui.cpp:868
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "Appuyez sur les deux sticks pour afficher la fenêtre de WiVRn"
@@ -564,15 +564,35 @@ msgstr "Utiliser le stick pour bouger le centre de fovéation"
msgid "Press A to save or B to cancel"
msgstr "A pour sauvegarder, B pour annuler"
#: client/scenes/stream_gui.cpp:819
#: client/scenes/stream_gui.cpp:618
msgid "Running XR applications:"
msgstr "Applications XR lancées :"
#: client/scenes/stream_gui.cpp:635
msgid "Overlays"
msgstr "Surcouches"
#: client/scenes/stream_gui.cpp:674
msgid "Request to quit, may be ignored by the application"
msgstr "Demande de quitter, peut être ignoré par l'application"
#: client/scenes/stream_gui.cpp:677
msgid "Start"
msgstr "Démarrer"
#: client/scenes/stream_gui.cpp:922
msgid "Stats"
msgstr "Statistiques"
#: client/scenes/stream_gui.cpp:828
#: client/scenes/stream_gui.cpp:928
msgid "Applications"
msgstr "Applications"
#: client/scenes/stream_gui.cpp:934
msgid "Statistics overlay"
msgstr "Statistiques seules"
#: client/scenes/stream_gui.cpp:831
#: client/scenes/stream_gui.cpp:937
msgid "Compact view"
msgstr "Vue compacte"
+137 -117
View File
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn 0.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-18 00:05+0200\n"
"PO-Revision-Date: 2025-09-18 00:05+0200\n"
"POT-Creation-Date: 2025-09-27 16:57+0200\n"
"PO-Revision-Date: 2025-09-27 16:57+0200\n"
"Last-Translator: Albano Battistella <albanobattistella@gmail.com>\n"
"Language-Team: Italian <>\n"
"Language: Italian\n"
@@ -19,6 +19,32 @@ msgstr ""
msgid "No supported swapchain format"
msgstr "Nessun formato swapchain supportato"
#: client/scenes/app_launcher.cpp:135
msgid "Connected to WiVRn server"
msgstr "Connesso al server WiVRn"
#: client/scenes/app_launcher.cpp:137
#, c++-format
msgid "Connected to {}"
msgstr "Connesso a {}"
#: client/scenes/app_launcher.cpp:143
msgid "Start an application on the server to start streaming."
msgstr "Avvia un applicazione sul server per incominciare a trasmettere."
#: client/scenes/app_launcher.cpp:153
msgid "Start an application on your computer or select one to start streaming."
msgstr ""
"Avvia un applicazione sul computer o scegli dalla lista per incominciare a "
"trasmettere."
#: client/scenes/app_launcher.cpp:155
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr ""
"Avvia un applicazione su {} o scegli dalla lista per incominciare a "
"trasmettere."
#: client/scenes/lobby.cpp:185
msgid "Incompatible WiVRn server: no protocol field in TXT"
msgstr "Server WiVRn incompatibile: nessun campo protocollo in TXT"
@@ -42,98 +68,72 @@ msgstr "Impossibile connettersi a {} ({}): {}"
msgid "Waiting for connection"
msgstr "In attesa di connessione"
#: client/scenes/lobby_gui.cpp:232
#: client/scenes/lobby_gui.cpp:107
msgctxt "openxr_post_processing"
msgid "Normal"
msgstr "Normale"
#: client/scenes/lobby_gui.cpp:235
#: client/scenes/lobby_gui.cpp:110
msgctxt "openxr_post_processing"
msgid "Quality"
msgstr "Alta qualità"
#: client/scenes/lobby_gui.cpp:237
#: client/scenes/lobby_gui.cpp:112
msgctxt "openxr_post_processing"
msgid "Disabled"
msgstr "Disattivato"
#: client/scenes/lobby_gui.cpp:245 client/scenes/lobby_gui.cpp:402
#: client/scenes/stream_gui.cpp:838
#: client/scenes/lobby_gui.cpp:120 client/scenes/lobby_gui.cpp:264
#: client/scenes/stream_gui.cpp:944
msgid "Disconnect"
msgstr "Sconnetti"
#: client/scenes/lobby_gui.cpp:266 client/scenes/stream_gui.cpp:834
#: client/scenes/lobby_gui.cpp:140 client/scenes/stream_gui.cpp:940
msgid "Close"
msgstr "Chiudi"
#: client/scenes/lobby_gui.cpp:272
#: client/scenes/lobby_gui.cpp:146
msgid "Connection"
msgstr "Connessione"
#: client/scenes/lobby_gui.cpp:274
#: client/scenes/lobby_gui.cpp:148
#, c++-format
msgid "Connection to {}"
msgstr "Connessione a {}"
#: client/scenes/lobby_gui.cpp:304
#: client/scenes/lobby_gui.cpp:178
msgid "PIN"
msgstr "PIN"
#: client/scenes/lobby_gui.cpp:326
#: client/scenes/lobby_gui.cpp:200
msgid "Input the PIN displayed on the dashboard"
msgstr "Digitare il PIN visibile sul server"
#: client/scenes/lobby_gui.cpp:397
msgid "Connected to WiVRn server"
msgstr "Connesso al server WiVRn"
#: client/scenes/lobby_gui.cpp:399
#, c++-format
msgid "Connected to {}"
msgstr "Connesso a {}"
#: client/scenes/lobby_gui.cpp:409
msgid "Start an application on the server to start streaming."
msgstr "Avvia un applicazione sul server per incominciare a trasmettere."
#: client/scenes/lobby_gui.cpp:421
msgid "Start an application on your computer or select one to start streaming."
msgstr ""
"Avvia un applicazione sul computer o scegli dalla lista per incominciare a "
"trasmettere."
#: client/scenes/lobby_gui.cpp:423
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr ""
"Avvia un applicazione su {} o scegli dalla lista per incominciare a "
"trasmettere."
#: client/scenes/lobby_gui.cpp:546
#: client/scenes/lobby_gui.cpp:290
msgid "Name"
msgstr "Nome"
#: client/scenes/lobby_gui.cpp:557
#: client/scenes/lobby_gui.cpp:301
msgid "Address"
msgstr "Indirizzo"
#: client/scenes/lobby_gui.cpp:566
#: client/scenes/lobby_gui.cpp:310
msgid "Port"
msgstr "Porta"
#: client/scenes/lobby_gui.cpp:574
#: client/scenes/lobby_gui.cpp:318
msgid "TCP only"
msgstr "Solo TCP"
#: client/scenes/lobby_gui.cpp:581
#: client/scenes/lobby_gui.cpp:325 client/scenes/stream_gui.cpp:908
msgid "Cancel"
msgstr "Annulla"
#: client/scenes/lobby_gui.cpp:595
#: client/scenes/lobby_gui.cpp:339
msgid "Save"
msgstr "Salva"
#: client/scenes/lobby_gui.cpp:648
#: client/scenes/lobby_gui.cpp:392
msgid ""
"Start a WiVRn server on your\n"
"local network"
@@ -141,45 +141,45 @@ msgstr ""
"Avvia un server WiVRn sulla\n"
"rete locale"
#: client/scenes/lobby_gui.cpp:680
#: client/scenes/lobby_gui.cpp:424
msgid "Autoconnect"
msgstr "Connessione automatica"
#: client/scenes/lobby_gui.cpp:706
#: client/scenes/lobby_gui.cpp:450
msgid "Connect"
msgstr "Connetti"
#: client/scenes/lobby_gui.cpp:716 client/wivrn_client.cpp:186
#: client/scenes/lobby_gui.cpp:460 client/wivrn_client.cpp:186
msgid "Incompatible server version"
msgstr "Versione del server incompatibile"
#: client/scenes/lobby_gui.cpp:718
#: client/scenes/lobby_gui.cpp:462
msgid "Server not available"
msgstr "Server non disponibile"
#: client/scenes/lobby_gui.cpp:800
#: client/scenes/lobby_gui.cpp:544
msgctxt "language selection, replace with the name of the language"
msgid "English"
msgstr "Italiano"
#: client/scenes/lobby_gui.cpp:814
#: client/scenes/lobby_gui.cpp:558
msgid "Language"
msgstr "Lingua"
#: client/scenes/lobby_gui.cpp:814 client/scenes/lobby_gui.cpp:816
#: client/scenes/lobby_gui.cpp:558 client/scenes/lobby_gui.cpp:560
msgid "System language"
msgstr "Lingua del sistema"
#: client/scenes/lobby_gui.cpp:841
#: client/scenes/lobby_gui.cpp:585
msgid "Refresh rate"
msgstr "Frequenza di aggiornamento"
#: client/scenes/lobby_gui.cpp:841 client/scenes/lobby_gui.cpp:843
#: client/scenes/lobby_gui.cpp:585 client/scenes/lobby_gui.cpp:587
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "Automatica"
#: client/scenes/lobby_gui.cpp:850
#: client/scenes/lobby_gui.cpp:594
msgid ""
"Select refresh rate based on measured application performance.\n"
"May cause flicker when a change happens."
@@ -188,60 +188,60 @@ msgstr ""
"misurate dell'applicazione.\n"
"Può causare un flash quando avviene il cambiamento."
#: client/scenes/lobby_gui.cpp:867
#: client/scenes/lobby_gui.cpp:611
msgid "Minimum refresh rate"
msgstr "Frequenza minima"
#: client/scenes/lobby_gui.cpp:890
#: client/scenes/lobby_gui.cpp:634
msgid "Resolution scale"
msgstr "Scala di risoluzione"
#: client/scenes/lobby_gui.cpp:894
#: client/scenes/lobby_gui.cpp:638
#, c-format, c++-format
msgid "%d%% - {}x{} per eye"
msgstr "%d%% - {}x{} per occhio"
#: client/scenes/lobby_gui.cpp:905
#: client/scenes/lobby_gui.cpp:649
#, c++-format
msgid "Resolution larger than {}x{} may not be supported by the headset"
msgstr ""
"Le risoluzioni superiori a {}x{} potrebbero non essere supportate dal visore"
#: client/scenes/lobby_gui.cpp:911
#: client/scenes/lobby_gui.cpp:655
msgid "Enable microphone"
msgstr "Attiva il microfono"
#: client/scenes/lobby_gui.cpp:920
#: client/scenes/lobby_gui.cpp:664
msgid "Unprocessed Microphone Audio"
msgstr "Usare dati grezzi del microfono"
#: client/scenes/lobby_gui.cpp:926
#: client/scenes/lobby_gui.cpp:670
msgid "Force disable audio filters, such as noise cancellation"
msgstr "Disattiva gli effetti come la cancellazione del rumore"
#: client/scenes/lobby_gui.cpp:933
#: client/scenes/lobby_gui.cpp:677
msgid "Enable hand tracking"
msgstr "Abilita il tracciamento delle mani"
#: client/scenes/lobby_gui.cpp:939 client/scenes/lobby_gui.cpp:951
#: client/scenes/lobby_gui.cpp:963 client/scenes/lobby_gui.cpp:980
#: client/scenes/lobby_gui.cpp:1025
#: client/scenes/lobby_gui.cpp:683 client/scenes/lobby_gui.cpp:695
#: client/scenes/lobby_gui.cpp:707 client/scenes/lobby_gui.cpp:724
#: client/scenes/lobby_gui.cpp:769
msgid "This feature is not supported by your headset"
msgstr "Questa funzionalità non è supportata dal visore"
#: client/scenes/lobby_gui.cpp:945
#: client/scenes/lobby_gui.cpp:689
msgid "Enable eye tracking"
msgstr "Abilita il tracciamento oculare"
#: client/scenes/lobby_gui.cpp:957
#: client/scenes/lobby_gui.cpp:701
msgid "Enable face tracking"
msgstr "Abilita il tracciamento facciale"
#: client/scenes/lobby_gui.cpp:971
#: client/scenes/lobby_gui.cpp:715
msgid "Enable body tracking"
msgstr "Abilita il tracciamento del corpo"
#: client/scenes/lobby_gui.cpp:985
#: client/scenes/lobby_gui.cpp:729
msgid ""
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
"tracking settings,\n"
@@ -254,11 +254,11 @@ msgstr ""
"controller e\n"
"del visore."
#: client/scenes/lobby_gui.cpp:995
#: client/scenes/lobby_gui.cpp:739
msgid "Enable lower body tracking"
msgstr "Abilita il tracciamento del basso del corpo"
#: client/scenes/lobby_gui.cpp:1001
#: client/scenes/lobby_gui.cpp:745
msgid ""
"Estimate lower body joint positions using Generative Legs\n"
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
@@ -269,11 +269,11 @@ msgstr ""
"impostazioni,\n"
"sezione \"Tracking dei movimenti\"."
#: client/scenes/lobby_gui.cpp:1004
#: client/scenes/lobby_gui.cpp:748
msgid "Enable hip tracking"
msgstr "Abilitia il tracciamento delle anche"
#: client/scenes/lobby_gui.cpp:1010
#: client/scenes/lobby_gui.cpp:754
msgid ""
"Only takes affect with lower body tracking enabled\n"
"May be desired when using another source of hip tracking"
@@ -282,15 +282,15 @@ msgstr ""
"Può essere utile se un altro metodo viene usato per il tracciamento\n"
"delle anche."
#: client/scenes/lobby_gui.cpp:1018
#: client/scenes/lobby_gui.cpp:762
msgid "Enable video passthrough in lobby"
msgstr "Abilita la visualizzazione reale in ingresso"
#: client/scenes/lobby_gui.cpp:1029
#: client/scenes/lobby_gui.cpp:773
msgid "Enable in-stream window"
msgstr "Attiva la finestra di WiVRn durante la trasmissione"
#: client/scenes/lobby_gui.cpp:1032
#: client/scenes/lobby_gui.cpp:776
msgid ""
"Enables the configuration window to be shown while the game is streaming.\n"
"If enabled, the window is activated by pressing both thumbsticks."
@@ -298,15 +298,15 @@ msgstr ""
"Abilita la finestra di configurazione quando il gioco viene trasmesso.\n"
"Se selezionato, la finestra può essere attivata premendo entrambi gli stick."
#: client/scenes/lobby_gui.cpp:1046 client/scenes/stream_gui.cpp:445
#: client/scenes/lobby_gui.cpp:790 client/scenes/stream_gui.cpp:445
msgid "OpenXR post-processing"
msgstr "Post-trattamento OpenXR"
#: client/scenes/lobby_gui.cpp:1050 client/scenes/stream_gui.cpp:449
#: client/scenes/lobby_gui.cpp:794 client/scenes/stream_gui.cpp:449
msgid "Supersampling"
msgstr "Supersamping"
#: client/scenes/lobby_gui.cpp:1070 client/scenes/stream_gui.cpp:470
#: client/scenes/lobby_gui.cpp:814 client/scenes/stream_gui.cpp:470
msgid ""
"Reduce flicker for high contrast edges.\n"
"Useful when the input resolution is high compared to the headset display"
@@ -314,11 +314,11 @@ msgstr ""
"Riduce i lampeggiamenti sui bordi ad alto contrasto.\n"
"Utile quando la risoluzine d'entrata è alta in confronto a quella del visore"
#: client/scenes/lobby_gui.cpp:1075 client/scenes/stream_gui.cpp:475
#: client/scenes/lobby_gui.cpp:819 client/scenes/stream_gui.cpp:475
msgid "Sharpening"
msgstr "Miglioramento della nitidezza"
#: client/scenes/lobby_gui.cpp:1095 client/scenes/stream_gui.cpp:496
#: client/scenes/lobby_gui.cpp:839 client/scenes/stream_gui.cpp:496
msgid ""
"Improve clarity of high contrast edges and counteract blur.\n"
"Useful when the input resolution is low compared to the headset display"
@@ -327,125 +327,125 @@ msgstr ""
"Utile quando la risoluzione d'entrate è bassa in contronto a quella del "
"visore"
#: client/scenes/lobby_gui.cpp:1191 client/scenes/lobby_gui.cpp:1199
#: client/scenes/lobby_gui.cpp:935 client/scenes/lobby_gui.cpp:943
#: client/scenes/stream_gui.cpp:222 client/scenes/stream_gui.cpp:424
msgid "CPU time"
msgstr "Tempo CPU"
#: client/scenes/lobby_gui.cpp:1195
#: client/scenes/lobby_gui.cpp:939
msgid "CPU time [ms]"
msgstr "Tempo CPU [ms]"
#: client/scenes/lobby_gui.cpp:1205 client/scenes/lobby_gui.cpp:1213
#: client/scenes/lobby_gui.cpp:949 client/scenes/lobby_gui.cpp:957
#: client/scenes/stream_gui.cpp:224 client/scenes/stream_gui.cpp:425
msgid "GPU time"
msgstr "Tempo GPU"
#: client/scenes/lobby_gui.cpp:1209
#: client/scenes/lobby_gui.cpp:953
msgid "GPU time [ms]"
msgstr "Tempo GPU [ms]"
#: client/scenes/lobby_gui.cpp:1252
#: client/scenes/lobby_gui.cpp:996
msgid "Enable the microphone?"
msgstr "Attivare il microfono?"
#: client/scenes/lobby_gui.cpp:1257
#: client/scenes/lobby_gui.cpp:1001
msgid "Enable eye tracking?"
msgstr "Attivare il tracciamento oculare?"
#: client/scenes/lobby_gui.cpp:1262
#: client/scenes/lobby_gui.cpp:1006
msgid "Enable face tracking?"
msgstr "Attivare il tracciamento facciale?"
#: client/scenes/lobby_gui.cpp:1267
#: client/scenes/lobby_gui.cpp:1011
msgid "Enable body tracking?"
msgstr "Attivare il tracciamento del corpo?"
#: client/scenes/lobby_gui.cpp:1275
#: client/scenes/lobby_gui.cpp:1019
msgid "Welcome to WiVRn"
msgstr "Benvenuto su WiVRn"
#: client/scenes/lobby_gui.cpp:1299
#: client/scenes/lobby_gui.cpp:1043
msgid "Yes"
msgstr "Sì"
#: client/scenes/lobby_gui.cpp:1306
#: client/scenes/lobby_gui.cpp:1050
msgid "No"
msgstr "No"
#: client/scenes/lobby_gui.cpp:1325 client/scenes/lobby_gui.cpp:1972
#: client/scenes/lobby_gui.cpp:1069 client/scenes/lobby_gui.cpp:1716
msgid "Licenses"
msgstr "Licenze"
#: client/scenes/lobby_gui.cpp:1650
#: client/scenes/lobby_gui.cpp:1394
msgid "Microphone is enabled"
msgstr "Microfono attivo"
#: client/scenes/lobby_gui.cpp:1651
#: client/scenes/lobby_gui.cpp:1395
msgid "Microphone is disabled"
msgstr "Microfono disattivato"
#: client/scenes/lobby_gui.cpp:1660
#: client/scenes/lobby_gui.cpp:1404
msgid "Hand tracking is enabled"
msgstr "Tracciamento delle mani attivo"
#: client/scenes/lobby_gui.cpp:1661
#: client/scenes/lobby_gui.cpp:1405
msgid "Hand tracking is disabled"
msgstr "Tracciamento delle mani disattivato"
#: client/scenes/lobby_gui.cpp:1670
#: client/scenes/lobby_gui.cpp:1414
msgid "Eye tracking is enabled"
msgstr "Tracciamento oculare attivo"
#: client/scenes/lobby_gui.cpp:1671
#: client/scenes/lobby_gui.cpp:1415
msgid "Eye tracking is disabled"
msgstr "Tracciamento oculare disattivato"
#: client/scenes/lobby_gui.cpp:1681
#: client/scenes/lobby_gui.cpp:1425
msgid "Face tracking is enabled"
msgstr "Tracciamento facciale attivato"
#: client/scenes/lobby_gui.cpp:1682
#: client/scenes/lobby_gui.cpp:1426
msgid "Face tracking is disabled"
msgstr "Tracciamento facciale disattivato"
#: client/scenes/lobby_gui.cpp:1692
#: client/scenes/lobby_gui.cpp:1436
msgid "Body tracking is enabled"
msgstr "Tracciamento del corpo attivato"
#: client/scenes/lobby_gui.cpp:1693
#: client/scenes/lobby_gui.cpp:1437
msgid "Body tracking is disabled"
msgstr "Tracciamento del corpo disattivato"
#: client/scenes/lobby_gui.cpp:1709
#: client/scenes/lobby_gui.cpp:1453
msgid "Add server"
msgstr "Aggiungi server"
#: client/scenes/lobby_gui.cpp:1954
#: client/scenes/lobby_gui.cpp:1698
msgid "Server list"
msgstr "Elenco dei server"
#: client/scenes/lobby_gui.cpp:1957 client/scenes/stream_gui.cpp:822
#: client/scenes/lobby_gui.cpp:1701 client/scenes/stream_gui.cpp:925
msgid "Settings"
msgstr "Impostazioni"
#: client/scenes/lobby_gui.cpp:1960
#: client/scenes/lobby_gui.cpp:1704
msgid "Post-processing"
msgstr "Post-trattamento"
#: client/scenes/lobby_gui.cpp:1964
#: client/scenes/lobby_gui.cpp:1708
msgid "Debug"
msgstr "Debug"
#: client/scenes/lobby_gui.cpp:1969
#: client/scenes/lobby_gui.cpp:1713
msgid "About"
msgstr "Informazioni"
#: client/scenes/lobby_gui.cpp:1975
#: client/scenes/lobby_gui.cpp:1719
msgid "Exit"
msgstr "Esci"
#: client/scenes/lobby_gui.cpp:1992
#: client/scenes/lobby_gui.cpp:1736
msgid ""
"Press the grip button or put your palm up\n"
"to move the main window"
@@ -453,7 +453,7 @@ msgstr ""
"Premi il pulsante laterale o punta il palmo della\n"
"mano verso l'alto per spostare la finestra principale"
#: client/scenes/lobby_gui.cpp:1994
#: client/scenes/lobby_gui.cpp:1738
msgid "Press the grip button to move the main window"
msgstr "Premi il pulsante laterale per spostare la finestra principale"
@@ -523,7 +523,7 @@ msgstr "Latenza stimata da movimento a fotoni: {}ms"
msgid "Press the grip button to move the window"
msgstr "Premi il pulsante laterale per spostare la finestra"
#: client/scenes/stream_gui.cpp:404 client/scenes/stream_gui.cpp:776
#: client/scenes/stream_gui.cpp:404 client/scenes/stream_gui.cpp:868
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "Premi entrabli gli stick per mostrare la finestra di WiVRn"
@@ -565,15 +565,35 @@ msgstr "Usa gli stick per spostare il centro di foveazione"
msgid "Press A to save or B to cancel"
msgstr "A per salvare, B per annullare"
#: client/scenes/stream_gui.cpp:819
#: client/scenes/stream_gui.cpp:618
msgid "Running XR applications:"
msgstr "Applicazioni XR avviate:"
#: client/scenes/stream_gui.cpp:635
msgid "Overlays"
msgstr "Overlays"
#: client/scenes/stream_gui.cpp:674
msgid "Request to quit, may be ignored by the application"
msgstr "Chiede di chiudere, può essere ignorato dall'applicazione"
#: client/scenes/stream_gui.cpp:677
msgid "Start"
msgstr "Avvio"
#: client/scenes/stream_gui.cpp:922
msgid "Stats"
msgstr "Statistiche"
#: client/scenes/stream_gui.cpp:828
#: client/scenes/stream_gui.cpp:928
msgid "Applications"
msgstr "Applicazioni"
#: client/scenes/stream_gui.cpp:934
msgid "Statistics overlay"
msgstr "Solo statistiche"
#: client/scenes/stream_gui.cpp:831
#: client/scenes/stream_gui.cpp:937
msgid "Compact view"
msgstr "Modalità compatta"
+135 -115
View File
@@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-18 13:35+0200\n"
"PO-Revision-Date: 2025-09-18 16:52+0200\n"
"POT-Creation-Date: 2025-09-27 17:11+0200\n"
"PO-Revision-Date: 2025-09-27 22:14+0200\n"
"Last-Translator: Claudio Sampaio (Patola) <patola@gmail.com>\n"
"Language-Team: Portuguese <>\n"
"Language: pt_BR\n"
@@ -26,6 +26,30 @@ msgstr ""
msgid "No supported swapchain format"
msgstr "Sem formato de cadeia de troca suportado"
#: client/scenes/app_launcher.cpp:135
msgid "Connected to WiVRn server"
msgstr "Conectado ao servidor WiVRn"
#: client/scenes/app_launcher.cpp:137
#, c++-format
msgid "Connected to {}"
msgstr "Conectado a {}"
#: client/scenes/app_launcher.cpp:143
msgid "Start an application on the server to start streaming."
msgstr "Abra um aplicativo no servidor para iniciar o streaming."
#: client/scenes/app_launcher.cpp:153
msgid "Start an application on your computer or select one to start streaming."
msgstr ""
"Abra um aplicativo no seu computador ou selecione um para iniciar o "
"streaming."
#: client/scenes/app_launcher.cpp:155
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr "Abra um aplicativo em {} ou selecione um para iniciar o streaming."
#: client/scenes/lobby.cpp:185
msgid "Incompatible WiVRn server: no protocol field in TXT"
msgstr "Servidor WiVRn incompatível: sem campo protocolo no TXT"
@@ -49,96 +73,72 @@ msgstr "Incapaz de conectar a {} ({}): {}"
msgid "Waiting for connection"
msgstr "Aguardando conexão"
#: client/scenes/lobby_gui.cpp:232
#: client/scenes/lobby_gui.cpp:107
msgctxt "openxr_post_processing"
msgid "Normal"
msgstr "Normal"
#: client/scenes/lobby_gui.cpp:235
#: client/scenes/lobby_gui.cpp:110
msgctxt "openxr_post_processing"
msgid "Quality"
msgstr "Qualidade"
#: client/scenes/lobby_gui.cpp:237
#: client/scenes/lobby_gui.cpp:112
msgctxt "openxr_post_processing"
msgid "Disabled"
msgstr "Desabilitado"
#: client/scenes/lobby_gui.cpp:245 client/scenes/lobby_gui.cpp:402
#: client/scenes/stream_gui.cpp:838
#: client/scenes/lobby_gui.cpp:120 client/scenes/lobby_gui.cpp:264
#: client/scenes/stream_gui.cpp:944
msgid "Disconnect"
msgstr "Desconectar"
#: client/scenes/lobby_gui.cpp:266 client/scenes/stream_gui.cpp:834
#: client/scenes/lobby_gui.cpp:140 client/scenes/stream_gui.cpp:940
msgid "Close"
msgstr "Fechar"
#: client/scenes/lobby_gui.cpp:272
#: client/scenes/lobby_gui.cpp:146
msgid "Connection"
msgstr "Conexão"
#: client/scenes/lobby_gui.cpp:274
#: client/scenes/lobby_gui.cpp:148
#, c++-format
msgid "Connection to {}"
msgstr "Conexão a {}"
#: client/scenes/lobby_gui.cpp:304
#: client/scenes/lobby_gui.cpp:178
msgid "PIN"
msgstr "PIN"
#: client/scenes/lobby_gui.cpp:326
#: client/scenes/lobby_gui.cpp:200
msgid "Input the PIN displayed on the dashboard"
msgstr "Entre o PIN mostrado no painel"
#: client/scenes/lobby_gui.cpp:397
msgid "Connected to WiVRn server"
msgstr "Conectado ao servidor WiVRn"
#: client/scenes/lobby_gui.cpp:399
#, c++-format
msgid "Connected to {}"
msgstr "Conectado a {}"
#: client/scenes/lobby_gui.cpp:409
msgid "Start an application on the server to start streaming."
msgstr "Abra um aplicativo no servidor para iniciar o streaming."
#: client/scenes/lobby_gui.cpp:421
msgid "Start an application on your computer or select one to start streaming."
msgstr ""
"Abra um aplicativo no seu computador ou selecione um para iniciar o "
"streaming."
#: client/scenes/lobby_gui.cpp:423
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr "Abra um aplicativo em {} ou selecione um para iniciar o streaming."
#: client/scenes/lobby_gui.cpp:546
#: client/scenes/lobby_gui.cpp:290
msgid "Name"
msgstr "Nome"
#: client/scenes/lobby_gui.cpp:557
#: client/scenes/lobby_gui.cpp:301
msgid "Address"
msgstr "Endereço"
#: client/scenes/lobby_gui.cpp:566
#: client/scenes/lobby_gui.cpp:310
msgid "Port"
msgstr "Porta"
#: client/scenes/lobby_gui.cpp:574
#: client/scenes/lobby_gui.cpp:318
msgid "TCP only"
msgstr "TCP somente"
#: client/scenes/lobby_gui.cpp:581
#: client/scenes/lobby_gui.cpp:325 client/scenes/stream_gui.cpp:908
msgid "Cancel"
msgstr "Cancelar"
#: client/scenes/lobby_gui.cpp:595
#: client/scenes/lobby_gui.cpp:339
msgid "Save"
msgstr "Salvar"
#: client/scenes/lobby_gui.cpp:648
#: client/scenes/lobby_gui.cpp:392
msgid ""
"Start a WiVRn server on your\n"
"local network"
@@ -146,45 +146,45 @@ msgstr ""
"Inicie um servidor WiVRn em sua\n"
"rede local"
#: client/scenes/lobby_gui.cpp:680
#: client/scenes/lobby_gui.cpp:424
msgid "Autoconnect"
msgstr "Autoconectar"
#: client/scenes/lobby_gui.cpp:706
#: client/scenes/lobby_gui.cpp:450
msgid "Connect"
msgstr "Conectar"
#: client/scenes/lobby_gui.cpp:716 client/wivrn_client.cpp:186
#: client/scenes/lobby_gui.cpp:460 client/wivrn_client.cpp:186
msgid "Incompatible server version"
msgstr "Versão de servidor incompatível"
#: client/scenes/lobby_gui.cpp:718
#: client/scenes/lobby_gui.cpp:462
msgid "Server not available"
msgstr "Servidor não disponível"
#: client/scenes/lobby_gui.cpp:800
#: client/scenes/lobby_gui.cpp:544
msgctxt "language selection, replace with the name of the language"
msgid "English"
msgstr "Português (Brasil)"
#: client/scenes/lobby_gui.cpp:814
#: client/scenes/lobby_gui.cpp:558
msgid "Language"
msgstr "Linguagem"
#: client/scenes/lobby_gui.cpp:814 client/scenes/lobby_gui.cpp:816
#: client/scenes/lobby_gui.cpp:558 client/scenes/lobby_gui.cpp:560
msgid "System language"
msgstr "Linguagem do Sistema"
#: client/scenes/lobby_gui.cpp:841
#: client/scenes/lobby_gui.cpp:585
msgid "Refresh rate"
msgstr "Taxa de atualização"
#: client/scenes/lobby_gui.cpp:841 client/scenes/lobby_gui.cpp:843
#: client/scenes/lobby_gui.cpp:585 client/scenes/lobby_gui.cpp:587
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "Automático"
#: client/scenes/lobby_gui.cpp:850
#: client/scenes/lobby_gui.cpp:594
msgid ""
"Select refresh rate based on measured application performance.\n"
"May cause flicker when a change happens."
@@ -192,60 +192,60 @@ 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:867
#: client/scenes/lobby_gui.cpp:611
msgid "Minimum refresh rate"
msgstr "Taxa de atualização mínima"
#: client/scenes/lobby_gui.cpp:890
#: client/scenes/lobby_gui.cpp:634
msgid "Resolution scale"
msgstr "Escala de resolução"
#: client/scenes/lobby_gui.cpp:894
#: client/scenes/lobby_gui.cpp:638
#, c-format, c++-format
msgid "%d%% - {}x{} per eye"
msgstr "%d%% - {}x{} por olho"
#: client/scenes/lobby_gui.cpp:905
#: client/scenes/lobby_gui.cpp:649
#, c++-format
msgid "Resolution larger than {}x{} may not be supported by the headset"
msgstr "Resolução maior que {}x{} pode não ser suportada pelo headset"
#: client/scenes/lobby_gui.cpp:911
#: client/scenes/lobby_gui.cpp:655
msgid "Enable microphone"
msgstr "Ativar microfone"
#: client/scenes/lobby_gui.cpp:920
#: client/scenes/lobby_gui.cpp:664
msgid "Unprocessed Microphone Audio"
msgstr "Áudio Não-processado de Microfone"
#: client/scenes/lobby_gui.cpp:926
#: client/scenes/lobby_gui.cpp:670
msgid "Force disable audio filters, such as noise cancellation"
msgstr ""
"Força a desativação de filtros de áudio tais como cancelamento de ruído"
#: client/scenes/lobby_gui.cpp:933
#: client/scenes/lobby_gui.cpp:677
msgid "Enable hand tracking"
msgstr "Ativar rastreamento de mãos"
#: client/scenes/lobby_gui.cpp:939 client/scenes/lobby_gui.cpp:951
#: client/scenes/lobby_gui.cpp:963 client/scenes/lobby_gui.cpp:980
#: client/scenes/lobby_gui.cpp:1025
#: client/scenes/lobby_gui.cpp:683 client/scenes/lobby_gui.cpp:695
#: client/scenes/lobby_gui.cpp:707 client/scenes/lobby_gui.cpp:724
#: client/scenes/lobby_gui.cpp:769
msgid "This feature is not supported by your headset"
msgstr "Este recurso não é suportado pelo seu headset"
#: client/scenes/lobby_gui.cpp:945
#: client/scenes/lobby_gui.cpp:689
msgid "Enable eye tracking"
msgstr "Ativar rastreamento ocular"
#: client/scenes/lobby_gui.cpp:957
#: client/scenes/lobby_gui.cpp:701
msgid "Enable face tracking"
msgstr "Ativar rastreamento facial"
#: client/scenes/lobby_gui.cpp:971
#: client/scenes/lobby_gui.cpp:715
msgid "Enable body tracking"
msgstr "Ativar rastreamento corporal"
#: client/scenes/lobby_gui.cpp:985
#: client/scenes/lobby_gui.cpp:729
msgid ""
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
"tracking settings,\n"
@@ -257,11 +257,11 @@ msgstr ""
"estimados\n"
"com base nas posições do controle e do headset."
#: client/scenes/lobby_gui.cpp:995
#: client/scenes/lobby_gui.cpp:739
msgid "Enable lower body tracking"
msgstr "Ativar rastreamento corporal inferior"
#: client/scenes/lobby_gui.cpp:1001
#: client/scenes/lobby_gui.cpp:745
msgid ""
"Estimate lower body joint positions using Generative Legs\n"
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
@@ -272,11 +272,11 @@ msgstr ""
"Requer que 'Rastreamento corporal e das mãos' esteja ativado nas\n"
"configurações de Rastreamento de Movimento do Quest"
#: client/scenes/lobby_gui.cpp:1004
#: client/scenes/lobby_gui.cpp:748
msgid "Enable hip tracking"
msgstr "Ativar rastreamento de quadril"
#: client/scenes/lobby_gui.cpp:1010
#: client/scenes/lobby_gui.cpp:754
msgid ""
"Only takes affect with lower body tracking enabled\n"
"May be desired when using another source of hip tracking"
@@ -284,15 +284,15 @@ msgstr ""
"Só tem efeito com o rastreamento corporal inferior ativado\n"
"Pode ser desejado ao usar outra fonte de rastreamento de quadril"
#: client/scenes/lobby_gui.cpp:1018
#: client/scenes/lobby_gui.cpp:762
msgid "Enable video passthrough in lobby"
msgstr "Habilitar repassagem de vídeo no lobby"
#: client/scenes/lobby_gui.cpp:1029
#: client/scenes/lobby_gui.cpp:773
msgid "Enable in-stream window"
msgstr "Habilitar janela na stream"
#: client/scenes/lobby_gui.cpp:1032
#: client/scenes/lobby_gui.cpp:776
msgid ""
"Enables the configuration window to be shown while the game is streaming.\n"
"If enabled, the window is activated by pressing both thumbsticks."
@@ -301,15 +301,15 @@ msgstr ""
"streamado.\n"
"Se habilitado, a janela é ativada clicando os dois joysticks simultaneamente."
#: client/scenes/lobby_gui.cpp:1046 client/scenes/stream_gui.cpp:445
#: client/scenes/lobby_gui.cpp:790 client/scenes/stream_gui.cpp:445
msgid "OpenXR post-processing"
msgstr "Pós-processamento OpenXR"
#: client/scenes/lobby_gui.cpp:1050 client/scenes/stream_gui.cpp:449
#: client/scenes/lobby_gui.cpp:794 client/scenes/stream_gui.cpp:449
msgid "Supersampling"
msgstr "Supersampling"
#: client/scenes/lobby_gui.cpp:1070 client/scenes/stream_gui.cpp:470
#: client/scenes/lobby_gui.cpp:814 client/scenes/stream_gui.cpp:470
msgid ""
"Reduce flicker for high contrast edges.\n"
"Useful when the input resolution is high compared to the headset display"
@@ -317,11 +317,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:1075 client/scenes/stream_gui.cpp:475
#: client/scenes/lobby_gui.cpp:819 client/scenes/stream_gui.cpp:475
msgid "Sharpening"
msgstr "Aumento de nitidez"
#: client/scenes/lobby_gui.cpp:1095 client/scenes/stream_gui.cpp:496
#: client/scenes/lobby_gui.cpp:839 client/scenes/stream_gui.cpp:496
msgid ""
"Improve clarity of high contrast edges and counteract blur.\n"
"Useful when the input resolution is low compared to the headset display"
@@ -329,125 +329,125 @@ msgstr ""
"Melhora a clareza de arestas de alto contraste e minimiza o desfoque.\n"
"Útil quando a resolução de entrada é baixa comparada ao display do headset"
#: client/scenes/lobby_gui.cpp:1191 client/scenes/lobby_gui.cpp:1199
#: client/scenes/lobby_gui.cpp:935 client/scenes/lobby_gui.cpp:943
#: client/scenes/stream_gui.cpp:222 client/scenes/stream_gui.cpp:424
msgid "CPU time"
msgstr "Tempo de CPU"
#: client/scenes/lobby_gui.cpp:1195
#: client/scenes/lobby_gui.cpp:939
msgid "CPU time [ms]"
msgstr "Tempo de CPU [ms]"
#: client/scenes/lobby_gui.cpp:1205 client/scenes/lobby_gui.cpp:1213
#: client/scenes/lobby_gui.cpp:949 client/scenes/lobby_gui.cpp:957
#: client/scenes/stream_gui.cpp:224 client/scenes/stream_gui.cpp:425
msgid "GPU time"
msgstr "Tempo de GPU"
#: client/scenes/lobby_gui.cpp:1209
#: client/scenes/lobby_gui.cpp:953
msgid "GPU time [ms]"
msgstr "Tempo de GPU [ms]"
#: client/scenes/lobby_gui.cpp:1252
#: client/scenes/lobby_gui.cpp:996
msgid "Enable the microphone?"
msgstr "Habilitar o microfone?"
#: client/scenes/lobby_gui.cpp:1257
#: client/scenes/lobby_gui.cpp:1001
msgid "Enable eye tracking?"
msgstr "Habilitar o rastreamento ocular?"
#: client/scenes/lobby_gui.cpp:1262
#: client/scenes/lobby_gui.cpp:1006
msgid "Enable face tracking?"
msgstr "Habilitar o rastreamento facial?"
#: client/scenes/lobby_gui.cpp:1267
#: client/scenes/lobby_gui.cpp:1011
msgid "Enable body tracking?"
msgstr "Habilitar o rastreamento corporal?"
#: client/scenes/lobby_gui.cpp:1275
#: client/scenes/lobby_gui.cpp:1019
msgid "Welcome to WiVRn"
msgstr "Bem vindo(a) ao WiVRn"
#: client/scenes/lobby_gui.cpp:1299
#: client/scenes/lobby_gui.cpp:1043
msgid "Yes"
msgstr "Sim"
#: client/scenes/lobby_gui.cpp:1306
#: client/scenes/lobby_gui.cpp:1050
msgid "No"
msgstr "Não"
#: client/scenes/lobby_gui.cpp:1325 client/scenes/lobby_gui.cpp:1972
#: client/scenes/lobby_gui.cpp:1069 client/scenes/lobby_gui.cpp:1716
msgid "Licenses"
msgstr "Licenças"
#: client/scenes/lobby_gui.cpp:1650
#: client/scenes/lobby_gui.cpp:1394
msgid "Microphone is enabled"
msgstr "O microfone está ativado"
#: client/scenes/lobby_gui.cpp:1651
#: client/scenes/lobby_gui.cpp:1395
msgid "Microphone is disabled"
msgstr "O microfone está desativado"
#: client/scenes/lobby_gui.cpp:1660
#: client/scenes/lobby_gui.cpp:1404
msgid "Hand tracking is enabled"
msgstr "O rastreamento de mãos está ativado"
#: client/scenes/lobby_gui.cpp:1661
#: client/scenes/lobby_gui.cpp:1405
msgid "Hand tracking is disabled"
msgstr "O rastreamento de mãos está desativado"
#: client/scenes/lobby_gui.cpp:1670
#: client/scenes/lobby_gui.cpp:1414
msgid "Eye tracking is enabled"
msgstr "O rastreamento ocular está ativado"
#: client/scenes/lobby_gui.cpp:1671
#: client/scenes/lobby_gui.cpp:1415
msgid "Eye tracking is disabled"
msgstr "O rastreamento ocular está desativado"
#: client/scenes/lobby_gui.cpp:1681
#: client/scenes/lobby_gui.cpp:1425
msgid "Face tracking is enabled"
msgstr "O rastreamento facial está ativado"
#: client/scenes/lobby_gui.cpp:1682
#: client/scenes/lobby_gui.cpp:1426
msgid "Face tracking is disabled"
msgstr "O rastreamento facial está desativado"
#: client/scenes/lobby_gui.cpp:1692
#: client/scenes/lobby_gui.cpp:1436
msgid "Body tracking is enabled"
msgstr "O rastreamento corporal está ativado"
#: client/scenes/lobby_gui.cpp:1693
#: client/scenes/lobby_gui.cpp:1437
msgid "Body tracking is disabled"
msgstr "O rastreamento corporal está desativado"
#: client/scenes/lobby_gui.cpp:1709
#: client/scenes/lobby_gui.cpp:1453
msgid "Add server"
msgstr "Adicionar servidor"
#: client/scenes/lobby_gui.cpp:1954
#: client/scenes/lobby_gui.cpp:1698
msgid "Server list"
msgstr "Lista de servidores"
#: client/scenes/lobby_gui.cpp:1957 client/scenes/stream_gui.cpp:822
#: client/scenes/lobby_gui.cpp:1701 client/scenes/stream_gui.cpp:925
msgid "Settings"
msgstr "Ajustes"
#: client/scenes/lobby_gui.cpp:1960
#: client/scenes/lobby_gui.cpp:1704
msgid "Post-processing"
msgstr "Pós-processamento"
#: client/scenes/lobby_gui.cpp:1964
#: client/scenes/lobby_gui.cpp:1708
msgid "Debug"
msgstr "Depurar"
#: client/scenes/lobby_gui.cpp:1969
#: client/scenes/lobby_gui.cpp:1713
msgid "About"
msgstr "Sobre"
#: client/scenes/lobby_gui.cpp:1975
#: client/scenes/lobby_gui.cpp:1719
msgid "Exit"
msgstr "Sair"
#: client/scenes/lobby_gui.cpp:1992
#: client/scenes/lobby_gui.cpp:1736
msgid ""
"Press the grip button or put your palm up\n"
"to move the main window"
@@ -455,7 +455,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:1994
#: client/scenes/lobby_gui.cpp:1738
msgid "Press the grip button to move the main window"
msgstr "Pressione o botão de aderência para mover a janela principal"
@@ -525,7 +525,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:404 client/scenes/stream_gui.cpp:776
#: client/scenes/stream_gui.cpp:404 client/scenes/stream_gui.cpp:868
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "Pressione ambos os thumbsticks para mostrar a janela do WiVRn"
@@ -567,15 +567,35 @@ msgstr "Use os thumbsticks para mover o centro da foveação"
msgid "Press A to save or B to cancel"
msgstr "Pressione A para salvar ou B para cancelar"
#: client/scenes/stream_gui.cpp:819
#: client/scenes/stream_gui.cpp:618
msgid "Running XR applications:"
msgstr "Aplicativos XR rodando:"
#: client/scenes/stream_gui.cpp:635
msgid "Overlays"
msgstr "Overlays"
#: client/scenes/stream_gui.cpp:674
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:677
msgid "Start"
msgstr "Iniciar"
#: client/scenes/stream_gui.cpp:922
msgid "Stats"
msgstr "Estatísticas"
#: client/scenes/stream_gui.cpp:828
#: client/scenes/stream_gui.cpp:928
msgid "Applications"
msgstr "Aplicativos"
#: client/scenes/stream_gui.cpp:934
msgid "Statistics overlay"
msgstr "Overlay de estatísticas"
#: client/scenes/stream_gui.cpp:831
#: client/scenes/stream_gui.cpp:937
msgid "Compact view"
msgstr "Visualização compacta"
+312
View File
@@ -0,0 +1,312 @@
From 36c63e58e4d54c31872b95fdc7fb431c8cfc57ab Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz <tbornecrantz@nvidia.com>
Date: Fri, 15 Nov 2024 22:51:32 +0000
Subject: [PATCH] ipc: Add callbacks and unify main functions
---
src/xrt/ipc/server/ipc_server_interface.h | 58 +++++++++----
src/xrt/ipc/server/ipc_server_process.c | 84 ++++++++++---------
.../targets/service-lib/service_target.cpp | 38 +++++++--
3 files changed, 118 insertions(+), 62 deletions(-)
diff --git a/src/xrt/ipc/server/ipc_server_interface.h b/src/xrt/ipc/server/ipc_server_interface.h
index b870a52c8c..1b44af8a82 100644
--- a/src/xrt/ipc/server/ipc_server_interface.h
+++ b/src/xrt/ipc/server/ipc_server_interface.h
@@ -10,12 +10,10 @@
* @ingroup ipc_server
*/
-#include "xrt/xrt_compiler.h"
#include "xrt/xrt_config_os.h"
+#include "xrt/xrt_results.h"
-#ifndef XRT_OS_ANDROID
#include "util/u_debug_gui.h"
-#endif
#ifdef __cplusplus
@@ -23,7 +21,7 @@ extern "C" {
#endif
-#ifndef XRT_OS_ANDROID
+struct ipc_server;
/*!
* Information passed into the IPC server main function, used for customization
@@ -38,31 +36,57 @@ struct ipc_server_main_info
};
/*!
- * Main entrypoint to the compositor process.
*
* @ingroup ipc_server
*/
-int
-ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi);
-
-#endif
+struct ipc_server_callbacks
+{
+ /*!
+ * The IPC server failed to init.
+ *
+ * @param[in] xret The error code generated during init.
+ * @param[in] data User data given passed into the main function.
+ */
+ void (*init_failed)(xrt_result_t xret, void *data);
+ /*!
+ * The service has completed init and is entering its mainloop.
+ *
+ * @param[in] s The IPC server.
+ * @param[in] xinst Instance that was created by the IPC server.
+ * @param[in] data User data given passed into the main function.
+ */
+ void (*mainloop_entering)(struct ipc_server *s, struct xrt_instance *xinst, void *data);
-#ifdef XRT_OS_ANDROID
+ /*!
+ * The service is leaving the mainloop, after this callback returns the
+ * IPC server will destroy all resources created.
+ *
+ * @param[in] s The IPC server.
+ * @param[in] xinst Instance that was created by the IPC server.
+ * @param[in] data User data given passed into the main function.
+ */
+ void (*mainloop_leaving)(struct ipc_server *s, struct xrt_instance *xinst, void *data);
+};
/*!
- * Main entrypoint to the server process.
+ * Common main function for starting the IPC service.
*
- * @param ps Pointer to populate with the server struct.
- * @param startup_complete_callback Function to call upon completing startup
- * and populating *ps, but before entering
- * the mainloop.
- * @param data user data to pass to your callback.
+ * @ingroup ipc_server
+ */
+int
+ipc_server_main_common(const struct ipc_server_main_info *ismi, const struct ipc_server_callbacks *iscb, void *data);
+
+
+#ifndef XRT_OS_ANDROID
+
+/*!
+ * Main entrypoint to the compositor process.
*
* @ingroup ipc_server
*/
int
-ipc_server_main_android(struct ipc_server **ps, void (*startup_complete_callback)(void *data), void *data);
+ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi);
#endif
diff --git a/src/xrt/ipc/server/ipc_server_process.c b/src/xrt/ipc/server/ipc_server_process.c
index f972d6835a..32bad0ec56 100644
--- a/src/xrt/ipc/server/ipc_server_process.c
+++ b/src/xrt/ipc/server/ipc_server_process.c
@@ -972,9 +972,10 @@ ipc_server_get_system_properties(struct ipc_server *vs, struct xrt_system_proper
return XRT_SUCCESS;
}
-#ifndef XRT_OS_ANDROID
int
-ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi)
+ipc_server_main_common(const struct ipc_server_main_info *ismi,
+ const struct ipc_server_callbacks *callbacks,
+ void *data)
{
xrt_result_t xret = XRT_SUCCESS;
int ret = -1;
@@ -1002,11 +1003,8 @@ ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi)
xret = init_all(s, log_level);
U_LOG_CHK_ONLY_PRINT(log_level, xret, "init_all");
if (xret != XRT_SUCCESS) {
-#ifdef XRT_OS_LINUX
- // Print information how to debug issues.
- print_linux_end_user_failed_information(log_level);
-#endif
-
+ // Propegate the failure.
+ callbacks->init_failed(xret, data);
u_debug_gui_stop(&s->debug_gui);
free(s);
return -1;
@@ -1015,13 +1013,15 @@ ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi)
// Start the debug UI now (if enabled).
u_debug_gui_start(s->debug_gui, s->xinst, s->xsysd);
-#ifdef XRT_OS_LINUX
- // Print a very clear service started message.
- print_linux_end_user_started_information(log_level);
-#endif
+ // Tell the callbacks we are entering the main-loop.
+ callbacks->mainloop_entering(s, s->xinst, data);
+
// Main loop.
ret = main_loop(s);
+ // Tell the callbacks we are leaving the main-loop.
+ callbacks->mainloop_leaving(s, s->xinst, data);
+
// Stop the UI before tearing everything down.
u_debug_gui_stop(&s->debug_gui);
@@ -1038,39 +1038,43 @@ ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi)
return ret;
}
-#endif // !XRT_OS_ANDROID
-
-#ifdef XRT_OS_ANDROID
-int
-ipc_server_main_android(struct ipc_server **ps, void (*startup_complete_callback)(void *data), void *data)
-{
- xrt_result_t xret = XRT_SUCCESS;
- int ret = -1;
-
- // Get log level first.
- enum u_logging_level log_level = debug_get_log_option_ipc_log();
- struct ipc_server *s = U_TYPED_CALLOC(struct ipc_server);
- U_LOG_D("Created IPC server!");
-
- xret = init_all(s, log_level);
- U_LOG_CHK_ONLY_PRINT(log_level, xret, "init_all");
- if (xret != XRT_SUCCESS) {
- free(s);
- startup_complete_callback(data);
- return -1;
- }
+#ifndef XRT_OS_ANDROID
- *ps = s;
- startup_complete_callback(data);
+static void
+init_failed(xrt_result_t xret, void *data)
+{
+#ifdef XRT_OS_LINUX
+ // Print information how to debug issues.
+ print_linux_end_user_failed_information(debug_get_log_option_ipc_log());
+#endif
+}
- ret = main_loop(s);
+static void
+mainloop_entering(struct ipc_server *s, struct xrt_instance *xinst, void *data)
+{
+#ifdef XRT_OS_LINUX
+ // Print a very clear service started message.
+ print_linux_end_user_started_information(s->log_level);
+#endif
+}
- teardown_all(s);
- free(s);
+static void
+mainloop_leaving(struct ipc_server *s, struct xrt_instance *xinst, void *data)
+{
+ // No-op
+}
- U_LOG_I("Server exiting '%i'!", ret);
+int
+ipc_server_main(int argc, char **argv, const struct ipc_server_main_info *ismi)
+{
+ const struct ipc_server_callbacks callbacks = {
+ .init_failed = init_failed,
+ .mainloop_entering = mainloop_entering,
+ .mainloop_leaving = mainloop_leaving,
+ };
- return ret;
+ return ipc_server_main_common(ismi, &callbacks, NULL);
}
-#endif // XRT_OS_ANDROID
+
+#endif // !XRT_OS_ANDROID
diff --git a/src/xrt/targets/service-lib/service_target.cpp b/src/xrt/targets/service-lib/service_target.cpp
index 45877803d3..71c581da6b 100644
--- a/src/xrt/targets/service-lib/service_target.cpp
+++ b/src/xrt/targets/service-lib/service_target.cpp
@@ -1,4 +1,5 @@
// Copyright 2020, Collabora, Ltd.
+// Copyright 2024, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
@@ -41,10 +42,11 @@ public:
}
void
- signalStartupComplete()
+ signalStartupComplete(ipc_server *s)
{
std::unique_lock<std::mutex> lock{server_mutex};
startup_complete = true;
+ server = s;
startup_cond.notify_all();
}
@@ -53,15 +55,27 @@ public:
{
std::unique_lock lock(server_mutex);
if (!server && !server_thread) {
- server_thread = std::make_unique<std::thread>(
- [&]() { ipc_server_main_android(&server, signalStartupCompleteTrampoline, this); });
+ server_thread =
+ std::make_unique<std::thread>([&]() { ipc_server_main_common(&ismi, &callbacks, this); });
}
}
static void
- signalStartupCompleteTrampoline(void *data)
+ signalInitFailed(xrt_result_t xret, void *data)
{
- static_cast<IpcServerHelper *>(data)->signalStartupComplete();
+ static_cast<IpcServerHelper *>(data)->signalStartupComplete(nullptr);
+ }
+
+ static void
+ signalStartupCompleteTrampoline(ipc_server *s, xrt_instance *xsint, void *data)
+ {
+ static_cast<IpcServerHelper *>(data)->signalStartupComplete(s);
+ }
+
+ static void
+ signalShuttingDownTrampoline(ipc_server *s, xrt_instance *xsint, void *data)
+ {
+ // No-op
}
int32_t
@@ -114,6 +128,20 @@ private:
return server && completed;
}
+ const struct ipc_server_main_info ismi = {
+ .udgci =
+ {
+ .window_title = "Monado Android Service",
+ .open = U_DEBUG_GUI_OPEN_NEVER,
+ },
+ };
+
+ const struct ipc_server_callbacks callbacks = {
+ .init_failed = signalInitFailed,
+ .mainloop_entering = signalStartupCompleteTrampoline,
+ .mainloop_leaving = signalShuttingDownTrampoline,
+ };
+
//! Reference to the ipc_server, managed by ipc_server_process
struct ipc_server *server = NULL;
--
GitLab
+2
View File
@@ -79,6 +79,7 @@ if (WIVRN_BUILD_SERVER)
main.cpp
sleep_inhibitor.cpp
start_application.cpp
ipc_server_cb.cpp
target_instance_wivrn.cpp
wivrn_ipc.cpp
@@ -86,6 +87,7 @@ if (WIVRN_BUILD_SERVER)
encoder/encoder_settings.cpp
encoder/video_encoder.cpp
encoder/video_encoder_raw.cpp
driver/app_pacer.cpp
driver/clock_offset.cpp
+1
View File
@@ -64,6 +64,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(
{h265, "hevc"},
{av1, "av1"},
{av1, "AV1"},
{raw, "raw"},
})
NLOHMANN_JSON_SERIALIZE_ENUM(
+4 -19
View File
@@ -75,7 +75,7 @@ wivrn_hmd::wivrn_hmd(wivrn::wivrn_session * cnx,
.supported = {
.orientation_tracking = true,
.position_tracking = true,
.presence = true,
.presence = info.user_presence,
.battery_status = true,
},
.update_inputs = [](xrt_device *) { return XRT_SUCCESS; },
@@ -231,28 +231,13 @@ void wivrn_hmd::update_visibility_mask(const from_headset::visibility_mask_chang
m->at(mask.view_index) = mask.data;
}
bool wivrn_hmd::update_presence(bool new_presence, bool real)
bool wivrn_hmd::update_presence(bool new_presence)
{
// if this presence change comes from headset, always honor it,
// otherwise try to keep it in sync with the real presence,
// while still changing presence to false when session is not
// visible
if (real || new_presence == this->real_presence || !new_presence)
if (this->presence.exchange(new_presence) != new_presence)
{
if (real && this->real_presence != new_presence)
{
U_LOG_I("Updating real user presence: %s -> %s", real_presence ? "true" : "false", new_presence ? "true" : "false");
this->real_presence = new_presence;
}
if (this->presence == new_presence)
return false;
U_LOG_I("Updating user presence: %s -> %s", this->presence ? "true" : "false", new_presence ? "true" : "false");
this->presence = new_presence;
U_LOG_I("user presence changed to %s", new_presence ? "true" : "false");
return true;
}
return false;
}
} // namespace wivrn
+1 -6
View File
@@ -54,10 +54,6 @@ class wivrn_hmd : public xrt_device
from_headset::battery battery{};
std::atomic<bool> presence{true};
// last XR_EVENT_DATA_USER_PRESENCE_CHANGED_EXT from headset
// we must keep track of this to not go out of sync with headset when
// a session state change also triggers presence change
std::atomic<bool> real_presence{true};
thread_safe<std::array<std::optional<from_headset::visibility_mask_changed::masks>, 2>> visibility_mask;
wivrn::wivrn_session * cnx;
@@ -86,7 +82,6 @@ public:
void update_battery(const from_headset::battery &);
void update_tracking(const from_headset::tracking &, const clock_offset &);
void update_visibility_mask(const from_headset::visibility_mask_changed &);
// real if this update comes from a presence changed event
bool update_presence(bool new_presence, bool real);
bool update_presence(bool);
};
} // namespace wivrn
+90 -28
View File
@@ -25,6 +25,8 @@
#include "main/comp_compositor.h"
#include "main/comp_main_interface.h"
#include "main/comp_target.h"
#include "server/ipc_server.h"
#include "target_instance_wivrn.h"
#include "util/u_builders.h"
#include "util/u_logging.h"
#include "util/u_system.h"
@@ -139,7 +141,7 @@ bool wivrn::tracking_control_t::set_enabled(to_headset::tracking_control::id id,
return changed;
}
wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system & system) :
wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection, instance & inst, u_system & system) :
xrt_system_devices{
.get_roles = [](xrt_system_devices * self, xrt_system_roles * out_roles) { return ((wivrn_session *)self)->get_roles(out_roles); },
.feature_inc = [](xrt_system_devices * self, xrt_device_feature_type f) { return ((wivrn_session *)self)->feature_inc(f); },
@@ -147,6 +149,7 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
.destroy = [](xrt_system_devices * self) { delete ((wivrn_session *)self); },
},
connection(std::move(connection)),
inst(inst),
xrt_system(system),
hmd(this, get_info()),
left_controller(0, &hmd, this),
@@ -305,6 +308,7 @@ wivrn_session::~wivrn_session()
}
xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connection> connection,
instance & inst,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
@@ -313,7 +317,7 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
std::unique_ptr<wivrn_session> self;
try
{
self.reset(new wivrn_session(std::move(connection), system));
self.reset(new wivrn_session(std::move(connection), inst, system));
}
catch (std::exception & e)
{
@@ -330,6 +334,7 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
U_LOG_E("Failed to create system compositor");
return xret;
}
self->system_compositor = *out_xsysc;
u_builder_create_space_overseer_legacy(
&self->xrt_system.broadcast,
@@ -668,49 +673,34 @@ void wivrn_session::operator()(from_headset::session_state_changed && event)
{
U_LOG_I("Session state changed: %s", xr::to_string(event.state));
bool visible, focused;
bool changed = false;
switch (event.state)
{
case XR_SESSION_STATE_SYNCHRONIZED:
visible = false;
focused = false;
changed = hmd.update_presence(false, false);
break;
case XR_SESSION_STATE_VISIBLE:
visible = true;
focused = false;
changed = hmd.update_presence(true, false);
break;
case XR_SESSION_STATE_FOCUSED:
visible = true;
focused = true;
changed = hmd.update_presence(true, false);
break;
default:
return;
visible = false;
focused = false;
break;
}
if (changed)
scoped_lock lock(inst.server->global_state.lock);
for (auto & t: inst.server->threads)
{
xrt_session_event_user_presence_change event = {
.type = XRT_SESSION_EVENT_USER_PRESENCE_CHANGE,
};
hmd.get_presence(&event.is_user_present);
push_event({.presence_change = event});
if (t.ics.server_thread_index < 0 or t.ics.xc == nullptr)
continue;
bool current = t.ics.client_state.session_overlay or
inst.server->global_state.active_client_index == t.ics.server_thread_index;
xrt_syscomp_set_state(system_compositor, t.ics.xc, visible and current, focused and current);
}
push_event(
{
.state = {
.type = XRT_SESSION_EVENT_STATE_CHANGE,
.visible = visible,
.focused = focused,
},
});
}
void wivrn_session::operator()(from_headset::user_presence_changed && event)
{
if (hmd.update_presence(event.present, true))
if (hmd.update_presence(event.present))
push_event(
{
.presence_change = {
@@ -793,6 +783,54 @@ void wivrn_session::operator()(const from_headset::start_app & request)
send_to_main(request);
}
void wivrn_session::operator()(const from_headset::get_running_applications &)
{
scoped_lock lock(inst.server->global_state.lock);
to_headset::running_applications msg{};
for (auto & t: inst.server->threads)
{
if (t.ics.server_thread_index < 0 or t.ics.xc == nullptr)
continue;
// nasty volatile
std::array<char, sizeof(t.ics.client_state.info.application_name)> tmp;
for (size_t i = 0; i + 1 < tmp.size(); ++i)
tmp[i] = t.ics.client_state.info.application_name[i];
tmp.back() = 0;
msg.applications.push_back(
{
.name = std::string(tmp.data()),
.id = t.ics.client_state.id,
.overlay = t.ics.client_state.session_overlay,
.active = t.ics.server_thread_index == inst.server->global_state.active_client_index,
});
}
connection->send_control(std::move(msg));
}
void wivrn_session::operator()(const from_headset::set_active_application & req)
{
ipc_server_set_active_client(inst.server, req.id);
ipc_server_update_state(inst.server);
// Send a refreshed application list
(*this)(from_headset::get_running_applications{});
}
void wivrn_session::operator()(const from_headset::stop_application & req)
{
scoped_lock lock(inst.server->global_state.lock);
for (auto & t: inst.server->threads)
{
if (t.ics.client_state.id == req.id)
{
U_LOG_I("Notify session loss pending for %s", t.ics.client_state.info.application_name);
auto when = os_monotonic_get_ns() + 200 * U_TIME_1MS_IN_NS;
xrt_syscomp_notify_loss_pending(system_compositor, t.ics.xc, when);
session_loss.lock()->emplace(when, req.id);
break;
}
}
}
void wivrn_session::operator()(audio_data && data)
{
if (audio_handle)
@@ -877,6 +915,7 @@ void wivrn_session::run(std::stop_token stop)
refresh.adjust(*connection);
}
}
poll_session_loss();
connection->poll(*this, 20);
}
catch (const std::exception & e)
@@ -980,6 +1019,29 @@ void wivrn_session::reconnect()
}
}
void wivrn_session::poll_session_loss()
{
auto locked = session_loss.lock();
auto now = os_monotonic_get_ns();
if (locked->empty())
return;
auto it = locked->begin();
scoped_lock lock(inst.server->global_state.lock);
while (it != locked->end() and it->first <= now)
{
for (auto & t: inst.server->threads)
{
if (t.ics.client_state.id == it->second)
{
U_LOG_I("Terminating %s", t.ics.client_state.info.application_name);
xrt_syscomp_notify_lost(system_compositor, t.ics.xc);
break;
}
}
it = locked->erase(it);
}
}
xrt_result_t wivrn_session::get_roles(xrt_system_roles * out_roles)
{
std::lock_guard lock(roles_mutex);
+15 -1
View File
@@ -21,6 +21,7 @@
#include "clock_offset.h"
#include "driver/app_pacer.h"
#include "utils/thread_safe.h"
#include "wivrn_connection.h"
#include "wivrn_controller.h"
#include "wivrn_hand_interaction.h"
@@ -31,6 +32,7 @@
#include "xrt/xrt_system.h"
#include <atomic>
#include <fstream>
#include <map>
#include <memory>
#include <mutex>
#include <shared_mutex>
@@ -43,6 +45,7 @@ union xrt_session_event;
namespace wivrn
{
class instance;
class wivrn_eye_tracker;
class wivrn_fb_face2_tracker;
class wivrn_htc_face_tracker;
@@ -92,10 +95,12 @@ class wivrn_session : public xrt_system_devices
{
friend wivrn_comp_target_factory;
std::unique_ptr<wivrn_connection> connection;
instance & inst;
pacing_app_factory app_pacers;
u_system & xrt_system;
xrt_space_overseer * space_overseer;
xrt_system_compositor * system_compositor;
std::mutex roles_mutex;
xrt_system_roles roles{
@@ -131,14 +136,18 @@ class wivrn_session : public xrt_system_devices
std::shared_ptr<audio_device> audio_handle;
// when sessions shall be destroyed, key is timestap, value is client id
thread_safe<std::map<int64_t, int32_t>> session_loss;
std::jthread thread;
wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system &);
wivrn_session(std::unique_ptr<wivrn_connection> connection, instance &, u_system &);
public:
~wivrn_session();
static xrt_result_t create_session(std::unique_ptr<wivrn_connection> connection,
instance & instance,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
@@ -188,6 +197,9 @@ public:
void operator()(from_headset::override_foveation_center &&);
void operator()(from_headset::get_application_list &&);
void operator()(const from_headset::start_app &);
void operator()(const from_headset::get_running_applications &);
void operator()(const from_headset::set_active_application &);
void operator()(const from_headset::stop_application &);
void operator()(audio_data &&);
void operator()(to_monado::disconnect &&);
@@ -219,6 +231,8 @@ private:
void run(std::stop_token stop);
void reconnect();
void poll_session_loss();
// xrt_system implementation
xrt_result_t get_roles(xrt_system_roles * out_roles);
xrt_result_t feature_inc(xrt_device_feature_type type);
+4
View File
@@ -70,6 +70,7 @@ static void split_bitrate(std::vector<wivrn::encoder_settings> & encoders, uint6
break;
case wivrn::h265:
case wivrn::av1:
case wivrn::raw:
break;
}
encoder.bitrate = w;
@@ -296,6 +297,9 @@ static void fill_defaults(wivrn_vk_bundle & bundle, const std::vector<wivrn::vid
config.codec = h264; // this will fail if 10-bit is enabled
#endif
if (config.name == encoder_raw)
config.codec = raw;
if (not config.codec)
config.codec = bit_depth == 10 ? h265 : h264;
}
@@ -58,6 +58,8 @@ const char * encoder(video_codec codec)
return "hevc_vaapi";
case video_codec::av1:
return "av1_vaapi";
case video_codec::raw:
break;
}
throw std::runtime_error("invalid codec " + std::to_string(int(codec)));
}
@@ -239,6 +241,8 @@ video_encoder_va::video_encoder_va(wivrn_vk_bundle & vk,
case video_codec::av1:
encoder_ctx->profile = FF_PROFILE_AV1_MAIN;
break;
case video_codec::raw:
throw std::runtime_error("raw codec not supported");
}
for (auto option: settings.options)
{
+12
View File
@@ -42,6 +42,7 @@
#include "video_encoder_vulkan_h264.h"
// #include "video_encoder_vulkan_h265.h"
#endif
#include "video_encoder_raw.h"
namespace wivrn
{
@@ -126,6 +127,8 @@ std::unique_ptr<video_encoder> video_encoder::create(
// break;
case video_codec::av1:
throw std::runtime_error("av1 not supported for vulkan video encode");
case video_codec::raw:
throw std::runtime_error("raw codec only supported on raw encoder");
}
#else
throw std::runtime_error("Vulkan video encode not enabled");
@@ -155,6 +158,12 @@ std::unique_ptr<video_encoder> video_encoder::create(
throw std::runtime_error("vaapi support not enabled");
#endif
}
if (settings.encoder_name == encoder_raw)
{
res = std::make_unique<video_encoder_raw>(wivrn_vk, settings, fps, stream_idx);
}
if (not res)
throw std::runtime_error("Failed to create encoder " + settings.encoder_name);
@@ -174,6 +183,9 @@ std::unique_ptr<video_encoder> video_encoder::create(
case av1:
file += ".av1";
break;
case raw:
file += ".yuv";
break;
}
res->video_dump.open(file);
}
+1
View File
@@ -43,6 +43,7 @@ inline const char * encoder_nvenc = "nvenc";
inline const char * encoder_vaapi = "vaapi";
inline const char * encoder_x264 = "x264";
inline const char * encoder_vulkan = "vulkan";
inline const char * encoder_raw = "raw";
class video_encoder
{
+4
View File
@@ -74,6 +74,8 @@ static auto encode_guid(video_codec codec)
return NV_ENC_CODEC_HEVC_GUID;
case av1:
return NV_ENC_CODEC_AV1_GUID;
case raw:
break;
}
throw std::out_of_range("Invalid codec " + std::to_string(codec));
}
@@ -164,6 +166,8 @@ video_encoder_nvenc::video_encoder_nvenc(
params.encodeCodecConfig.av1Config.maxNumRefFramesInDPB = 0;
params.encodeCodecConfig.av1Config.idrPeriod = NVENC_INFINITE_GOPLENGTH;
break;
case video_codec::raw:
throw std::runtime_error("raw codec not supported for nvenc");
}
NV_ENC_INITIALIZE_PARAMS params2{
+121
View File
@@ -0,0 +1,121 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "video_encoder_raw.h"
#include "encoder/encoder_settings.h"
#include "utils/wivrn_vk_bundle.h"
wivrn::video_encoder_raw::video_encoder_raw(
wivrn_vk_bundle & vk,
encoder_settings & settings,
float fps,
uint8_t stream_idx) :
video_encoder(stream_idx, settings.channels, settings.bitrate_multiplier, true)
{
if (settings.bit_depth != 8)
throw std::runtime_error("Raw encoding is only supported for 8 bit");
rect = vk::Rect2D{
.offset = {
.x = settings.offset_x,
.y = settings.offset_y,
},
.extent = {
.width = settings.width,
.height = settings.height,
},
};
vk::DeviceSize buffer_size = settings.width * settings.height;
switch (settings.channels)
{
case to_headset::video_stream_description::channels_t::colour:
buffer_size += buffer_size / 2;
break;
case to_headset::video_stream_description::channels_t::alpha:
break;
}
for (auto & slot: buffers)
{
slot = buffer_allocation(
vk.device,
{
.size = buffer_size,
.usage = vk::BufferUsageFlagBits::eTransferDst,
},
{
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
.usage = VMA_MEMORY_USAGE_AUTO,
},
"raw stream buffer");
}
}
std::pair<bool, vk::Semaphore> wivrn::video_encoder_raw::present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t)
{
std::array regions{
vk::BufferImageCopy{
.imageSubresource = {
.aspectMask = vk::ImageAspectFlagBits::ePlane0,
.baseArrayLayer = uint32_t(channels),
.layerCount = 1,
},
.imageOffset = {
.x = rect.offset.x,
.y = rect.offset.y,
},
.imageExtent = {
.width = rect.extent.width,
.height = rect.extent.height,
.depth = 1,
},
},
vk::BufferImageCopy{
.bufferOffset = rect.extent.width * rect.extent.height,
.imageSubresource = {
.aspectMask = vk::ImageAspectFlagBits::ePlane1,
.baseArrayLayer = uint32_t(channels),
.layerCount = 1,
},
.imageOffset = {
.x = rect.offset.x / 2,
.y = rect.offset.y / 2,
},
.imageExtent = {
.width = rect.extent.width / 2,
.height = rect.extent.height / 2,
.depth = 1,
},
},
};
cmd_buf.copyImageToBuffer(
y_cbcr,
vk::ImageLayout::eTransferSrcOptimal,
buffers[slot],
std::span(regions.data(),
channels == to_headset::video_stream_description::channels_t::colour ? 2 : 1));
return {false, nullptr};
}
std::optional<wivrn::video_encoder::data> wivrn::video_encoder_raw::encode(bool idr, std::chrono::steady_clock::time_point pts, uint8_t slot)
{
return wivrn::video_encoder::data{
.encoder = this,
.span = std::span<uint8_t>((uint8_t *)buffers[slot].map(), buffers[slot].info().size),
};
}
+41
View File
@@ -0,0 +1,41 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "video_encoder.h"
#include "vk/allocation.h"
#include <array>
namespace wivrn
{
class video_encoder_raw : public video_encoder
{
std::array<buffer_allocation, num_slots> buffers;
vk::Rect2D rect;
public:
video_encoder_raw(wivrn_vk_bundle & vk, encoder_settings & settings, float fps, uint8_t stream_idx);
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
std::optional<data> encode(bool idr, std::chrono::steady_clock::time_point pts, uint8_t slot) override;
};
} // namespace wivrn
+48
View File
@@ -0,0 +1,48 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ipc_server_cb.h"
#include "target_instance_wivrn.h"
#include "utils/method.h"
namespace wivrn
{
void ipc_server_cb::init_failed(xrt_result res)
{
}
void ipc_server_cb::mainloop_entering(ipc_server * server, xrt_instance * xrt_inst)
{
auto inst = static_cast<wivrn::instance *>(xrt_inst);
inst->server = server;
}
void ipc_server_cb::mainloop_leaving(ipc_server * server, xrt_instance * xrt_inst)
{
auto inst = static_cast<wivrn::instance *>(xrt_inst);
inst->server = nullptr;
}
ipc_server_cb::ipc_server_cb() :
ipc_server_callbacks{
.init_failed = method_pointer2<&ipc_server_cb::init_failed>,
.mainloop_entering = method_pointer2<&ipc_server_cb::mainloop_entering>,
.mainloop_leaving = method_pointer2<&ipc_server_cb::mainloop_leaving>,
}
{}
} // namespace wivrn
+35
View File
@@ -0,0 +1,35 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "server/ipc_server_interface.h"
namespace wivrn
{
class ipc_server_cb : public ipc_server_callbacks
{
void init_failed(xrt_result);
void mainloop_entering(ipc_server *, xrt_instance *);
void mainloop_leaving(ipc_server *, xrt_instance *);
public:
using base = void;
ipc_server_cb();
};
} // namespace wivrn
+4 -3
View File
@@ -16,6 +16,7 @@
#include "driver/wivrn_connection.h"
#include "exit_codes.h"
#include "hostname.h"
#include "ipc_server_cb.h"
#include "protocol_version.h"
#include "start_application.h"
#include "utils/overloaded.h"
@@ -48,7 +49,6 @@
#include <glib.h>
#include <libnotify/notify.h>
#include <server/ipc_server_interface.h>
#include <shared/ipc_protocol.h>
#include <util/u_file.h>
@@ -249,11 +249,12 @@ void start_server(configuration config)
// foveation code does not allow oversampling
setenv("XRT_COMPOSITOR_SCALE_PERCENTAGE", "100", true);
// FIXME: synchronization fails on gfx pipeline
setenv("XRT_COMPOSITOR_COMPUTE", "1", true);
setenv("AMD_DEBUG", "lowlatencyenc", false);
wivrn::ipc_server_cb server_cb;
ipc_server_main_info server_info{
.udgci = {
.window_title = "WiVRn",
@@ -267,7 +268,7 @@ void start_server(configuration config)
try
{
exit(ipc_server_main(0, 0, &server_info /*argc, argv, ismi*/));
exit(ipc_server_main_common(&server_info, &server_cb, nullptr));
}
catch (std::exception & e)
{
+40 -39
View File
@@ -1,16 +1,28 @@
// Copyright 2020-2022, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Shared default implementation of the instance with compositor.
* @author Jakob Bornecrantz <jakob@collabora.com>
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "target_instance_wivrn.h"
#include "utils/method.h"
#include "xrt/xrt_instance.h"
#include "xrt/xrt_system.h"
#include "os/os_time.h"
#include "util/u_system.h"
#include "util/u_trace_marker.h"
@@ -19,18 +31,13 @@
#include "driver/wivrn_session.h"
#include "wivrn_ipc.h"
/*
*
* Internal functions.
*
*/
static xrt_result_t
wivrn_instance_create_system(struct xrt_instance * xinst,
struct xrt_system ** out_xsys,
struct xrt_system_devices ** out_xsysd,
struct xrt_space_overseer ** out_xspovrs,
struct xrt_system_compositor ** out_xsysc)
namespace wivrn
{
xrt_result_t instance::create_system(
struct xrt_system ** out_xsys,
struct xrt_system_devices ** out_xsysd,
struct xrt_space_overseer ** out_xspovrs,
struct xrt_system_compositor ** out_xsysc)
{
assert(out_xsysd != NULL);
assert(*out_xsysd == NULL);
@@ -41,6 +48,7 @@ wivrn_instance_create_system(struct xrt_instance * xinst,
struct xrt_system_compositor * xsysc = NULL;
auto res = wivrn::wivrn_session::create_session(
std::move(connection),
*this,
*u_sys,
out_xsysd,
out_xspovrs,
@@ -49,36 +57,29 @@ wivrn_instance_create_system(struct xrt_instance * xinst,
return res;
}
static void
wivrn_instance_destroy(struct xrt_instance * xinst)
{
delete xinst;
}
static xrt_result_t
wivrn_instance_get_prober(struct xrt_instance * xinst, struct xrt_prober ** out_xp)
xrt_result_t instance::get_prober(struct xrt_prober ** out_xp)
{
*out_xp = nullptr;
return XRT_ERROR_PROBER_NOT_SUPPORTED;
}
/*
*
* Exported function(s).
*
*/
instance::instance() :
xrt_instance{
.create_system = method_pointer<&instance::create_system>,
.get_prober = method_pointer<&instance::get_prober>,
.destroy = [](xrt_instance * ptr) { delete (instance *)ptr; },
.startup_timestamp = os_monotonic_get_ns(),
}
{
}
} // namespace wivrn
xrt_result_t
xrt_instance_create(struct xrt_instance_info * ii, struct xrt_instance ** out_xinst)
{
u_trace_marker_init();
*out_xinst = new xrt_instance{
.create_system = wivrn_instance_create_system,
.get_prober = wivrn_instance_get_prober,
.destroy = wivrn_instance_destroy,
.startup_timestamp = os_monotonic_get_ns(),
};
*out_xinst = new wivrn::instance();
return XRT_SUCCESS;
}
+41
View File
@@ -0,0 +1,41 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "server/ipc_server.h"
#include "xrt/xrt_instance.h"
namespace wivrn
{
class instance : public xrt_instance
{
xrt_result_t create_system(
xrt_system **,
xrt_system_devices **,
xrt_space_overseer **,
xrt_system_compositor **);
xrt_result_t get_prober(xrt_prober **);
public:
ipc_server * server = nullptr;
using base = xrt_instance;
instance();
};
} // namespace wivrn
+8
View File
@@ -32,6 +32,10 @@ struct method_trait<Method, Result (Class::*)(Args...)>
{
return std::invoke(Method, static_cast<Class *>(arg), args...);
}
static Result magic2(Args... args, Class::base * arg)
{
return std::invoke(Method, static_cast<Class *>(arg), args...);
}
};
} // namespace details
@@ -54,4 +58,8 @@ namespace wivrn
// }
template <auto Method>
auto method_pointer = ::details::method_trait<Method>::magic;
// same, but "this" argument is last
template <auto Method>
auto method_pointer2 = ::details::method_trait<Method>::magic2;
} // namespace wivrn