Set WIVRN_USE_V4L2 in wivrn_config.h
This commit is contained in:
@@ -114,7 +114,6 @@ else()
|
|||||||
file(GLOB CLIENT_V4L2_SOURCE CONFIGURE_DEPENDS
|
file(GLOB CLIENT_V4L2_SOURCE CONFIGURE_DEPENDS
|
||||||
"decoder/v4l2/*.cpp")
|
"decoder/v4l2/*.cpp")
|
||||||
list(APPEND PLATFORM_SOURCE ${CLIENT_V4L2_SOURCE})
|
list(APPEND PLATFORM_SOURCE ${CLIENT_V4L2_SOURCE})
|
||||||
target_compile_definitions(wivrn PRIVATE WIVRN_USE_V4L2)
|
|
||||||
else()
|
else()
|
||||||
target_link_libraries(wivrn PkgConfig::LIBAV_CLIENT)
|
target_link_libraries(wivrn PkgConfig::LIBAV_CLIENT)
|
||||||
file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS
|
file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ void application::initialize_vulkan()
|
|||||||
optional_device_extensions.emplace(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME);
|
optional_device_extensions.emplace(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME);
|
||||||
optional_device_extensions.emplace(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME);
|
optional_device_extensions.emplace(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME);
|
||||||
|
|
||||||
#ifdef WIVRN_USE_V4L2
|
#if WIVRN_USE_V4L2
|
||||||
// V4L2 decoders expose their output through DMA-buf
|
// V4L2 decoders expose their output through DMA-buf
|
||||||
optional_device_extensions.emplace(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
|
optional_device_extensions.emplace(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
|
||||||
optional_device_extensions.emplace(VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME);
|
optional_device_extensions.emplace(VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME);
|
||||||
|
|||||||
@@ -20,13 +20,11 @@
|
|||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
#include "decoder/android/android_decoder.h"
|
#include "decoder/android/android_decoder.h"
|
||||||
#else
|
#elif WIVRN_USE_V4L2
|
||||||
#ifdef WIVRN_USE_V4L2
|
|
||||||
#include "decoder/v4l2/v4l2_decoder.h"
|
#include "decoder/v4l2/v4l2_decoder.h"
|
||||||
#else
|
#else
|
||||||
#include "decoder/ffmpeg/ffmpeg_decoder.h"
|
#include "decoder/ffmpeg/ffmpeg_decoder.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#include "decoder/raw_decoder.h"
|
#include "decoder/raw_decoder.h"
|
||||||
|
|
||||||
wivrn::decoder::~decoder() = default;
|
wivrn::decoder::~decoder() = default;
|
||||||
@@ -53,7 +51,7 @@ std::shared_ptr<wivrn::decoder> wivrn::decoder::make(
|
|||||||
stream_index,
|
stream_index,
|
||||||
scene,
|
scene,
|
||||||
acc);
|
acc);
|
||||||
#elifdef WIVRN_USE_V4L2
|
#elif WIVRN_USE_V4L2
|
||||||
return std::make_shared<wivrn::v4l2::decoder>(
|
return std::make_shared<wivrn::v4l2::decoder>(
|
||||||
device, phys_dev, vk_queue_family_index, description, stream_index, scene, acc);
|
device, phys_dev, vk_queue_family_index, description, stream_index, scene, acc);
|
||||||
#else
|
#else
|
||||||
@@ -78,7 +76,7 @@ static std::vector<wivrn::video_codec> supported_codecs_()
|
|||||||
std::vector<wivrn::video_codec> res;
|
std::vector<wivrn::video_codec> res;
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
wivrn::android::decoder::supported_codecs(res);
|
wivrn::android::decoder::supported_codecs(res);
|
||||||
#elifdef WIVRN_USE_V4L2
|
#elif WIVRN_USE_V4L2
|
||||||
wivrn::v4l2::decoder::supported_codecs(res);
|
wivrn::v4l2::decoder::supported_codecs(res);
|
||||||
#else
|
#else
|
||||||
wivrn::ffmpeg::decoder::supported_codecs(res);
|
wivrn::ffmpeg::decoder::supported_codecs(res);
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "wivrn_packets.h"
|
#include "wivrn_packets.h"
|
||||||
|
|
||||||
|
#include "wivrn_config.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <span>
|
#include <span>
|
||||||
@@ -46,7 +48,7 @@ public:
|
|||||||
vk::ImageLayout & current_layout;
|
vk::ImageLayout & current_layout;
|
||||||
vk::Semaphore semaphore = nullptr;
|
vk::Semaphore semaphore = nullptr;
|
||||||
uint64_t * semaphore_val = nullptr;
|
uint64_t * semaphore_val = nullptr;
|
||||||
#ifdef WIVRN_USE_V4L2
|
#if WIVRN_USE_V4L2
|
||||||
// DMA-buf images from V4L2 require queue-family ownership
|
// DMA-buf images from V4L2 require queue-family ownership
|
||||||
// transfers between Vulkan and external engine
|
// transfers between Vulkan and external engine
|
||||||
uint32_t foreign_queue_family = vk::QueueFamilyIgnored;
|
uint32_t foreign_queue_family = vk::QueueFamilyIgnored;
|
||||||
|
|||||||
@@ -945,7 +945,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
|||||||
|
|
||||||
use_alpha = blit_handle->view_info.alpha;
|
use_alpha = blit_handle->view_info.alpha;
|
||||||
|
|
||||||
#ifdef WIVRN_USE_V4L2
|
#if WIVRN_USE_V4L2
|
||||||
if (blit_handle->foreign_queue_family != vk::QueueFamilyIgnored)
|
if (blit_handle->foreign_queue_family != vk::QueueFamilyIgnored)
|
||||||
{
|
{
|
||||||
// decoder completed its write before handing us this image
|
// decoder completed its write before handing us this image
|
||||||
@@ -1105,7 +1105,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
|||||||
{bias, bias, bias, 0.},
|
{bias, bias, bias, 0.},
|
||||||
image_index);
|
image_index);
|
||||||
|
|
||||||
#ifdef WIVRN_USE_V4L2
|
#if WIVRN_USE_V4L2
|
||||||
// the blit handles keep CAPTURE buffers alive until this cmd buffer's fence has completed
|
// the blit handles keep CAPTURE buffers alive until this cmd buffer's fence has completed
|
||||||
inplace_vector<vk::ImageMemoryBarrier, decoder_count> foreign_release_barriers;
|
inplace_vector<vk::ImageMemoryBarrier, decoder_count> foreign_release_barriers;
|
||||||
for (const auto & handle: current_blit_handles)
|
for (const auto & handle: current_blit_handles)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ static const int64_t max_extrapolation_ns = 80'000'000;
|
|||||||
#cmakedefine01 WIVRN_USE_VAAPI
|
#cmakedefine01 WIVRN_USE_VAAPI
|
||||||
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
|
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
|
||||||
#cmakedefine01 WIVRN_USE_X264
|
#cmakedefine01 WIVRN_USE_X264
|
||||||
|
#cmakedefine01 WIVRN_USE_V4L2
|
||||||
|
|
||||||
#cmakedefine01 WIVRN_USE_PIPEWIRE
|
#cmakedefine01 WIVRN_USE_PIPEWIRE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user