From 4996266f28f2f275be9f08d8d591f1245efddafc Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 10 Apr 2023 21:32:10 +0200 Subject: Amd monitor recording fixed, remove unused modifier code --- src/capture/kms_vaapi.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'src/capture') diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index 2373919..6500cd2 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -12,7 +12,6 @@ #include #include #include -#include typedef struct { gsr_capture_kms_vaapi_params params; @@ -219,13 +218,6 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { cap_kms->kms_size.x = kms_response.data.fd.width; cap_kms->kms_size.y = kms_response.data.fd.height; - static bool dd = false; - if(!dd) { - dd = true; - fprintf(stderr, "kms capture, fd: %d, pitch: %u, offset: %u, fourcc: %u, modifiers: %lu, size x: %u, y: %u\n", - cap_kms->dmabuf_fd, cap_kms->pitch, cap_kms->offset, cap_kms->fourcc, cap_kms->modifiers, cap_kms->kms_size.x, cap_kms->kms_size.y); - } - if(cap_kms->buffer_id) { vaDestroyBuffer(cap_kms->va_dpy, cap_kms->buffer_id); cap_kms->buffer_id = 0; @@ -257,10 +249,6 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { buf.flags = 0; buf.private_data = 0; - VADRMFormatModifierList modifier_list = {0}; - modifier_list.modifiers = &cap_kms->modifiers; - modifier_list.num_modifiers = 1; - #define VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME 0x20000000 VASurfaceAttrib attribs[3] = {0}; @@ -273,14 +261,7 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { attribs[1].value.type = VAGenericValueTypePointer; attribs[1].value.value.p = &buf; - int num_attribs = 2; - /*if(cap_kms->modifiers != DRM_FORMAT_MOD_INVALID) { - attribs[2].type = VASurfaceAttribDRMFormatModifiers; - attribs[2].flags = VA_SURFACE_ATTRIB_SETTABLE; - attribs[2].value.type = VAGenericValueTypePointer; - attribs[2].value.value.p = &modifier_list; - ++num_attribs; - }*/ + const int num_attribs = 2; // TODO: Do we really need to create a new surface every frame? VAStatus va_status = vaCreateSurfaces(cap_kms->va_dpy, VA_RT_FORMAT_RGB32, cap_kms->kms_size.x, cap_kms->kms_size.y, &cap_kms->input_surface, 1, attribs, num_attribs); -- cgit v1.2.3