aboutsummaryrefslogtreecommitdiff
path: root/src/capture/xcomposite_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/xcomposite_vaapi.c
parentea7b58d7f92b179a4c2717237422e1200b5be673 (diff)
Add support for software video encoding with '-encoder cpu' option, currently h264 only
Diffstat (limited to 'src/capture/xcomposite_vaapi.c')
-rw-r--r--src/capture/xcomposite_vaapi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/capture/xcomposite_vaapi.c b/src/capture/xcomposite_vaapi.c
index 3f27014..3a14f30 100644
--- a/src/capture/xcomposite_vaapi.c
+++ b/src/capture/xcomposite_vaapi.c
@@ -25,7 +25,7 @@ static int gsr_capture_xcomposite_vaapi_start(gsr_capture *cap, AVCodecContext *
return res;
}
- if(!drm_create_codec_context(cap_xcomp->xcomposite.params.egl->card_path, video_codec_context, video_codec_context->width, video_codec_context->height, false, &cap_xcomp->va_dpy)) {
+ if(!vaapi_create_codec_context(cap_xcomp->xcomposite.params.egl->card_path, video_codec_context, video_codec_context->width, video_codec_context->height, false, &cap_xcomp->va_dpy)) {
gsr_capture_xcomposite_vaapi_stop(cap, video_codec_context);
return -1;
}
@@ -60,7 +60,9 @@ static bool gsr_capture_xcomposite_vaapi_should_stop(gsr_capture *cap, bool *err
static int gsr_capture_xcomposite_vaapi_capture(gsr_capture *cap, AVFrame *frame) {
gsr_capture_xcomposite_vaapi *cap_xcomp = cap->priv;
- return gsr_capture_xcomposite_capture(&cap_xcomp->xcomposite, frame);
+ gsr_capture_xcomposite_capture(&cap_xcomp->xcomposite, frame);
+ cap_xcomp->xcomposite.params.egl->eglSwapBuffers(cap_xcomp->xcomposite.params.egl->egl_display, cap_xcomp->xcomposite.params.egl->egl_surface);
+ return 0;
}
static void gsr_capture_xcomposite_vaapi_stop(gsr_capture *cap, AVCodecContext *video_codec_context) {