File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -280,16 +280,16 @@ private void setCurrentRotation() {
280
280
281
281
int surfaceRotation = mActivity .getWindowManager ().getDefaultDisplay ().getRotation ();
282
282
283
+ int correction = cameraInfo .orientation - 90 ;
284
+
283
285
if (cameraInfo .facing == Camera .CameraInfo .CAMERA_FACING_FRONT ) {
284
286
switch (surfaceRotation ) {
285
- case Surface .ROTATION_0 : mRotation = 180 ; break ;
286
- case Surface .ROTATION_90 : mRotation = 0 ; break ;
287
- case Surface .ROTATION_180 : mRotation = 180 ; break ;
288
- case Surface .ROTATION_270 : mRotation = 0 ; break ;
287
+ case Surface .ROTATION_90 : correction += 180 ; break ;
288
+ case Surface .ROTATION_270 : correction += 180 ; break ;
289
289
}
290
- } else { // back-facing
291
- mRotation = 0 ;
292
290
}
291
+
292
+ mRotation = correction ;
293
293
}
294
294
}
295
295
@@ -320,7 +320,7 @@ private String getOptimalFocusMode(Camera.Parameters params) {
320
320
} else {
321
321
result = params .getSupportedFocusModes ().get (0 );
322
322
}
323
-
323
+
324
324
return result ;
325
325
}
326
326
You can’t perform that action at this time.
0 commit comments