aboutsummaryrefslogtreecommitdiff
path: root/src/capture
diff options
context:
space:
mode:
authordec05eba <dec05eba®protonmail.com>2023-04-16 22:48:22 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-16 22:50:43 +0200
commitc0ebae365d3ee20dc6ed1cf71d998bf040e93149 (patch)
treed66723be1a63cb7fb571a7115972c79fde5176f9 /src/capture
parentd953d0bb363799211d546035e825d248b9b3c2ed (diff)
Find /dev/dri/card path that exists (the first one)
Diffstat (limited to 'src/capture')
-rw-r--r--src/capture/kms_vaapi.c4
-rw-r--r--src/capture/xcomposite_vaapi.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c
index 74e50f1..dc27d6b 100644
--- a/src/capture/kms_vaapi.c
+++ b/src/capture/kms_vaapi.c
@@ -65,7 +65,7 @@ static void gsr_capture_kms_vaapi_stop(gsr_capture *cap, AVCodecContext *video_c
static bool drm_create_codec_context(gsr_capture_kms_vaapi *cap_kms, 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_kms->params.card_path, NULL, 0) < 0) {
fprintf(stderr, "Error: Failed to create hardware device context\n");
return false;
}
@@ -123,7 +123,7 @@ static int gsr_capture_kms_vaapi_start(gsr_capture *cap, AVCodecContext *video_c
gsr_capture_kms_vaapi *cap_kms = cap->priv;
// TODO: Allow specifying another card, and in other places
- if(gsr_kms_client_init(&cap_kms->kms_client, "/dev/dri/renderD128") != 0) {
+ if(gsr_kms_client_init(&cap_kms->kms_client, cap_kms->params.card_path) != 0) {
return -1;
}
diff --git a/src/capture/xcomposite_vaapi.c b/src/capture/xcomposite_vaapi.c
index 3423af0..0f3ab47 100644
--- a/src/capture/xcomposite_vaapi.c
+++ b/src/capture/xcomposite_vaapi.c
@@ -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;
}