From fa222b0ea27ebf03dd41132ee3da8c99ab4688fd Mon Sep 17 00:00:00 2001 From: ShuangLiu1992 Date: Tue, 23 Nov 2021 15:03:18 +0000 Subject: [PATCH] Update cap_android_camera.cpp since u and v Pixel ptr have been swapped the compare condition should be updated too --- modules/videoio/src/cap_android_camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_android_camera.cpp b/modules/videoio/src/cap_android_camera.cpp index 5952b6f08c..f51bfe949d 100644 --- a/modules/videoio/src/cap_android_camera.cpp +++ b/modules/videoio/src/cap_android_camera.cpp @@ -308,7 +308,7 @@ public: AImage_getPlaneData(image.get(), 2, &vPixel, &vLen); AImage_getPlanePixelStride(image.get(), 1, &uvPixelStride); - if ( (uvPixelStride == 2) && (vPixel == uPixel + 1) && (yLen == frameWidth * frameHeight) && (uLen == ((yLen / 2) - 1)) && (vLen == uLen) ) { + if ( (uvPixelStride == 2) && (uPixel == vPixel + 1) && (yLen == frameWidth * frameHeight) && (uLen == ((yLen / 2) - 1)) && (vLen == uLen) ) { colorFormat = COLOR_FormatYUV420SemiPlanar; if (fourCC == FOURCC_UNKNOWN) { fourCC = FOURCC_NV21;