Choose between x11grab and kmsgrab at runtime

This commit is contained in:
loki
2021-08-06 15:55:38 +02:00
parent ac5f439839
commit 065e9e718a
8 changed files with 341 additions and 118 deletions

View File

@@ -98,7 +98,7 @@ exportSurfaceHandle_fn exportSurfaceHandle;
using display_t = util::dyn_safe_ptr_v2<void, VAStatus, &terminate>;
int init() {
int init_main_va() {
static void *handle { nullptr };
static bool funcs_loaded = false;
@@ -129,8 +129,8 @@ int init() {
return 0;
}
int init_drm() {
if(init()) {
int init() {
if(init_main_va()) {
return -1;
}
@@ -346,17 +346,4 @@ std::shared_ptr<platf::hwdevice_t> make_hwdevice(int width, int height) {
return egl;
}
} // namespace va
namespace platf {
std::unique_ptr<deinit_t> init() {
gbm::init();
va::init_drm();
if(!gladLoaderLoadEGL(EGL_NO_DISPLAY) || !eglGetPlatformDisplay) {
BOOST_LOG(warning) << "Couldn't load EGL library"sv;
}
return std::make_unique<deinit_t>();
}
} // namespace platf
} // namespace va