Adjust SDK level for video display upside down

Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
camera2
Leo Ma 9 years ago
parent 3700fc7fbe
commit 652cff57e4

@ -197,9 +197,9 @@ public class SrsCameraView extends GLSurfaceView implements GLSurfaceView.Render
Camera.getCameraInfo(mCamId, info);
if (info.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
if (orientation == Configuration.ORIENTATION_PORTRAIT) {
mPreviewRotation = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? 270 : 90;
mPreviewRotation = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? 270 : 90;
} else if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
mPreviewRotation = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? 180 : 0;
mPreviewRotation = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? 180 : 0;
}
} else if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
if (orientation == Configuration.ORIENTATION_PORTRAIT) {

Loading…
Cancel
Save