aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms_vaapi.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-04 01:35:03 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-04 01:35:03 +0200
commit62d61fda12e3774fee6b671e44fb89bd2ef8da8c (patch)
treed5050689876d9adbe51bdf137475b3c3bc332c63 /src/capture/kms_vaapi.c
parentea7b58d7f92b179a4c2717237422e1200b5be673 (diff)
Add support for software video encoding with '-encoder cpu' option, currently h264 only
Diffstat (limited to 'src/capture/kms_vaapi.c')
-rw-r--r--src/capture/kms_vaapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c
index b9c9ee5..9ca965d 100644
--- a/src/capture/kms_vaapi.c
+++ b/src/capture/kms_vaapi.c
@@ -29,7 +29,7 @@ static int gsr_capture_kms_vaapi_start(gsr_capture *cap, AVCodecContext *video_c
return res;
}
- if(!drm_create_codec_context(cap_kms->params.egl->card_path, video_codec_context, video_codec_context->width, video_codec_context->height, cap_kms->params.hdr, &cap_kms->va_dpy)) {
+ if(!vaapi_create_codec_context(cap_kms->params.egl->card_path, video_codec_context, video_codec_context->width, video_codec_context->height, cap_kms->params.hdr, &cap_kms->va_dpy)) {
gsr_capture_kms_vaapi_stop(cap, video_codec_context);
return -1;
}
@@ -57,7 +57,9 @@ static bool gsr_capture_kms_vaapi_should_stop(gsr_capture *cap, bool *err) {
static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) {
gsr_capture_kms_vaapi *cap_kms = cap->priv;
+ cap_kms->kms.base.egl->glClear(0);
gsr_capture_kms_capture(&cap_kms->kms, frame, cap_kms->params.hdr, cap_kms->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_INTEL, false, cap_kms->params.record_cursor);
+ cap_kms->kms.base.egl->eglSwapBuffers(cap_kms->kms.base.egl->egl_display, cap_kms->kms.base.egl->egl_surface);
return 0;
}