From 84f7975296be8589a27794eb0d0b1eab5b23097a Mon Sep 17 00:00:00 2001 From: Tirus Date: Wed, 22 Feb 2023 23:11:20 +0100 Subject: [PATCH 1/2] Fixed compiling with gcc 10. - declarated the PFNGLEGLIMAGETARGETTEXTURE2DOESPROC as extern --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index 45b34fb..ad15e58 100644 --- a/src/util.h +++ b/src/util.h @@ -11,7 +11,7 @@ typedef void *GLeglImageOES; typedef void (*PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum target, GLeglImageOES image); -PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; +extern PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; int texture2d_to_jpeg( GLuint tex, int level, const char* filename ); int texture_2d_load_from_file( GLuint* tex, const char* filename ); From 80fce4b2bd163b451ff3fa17b2900ee6319559ee Mon Sep 17 00:00:00 2001 From: Tirus Date: Wed, 22 Feb 2023 23:26:08 +0100 Subject: [PATCH 2/2] Swapped RGBA to BGRA to fix video encoding on AMDGPU: - with RGBA on AMDGPU (with Mesa 20.3.5) for some reason the driver just encodes the red channel as greyscale video - with BGRA it just works fine - also still works on intel GPU's (tested on a Intel HD 4000 also with Mesa 20.3.5) --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index f5073a0..16c8502 100644 --- a/src/util.c +++ b/src/util.c @@ -429,7 +429,7 @@ EGLImage egl_create_image_from_va(VASurfaceID* _va_surface, VADisplay va_display va_surface_attrib.type = VASurfaceAttribPixelFormat; va_surface_attrib.flags = VA_SURFACE_ATTRIB_SETTABLE; va_surface_attrib.value.type = VAGenericValueTypeInteger; - va_surface_attrib.value.value.i = VA_FOURCC_RGBA; + va_surface_attrib.value.value.i = VA_FOURCC_BGRA; r = vaCreateSurfaces( va_display, VA_RT_FORMAT_RGB32, width, height, &va_surface, 1, &va_surface_attrib, 1 ); if( r != VA_STATUS_SUCCESS )