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
8be677a426
commit
00dbb780f1
@ -387,6 +387,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public AudioComponent getAudioComponent() {
|
public AudioComponent getAudioComponent() {
|
||||||
|
verifyApplicationThread();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,6 +395,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public VideoComponent getVideoComponent() {
|
public VideoComponent getVideoComponent() {
|
||||||
|
verifyApplicationThread();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,6 +403,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public TextComponent getTextComponent() {
|
public TextComponent getTextComponent() {
|
||||||
|
verifyApplicationThread();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,6 +411,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public DeviceComponent getDeviceComponent() {
|
public DeviceComponent getDeviceComponent() {
|
||||||
|
verifyApplicationThread();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,6 +485,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void retry() {
|
public void retry() {
|
||||||
|
verifyApplicationThread();
|
||||||
prepare();
|
prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -911,6 +916,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
|
verifyApplicationThread();
|
||||||
stop(/* reset= */ false);
|
stop(/* reset= */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1194,6 +1200,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @C.VideoScalingMode int getVideoScalingMode() {
|
public @C.VideoScalingMode int getVideoScalingMode() {
|
||||||
|
verifyApplicationThread();
|
||||||
return videoScalingMode;
|
return videoScalingMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1211,11 +1218,13 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
|
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
|
||||||
|
verifyApplicationThread();
|
||||||
return videoChangeFrameRateStrategy;
|
return videoChangeFrameRateStrategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VideoSize getVideoSize() {
|
public VideoSize getVideoSize() {
|
||||||
|
verifyApplicationThread();
|
||||||
return videoSize;
|
return videoSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1362,6 +1371,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AudioAttributes getAudioAttributes() {
|
public AudioAttributes getAudioAttributes() {
|
||||||
|
verifyApplicationThread();
|
||||||
return audioAttributes;
|
return audioAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1392,6 +1402,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAudioSessionId() {
|
public int getAudioSessionId() {
|
||||||
|
verifyApplicationThread();
|
||||||
return audioSessionId;
|
return audioSessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1403,6 +1414,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearAuxEffectInfo() {
|
public void clearAuxEffectInfo() {
|
||||||
|
verifyApplicationThread();
|
||||||
setAuxEffectInfo(new AuxEffectInfo(AuxEffectInfo.NO_AUX_EFFECT_ID, /* sendLevel= */ 0f));
|
setAuxEffectInfo(new AuxEffectInfo(AuxEffectInfo.NO_AUX_EFFECT_ID, /* sendLevel= */ 0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1421,11 +1433,13 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getVolume() {
|
public float getVolume() {
|
||||||
|
verifyApplicationThread();
|
||||||
return volume;
|
return volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getSkipSilenceEnabled() {
|
public boolean getSkipSilenceEnabled() {
|
||||||
|
verifyApplicationThread();
|
||||||
return skipSilenceEnabled;
|
return skipSilenceEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1444,6 +1458,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AnalyticsCollector getAnalyticsCollector() {
|
public AnalyticsCollector getAnalyticsCollector() {
|
||||||
|
verifyApplicationThread();
|
||||||
return analyticsCollector;
|
return analyticsCollector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1490,24 +1505,28 @@ import java.util.concurrent.TimeoutException;
|
|||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public Format getVideoFormat() {
|
public Format getVideoFormat() {
|
||||||
|
verifyApplicationThread();
|
||||||
return videoFormat;
|
return videoFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public Format getAudioFormat() {
|
public Format getAudioFormat() {
|
||||||
|
verifyApplicationThread();
|
||||||
return audioFormat;
|
return audioFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public DecoderCounters getVideoDecoderCounters() {
|
public DecoderCounters getVideoDecoderCounters() {
|
||||||
|
verifyApplicationThread();
|
||||||
return videoDecoderCounters;
|
return videoDecoderCounters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public DecoderCounters getAudioDecoderCounters() {
|
public DecoderCounters getAudioDecoderCounters() {
|
||||||
|
verifyApplicationThread();
|
||||||
return audioDecoderCounters;
|
return audioDecoderCounters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1577,6 +1596,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHandleWakeLock(boolean handleWakeLock) {
|
public void setHandleWakeLock(boolean handleWakeLock) {
|
||||||
|
verifyApplicationThread();
|
||||||
setWakeMode(handleWakeLock ? C.WAKE_MODE_LOCAL : C.WAKE_MODE_NONE);
|
setWakeMode(handleWakeLock ? C.WAKE_MODE_LOCAL : C.WAKE_MODE_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user