Initial audio support
Co-authored-by: Guillaume Meunier <guillaume.meunier@centraliens.net>
This commit is contained in:
committed by
Guillaume Meunier
co-authored by
Guillaume Meunier
parent
b5417633a1
commit
2b4303272d
@@ -38,6 +38,7 @@
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vulkan/vulkan_core.h>
|
||||
#include "audio/audio.h"
|
||||
|
||||
using namespace xrt::drivers::wivrn;
|
||||
|
||||
@@ -90,6 +91,8 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
|
||||
if (info.available_refresh_rates.empty())
|
||||
spdlog::warn("Unable to detect refresh rates");
|
||||
|
||||
audio::get_audio_description(info);
|
||||
|
||||
self->network_session->send_control(info);
|
||||
|
||||
self->network_thread = std::thread(&stream::process_packets, self.get());
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vulkan/vulkan_core.h>
|
||||
#include "audio/audio.h"
|
||||
|
||||
namespace scenes
|
||||
{
|
||||
@@ -88,6 +89,8 @@ class stream : public scene, public std::enable_shared_from_this<stream>
|
||||
XrTime first_frame_time{};
|
||||
const float dbrightness = 2;
|
||||
|
||||
std::optional<audio> audio_handle;
|
||||
|
||||
stream() = default;
|
||||
|
||||
public:
|
||||
@@ -101,6 +104,7 @@ public:
|
||||
void operator()(to_headset::video_stream_parity_shard &&);
|
||||
void operator()(to_headset::haptics &&);
|
||||
void operator()(to_headset::timesync_query &&);
|
||||
void operator()(to_headset::audio_stream_description &&);
|
||||
void operator()(to_headset::video_stream_description &&);
|
||||
|
||||
VkFormat swapchain_format()
|
||||
|
||||
@@ -49,6 +49,13 @@ void scenes::stream::operator()(to_headset::video_stream_parity_shard && shard)
|
||||
shard_queue.push(std::move(shard));
|
||||
}
|
||||
|
||||
void scenes::stream::operator()(to_headset::audio_stream_description && desc)
|
||||
{
|
||||
std::visit([&](auto & address){
|
||||
audio_handle.emplace(desc, address);
|
||||
}, network_session->address);
|
||||
}
|
||||
|
||||
void scenes::stream::operator()(to_headset::video_stream_description && desc)
|
||||
{
|
||||
setup(desc);
|
||||
|
||||
Reference in New Issue
Block a user