diff --git a/server/encoder/encoder_settings.cpp b/server/encoder/encoder_settings.cpp index ec480a03..2727e805 100644 --- a/server/encoder/encoder_settings.cpp +++ b/server/encoder/encoder_settings.cpp @@ -180,6 +180,35 @@ static std::optional filter_codecs_vaapi(wivrn_vk_bundle & b } #endif +#if WIVRN_USE_NVENC +static bool probe_nvenc(wivrn_vk_bundle & bundle) +{ + static bool res = [&]() { + encoder_settings s{ + { + .width = 800, + .height = 600, + .video_width = 800, + .video_height = 600, + .codec = h264, + }, + encoder_nvenc, + default_bitrate, + }; + try + { + video_encoder_nvenc test(bundle, s, 60, 0); + return true; + } + catch (std::exception & e) + { + U_LOG_W("nvenc not supported: %s", e.what()); + return false; + } }(); + return res; +} +#endif + static void fill_defaults(wivrn_vk_bundle & bundle, const std::vector & headset_codecs, configuration::encoder & config) { if (config.name.empty()) @@ -187,14 +216,20 @@ static void fill_defaults(wivrn_vk_bundle & bundle, const std::vector