diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-04-11 00:29:12 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-04-11 00:29:12 +0200 |
commit | e7020376e9b05bdcea5f4460a286218a41f3a6e7 (patch) | |
tree | 98ea83abf285ef5fd814d9b3600847a6f2841462 | |
parent | cc7cf8197e657cf66157670cb3b819a2ea856e1a (diff) |
Remove kms modifier
-rw-r--r-- | src/capture/kms_vaapi.c | 19 | ||||
-rw-r--r-- | src/capture/xcomposite_vaapi.c | 6 |
2 files changed, 4 insertions, 21 deletions
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index f1630ea..ce3a47a 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -248,7 +248,7 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { uintptr_t dmabuf = cap_kms->dmabuf_fd; VASurfaceAttribExternalBuffers buf = {0}; - buf.pixel_format = VA_FOURCC_BGRX; // VA_FOURCC_XRGB + buf.pixel_format = VA_FOURCC_BGRX; buf.width = cap_kms->kms_size.x; buf.height = cap_kms->kms_size.y; buf.data_size = cap_kms->kms_size.y * cap_kms->pitch; @@ -260,33 +260,20 @@ 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}; attribs[0].type = VASurfaceAttribMemoryType; attribs[0].flags = VA_SURFACE_ATTRIB_SETTABLE; attribs[0].value.type = VAGenericValueTypeInteger; - attribs[0].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; // TODO: prime1 instead? + attribs[0].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; attribs[1].type = VASurfaceAttribExternalBufferDescriptor; attribs[1].flags = VA_SURFACE_ATTRIB_SETTABLE; 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; - } // 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); + 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, 2); if(va_status != VA_STATUS_SUCCESS) { fprintf(stderr, "gsr error: gsr_capture_kms_vaapi_capture: vaCreateSurfaces failed: %d\n", va_status); cap_kms->should_stop = true; diff --git a/src/capture/xcomposite_vaapi.c b/src/capture/xcomposite_vaapi.c index f12a978..532c0b0 100644 --- a/src/capture/xcomposite_vaapi.c +++ b/src/capture/xcomposite_vaapi.c @@ -398,15 +398,13 @@ static void gsr_capture_xcomposite_vaapi_tick(gsr_capture *cap, AVCodecContext * buf.flags = 0; buf.private_data = 0; - // TODO: Use VASurfaceAttribDRMFormatModifiers to set modifier if modifier is not INVALID - #define VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME 0x20000000 VASurfaceAttrib attribs[2] = {0}; attribs[0].type = VASurfaceAttribMemoryType; attribs[0].flags = VA_SURFACE_ATTRIB_SETTABLE; attribs[0].value.type = VAGenericValueTypeInteger; - attribs[0].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; // TODO: prime1 instead? + attribs[0].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; attribs[1].type = VASurfaceAttribExternalBufferDescriptor; attribs[1].flags = VA_SURFACE_ATTRIB_SETTABLE; attribs[1].value.type = VAGenericValueTypePointer; @@ -420,8 +418,6 @@ static void gsr_capture_xcomposite_vaapi_tick(gsr_capture *cap, AVCodecContext * return; } - //vaBeginPicture(cap_xcomp->va_dpy, ) - va_status = vaCreateConfig(cap_xcomp->va_dpy, VAProfileNone, VAEntrypointVideoProc, NULL, 0, &cap_xcomp->config_id); if(va_status != VA_STATUS_SUCCESS) { fprintf(stderr, "gsr error: gsr_capture_xcomposite_vaapi_tick: vaCreateConfig failed: %d\n", va_status); |