Make encoder options explicit in cmake

This commit is contained in:
Patrick Nicolas
2023-11-25 14:37:36 +01:00
parent 3700a97aed
commit 10fa78c21c
8 changed files with 37 additions and 38 deletions
+6 -6
View File
@@ -27,13 +27,13 @@
#include "wivrn_config.h"
#ifdef WIVRN_HAVE_CUDA
#ifdef WIVRN_USE_NVENC
#include "video_encoder_nvenc.h"
#endif
#ifdef WIVRN_HAVE_FFMPEG
#ifdef WIVRN_USE_VAAPI
#include "ffmpeg/VideoEncoderVA.h"
#endif
#ifdef WIVRN_HAVE_X264
#ifdef WIVRN_USE_X264
#include "video_encoder_x264.h"
#endif
@@ -51,19 +51,19 @@ std::unique_ptr<VideoEncoder> VideoEncoder::Create(
{
using namespace std::string_literals;
std::unique_ptr<VideoEncoder> res;
#ifdef WIVRN_HAVE_X264
#ifdef WIVRN_USE_X264
if (settings.encoder_name == encoder_x264)
{
res = std::make_unique<VideoEncoderX264>(vk, pool, settings, input_width, input_height, fps);
}
#endif
#ifdef WIVRN_HAVE_CUDA
#ifdef WIVRN_USE_NVENC
if (settings.encoder_name == encoder_nvenc)
{
res = std::make_unique<VideoEncoderNvenc>(vk, settings, fps);
}
#endif
#ifdef WIVRN_HAVE_FFMPEG
#ifdef WIVRN_USE_VAAPI
if (settings.encoder_name == encoder_vaapi)
{
res = std::make_unique<VideoEncoderVA>(vk, settings, fps);