From 99f32f17b481a7ab387c3f4f177b343dad5d1e64 Mon Sep 17 00:00:00 2001 From: Alexander Lyulkov Date: Wed, 5 Jun 2024 19:17:49 +0300 Subject: [PATCH] Added potential fix for Android H264 Encoding Bug --- modules/videoio/src/cap_android_mediandk.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/videoio/src/cap_android_mediandk.cpp b/modules/videoio/src/cap_android_mediandk.cpp index 2f8b193404..87d5114ab4 100644 --- a/modules/videoio/src/cap_android_mediandk.cpp +++ b/modules/videoio/src/cap_android_mediandk.cpp @@ -587,6 +587,7 @@ public: LOGE("ERROR: AMediaCodec_createInputSurface (%d)", status); goto error; } + ANativeWindow_setBuffersGeometry(surface, width, height, AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM); #endif AMediaCodec_start(encoder);