mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Reset camera motion rotation when camera motion track is disabled
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=210696525
This commit is contained in:
parent
13889c9116
commit
ca0e276798
2 changed files with 10 additions and 6 deletions
|
|
@ -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 {
|
||||||
|
|
||||||
@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 {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reset() {
|
||||||
|
lastTimestampUs = 0;
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onCameraMotionReset();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue