mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Add some missing thread verifications
This adds some missing calls to verifyApplicationThread to ExoPlayerImpl. Now all public methods start with this call, except listener registrations because registration after construction on a background thread is allowed and supported. PiperOrigin-RevId: 428009498
This commit is contained in:
parent
644524f444
commit
95abd7d3cc
1 changed files with 20 additions and 0 deletions
|
|
@ -382,6 +382,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public AudioComponent getAudioComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -389,6 +390,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public VideoComponent getVideoComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -396,6 +398,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public TextComponent getTextComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -403,6 +406,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public DeviceComponent getDeviceComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -476,6 +480,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public void retry() {
|
||||
verifyApplicationThread();
|
||||
prepare();
|
||||
}
|
||||
|
||||
|
|
@ -906,6 +911,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public void stop() {
|
||||
verifyApplicationThread();
|
||||
stop(/* reset= */ false);
|
||||
}
|
||||
|
||||
|
|
@ -1189,6 +1195,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public @C.VideoScalingMode int getVideoScalingMode() {
|
||||
verifyApplicationThread();
|
||||
return videoScalingMode;
|
||||
}
|
||||
|
||||
|
|
@ -1206,11 +1213,13 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
|
||||
verifyApplicationThread();
|
||||
return videoChangeFrameRateStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoSize getVideoSize() {
|
||||
verifyApplicationThread();
|
||||
return videoSize;
|
||||
}
|
||||
|
||||
|
|
@ -1357,6 +1366,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public AudioAttributes getAudioAttributes() {
|
||||
verifyApplicationThread();
|
||||
return audioAttributes;
|
||||
}
|
||||
|
||||
|
|
@ -1387,6 +1397,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public int getAudioSessionId() {
|
||||
verifyApplicationThread();
|
||||
return audioSessionId;
|
||||
}
|
||||
|
||||
|
|
@ -1398,6 +1409,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public void clearAuxEffectInfo() {
|
||||
verifyApplicationThread();
|
||||
setAuxEffectInfo(new AuxEffectInfo(AuxEffectInfo.NO_AUX_EFFECT_ID, /* sendLevel= */ 0f));
|
||||
}
|
||||
|
||||
|
|
@ -1416,11 +1428,13 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public float getVolume() {
|
||||
verifyApplicationThread();
|
||||
return volume;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkipSilenceEnabled() {
|
||||
verifyApplicationThread();
|
||||
return skipSilenceEnabled;
|
||||
}
|
||||
|
||||
|
|
@ -1439,6 +1453,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public AnalyticsCollector getAnalyticsCollector() {
|
||||
verifyApplicationThread();
|
||||
return analyticsCollector;
|
||||
}
|
||||
|
||||
|
|
@ -1485,24 +1500,28 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Nullable
|
||||
public Format getVideoFormat() {
|
||||
verifyApplicationThread();
|
||||
return videoFormat;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Format getAudioFormat() {
|
||||
verifyApplicationThread();
|
||||
return audioFormat;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public DecoderCounters getVideoDecoderCounters() {
|
||||
verifyApplicationThread();
|
||||
return videoDecoderCounters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public DecoderCounters getAudioDecoderCounters() {
|
||||
verifyApplicationThread();
|
||||
return audioDecoderCounters;
|
||||
}
|
||||
|
||||
|
|
@ -1572,6 +1591,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public void setHandleWakeLock(boolean handleWakeLock) {
|
||||
verifyApplicationThread();
|
||||
setWakeMode(handleWakeLock ? C.WAKE_MODE_LOCAL : C.WAKE_MODE_NONE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue