Drop xrt::drivers namespace
This commit is contained in:
@@ -48,9 +48,9 @@ struct wivrn::android::decoder::mapped_hardware_buffer
|
||||
|
||||
namespace
|
||||
{
|
||||
const char * mime(xrt::drivers::wivrn::video_codec codec)
|
||||
const char * mime(wivrn::video_codec codec)
|
||||
{
|
||||
using c = xrt::drivers::wivrn::video_codec;
|
||||
using c = wivrn::video_codec;
|
||||
switch (codec)
|
||||
{
|
||||
case c::h264:
|
||||
@@ -80,7 +80,7 @@ namespace wivrn::android
|
||||
decoder::decoder(
|
||||
vk::raii::Device & device,
|
||||
vk::raii::PhysicalDevice & physical_device,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_description::item & description,
|
||||
const wivrn::to_headset::video_stream_description::item & description,
|
||||
float fps,
|
||||
uint8_t stream_index,
|
||||
std::weak_ptr<scenes::stream> weak_scene,
|
||||
@@ -219,7 +219,7 @@ void decoder::push_data(std::span<std::span<const uint8_t>> data, uint64_t frame
|
||||
current_input_buffer = input_buffer{};
|
||||
}
|
||||
|
||||
void decoder::frame_completed(xrt::drivers::wivrn::from_headset::feedback & feedback, const xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info, const xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t & view_info)
|
||||
void decoder::frame_completed(wivrn::from_headset::feedback & feedback, const wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info, const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info)
|
||||
{
|
||||
if (not media_codec)
|
||||
{
|
||||
@@ -532,11 +532,11 @@ static bool hardware_accelerated(AMediaCodec * media_codec)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<xrt::drivers::wivrn::video_codec> decoder::supported_codecs()
|
||||
std::vector<wivrn::video_codec> decoder::supported_codecs()
|
||||
{
|
||||
std::vector<xrt::drivers::wivrn::video_codec> result;
|
||||
std::vector<wivrn::video_codec> result;
|
||||
|
||||
for (auto codec: std::ranges::reverse_view(magic_enum::enum_values<xrt::drivers::wivrn::video_codec>()))
|
||||
for (auto codec: std::ranges::reverse_view(magic_enum::enum_values<wivrn::video_codec>()))
|
||||
{
|
||||
AMediaCodec_ptr media_codec(AMediaCodec_createDecoderByType(mime(codec)));
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ public:
|
||||
{
|
||||
void operator()(AImage *);
|
||||
};
|
||||
xrt::drivers::wivrn::from_headset::feedback feedback;
|
||||
xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t timing_info;
|
||||
xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
|
||||
wivrn::from_headset::feedback feedback;
|
||||
wivrn::to_headset::video_stream_data_shard::timing_info_t timing_info;
|
||||
wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
|
||||
vk::raii::ImageView & image_view;
|
||||
vk::Image image = nullptr;
|
||||
vk::ImageLayout * current_layout = nullptr;
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
xrt::drivers::wivrn::to_headset::video_stream_description::item description;
|
||||
wivrn::to_headset::video_stream_description::item description;
|
||||
float fps;
|
||||
|
||||
vk::raii::Device & device;
|
||||
@@ -117,9 +117,9 @@ private:
|
||||
|
||||
struct frame_info
|
||||
{
|
||||
xrt::drivers::wivrn::from_headset::feedback feedback;
|
||||
xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t timing_info;
|
||||
xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
|
||||
wivrn::from_headset::feedback feedback;
|
||||
wivrn::to_headset::video_stream_data_shard::timing_info_t timing_info;
|
||||
wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
|
||||
};
|
||||
utils::sync_queue<frame_info> frame_infos;
|
||||
|
||||
@@ -138,7 +138,7 @@ private:
|
||||
public:
|
||||
decoder(vk::raii::Device & device,
|
||||
vk::raii::PhysicalDevice & physical_device,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_description::item & description,
|
||||
const wivrn::to_headset::video_stream_description::item & description,
|
||||
float fps,
|
||||
uint8_t stream_index,
|
||||
std::weak_ptr<scenes::stream> scene,
|
||||
@@ -151,9 +151,9 @@ public:
|
||||
void push_data(std::span<std::span<const uint8_t>> data, uint64_t frame_index, bool partial);
|
||||
|
||||
void frame_completed(
|
||||
xrt::drivers::wivrn::from_headset::feedback & feedback,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t & view_info);
|
||||
wivrn::from_headset::feedback & feedback,
|
||||
const wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info,
|
||||
const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info);
|
||||
|
||||
const auto & desc() const
|
||||
{
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
return extent;
|
||||
}
|
||||
|
||||
static std::vector<xrt::drivers::wivrn::video_codec> supported_codecs();
|
||||
static std::vector<wivrn::video_codec> supported_codecs();
|
||||
};
|
||||
|
||||
} // namespace wivrn::android
|
||||
|
||||
@@ -45,9 +45,9 @@ static void free_frame(AVFrame * frame)
|
||||
av_frame_free(&frame);
|
||||
}
|
||||
|
||||
static AVCodecID codec_id(xrt::drivers::wivrn::video_codec codec)
|
||||
static AVCodecID codec_id(wivrn::video_codec codec)
|
||||
{
|
||||
using c = xrt::drivers::wivrn::video_codec;
|
||||
using c = wivrn::video_codec;
|
||||
switch (codec)
|
||||
{
|
||||
case c::h264:
|
||||
@@ -73,7 +73,7 @@ decoder::blit_handle::~blit_handle()
|
||||
decoder::decoder(
|
||||
vk::raii::Device & device,
|
||||
vk::raii::PhysicalDevice & physical_device,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_description::item & description,
|
||||
const wivrn::to_headset::video_stream_description::item & description,
|
||||
float fps,
|
||||
uint8_t stream_index,
|
||||
std::weak_ptr<scenes::stream> scene,
|
||||
@@ -166,7 +166,7 @@ void decoder::push_data(std::span<std::span<const uint8_t>> data, uint64_t frame
|
||||
this->frame_index = frame_index;
|
||||
}
|
||||
|
||||
void decoder::frame_completed(const xrt::drivers::wivrn::from_headset::feedback & feedback, const xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info, const xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t & view_info)
|
||||
void decoder::frame_completed(const wivrn::from_headset::feedback & feedback, const wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info, const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info)
|
||||
{
|
||||
spdlog::trace("ffmpeg decoder:frame_completed {}", frame_index);
|
||||
AVPacket packet{};
|
||||
@@ -235,12 +235,12 @@ void decoder::frame_completed(const xrt::drivers::wivrn::from_headset::feedback
|
||||
scene->push_blit_handle(accumulator, std::move(handle));
|
||||
}
|
||||
|
||||
std::vector<xrt::drivers::wivrn::video_codec> decoder::supported_codecs()
|
||||
std::vector<wivrn::video_codec> decoder::supported_codecs()
|
||||
{
|
||||
return {
|
||||
xrt::drivers::wivrn::video_codec::h264,
|
||||
xrt::drivers::wivrn::video_codec::h265,
|
||||
xrt::drivers::wivrn::video_codec::av1,
|
||||
wivrn::video_codec::h264,
|
||||
wivrn::video_codec::h265,
|
||||
wivrn::video_codec::av1,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ class decoder
|
||||
public:
|
||||
struct blit_handle
|
||||
{
|
||||
xrt::drivers::wivrn::from_headset::feedback feedback;
|
||||
xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t timing_info;
|
||||
xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
|
||||
wivrn::from_headset::feedback feedback;
|
||||
wivrn::to_headset::video_stream_data_shard::timing_info_t timing_info;
|
||||
wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
|
||||
vk::raii::ImageView & image_view;
|
||||
vk::Image image = nullptr;
|
||||
vk::ImageLayout * current_layout = nullptr;
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
vk::Extent2D extent{};
|
||||
std::vector<int> free_images;
|
||||
|
||||
xrt::drivers::wivrn::to_headset::video_stream_description::item description;
|
||||
wivrn::to_headset::video_stream_description::item description;
|
||||
|
||||
std::unique_ptr<AVCodecContext, void (*)(AVCodecContext *)> codec;
|
||||
std::unique_ptr<SwsContext, void (*)(SwsContext *)> sws;
|
||||
@@ -93,7 +93,7 @@ private:
|
||||
public:
|
||||
decoder(vk::raii::Device & device,
|
||||
vk::raii::PhysicalDevice & physical_device,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_description::item & description,
|
||||
const wivrn::to_headset::video_stream_description::item & description,
|
||||
float fps,
|
||||
uint8_t stream_index,
|
||||
std::weak_ptr<scenes::stream> scene,
|
||||
@@ -105,9 +105,9 @@ public:
|
||||
void push_data(std::span<std::span<const uint8_t>> data, uint64_t frame_index, bool partial);
|
||||
|
||||
void frame_completed(
|
||||
const xrt::drivers::wivrn::from_headset::feedback & feedback,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_data_shard::view_info_t & view_info);
|
||||
const wivrn::from_headset::feedback & feedback,
|
||||
const wivrn::to_headset::video_stream_data_shard::timing_info_t & timing_info,
|
||||
const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info);
|
||||
|
||||
const auto & desc() const
|
||||
{
|
||||
@@ -124,6 +124,6 @@ public:
|
||||
return extent;
|
||||
}
|
||||
|
||||
static std::vector<xrt::drivers::wivrn::video_codec> supported_codecs();
|
||||
static std::vector<wivrn::video_codec> supported_codecs();
|
||||
};
|
||||
} // namespace ffmpeg
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "scenes/stream.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
using namespace xrt::drivers::wivrn::to_headset;
|
||||
using namespace wivrn::to_headset;
|
||||
using shard_set = shard_accumulator::shard_set;
|
||||
using data_shard = shard_accumulator::data_shard;
|
||||
|
||||
@@ -203,7 +203,7 @@ void shard_accumulator::try_submit_frame(uint16_t shard_idx)
|
||||
advance();
|
||||
}
|
||||
|
||||
void shard_accumulator::send_feedback(xrt::drivers::wivrn::from_headset::feedback & feedback)
|
||||
void shard_accumulator::send_feedback(wivrn::from_headset::feedback & feedback)
|
||||
{
|
||||
if (not feedback.received_last_packet)
|
||||
feedback.received_first_packet = application::now();
|
||||
|
||||
@@ -39,7 +39,7 @@ class shard_accumulator
|
||||
std::shared_ptr<decoder_impl> decoder;
|
||||
|
||||
public:
|
||||
using data_shard = xrt::drivers::wivrn::to_headset::video_stream_data_shard;
|
||||
using data_shard = wivrn::to_headset::video_stream_data_shard;
|
||||
struct shard_set
|
||||
{
|
||||
size_t min_for_reconstruction = -1;
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
std::optional<uint16_t> insert(data_shard &&);
|
||||
|
||||
xrt::drivers::wivrn::from_headset::feedback feedback{};
|
||||
wivrn::from_headset::feedback feedback{};
|
||||
|
||||
explicit shard_set(uint8_t stream_index);
|
||||
shard_set(const shard_set &) = default;
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
explicit shard_accumulator(
|
||||
vk::raii::Device & device,
|
||||
vk::raii::PhysicalDevice & physical_device,
|
||||
const xrt::drivers::wivrn::to_headset::video_stream_description::item & description,
|
||||
const wivrn::to_headset::video_stream_description::item & description,
|
||||
float fps,
|
||||
std::weak_ptr<scenes::stream> scene,
|
||||
uint8_t stream_index) :
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
next.reset(1);
|
||||
}
|
||||
|
||||
void push_shard(xrt::drivers::wivrn::to_headset::video_stream_data_shard &&);
|
||||
void push_shard(wivrn::to_headset::video_stream_data_shard &&);
|
||||
|
||||
auto & desc() const
|
||||
{
|
||||
@@ -106,6 +106,6 @@ public:
|
||||
private:
|
||||
void try_submit_frame(std::optional<uint16_t> shard_idx);
|
||||
void try_submit_frame(uint16_t shard_idx);
|
||||
void send_feedback(xrt::drivers::wivrn::from_headset::feedback & feedback);
|
||||
void send_feedback(wivrn::from_headset::feedback & feedback);
|
||||
void advance();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user