DisplayRotationHelper

Helper to track the display rotations. In particular, the 180 degree rotations are not notified by the onSurfaceChanged() callback, and thus they require listening to the android display events.

Constructors

Link copied to clipboard
constructor(context: Context)
Constructs the DisplayRotationHelper but does not register the listener yet.

Functions

Returns the aspect ratio of the GL surface viewport while accounting for the display rotation relative to the device camera sensor orientation.
Link copied to clipboard
Returns the rotation of the back-facing camera with respect to the display.
Link copied to clipboard
open fun onDisplayAdded(displayId: Int)
Link copied to clipboard
open fun onDisplayChanged(displayId: Int)
Link copied to clipboard
open fun onDisplayRemoved(displayId: Int)
Link copied to clipboard
open fun onPause()
Link copied to clipboard
open fun onResume()
Link copied to clipboard
open fun onSurfaceChanged(width: Int, height: Int)
Records a change in surface dimensions.
Link copied to clipboard
open fun updateSessionIfNeeded(session: Session)
Updates the session display geometry if a change was posted either by onSurfaceChanged call or by onDisplayChanged system callback.