Commit ca0e2767 by eguven Committed by Oliver Woodman

Reset camera motion rotation when camera motion track is disabled

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210696525
parent 13889c91
...@@ -27,6 +27,6 @@ public interface CameraMotionListener { ...@@ -27,6 +27,6 @@ public interface CameraMotionListener {
*/ */
void onCameraMotion(long timeUs, float[] rotation); void onCameraMotion(long timeUs, float[] rotation);
/** Called when the camera motion track position is reset. */ /** Called when the camera motion track position is reset or the track is disabled. */
void onCameraMotionReset(); void onCameraMotionReset();
} }
...@@ -72,15 +72,12 @@ public class CameraMotionRenderer extends BaseRenderer { ...@@ -72,15 +72,12 @@ public class CameraMotionRenderer extends BaseRenderer {
@Override @Override
protected void onPositionReset(long positionUs, boolean joining) throws ExoPlaybackException { protected void onPositionReset(long positionUs, boolean joining) throws ExoPlaybackException {
lastTimestampUs = 0; reset();
if (listener != null) {
listener.onCameraMotionReset();
}
} }
@Override @Override
protected void onDisabled() { protected void onDisabled() {
lastTimestampUs = 0; reset();
} }
@Override @Override
...@@ -126,4 +123,11 @@ public class CameraMotionRenderer extends BaseRenderer { ...@@ -126,4 +123,11 @@ public class CameraMotionRenderer extends BaseRenderer {
} }
return result; return result;
} }
private void reset() {
lastTimestampUs = 0;
if (listener != null) {
listener.onCameraMotionReset();
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment