mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +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);
|
||||
|
||||
/** 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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,15 +72,12 @@ public class CameraMotionRenderer extends BaseRenderer {
|
|||
|
||||
@Override
|
||||
protected void onPositionReset(long positionUs, boolean joining) throws ExoPlaybackException {
|
||||
lastTimestampUs = 0;
|
||||
if (listener != null) {
|
||||
listener.onCameraMotionReset();
|
||||
}
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDisabled() {
|
||||
lastTimestampUs = 0;
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -126,4 +123,11 @@ public class CameraMotionRenderer extends BaseRenderer {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void reset() {
|
||||
lastTimestampUs = 0;
|
||||
if (listener != null) {
|
||||
listener.onCameraMotionReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue