Find /dev/dri/card path that exists (the first one)

This commit is contained in:
dec05eba
2023-04-16 22:48:22 +02:00
committed by dec05eba
parent d953d0bb36
commit c0ebae365d
7 changed files with 42 additions and 15 deletions

View File

@@ -74,7 +74,7 @@ static Window get_focused_window(Display *display, Atom net_active_window_atom)
static bool drm_create_codec_context(gsr_capture_xcomposite_vaapi *cap_xcomp, AVCodecContext *video_codec_context) {
AVBufferRef *device_ctx;
if(av_hwdevice_ctx_create(&device_ctx, AV_HWDEVICE_TYPE_VAAPI, "/dev/dri/renderD128", NULL, 0) < 0) {
if(av_hwdevice_ctx_create(&device_ctx, AV_HWDEVICE_TYPE_VAAPI, cap_xcomp->params.card_path, NULL, 0) < 0) {
fprintf(stderr, "Error: Failed to create hardware device context\n");
return false;
}