wivrn namespace: client/decoder/shard_accumulator

This commit is contained in:
Patrick Nicolas
2024-10-03 23:39:32 +02:00
parent 7b4086d482
commit efbcef2861
5 changed files with 22 additions and 8 deletions
+3
View File
@@ -46,7 +46,10 @@ DEUGLIFY(AImage)
DEUGLIFY(AImageReader)
DEUGLIFY(AMediaCodec)
namespace wivrn
{
class shard_accumulator;
}
namespace scenes
{
+4 -1
View File
@@ -27,7 +27,10 @@
#include <vector>
#include <vulkan/vulkan_raii.hpp>
namespace wivrn
{
class shard_accumulator;
}
extern "C"
{
@@ -126,4 +129,4 @@ public:
static std::vector<wivrn::video_codec> supported_codecs();
};
} // namespace ffmpeg
} // namespace wivrn::ffmpeg
+4
View File
@@ -22,6 +22,9 @@
#include "scenes/stream.h"
#include "spdlog/spdlog.h"
namespace wivrn
{
using namespace wivrn::to_headset;
using shard_set = shard_accumulator::shard_set;
using data_shard = shard_accumulator::data_shard;
@@ -211,3 +214,4 @@ void shard_accumulator::send_feedback(wivrn::from_headset::feedback & feedback)
if (scene)
scene->send_feedback(feedback);
}
} // namespace wivrn
+4
View File
@@ -34,6 +34,9 @@ using decoder_impl = ::wivrn::ffmpeg::decoder;
#include <optional>
#include <vector>
namespace wivrn
{
class shard_accumulator
{
std::shared_ptr<decoder_impl> decoder;
@@ -109,3 +112,4 @@ private:
void send_feedback(wivrn::from_headset::feedback & feedback);
void advance();
};
} // namespace wivrn
+7 -7
View File
@@ -52,15 +52,15 @@ private:
struct accumulator_images
{
std::unique_ptr<shard_accumulator> decoder;
std::unique_ptr<wivrn::shard_accumulator> decoder;
vk::raii::DescriptorSetLayout descriptor_set_layout = nullptr;
vk::DescriptorSet descriptor_set = nullptr;
vk::raii::PipelineLayout blit_pipeline_layout = nullptr;
vk::raii::Pipeline blit_pipeline = nullptr;
// latest frames from oldest to most recent
std::array<std::shared_ptr<shard_accumulator::blit_handle>, image_buffer_size> latest_frames;
std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, image_buffer_size> latest_frames;
std::shared_ptr<shard_accumulator::blit_handle> frame(std::optional<uint64_t> id) const;
std::shared_ptr<wivrn::shard_accumulator::blit_handle> frame(std::optional<uint64_t> id) const;
std::vector<uint64_t> frames() const;
};
@@ -68,7 +68,7 @@ private:
// for frames inside accumulator images
std::mutex frames_mutex;
std::vector<std::shared_ptr<shard_accumulator::blit_handle>> common_frame(XrTime display_time);
std::vector<std::shared_ptr<wivrn::shard_accumulator::blit_handle>> common_frame(XrTime display_time);
struct renderpass_output
{
@@ -125,7 +125,7 @@ private:
XrAction plots_toggle_2 = XR_NULL_HANDLE;
// Keep a reference to the resources needed to blit the images until vkWaitForFences
std::vector<std::shared_ptr<shard_accumulator::blit_handle>> current_blit_handles;
std::vector<std::shared_ptr<wivrn::shard_accumulator::blit_handle>> current_blit_handles;
stream() = default;
@@ -147,7 +147,7 @@ public:
void operator()(to_headset::video_stream_description &&);
void operator()(audio_data &&);
void push_blit_handle(shard_accumulator * decoder, std::shared_ptr<shard_accumulator::blit_handle> handle);
void push_blit_handle(wivrn::shard_accumulator * decoder, std::shared_ptr<wivrn::shard_accumulator::blit_handle> handle);
void send_feedback(const wivrn::from_headset::feedback & feedback);
@@ -231,7 +231,7 @@ private:
XrTime last_metric_time = 0;
int metrics_offset = 0;
void accumulate_metrics(XrTime predicted_display_time, const std::vector<std::shared_ptr<shard_accumulator::blit_handle>> & blit_handles, const gpu_timestamps & timestamps);
void accumulate_metrics(XrTime predicted_display_time, const std::vector<std::shared_ptr<wivrn::shard_accumulator::blit_handle>> & blit_handles, const gpu_timestamps & timestamps);
XrCompositionLayerQuad plot_performance_metrics(XrTime predicted_display_time);
void on_reference_space_changed(XrReferenceSpaceType space, XrTime) override;
};