Package com.google.android.exoplayer2.video.spherical

## Class FrameRotationQueue

- java.lang.Object
- - com.google.android.exoplayer2.video.spherical.FrameRotationQueue

-     public final class FrameRotationQueue
      extends Object

  This class serves multiple purposes:
  - Queues the rotation metadata extracted from camera motion track.
  - Converts the metadata to rotation matrices in OpenGl coordinate system.
  - Recenters the rotations to componsate the yaw of the initial rotation.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FrameRotationQueue()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `computeRecenterMatrix​(float[] recenterMatrix, float[] rotationMatrix)` | Computes a recentering matrix from the given angle-axis rotation only accounting for yaw.
    `boolean` | `pollRotationMatrix​(float[] matrix, long timestampUs)` | Copies the rotation matrix with the greatest timestamp which is less than or equal to the given timestamp to `matrix`.
    `void` | `reset()` | Removes all of the rotations and forces rotations to be recentered.
    `void` | `setRotation​(long timestampUs, float[] angleAxis)` | Sets a rotation for a given timestamp.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FrameRotationQueue

          public FrameRotationQueue()

  - ### Method Detail

    - #### setRotation

          public void setRotation​(long timestampUs,
                                  float[] angleAxis)

      Sets a rotation for a given timestamp.
      Parameters:
        `timestampUs` - Timestamp of the rotation.
        `angleAxis` - Angle axis orientation in radians representing the rotation from camera coordinate system to world coordinate system.

    - #### reset

          public void reset()

      Removes all of the rotations and forces rotations to be recentered.

    - #### pollRotationMatrix

          public boolean pollRotationMatrix​(float[] matrix,
                                            long timestampUs)

      Copies the rotation matrix with the greatest timestamp which is less than or equal to the given timestamp to `matrix`. Removes all older rotations and the returned one from the queue. Does nothing if there is no such rotation.
      Parameters:
        `matrix` - The rotation matrix.
        `timestampUs` - The time in microseconds to query the rotation.
      Returns:
        Whether a rotation matrix is copied to `matrix`.

    - #### computeRecenterMatrix

          public static void computeRecenterMatrix​(float[] recenterMatrix,
                                                   float[] rotationMatrix)

      Computes a recentering matrix from the given angle-axis rotation only accounting for yaw. Roll and tilt will not be compensated.
      Parameters:
        `recenterMatrix` - The recenter matrix.
        `rotationMatrix` - The rotation matrix.