mirror of
https://github.com/samsonjs/media.git
synced 2026-04-03 10:55:48 +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
ea2f73af4d
commit
449a840f88
1 changed files with 20 additions and 0 deletions
|
|
@ -393,6 +393,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public AudioComponent getAudioComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -400,6 +401,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public VideoComponent getVideoComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -407,6 +409,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public TextComponent getTextComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -414,6 +417,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public DeviceComponent getDeviceComponent() {
|
||||
verifyApplicationThread();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -487,6 +491,7 @@ import java.util.concurrent.TimeoutException;
|
|||
@Override
|
||||
@Deprecated
|
||||
public void retry() {
|
||||
verifyApplicationThread();
|
||||
prepare();
|
||||
}
|
||||
|
||||
|
|
@ -917,6 +922,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public void stop() {
|
||||
verifyApplicationThread();
|
||||
stop(/* reset= */ false);
|
||||
}
|
||||
|
||||
|
|
@ -1200,6 +1206,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public @C.VideoScalingMode int getVideoScalingMode() {
|
||||
verifyApplicationThread();
|
||||
return videoScalingMode;
|
||||
}
|
||||
|
||||
|
|
@ -1217,11 +1224,13 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public @C.VideoChangeFrameRateStrategy int getVideoChangeFrameRateStrategy() {
|
||||
verifyApplicationThread();
|
||||
return videoChangeFrameRateStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoSize getVideoSize() {
|
||||
verifyApplicationThread();
|
||||
return videoSize;
|
||||
}
|
||||
|
||||
|
|
@ -1368,6 +1377,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public AudioAttributes getAudioAttributes() {
|
||||
verifyApplicationThread();
|
||||
return audioAttributes;
|
||||
}
|
||||
|
||||
|
|
@ -1398,6 +1408,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public int getAudioSessionId() {
|
||||
verifyApplicationThread();
|
||||
return audioSessionId;
|
||||
}
|
||||
|
||||
|
|
@ -1409,6 +1420,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public void clearAuxEffectInfo() {
|
||||
verifyApplicationThread();
|
||||
setAuxEffectInfo(new AuxEffectInfo(AuxEffectInfo.NO_AUX_EFFECT_ID, /* sendLevel= */ 0f));
|
||||
}
|
||||
|
||||
|
|
@ -1427,11 +1439,13 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public float getVolume() {
|
||||
verifyApplicationThread();
|
||||
return volume;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSkipSilenceEnabled() {
|
||||
verifyApplicationThread();
|
||||
return skipSilenceEnabled;
|
||||
}
|
||||
|
||||
|
|
@ -1450,6 +1464,7 @@ import java.util.concurrent.TimeoutException;
|
|||
|
||||
@Override
|
||||
public AnalyticsCollector getAnalyticsCollector() {
|
||||
verifyApplicationThread();
|
||||
return analyticsCollector;
|
||||
}
|
||||
|
||||
|
|
@ -1496,24 +1511,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;
|
||||
}
|
||||
|
||||
|
|
@ -1583,6 +1602,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