mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Apply proper rotation to buttons and video in landscape.
This commit is contained in:
committed by
Greyson Parrelli
parent
e6e8786d86
commit
2678a00781
@@ -46,6 +46,7 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
|
||||
@NonNull private CameraState.Direction activeDirection;
|
||||
private boolean enabled;
|
||||
private boolean isInitialized;
|
||||
private int orientation;
|
||||
|
||||
public Camera(@NonNull Context context,
|
||||
@NonNull CameraEventListener cameraEventListener,
|
||||
@@ -81,6 +82,7 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
|
||||
capturer.initialize(SurfaceTextureHelper.create("WebRTC-SurfaceTextureHelper", eglBase.getEglBaseContext()),
|
||||
context,
|
||||
observer);
|
||||
capturer.setOrientation(orientation);
|
||||
isInitialized = true;
|
||||
}
|
||||
}
|
||||
@@ -99,6 +101,15 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
|
||||
capturer.switchCamera(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrientation(@Nullable Integer orientation) {
|
||||
this.orientation = orientation;
|
||||
|
||||
if (isInitialized && capturer != null) {
|
||||
capturer.setOrientation(orientation);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
Log.i(TAG, "setEnabled(): " + enabled);
|
||||
|
||||
Reference in New Issue
Block a user