mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-20 00:51:32 -08:00
Fix build on steamrt for the Frame
This commit is contained in:
1 parent
4261477840
commit
83744c11d8
4 files changed
+38
-30
No files matched your search
+3
-1
@@ -204,7 +204,9 @@ if (WIVRN_BUILD_CLIENT)
|
||||
endif()
|
||||
|
||||
if (WIVRN_BUILD_CLIENT AND NOT ANDROID)
|
||||
pkg_check_modules(LIBAV_CLIENT REQUIRED IMPORTED_TARGET libavcodec libavutil libswscale)
|
||||
if(NOT WIVRN_USE_V4L2)
|
||||
pkg_check_modules(LIBAV_CLIENT REQUIRED IMPORTED_TARGET libavcodec libavutil libswscale)
|
||||
endif()
|
||||
find_package(Fontconfig REQUIRED)
|
||||
|
||||
if (WIVRN_USE_SYSTEM_OPENXR)
|
||||
|
||||
@@ -157,6 +157,28 @@
|
||||
"cacheVariables": {
|
||||
"WIVRN_USE_SYSTEM_BOOST": "OFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "frame",
|
||||
"generator": "Ninja",
|
||||
"cacheVariables": {
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
|
||||
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "ON",
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"WIVRN_BUILD_CLIENT": "ON",
|
||||
"WIVRN_BUILD_SERVER": "OFF",
|
||||
"WIVRN_BUILD_SERVER_LIBRARY": "OFF",
|
||||
"WIVRN_BUILD_DASHBOARD": "OFF",
|
||||
"WIVRN_BUILD_DISSECTOR": "OFF",
|
||||
"WIVRN_BUILD_WIVRNCTL": "OFF",
|
||||
"WIVRN_USE_PIPEWIRE": "ON",
|
||||
"WIVRN_USE_V4L2": "ON",
|
||||
"WIVRN_USE_SYSTEM_BOOST": "OFF",
|
||||
"WIVRN_USE_SYSTEM_LIBKTX": "OFF",
|
||||
"WIVRN_USE_SYSTEM_OPENXR": "OFF",
|
||||
"WIVRN_COMPRESS_GLB": "ON",
|
||||
"WIVRN_WERROR": "ON"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
|
||||
@@ -108,16 +108,17 @@ else()
|
||||
target_link_libraries(wivrn openxr_loader)
|
||||
endif()
|
||||
|
||||
target_link_libraries(wivrn PkgConfig::LIBAV_CLIENT Fontconfig::Fontconfig CURL::libcurl)
|
||||
|
||||
file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS
|
||||
"decoder/ffmpeg/*.cpp")
|
||||
target_link_libraries(wivrn Fontconfig::Fontconfig CURL::libcurl)
|
||||
|
||||
if(WIVRN_USE_V4L2)
|
||||
file(GLOB CLIENT_V4L2_SOURCE CONFIGURE_DEPENDS
|
||||
"decoder/v4l2/*.cpp")
|
||||
list(APPEND PLATFORM_SOURCE ${CLIENT_V4L2_SOURCE})
|
||||
target_compile_definitions(wivrn PRIVATE WIVRN_USE_V4L2)
|
||||
else()
|
||||
target_link_libraries(wivrn PkgConfig::LIBAV_CLIENT)
|
||||
file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS
|
||||
"decoder/ffmpeg/*.cpp")
|
||||
endif()
|
||||
|
||||
if(WIVRN_USE_PIPEWIRE)
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
#ifdef __ANDROID__
|
||||
#include "decoder/android/android_decoder.h"
|
||||
#else
|
||||
#include "decoder/ffmpeg/ffmpeg_decoder.h"
|
||||
#ifdef WIVRN_USE_V4L2
|
||||
#include "decoder/v4l2/v4l2_decoder.h"
|
||||
#else
|
||||
#include "decoder/ffmpeg/ffmpeg_decoder.h"
|
||||
#endif
|
||||
#endif
|
||||
#include "decoder/raw_decoder.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <algorithm>
|
||||
|
||||
wivrn::decoder::~decoder() = default;
|
||||
|
||||
@@ -54,21 +53,10 @@ std::shared_ptr<wivrn::decoder> wivrn::decoder::make(
|
||||
stream_index,
|
||||
scene,
|
||||
acc);
|
||||
#elifdef WIVRN_USE_V4L2
|
||||
return std::make_shared<wivrn::v4l2::decoder>(
|
||||
device, phys_dev, vk_queue_family_index, description, stream_index, scene, acc);
|
||||
#else
|
||||
#ifdef WIVRN_USE_V4L2
|
||||
if (wivrn::v4l2::decoder::available_for(description.codec[stream_index]))
|
||||
{
|
||||
try
|
||||
{
|
||||
return std::make_shared<wivrn::v4l2::decoder>(
|
||||
device, phys_dev, vk_queue_family_index, description, stream_index, scene, acc);
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
{
|
||||
spdlog::warn("V4L2 iris decoder initialization failed: {}. Falling back to FFmpeg.", e.what());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return std::make_shared<wivrn::ffmpeg::decoder>(
|
||||
device, phys_dev, description, stream_index, scene, acc);
|
||||
#endif
|
||||
@@ -90,15 +78,10 @@ static std::vector<wivrn::video_codec> supported_codecs_()
|
||||
std::vector<wivrn::video_codec> res;
|
||||
#ifdef __ANDROID__
|
||||
wivrn::android::decoder::supported_codecs(res);
|
||||
#else
|
||||
#ifdef WIVRN_USE_V4L2
|
||||
#elifdef WIVRN_USE_V4L2
|
||||
wivrn::v4l2::decoder::supported_codecs(res);
|
||||
#endif
|
||||
std::vector<wivrn::video_codec> software_codecs;
|
||||
wivrn::ffmpeg::decoder::supported_codecs(software_codecs);
|
||||
for (auto codec: software_codecs)
|
||||
if (not std::ranges::contains(res, codec))
|
||||
res.push_back(codec);
|
||||
#else
|
||||
wivrn::ffmpeg::decoder::supported_codecs(res);
|
||||
#endif
|
||||
res.push_back(wivrn::video_codec::raw);
|
||||
return res;
|
||||
|
||||
Reference in new issue
Block a user