Skip to content

Commit 441ce89

Browse files
committed
Patch for Android front-camera orientation.
1 parent 618b498 commit 441ce89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

calib_camera.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,13 @@ int main(int argc, char *argv[])
644644
int frontCamera;
645645
if (ar2VideoGetParami(vid, AR_VIDEO_PARAM_AVFOUNDATION_CAMERA_POSITION, &frontCamera) >= 0) {
646646
gCameraIsFrontFacing = (frontCamera == AR_VIDEO_AVFOUNDATION_CAMERA_POSITION_FRONT);
647+
ARLOGi("Camera is %sfront-facing.\n", gCameraIsFrontFacing ? "" : "not ");
647648
}
648649
} else if (vid->module == AR_VIDEO_MODULE_ANDROID) {
649650
int frontCamera;
650651
if (ar2VideoGetParami(vid, AR_VIDEO_PARAM_ANDROID_CAMERA_FACE, &frontCamera) >= 0) {
651652
gCameraIsFrontFacing = (frontCamera == AR_VIDEO_ANDROID_CAMERA_FACE_FRONT);
653+
ARLOGi("Camera is %sfront-facing.\n", gCameraIsFrontFacing ? "" : "not ");
652654
}
653655
}
654656
bool contentRotate90, contentFlipV, contentFlipH;
@@ -666,8 +668,8 @@ int main(int argc, char *argv[])
666668
contentFlipH = (!gCameraIsFrontFacing);
667669
} else /*(gDisplayOrientation == 0)*/ { // Portait
668670
contentRotate90 = true;
669-
contentFlipV = gCameraIsFrontFacing;
670-
contentFlipH = false;
671+
contentFlipV = false;
672+
contentFlipH = gCameraIsFrontFacing;
671673
}
672674

673675
// Setup a route for rendering the colour background image.

0 commit comments

Comments
 (0)