diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-08-13 01:38:15 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-08-13 01:38:15 +0200 |
commit | a151d7ac2617f70e09f688575c76d250cf05ac66 (patch) | |
tree | c82f44f3715b04d261e619a23f85189ec13531a6 | |
parent | 3131e041c1061a0569eecb192a5a36c4d0e674cc (diff) |
test
-rw-r--r-- | src/capture/kms_vaapi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index ea2ece0..4245f39 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -165,12 +165,16 @@ static int gsr_capture_kms_vaapi_start(gsr_capture *cap, AVCodecContext *video_c cap_kms->capture_pos = monitor.pos; cap_kms->capture_size = monitor.size; + fprintf(stderr, "capture size: %d, %d\n", cap_kms->capture_size.x, cap_kms->capture_size.y); + /* Disable vsync */ cap_kms->params.egl->eglSwapInterval(cap_kms->params.egl->egl_display, 0); video_codec_context->width = max_int(2, even_number_ceil(cap_kms->capture_size.x)); video_codec_context->height = max_int(2, even_number_ceil(cap_kms->capture_size.y)); + fprintf(stderr, "video size: %d, %d\n", video_codec_context->width, video_codec_context->height); + if(!drm_create_codec_context(cap_kms, video_codec_context)) { gsr_capture_kms_vaapi_stop(cap, video_codec_context); return -1; @@ -246,6 +250,8 @@ static void gsr_capture_kms_vaapi_tick(gsr_capture *cap, AVCodecContext *video_c cap_kms->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); cap_kms->params.egl->glBindTexture(GL_TEXTURE_2D, 0); + fprintf(stderr, "prime width: %u, height: %u\n", cap_kms->prime.width, cap_kms->prime.height); + if(cap_kms->prime.fourcc == FOURCC_NV12) { cap_kms->params.egl->glGenTextures(2, cap_kms->target_textures); for(int i = 0; i < 2; ++i) { @@ -463,6 +469,12 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { if(!capture_is_combined_plane && cursor_drm_fd && cursor_drm_fd->connector_id != drm_fd->connector_id) cursor_drm_fd = NULL; + static bool test = true; + if(test) { + test = false; + fprintf(stderr, "drm fd: %d, %d\n", drm_fd->width, drm_fd->height); + } + // TODO: This causes a crash sometimes on steam deck, why? is it a driver bug? a vaapi pure version doesn't cause a crash. // Even ffmpeg kmsgrab causes this crash. The error is: // amdgpu: Failed to allocate a buffer: |