diff --git a/extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/CastTimelineTrackerTest.java b/extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/CastTimelineTrackerTest.java index 71bfc97f7f..8de209c5b4 100644 --- a/extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/CastTimelineTrackerTest.java +++ b/extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/CastTimelineTrackerTest.java @@ -311,7 +311,7 @@ public class CastTimelineTrackerTest { } private static MediaInfo getMediaInfo(long durationMs) { - return new MediaInfo.Builder(/*contentId= */ "") + return new MediaInfo.Builder(/* contentId= */ "") .setStreamDuration(durationMs) .setContentType(MimeTypes.APPLICATION_MP4) .setStreamType(MediaInfo.STREAM_TYPE_NONE) diff --git a/extensions/cronet/src/test/java/com/google/android/exoplayer2/ext/cronet/CronetDataSourceTest.java b/extensions/cronet/src/test/java/com/google/android/exoplayer2/ext/cronet/CronetDataSourceTest.java index 13c59636ae..46f83353e4 100644 --- a/extensions/cronet/src/test/java/com/google/android/exoplayer2/ext/cronet/CronetDataSourceTest.java +++ b/extensions/cronet/src/test/java/com/google/android/exoplayer2/ext/cronet/CronetDataSourceTest.java @@ -1157,7 +1157,7 @@ public final class CronetDataSourceTest { @Test public void redirectParseAndAttachCookie_dataSourceDoesNotHandleSetCookie_followsRedirect() throws HttpDataSourceException { - mockSingleRedirectSuccess(/*responseCode=*/ 300); + mockSingleRedirectSuccess(/* responseCode= */ 300); mockFollowRedirectSuccess(); testResponseHeader.put("Set-Cookie", "testcookie=testcookie; Path=/video"); @@ -1182,7 +1182,7 @@ public final class CronetDataSourceTest { dataSourceUnderTest.addTransferListener(mockTransferListener); dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE); - mockSingleRedirectSuccess(/*responseCode=*/ 300); + mockSingleRedirectSuccess(/* responseCode= */ 300); testResponseHeader.put("Set-Cookie", "testcookie=testcookie; Path=/video"); @@ -1210,7 +1210,7 @@ public final class CronetDataSourceTest { dataSourceUnderTest.addTransferListener(mockTransferListener); dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE); - mockSingleRedirectSuccess(/*responseCode=*/ 300); + mockSingleRedirectSuccess(/* responseCode= */ 300); mockReadSuccess(0, 1000); testResponseHeader.put("Set-Cookie", "testcookie=testcookie; Path=/video"); @@ -1225,7 +1225,7 @@ public final class CronetDataSourceTest { @Test public void redirectNoSetCookieFollowsRedirect() throws HttpDataSourceException { - mockSingleRedirectSuccess(/*responseCode=*/ 300); + mockSingleRedirectSuccess(/* responseCode= */ 300); mockFollowRedirectSuccess(); dataSourceUnderTest.open(testDataSpec); @@ -1245,7 +1245,7 @@ public final class CronetDataSourceTest { .setHandleSetCookieRequests(true) .createDataSource(); dataSourceUnderTest.addTransferListener(mockTransferListener); - mockSingleRedirectSuccess(/*responseCode=*/ 300); + mockSingleRedirectSuccess(/* responseCode= */ 300); mockFollowRedirectSuccess(); dataSourceUnderTest.open(testDataSpec); @@ -1255,7 +1255,7 @@ public final class CronetDataSourceTest { @Test public void redirectPostFollowRedirect() throws HttpDataSourceException { - mockSingleRedirectSuccess(/*responseCode=*/ 302); + mockSingleRedirectSuccess(/* responseCode= */ 302); mockFollowRedirectSuccess(); dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE); @@ -1275,7 +1275,7 @@ public final class CronetDataSourceTest { .setKeepPostFor302Redirects(false) .setHandleSetCookieRequests(true) .createDataSource(); - mockSingleRedirectSuccess(/*responseCode=*/ 302); + mockSingleRedirectSuccess(/* responseCode= */ 302); dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE); testResponseHeader.put("Set-Cookie", "testcookie=testcookie; Path=/video"); @@ -1297,7 +1297,7 @@ public final class CronetDataSourceTest { .setResetTimeoutOnRedirects(true) .setKeepPostFor302Redirects(true) .createDataSource(); - mockSingleRedirectSuccess(/*responseCode=*/ 302); + mockSingleRedirectSuccess(/* responseCode= */ 302); dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE); dataSourceUnderTest.open(testPostDataSpec); diff --git a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.java b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.java index 9a94c53edf..2616057b05 100644 --- a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.java +++ b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.java @@ -680,7 +680,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou adPlaybackState, /* fromPositionUs= */ fromPositionUs, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ getAdDuration( + /* adDurationsUs= */ getAdDuration( /* startTimeSeconds= */ cuePoint.getStartTime(), /* endTimeSeconds= */ cuePoint.getEndTime())); } diff --git a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaUtil.java b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaUtil.java index 7a5e90c149..66eb9a4cad 100644 --- a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaUtil.java +++ b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaUtil.java @@ -443,7 +443,7 @@ import java.util.Set; private static AdPlaybackState splitAdGroupForPeriod( Object adsId, AdGroup adGroup, long periodStartUs, long periodDurationUs) { AdPlaybackState adPlaybackState = - new AdPlaybackState(checkNotNull(adsId), /* adGroupTimesUs...= */ 0) + new AdPlaybackState(checkNotNull(adsId), /* adGroupTimesUs= */ 0) .withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1) .withAdDurationsUs(/* adGroupIndex= */ 0, periodDurationUs) .withIsServerSideInserted(/* adGroupIndex= */ 0, true) @@ -605,7 +605,7 @@ import java.util.Set; adPlaybackState, /* fromPositionUs= */ currentContentPeriodPositionUs, /* contentResumeOffsetUs= */ sum(adDurationsUs), - /* adDurationsUs...= */ adDurationsUs); + /* adDurationsUs= */ adDurationsUs); adGroupIndex = adPlaybackState.getAdGroupIndexForPositionUs( mediaPeriodPositionUs, /* periodDurationUs= */ C.TIME_UNSET); diff --git a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java index aa541a7518..6cc8135e60 100644 --- a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java +++ b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java @@ -239,7 +239,7 @@ public final class ImaAdsLoaderTest { assertThat(getAdPlaybackState(/* periodIndex= */ 0)) .isEqualTo( - new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs...= */ 0) + new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs= */ 0) .withContentDurationUs(CONTENT_PERIOD_DURATION_US)); } @@ -312,7 +312,7 @@ public final class ImaAdsLoaderTest { // Verify that the preroll ad has been marked as played. assertThat(getAdPlaybackState(/* periodIndex= */ 0)) .isEqualTo( - new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs...= */ 0) + new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs= */ 0) .withContentDurationUs(CONTENT_PERIOD_DURATION_US) .withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1) .withAvailableAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI) @@ -336,7 +336,7 @@ public final class ImaAdsLoaderTest { assertThat(getAdPlaybackState(/* periodIndex= */ 0)) .isEqualTo( - new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs...= */ 20_500_000) + new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs= */ 20_500_000) .withContentDurationUs(CONTENT_PERIOD_DURATION_US) .withAdDurationsUs(new long[][] {{TEST_AD_DURATION_US}}) .withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1) @@ -384,7 +384,7 @@ public final class ImaAdsLoaderTest { assertThat(getAdPlaybackState(/* periodIndex= */ 0)) .isEqualTo( - new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs...= */ C.TIME_END_OF_SOURCE) + new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs= */ C.TIME_END_OF_SOURCE) .withContentDurationUs(CONTENT_PERIOD_DURATION_US) .withAdDurationsUs(new long[][] {{TEST_AD_DURATION_US}}) .withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1) @@ -1114,7 +1114,7 @@ public final class ImaAdsLoaderTest { // Verify that the preroll ad has been marked as played. assertThat(getAdPlaybackState(/* periodIndex= */ 0)) .isEqualTo( - new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs...= */ 0) + new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs= */ 0) .withContentDurationUs(CONTENT_PERIOD_DURATION_US) .withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1) .withAvailableAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI) @@ -1123,7 +1123,7 @@ public final class ImaAdsLoaderTest { .withAdResumePositionUs(/* adResumePositionUs= */ 0)); // Verify that the second source's ad cue points have preloaded. assertThat(getAdPlaybackState(/* periodIndex= */ 1)) - .isEqualTo(new AdPlaybackState(secondAdsId, /* adGroupTimesUs...= */ 0)); + .isEqualTo(new AdPlaybackState(secondAdsId, /* adGroupTimesUs= */ 0)); } @Test @@ -1181,7 +1181,7 @@ public final class ImaAdsLoaderTest { // Verify that the preroll ad has been marked as played. assertThat(getAdPlaybackState(/* periodIndex= */ 0)) .isEqualTo( - new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs...= */ 0) + new AdPlaybackState(TEST_ADS_ID, /* adGroupTimesUs= */ 0) .withContentDurationUs(CONTENT_PERIOD_DURATION_US) .withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1) .withAvailableAdUri(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0, TEST_URI) @@ -1190,7 +1190,7 @@ public final class ImaAdsLoaderTest { .withAdResumePositionUs(/* adResumePositionUs= */ 0)); // Verify that the second source's ad cue points have preloaded. assertThat(getAdPlaybackState(/* periodIndex= */ 1)) - .isEqualTo(new AdPlaybackState(secondAdsId, /* adGroupTimesUs...= */ 0)); + .isEqualTo(new AdPlaybackState(secondAdsId, /* adGroupTimesUs= */ 0)); } @Test diff --git a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSourceTest.java b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSourceTest.java index 901a5c127b..1b4bb35902 100644 --- a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSourceTest.java +++ b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSourceTest.java @@ -37,7 +37,7 @@ public class ImaServerSideAdInsertionMediaSourceTest { new AdPlaybackState("adsId1"), /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 10, - /* adDurationsUs...= */ 5_000_000, + /* adDurationsUs= */ 5_000_000, 10_000_000, 20_000_000); AdPlaybackState secondAdPlaybackState = @@ -45,20 +45,20 @@ public class ImaServerSideAdInsertionMediaSourceTest { new AdPlaybackState("adsId2"), /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 10, - /* adDurationsUs...= */ 10_000_000) + /* adDurationsUs= */ 10_000_000) .withPlayedAd(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0); AdPlaybackState thirdAdPlaybackState = ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState( new AdPlaybackState("adsId3"), /* fromPositionUs= */ C.TIME_END_OF_SOURCE, /* contentResumeOffsetUs= */ 10, - /* adDurationsUs...= */ 10_000_000); + /* adDurationsUs= */ 10_000_000); thirdAdPlaybackState = ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState( thirdAdPlaybackState, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 10, - /* adDurationsUs...= */ 10_000_000) + /* adDurationsUs= */ 10_000_000) .withRemovedAdGroupCount(1); State state = new State( diff --git a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaUtilTest.java b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaUtilTest.java index ad094ced27..1518ac7318 100644 --- a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaUtilTest.java +++ b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaUtilTest.java @@ -435,7 +435,7 @@ public class ImaUtilTest { new AdPlaybackState(/* adsId= */ "adsId", 0) .withAdCount(/* adGroupIndex= */ 0, periodCount) .withAdDurationsUs( - /* adGroupIndex= */ 0, /* adDurationsUs...= */ + /* adGroupIndex= */ 0, /* adDurationsUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US + periodDurationUs, periodDurationUs, periodDurationUs, @@ -475,12 +475,10 @@ public class ImaUtilTest { .withAdCount(/* adGroupIndex= */ 1, 1) .withAdCount(/* adGroupIndex= */ 2, 1) .withAdDurationsUs( - /* adGroupIndex= */ 0, /* adDurationsUs...= */ + /* adGroupIndex= */ 0, /* adDurationsUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US + (2 * periodDurationUs)) - .withAdDurationsUs( - /* adGroupIndex= */ 1, /* adDurationsUs...= */ (2 * periodDurationUs)) - .withAdDurationsUs( - /* adGroupIndex= */ 2, /* adDurationsUs...= */ (2 * periodDurationUs)) + .withAdDurationsUs(/* adGroupIndex= */ 1, /* adDurationsUs= */ (2 * periodDurationUs)) + .withAdDurationsUs(/* adGroupIndex= */ 2, /* adDurationsUs= */ (2 * periodDurationUs)) .withPlayedAd(/* adGroupIndex= */ 0, /* adIndexInAdGroup= */ 0) .withPlayedAd(/* adGroupIndex= */ 1, /* adIndexInAdGroup= */ 0) .withIsServerSideInserted(/* adGroupIndex= */ 0, true) @@ -522,7 +520,7 @@ public class ImaUtilTest { // around removed. DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US + periodDurationUs + 2) .withAdCount(/* adGroupIndex= */ 0, 1) - .withAdDurationsUs(/* adGroupIndex= */ 0, /* adDurationsUs...= */ periodDurationUs) + .withAdDurationsUs(/* adGroupIndex= */ 0, /* adDurationsUs= */ periodDurationUs) .withIsServerSideInserted(/* adGroupIndex= */ 0, true); FakeTimeline timeline = new FakeTimeline( @@ -545,7 +543,7 @@ public class ImaUtilTest { AdPlaybackState adPlaybackState = new AdPlaybackState(/* adsId= */ "adsId", periodDurationUs - 1) .withAdCount(/* adGroupIndex= */ 0, 1) - .withAdDurationsUs(/* adGroupIndex= */ 0, /* adDurationsUs...= */ periodDurationUs) + .withAdDurationsUs(/* adGroupIndex= */ 0, /* adDurationsUs= */ periodDurationUs) .withIsServerSideInserted(/* adGroupIndex= */ 0, true); FakeTimeline timeline = new FakeTimeline( @@ -569,7 +567,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 30_000_000); + /* adDurationsUs= */ 30_000_000); adPlaybackState = ImaUtil.expandAdGroupPlaceholder( @@ -594,7 +592,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 30_000_000); + /* adDurationsUs= */ 30_000_000); adPlaybackState = ImaUtil.expandAdGroupPlaceholder( @@ -619,7 +617,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 30_000_000); + /* adDurationsUs= */ 30_000_000); adPlaybackState = ImaUtil.expandAdGroupPlaceholder( @@ -644,7 +642,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 30_000_000); + /* adDurationsUs= */ 30_000_000); adPlaybackState = ImaUtil.expandAdGroupPlaceholder( @@ -667,7 +665,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 10_000_001); + /* adDurationsUs= */ 10_000_001); adPlaybackState = ImaUtil.expandAdGroupPlaceholder( @@ -690,7 +688,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 30_000_000); + /* adDurationsUs= */ 30_000_000); adPlaybackState = ImaUtil.expandAdGroupPlaceholder( @@ -714,7 +712,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 10_000_000, + /* adDurationsUs= */ 10_000_000, 20_000_000, 0); @@ -739,7 +737,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 0, + /* adDurationsUs= */ 0, 10_000_000, 20_000_000); @@ -764,7 +762,7 @@ public class ImaUtilTest { AdPlaybackState.NONE, /* fromPositionUs= */ 0, /* contentResumeOffsetUs= */ 0, - /* adDurationsUs...= */ 5_000_000, + /* adDurationsUs= */ 5_000_000, 10_000_000, 20_000_000); diff --git a/extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java b/extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java index 95a4de028d..221370f01b 100644 --- a/extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java +++ b/extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java @@ -264,7 +264,7 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab // int arguments (int what, int extra). Since PlaybackException defines a single error // code, we pass 0 as the extra. context.getString( - R.string.lb_media_player_error, /* formatArgs...= */ error.errorCode, 0)); + R.string.lb_media_player_error, /* formatArgs= */ error.errorCode, 0)); } } diff --git a/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessingPipeline.java b/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessingPipeline.java new file mode 100644 index 0000000000..21cf77e2d7 --- /dev/null +++ b/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessingPipeline.java @@ -0,0 +1,331 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.android.exoplayer2.audio; + +import static com.google.android.exoplayer2.audio.AudioProcessor.EMPTY_BUFFER; +import static com.google.android.exoplayer2.util.Assertions.checkState; + +import androidx.annotation.Nullable; +import com.google.android.exoplayer2.audio.AudioProcessor.AudioFormat; +import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.CanIgnoreReturnValue; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; + +/** + * Handles passing buffers through multiple {@link AudioProcessor} instances. + * + *
Two instances of {@link AudioProcessingPipeline} are considered {@linkplain #equals(Object) + * equal} if they have the same underlying {@link AudioProcessor} references, in the same order. + * + *
To make use of this class, the caller must: + * + *
If underlying {@link AudioProcessor} instances have pending configuration changes, or the + * {@link AudioFormat} of the input is changing: + * + *
To apply the new configuration for use, the pipeline must be {@linkplain #flush() flushed}. + * Before applying the new configuration, it is safe to queue input and get output in the old + * input/output formats/configuration. Call {@link #queueEndOfStream()} when no more input will be + * supplied for processing in the old configuration. + * + * @param inputAudioFormat The format of audio that will be queued after the next call to {@link + * #flush()}. + * @return The configured output audio format. + * @throws AudioProcessor.UnhandledAudioFormatException If the specified format is not supported + * by the pipeline. + */ + @CanIgnoreReturnValue + public AudioFormat configure(AudioFormat inputAudioFormat) + throws AudioProcessor.UnhandledAudioFormatException { + if (inputAudioFormat.equals(AudioFormat.NOT_SET)) { + throw new AudioProcessor.UnhandledAudioFormatException(inputAudioFormat); + } + + AudioFormat intermediateAudioFormat = inputAudioFormat; + + for (int i = 0; i < audioProcessors.size(); i++) { + AudioProcessor audioProcessor = audioProcessors.get(i); + AudioFormat nextFormat = audioProcessor.configure(intermediateAudioFormat); + if (audioProcessor.isActive()) { + checkState(!nextFormat.equals(AudioFormat.NOT_SET)); + intermediateAudioFormat = nextFormat; + } + } + + return pendingOutputAudioFormat = intermediateAudioFormat; + } + + /** + * Clears any buffered data and pending output. If any underlying audio processors are {@linkplain + * AudioProcessor#isActive() active}, this also prepares them to receive a new stream of input in + * the last {@linkplain #configure(AudioFormat) configured} (pending) format. + * + *
{@link #configure(AudioFormat)} must have been called at least once since the last call to + * {@link #reset()} before calling this. + */ + public void flush() { + activeAudioProcessors.clear(); + outputAudioFormat = pendingOutputAudioFormat; + inputEnded = false; + + for (int i = 0; i < audioProcessors.size(); i++) { + AudioProcessor audioProcessor = audioProcessors.get(i); + audioProcessor.flush(); + if (audioProcessor.isActive()) { + activeAudioProcessors.add(audioProcessor); + } + } + + outputBuffers = new ByteBuffer[activeAudioProcessors.size()]; + for (int i = 0; i <= getFinalOutputBufferIndex(); i++) { + outputBuffers[i] = activeAudioProcessors.get(i).getOutput(); + } + } + + /** Returns the {@link AudioFormat} currently being output. */ + public AudioFormat getOutputAudioFormat() { + return outputAudioFormat; + } + + /** + * Whether the pipeline can be used for processing buffers. + * + *
For this to happen the pipeline must be {@linkplain #configure(AudioFormat) configured}, + * {@linkplain #flush() flushed} and have {@linkplain AudioProcessor#isActive() active} + * {@linkplain AudioProcessor underlying audio processors} that are ready to process buffers with + * the current configuration. + */ + public boolean isOperational() { + return !activeAudioProcessors.isEmpty(); + } + + /** + * Queues audio data between the position and limit of the {@code inputBuffer} for processing. + * After calling this method, processed output may be available via {@link #getOutput()}. + * + * @param inputBuffer The input buffer to process. It must be a direct {@link ByteBuffer} with + * native byte order. Its contents are treated as read-only. Its position will be advanced by + * the number of bytes consumed (which may be zero). The caller retains ownership of the + * provided buffer. + */ + public void queueInput(ByteBuffer inputBuffer) { + if (!isOperational() || inputEnded) { + return; + } + processData(inputBuffer); + } + + /** + * Returns a {@link ByteBuffer} containing processed output data between its position and limit. + * The buffer will be empty if no output is available. + * + *
Buffers returned from this method are retained by pipeline, and it is necessary to consume + * the data (or copy it into another buffer) to allow the pipeline to progress. + * + * @return A buffer containing processed output data between its position and limit. + */ + public ByteBuffer getOutput() { + if (!isOperational()) { + return EMPTY_BUFFER; + } + processData(EMPTY_BUFFER); + return outputBuffers[getFinalOutputBufferIndex()]; + } + + /** + * Queues an end of stream signal. After this method has been called, {@link + * #queueInput(ByteBuffer)} should not be called until after the next call to {@link #flush()}. + * Calling {@link #getOutput()} will return any remaining output data. Multiple calls may be + * required to read all of the remaining output data. {@link #isEnded()} will return {@code true} + * once all remaining output data has been read. + */ + public void queueEndOfStream() { + if (!isOperational() || inputEnded) { + return; + } + inputEnded = true; + activeAudioProcessors.get(0).queueEndOfStream(); + } + + /** + * Returns whether the pipeline has ended. + * + *
The pipeline is considered ended when: + * + *
Two instances of {@link AudioProcessingPipeline} are considered equal if they have the same + * underlying {@link AudioProcessor} references in the same order. + */ + @Override + public boolean equals(@Nullable Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AudioProcessingPipeline)) { + return false; + } + AudioProcessingPipeline that = (AudioProcessingPipeline) o; + if (this.audioProcessors.size() != that.audioProcessors.size()) { + return false; + } + for (int i = 0; i < this.audioProcessors.size(); i++) { + if (this.audioProcessors.get(i) != that.audioProcessors.get(i)) { + return false; + } + } + + return true; + } + + @Override + public int hashCode() { + return audioProcessors.hashCode(); + } + + private void processData(ByteBuffer inputBuffer) { + boolean progressMade = true; + while (progressMade) { + progressMade = false; + for (int index = 0; index <= getFinalOutputBufferIndex(); index++) { + if (outputBuffers[index].hasRemaining()) { + // Processor at this index has output that has not been consumed. Do not queue input. + continue; + } + + AudioProcessor audioProcessor = activeAudioProcessors.get(index); + + if (audioProcessor.isEnded()) { + if (!outputBuffers[index].hasRemaining() && index < getFinalOutputBufferIndex()) { + activeAudioProcessors.get(index + 1).queueEndOfStream(); + } + continue; + } + + ByteBuffer input = + index > 0 + ? outputBuffers[index - 1] + : inputBuffer.hasRemaining() ? inputBuffer : EMPTY_BUFFER; + long inputBytes = input.remaining(); + audioProcessor.queueInput(input); + outputBuffers[index] = audioProcessor.getOutput(); + + progressMade |= (inputBytes - input.remaining()) > 0 || outputBuffers[index].hasRemaining(); + } + } + } + + private int getFinalOutputBufferIndex() { + return outputBuffers.length - 1; + } +} diff --git a/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessor.java b/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessor.java index 791f9aa050..3848b28674 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessor.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessor.java @@ -35,6 +35,13 @@ public interface AudioProcessor { /** PCM audio format that may be handled by an audio processor. */ final class AudioFormat { + /** + * An {@link AudioFormat} instance to represent an unset {@link AudioFormat}. This should not be + * returned by {@link #configure(AudioFormat)} if the processor {@link #isActive()}. + * + *
Typically used to represent an inactive {@link AudioProcessor} {@linkplain
+ * #configure(AudioFormat) output format}.
+ */
public static final AudioFormat NOT_SET =
new AudioFormat(
/* sampleRate= */ Format.NO_VALUE,
diff --git a/library/common/src/main/java/com/google/android/exoplayer2/util/GlProgram.java b/library/common/src/main/java/com/google/android/exoplayer2/util/GlProgram.java
index 18a1cc60bc..2019e894d9 100644
--- a/library/common/src/main/java/com/google/android/exoplayer2/util/GlProgram.java
+++ b/library/common/src/main/java/com/google/android/exoplayer2/util/GlProgram.java
@@ -327,7 +327,7 @@ public final class GlProgram {
/* unusedLength */ new int[1],
/* lengthOffset= */ 0,
/* unusedSize */ new int[1],
- /*sizeOffset= */ 0,
+ /* sizeOffset= */ 0,
type,
/* typeOffset= */ 0,
nameBytes,
diff --git a/library/common/src/test/java/com/google/android/exoplayer2/audio/AudioProcessingPipelineTest.java b/library/common/src/test/java/com/google/android/exoplayer2/audio/AudioProcessingPipelineTest.java
new file mode 100644
index 0000000000..d06aada5f9
--- /dev/null
+++ b/library/common/src/test/java/com/google/android/exoplayer2/audio/AudioProcessingPipelineTest.java
@@ -0,0 +1,368 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.android.exoplayer2.audio;
+
+import static com.google.common.truth.Truth.assertThat;
+import static java.lang.Math.min;
+
+import androidx.annotation.Nullable;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import com.google.android.exoplayer2.C;
+import com.google.android.exoplayer2.audio.AudioProcessor.AudioFormat;
+import com.google.common.collect.ImmutableList;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.ArrayList;
+import java.util.List;
+import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+// TODO(b/198772621): Add tests for PlaybackParameter changes once Sonic or
+// DefaultAudioProcessorChain is in common.
+/** Unit tests for {@link AudioProcessingPipeline}. */
+@RunWith(AndroidJUnit4.class)
+public final class AudioProcessingPipelineTest {
+ private static final AudioFormat AUDIO_FORMAT =
+ new AudioFormat(/* sampleRate= */ 44100, /* channelCount= */ 2, C.ENCODING_PCM_16BIT);
+
+ @Test
+ public void noAudioProcessors_isNotOperational() throws Exception {
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of());
+
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ audioProcessingPipeline.flush();
+
+ assertThat(audioProcessingPipeline.isOperational()).isFalse();
+ }
+
+ @Test
+ public void sameProcessors_pipelinesAreOnlyEqualIfSameOrderAndReference() throws Exception {
+ AudioProcessor audioProcessorOne = new FakeAudioProcessor(/* active= */ true);
+ AudioProcessor audioProcessorTwo = new FakeAudioProcessor(/* active= */ false);
+ AudioProcessor audioProcessorThree = new FakeAudioProcessor(/* active= */ true);
+
+ AudioProcessingPipeline pipelineOne =
+ new AudioProcessingPipeline(
+ ImmutableList.of(audioProcessorOne, audioProcessorTwo, audioProcessorThree));
+ // The internal state of the pipeline does not affect equality.
+ pipelineOne.configure(AUDIO_FORMAT);
+ pipelineOne.flush();
+
+ AudioProcessingPipeline pipelineTwo =
+ new AudioProcessingPipeline(
+ ImmutableList.of(audioProcessorOne, audioProcessorTwo, audioProcessorThree));
+
+ assertThat(pipelineOne).isEqualTo(pipelineTwo);
+
+ AudioProcessingPipeline pipelineThree =
+ new AudioProcessingPipeline(
+ ImmutableList.of(audioProcessorThree, audioProcessorTwo, audioProcessorOne));
+ assertThat(pipelineTwo).isNotEqualTo(pipelineThree);
+ }
+
+ @Test
+ public void configuringPipeline_givesFormat() throws Exception {
+ FakeAudioProcessor fakeSampleRateChangingAudioProcessor =
+ new FakeAudioProcessor(/* active= */ true) {
+ @Override
+ public AudioFormat configure(AudioFormat inputAudioFormat)
+ throws UnhandledAudioFormatException {
+ AudioFormat outputFormat =
+ new AudioFormat(
+ inputAudioFormat.sampleRate * 2,
+ inputAudioFormat.channelCount,
+ inputAudioFormat.encoding);
+ return super.configure(outputFormat);
+ }
+ };
+
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of(fakeSampleRateChangingAudioProcessor));
+ AudioFormat outputFormat = audioProcessingPipeline.configure(AUDIO_FORMAT);
+
+ assertThat(outputFormat.sampleRate).isEqualTo(AUDIO_FORMAT.sampleRate * 2);
+ }
+
+ @Test
+ public void configuringAndFlushingPipeline_isOperational() throws Exception {
+ FakeAudioProcessor fakeSampleRateChangingAudioProcessor =
+ new FakeAudioProcessor(/* active= */ true) {
+ @Override
+ public AudioFormat configure(AudioFormat inputAudioFormat)
+ throws UnhandledAudioFormatException {
+ AudioFormat outputFormat =
+ new AudioFormat(
+ inputAudioFormat.sampleRate * 2,
+ inputAudioFormat.channelCount,
+ inputAudioFormat.encoding);
+ return super.configure(outputFormat);
+ }
+ };
+
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of(fakeSampleRateChangingAudioProcessor));
+
+ assertThat(audioProcessingPipeline.isOperational()).isFalse();
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ // Configuring the pipeline is not enough for it to be operational.
+ assertThat(audioProcessingPipeline.isOperational()).isFalse();
+ audioProcessingPipeline.flush();
+ assertThat(audioProcessingPipeline.isOperational()).isTrue();
+ }
+
+ @Test
+ public void reconfigure_doesNotChangeOperational_untilFlush() throws Exception {
+ FakeAudioProcessor audioProcessor = new FakeAudioProcessor(/* active= */ true);
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of(audioProcessor));
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ audioProcessingPipeline.flush();
+ assertThat(audioProcessingPipeline.isOperational()).isTrue();
+
+ audioProcessor.setActive(false);
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ assertThat(audioProcessingPipeline.isOperational()).isTrue();
+ audioProcessingPipeline.flush();
+ assertThat(audioProcessingPipeline.isOperational()).isFalse();
+ }
+
+ @Test
+ public void inactiveProcessor_isIgnoredInConfiguration() throws Exception {
+ FakeAudioProcessor fakeSampleRateChangingAudioProcessor =
+ new FakeAudioProcessor(/* active= */ false) {
+ @Override
+ public AudioFormat configure(AudioFormat inputAudioFormat)
+ throws UnhandledAudioFormatException {
+ AudioFormat outputFormat =
+ new AudioFormat(
+ inputAudioFormat.sampleRate * 2,
+ inputAudioFormat.channelCount,
+ inputAudioFormat.encoding);
+ return super.configure(outputFormat);
+ }
+ };
+
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of(fakeSampleRateChangingAudioProcessor));
+ AudioFormat outputFormat = audioProcessingPipeline.configure(AUDIO_FORMAT);
+ audioProcessingPipeline.flush();
+ assertThat(outputFormat).isEqualTo(AUDIO_FORMAT);
+ assertThat(audioProcessingPipeline.isOperational()).isFalse();
+ }
+
+ @Test
+ public void queueInput_producesOutputBuffer() throws Exception {
+ FakeAudioProcessor audioProcessor = new FakeAudioProcessor(/* active= */ true);
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of(audioProcessor));
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ audioProcessingPipeline.flush();
+
+ ByteBuffer inputBuffer = createOneSecondDefaultSilenceBuffer(AUDIO_FORMAT);
+ long inputBytes = inputBuffer.remaining();
+ audioProcessingPipeline.queueInput(inputBuffer);
+ inputBytes -= inputBuffer.remaining();
+ ByteBuffer outputBuffer = audioProcessingPipeline.getOutput();
+ assertThat(inputBytes).isEqualTo(outputBuffer.remaining());
+ assertThat(inputBuffer).isNotSameInstanceAs(outputBuffer);
+ }
+
+ @Test
+ public void isEnded_needsBufferConsuming() throws Exception {
+ FakeAudioProcessor audioProcessor = new FakeAudioProcessor(/* active= */ true);
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(ImmutableList.of(audioProcessor));
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ audioProcessingPipeline.flush();
+
+ ByteBuffer inputBuffer = createOneSecondDefaultSilenceBuffer(AUDIO_FORMAT);
+ audioProcessingPipeline.queueInput(inputBuffer);
+ audioProcessingPipeline.queueEndOfStream();
+ assertThat(audioProcessingPipeline.isEnded()).isFalse();
+ ByteBuffer outputBuffer = audioProcessingPipeline.getOutput();
+ assertThat(audioProcessingPipeline.isEnded()).isFalse();
+
+ // "consume" the buffer
+ outputBuffer.position(outputBuffer.limit());
+ assertThat(audioProcessingPipeline.isEnded()).isTrue();
+ }
+
+ @Test
+ public void pipelineWithAdvancedAudioProcessors_drainsAndFeedsCorrectly_duplicatesBytes()
+ throws Exception {
+ AudioProcessingPipeline audioProcessingPipeline =
+ new AudioProcessingPipeline(
+ ImmutableList.of(
+ new FakeAudioProcessor(
+ /* active= */ true, /* maxInputBytesAtOnce= */ 8, /* duplicateBytes= */ true),
+ new FakeAudioProcessor(
+ /* active= */ true, /* maxInputBytesAtOnce= */ 0, /* duplicateBytes= */ false),
+ new FakeAudioProcessor(
+ /* active= */ true, /* maxInputBytesAtOnce= */ 12, /* duplicateBytes= */ true),
+ new FakeAudioProcessor(
+ /* active= */ true,
+ /* maxInputBytesAtOnce= */ 160,
+ /* duplicateBytes= */ false)));
+ audioProcessingPipeline.configure(AUDIO_FORMAT);
+ audioProcessingPipeline.flush();
+
+ ByteBuffer inputBuffer = createOneSecondDefaultSilenceBuffer(AUDIO_FORMAT);
+ inputBuffer.put(0, (byte) 24);
+ inputBuffer.put(1, (byte) 36);
+ inputBuffer.put(2, (byte) 6);
+ int bytesInput = inputBuffer.remaining();
+ List If the {@link AudioProcessingPipeline} is not {@linkplain
+ * AudioProcessingPipeline#isOperational() operational}, input buffers are passed straight to
+ * {@link #writeBuffer(ByteBuffer, long)}.
+ */
private void processBuffers(long avSyncPresentationTimeUs) throws WriteException {
- int count = activeAudioProcessors.length;
- int index = count;
- while (index >= 0) {
- ByteBuffer input =
- index > 0
- ? outputBuffers[index - 1]
- : (inputBuffer != null ? inputBuffer : AudioProcessor.EMPTY_BUFFER);
- if (index == count) {
- writeBuffer(input, avSyncPresentationTimeUs);
- } else {
- AudioProcessor audioProcessor = activeAudioProcessors[index];
- if (index > drainingAudioProcessorIndex) {
- audioProcessor.queueInput(input);
- }
- ByteBuffer output = audioProcessor.getOutput();
- outputBuffers[index] = output;
- if (output.hasRemaining()) {
- // Handle the output as input to the next audio processor or the AudioTrack.
- index++;
- continue;
+ if (!audioProcessingPipeline.isOperational() && inputBuffer != null) {
+ writeBuffer(inputBuffer, avSyncPresentationTimeUs);
+ return;
+ }
+
+ while (!audioProcessingPipeline.isEnded()) {
+ ByteBuffer bufferToWrite;
+ while ((bufferToWrite = audioProcessingPipeline.getOutput()).hasRemaining()) {
+ writeBuffer(bufferToWrite, avSyncPresentationTimeUs);
+ if (bufferToWrite.hasRemaining()) {
+ // writeBuffer method is providing back pressure.
+ return;
}
}
-
- if (input.hasRemaining()) {
- // The input wasn't consumed and no output was produced, so give up for now.
+ if (inputBuffer == null || !inputBuffer.hasRemaining()) {
return;
}
-
- // Get more input from upstream.
- index--;
+ audioProcessingPipeline.queueInput(inputBuffer);
}
}
+ /**
+ * Queues end of stream and then fully drains all buffers.
+ *
+ * @return Whether the buffers have been fully drained.
+ */
+ private boolean drainToEndOfStream() throws WriteException {
+ if (!audioProcessingPipeline.isOperational()) {
+ if (outputBuffer == null) {
+ return true;
+ }
+ writeBuffer(outputBuffer, C.TIME_UNSET);
+ return outputBuffer == null;
+ }
+
+ audioProcessingPipeline.queueEndOfStream();
+ processBuffers(C.TIME_UNSET);
+ return audioProcessingPipeline.isEnded()
+ && (outputBuffer == null || !outputBuffer.hasRemaining());
+ }
+
@SuppressWarnings("ReferenceEquality")
private void writeBuffer(ByteBuffer buffer, long avSyncPresentationTimeUs) throws WriteException {
if (!buffer.hasRemaining()) {
@@ -1168,36 +1161,6 @@ public final class DefaultAudioSink implements AudioSink {
|| status == ERROR_NATIVE_DEAD_OBJECT;
}
- private boolean drainToEndOfStream() throws WriteException {
- boolean audioProcessorNeedsEndOfStream = false;
- if (drainingAudioProcessorIndex == C.INDEX_UNSET) {
- drainingAudioProcessorIndex = 0;
- audioProcessorNeedsEndOfStream = true;
- }
- while (drainingAudioProcessorIndex < activeAudioProcessors.length) {
- AudioProcessor audioProcessor = activeAudioProcessors[drainingAudioProcessorIndex];
- if (audioProcessorNeedsEndOfStream) {
- audioProcessor.queueEndOfStream();
- }
- processBuffers(C.TIME_UNSET);
- if (!audioProcessor.isEnded()) {
- return false;
- }
- audioProcessorNeedsEndOfStream = true;
- drainingAudioProcessorIndex++;
- }
-
- // Finish writing any remaining output to the track.
- if (outputBuffer != null) {
- writeBuffer(outputBuffer, C.TIME_UNSET);
- if (outputBuffer != null) {
- return false;
- }
- }
- drainingAudioProcessorIndex = C.INDEX_UNSET;
- return true;
- }
-
@Override
public boolean isEnded() {
return !isAudioTrackInitialized() || (handledEndOfStream && !hasPendingData());
@@ -1413,6 +1376,9 @@ public final class DefaultAudioSink implements AudioSink {
for (AudioProcessor audioProcessor : toFloatPcmAvailableAudioProcessors) {
audioProcessor.reset();
}
+ if (audioProcessingPipeline != null) {
+ audioProcessingPipeline.reset();
+ }
playing = false;
offloadDisabledUntilNextConfiguration = false;
}
@@ -1440,11 +1406,10 @@ public final class DefaultAudioSink implements AudioSink {
outputBuffer = null;
stoppedAudioTrack = false;
handledEndOfStream = false;
- drainingAudioProcessorIndex = C.INDEX_UNSET;
avSyncHeader = null;
bytesUntilNextAvSync = 0;
trimmingAudioProcessor.resetTrimmedFrameCount();
- flushAudioProcessors();
+ setupAudioProcessors();
}
@RequiresApi(23)
@@ -1982,7 +1947,7 @@ public final class DefaultAudioSink implements AudioSink {
public final int outputChannelConfig;
public final @C.Encoding int outputEncoding;
public final int bufferSize;
- public final AudioProcessor[] availableAudioProcessors;
+ public final AudioProcessingPipeline audioProcessingPipeline;
public Configuration(
Format inputFormat,
@@ -1993,7 +1958,7 @@ public final class DefaultAudioSink implements AudioSink {
int outputChannelConfig,
int outputEncoding,
int bufferSize,
- AudioProcessor[] availableAudioProcessors) {
+ AudioProcessingPipeline audioProcessingPipeline) {
this.inputFormat = inputFormat;
this.inputPcmFrameSize = inputPcmFrameSize;
this.outputMode = outputMode;
@@ -2002,7 +1967,7 @@ public final class DefaultAudioSink implements AudioSink {
this.outputChannelConfig = outputChannelConfig;
this.outputEncoding = outputEncoding;
this.bufferSize = bufferSize;
- this.availableAudioProcessors = availableAudioProcessors;
+ this.audioProcessingPipeline = audioProcessingPipeline;
}
public Configuration copyWithBufferSize(int bufferSize) {
@@ -2015,7 +1980,7 @@ public final class DefaultAudioSink implements AudioSink {
outputChannelConfig,
outputEncoding,
bufferSize,
- availableAudioProcessors);
+ audioProcessingPipeline);
}
/** Returns if the configurations are sufficiently compatible to reuse the audio track. */
diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/MaskingMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/MaskingMediaSource.java
index 6ea76c5f78..bf64d1b015 100644
--- a/library/core/src/main/java/com/google/android/exoplayer2/source/MaskingMediaSource.java
+++ b/library/core/src/main/java/com/google/android/exoplayer2/source/MaskingMediaSource.java
@@ -374,7 +374,7 @@ public final class MaskingMediaSource extends WrappingMediaSource {
/* id= */ setIds ? 0 : null,
/* uid= */ setIds ? MaskingTimeline.MASKING_EXTERNAL_PERIOD_UID : null,
/* windowIndex= */ 0,
- /* durationUs = */ C.TIME_UNSET,
+ /* durationUs= */ C.TIME_UNSET,
/* positionInWindowUs= */ 0,
/* adPlaybackState= */ AdPlaybackState.NONE,
/* isPlaceholder= */ true);
diff --git a/library/core/src/main/java/com/google/android/exoplayer2/text/ExoplayerCuesDecoder.java b/library/core/src/main/java/com/google/android/exoplayer2/text/ExoplayerCuesDecoder.java
index 937bb52287..c3d465d9ee 100644
--- a/library/core/src/main/java/com/google/android/exoplayer2/text/ExoplayerCuesDecoder.java
+++ b/library/core/src/main/java/com/google/android/exoplayer2/text/ExoplayerCuesDecoder.java
@@ -111,7 +111,7 @@ public final class ExoplayerCuesDecoder implements SubtitleDecoder {
SingleEventSubtitle subtitle =
new SingleEventSubtitle(
inputBuffer.timeUs, cueDecoder.decode(checkNotNull(inputBuffer.data).array()));
- outputBuffer.setContent(inputBuffer.timeUs, subtitle, /* subsampleOffsetUs=*/ 0);
+ outputBuffer.setContent(inputBuffer.timeUs, subtitle, /* subsampleOffsetUs= */ 0);
}
inputBuffer.clear();
inputBufferState = INPUT_BUFFER_AVAILABLE;
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
index 1c1662ea97..428c388de9 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
@@ -746,7 +746,7 @@ public final class ExoPlayerTest {
public void adGroupWithLoadError_noFurtherAdGroup_isSkipped() throws Exception {
AdPlaybackState initialAdPlaybackState =
FakeTimeline.createAdPlaybackState(
- /* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */
+ /* adsPerAdGroup= */ 1, /* adGroupTimesUs= */
TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ 5 * C.MICROS_PER_SECOND);
Timeline fakeTimeline =
@@ -799,7 +799,7 @@ public final class ExoPlayerTest {
public void adGroupWithLoadError_withFurtherAdGroup_isSkipped() throws Exception {
AdPlaybackState initialAdPlaybackState =
FakeTimeline.createAdPlaybackState(
- /* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */
+ /* adsPerAdGroup= */ 1, /* adGroupTimesUs= */
TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ 5 * C.MICROS_PER_SECOND,
TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
@@ -2627,7 +2627,7 @@ public final class ExoPlayerTest {
new ActionSchedule.Builder(TAG)
.pause()
.waitForTimelineChanged(timeline, Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE)
- .sendMessage(target, /* mediaItemIndex = */ 2, /* positionMs= */ 50)
+ .sendMessage(target, /* mediaItemIndex= */ 2, /* positionMs= */ 50)
.play()
.build();
new ExoPlayerTestRunner.Builder(context)
@@ -2649,7 +2649,7 @@ public final class ExoPlayerTest {
.pause()
.waitForTimelineChanged(
timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE)
- .sendMessage(target, /* mediaItemIndex = */ 2, /* positionMs= */ 50)
+ .sendMessage(target, /* mediaItemIndex= */ 2, /* positionMs= */ 50)
.play()
.build();
new ExoPlayerTestRunner.Builder(context)
@@ -2680,7 +2680,7 @@ public final class ExoPlayerTest {
.pause()
.waitForTimelineChanged(
timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE)
- .sendMessage(target, /* mediaItemIndex = */ 1, /* positionMs= */ 50)
+ .sendMessage(target, /* mediaItemIndex= */ 1, /* positionMs= */ 50)
.executeRunnable(() -> mediaSource.setNewSourceInfo(secondTimeline))
.waitForTimelineChanged(
secondTimeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE)
@@ -2714,9 +2714,9 @@ public final class ExoPlayerTest {
new ActionSchedule.Builder(TAG)
.pause()
.waitForPlaybackState(Player.STATE_READY)
- .sendMessage(target1, /* mediaItemIndex = */ 0, /* positionMs= */ 50)
- .sendMessage(target2, /* mediaItemIndex = */ 1, /* positionMs= */ 50)
- .sendMessage(target3, /* mediaItemIndex = */ 2, /* positionMs= */ 50)
+ .sendMessage(target1, /* mediaItemIndex= */ 0, /* positionMs= */ 50)
+ .sendMessage(target2, /* mediaItemIndex= */ 1, /* positionMs= */ 50)
+ .sendMessage(target3, /* mediaItemIndex= */ 2, /* positionMs= */ 50)
.setShuffleModeEnabled(true)
.seek(/* mediaItemIndex= */ 2, /* positionMs= */ 0)
.play()
@@ -2928,8 +2928,7 @@ public final class ExoPlayerTest {
AdPlaybackState adPlaybackStateWithMidroll =
FakeTimeline.createAdPlaybackState(
/* adsPerAdGroup= */ 1,
- /* adGroupTimesUs...= */ TimelineWindowDefinition
- .DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ /* adGroupTimesUs= */ TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ 5 * C.MICROS_PER_SECOND);
Timeline timeline2 =
new FakeTimeline(
@@ -2980,8 +2979,7 @@ public final class ExoPlayerTest {
AdPlaybackState adPlaybackState =
FakeTimeline.createAdPlaybackState(
/* adsPerAdGroup= */ 1,
- /* adGroupTimesUs...= */ TimelineWindowDefinition
- .DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ /* adGroupTimesUs= */ TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ Util.msToUs(adGroupWindowTimeMs));
Timeline timeline =
new FakeTimeline(
@@ -3614,7 +3612,7 @@ public final class ExoPlayerTest {
@Test
public void contentWithInitialSeekPositionAfterPrerollAdStartsAtSeekPosition() throws Exception {
AdPlaybackState adPlaybackState =
- FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 3, /* adGroupTimesUs...= */ 0);
+ FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 3, /* adGroupTimesUs= */ 0);
Timeline fakeTimeline =
new FakeTimeline(
new TimelineWindowDefinition(
@@ -3663,7 +3661,7 @@ public final class ExoPlayerTest {
@Test
public void contentWithoutInitialSeekStartsAtDefaultPositionAfterPrerollAd() throws Exception {
AdPlaybackState adPlaybackState =
- FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 3, /* adGroupTimesUs...= */ 0);
+ FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 3, /* adGroupTimesUs= */ 0);
Timeline fakeTimeline =
new FakeTimeline(
new TimelineWindowDefinition(
@@ -3717,7 +3715,7 @@ public final class ExoPlayerTest {
ExoPlayer player = new TestExoPlayerBuilder(context).build();
AdPlaybackState adPlaybackState =
FakeTimeline.createAdPlaybackState(
- /* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */ 42_000_004_000_000L);
+ /* adsPerAdGroup= */ 1, /* adGroupTimesUs= */ 42_000_004_000_000L);
Timeline liveTimeline1 =
new FakeTimeline(
new TimelineWindowDefinition(
@@ -4722,7 +4720,7 @@ public final class ExoPlayerTest {
long contentDurationMs = 10_000;
long adDurationMs = 100_000;
AdPlaybackState adPlaybackState =
- new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs...= */ 0);
+ new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs= */ 0);
adPlaybackState = adPlaybackState.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1);
adPlaybackState =
adPlaybackState.withAvailableAdUri(
@@ -4824,7 +4822,7 @@ public final class ExoPlayerTest {
long contentDurationMs = 10_000;
long adDurationMs = 4_000;
AdPlaybackState adPlaybackState =
- new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs...= */ 0);
+ new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs= */ 0);
adPlaybackState = adPlaybackState.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1);
adPlaybackState =
adPlaybackState.withAvailableAdUri(
@@ -4907,7 +4905,7 @@ public final class ExoPlayerTest {
long contentDurationMs = 10_000;
long adDurationMs = 4_000;
AdPlaybackState adPlaybackState =
- new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs...= */ 0)
+ new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs= */ 0)
.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1)
.withAvailableAdUri(
/* adGroupIndex= */ 0,
@@ -4952,7 +4950,7 @@ public final class ExoPlayerTest {
FakeTimeline.createMultiPeriodAdTimeline(
"windowId",
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
true,
false);
@@ -5043,7 +5041,7 @@ public final class ExoPlayerTest {
FakeTimeline.createMultiPeriodAdTimeline(
"windowId",
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
false,
false);
@@ -5105,7 +5103,7 @@ public final class ExoPlayerTest {
FakeTimeline.createMultiPeriodAdTimeline(
"windowId",
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
true,
false);
@@ -5172,7 +5170,7 @@ public final class ExoPlayerTest {
FakeTimeline.createMultiPeriodAdTimeline(
"windowId",
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
true,
false);
@@ -5253,7 +5251,7 @@ public final class ExoPlayerTest {
FakeTimeline.createMultiPeriodAdTimeline(
"windowId",
/* numberOfPlayedAds= */ 2,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
true,
false);
@@ -5308,7 +5306,7 @@ public final class ExoPlayerTest {
FakeTimeline.createMultiPeriodAdTimeline(
"windowId",
/* numberOfPlayedAds= */ Integer.MAX_VALUE,
- /* isAdPeriodFlags...= */ true,
+ /* isAdPeriodFlags= */ true,
false,
true,
true,
@@ -5376,28 +5374,28 @@ public final class ExoPlayerTest {
new AdPlaybackState("adsId"),
/* fromPositionUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US,
/* contentResumeOffsetUs= */ 0,
- /* adDurationsUs...= */ C.MICROS_PER_SECOND);
+ /* adDurationsUs= */ C.MICROS_PER_SECOND);
adPlaybackState =
addAdGroupToAdPlaybackState(
adPlaybackState,
/* fromPositionUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ (3 * C.MICROS_PER_SECOND),
/* contentResumeOffsetUs= */ 0,
- /* adDurationsUs...= */ C.MICROS_PER_SECOND);
+ /* adDurationsUs= */ C.MICROS_PER_SECOND);
adPlaybackState =
addAdGroupToAdPlaybackState(
adPlaybackState,
/* fromPositionUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ (5 * C.MICROS_PER_SECOND),
/* contentResumeOffsetUs= */ 0,
- /* adDurationsUs...= */ C.MICROS_PER_SECOND);
+ /* adDurationsUs= */ C.MICROS_PER_SECOND);
adPlaybackState =
addAdGroupToAdPlaybackState(
adPlaybackState,
/* fromPositionUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
+ (9 * C.MICROS_PER_SECOND),
/* contentResumeOffsetUs= */ 0,
- /* adDurationsUs...= */ C.MICROS_PER_SECOND);
+ /* adDurationsUs= */ C.MICROS_PER_SECOND);
adPlaybackState =
adPlaybackState.withPlayedAd(/* adGroupIndex= */ 0, /* adIndexInAdGroup+ */ 0);
adPlaybackState =
@@ -5643,7 +5641,7 @@ public final class ExoPlayerTest {
@Test
public void shortAdFollowedByUnpreparedAd_playbackDoesNotGetStuck() throws Exception {
AdPlaybackState adPlaybackState =
- FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 2, /* adGroupTimesUs...= */ 0);
+ FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 2, /* adGroupTimesUs= */ 0);
long shortAdDurationMs = 1_000;
adPlaybackState =
adPlaybackState.withAdDurationsUs(new long[][] {{shortAdDurationMs, shortAdDurationMs}});
@@ -8071,7 +8069,7 @@ public final class ExoPlayerTest {
@Test
public void seekToCurrentPosition_inEndedState_switchesToBufferingStateAndContinuesPlayback()
throws Exception {
- MediaSource mediaSource = new FakeMediaSource(new FakeTimeline(/* windowCount = */ 1));
+ MediaSource mediaSource = new FakeMediaSource(new FakeTimeline(/* windowCount= */ 1));
AtomicInteger mediaItemIndexAfterFinalEndedState = new AtomicInteger();
ActionSchedule actionSchedule =
new ActionSchedule.Builder(TAG)
@@ -8542,8 +8540,8 @@ public final class ExoPlayerTest {
/* isDynamic= */ false,
/* isLive= */ false,
/* isPlaceholder= */ false,
- /* durationUs = */ 100_000,
- /* defaultPositionUs = */ 0,
+ /* durationUs= */ 100_000,
+ /* defaultPositionUs= */ 0,
/* windowOffsetInFirstPeriodUs= */ 0,
ImmutableList.of(AdPlaybackState.NONE),
MediaItem.fromUri("http://foo.bar/fake1"));
@@ -8556,8 +8554,8 @@ public final class ExoPlayerTest {
/* isDynamic= */ false,
/* isLive= */ false,
/* isPlaceholder= */ false,
- /* durationUs = */ 100_000,
- /* defaultPositionUs = */ 0,
+ /* durationUs= */ 100_000,
+ /* defaultPositionUs= */ 0,
/* windowOffsetInFirstPeriodUs= */ 0,
ImmutableList.of(AdPlaybackState.NONE),
MediaItem.fromUri("http://foo.bar/fake2"));
@@ -8570,8 +8568,8 @@ public final class ExoPlayerTest {
/* isDynamic= */ false,
/* isLive= */ false,
/* isPlaceholder= */ false,
- /* durationUs = */ 100_000,
- /* defaultPositionUs = */ 0,
+ /* durationUs= */ 100_000,
+ /* defaultPositionUs= */ 0,
/* windowOffsetInFirstPeriodUs= */ 0,
ImmutableList.of(AdPlaybackState.NONE),
MediaItem.fromUri("http://foo.bar/fake3"));
@@ -9055,7 +9053,7 @@ public final class ExoPlayerTest {
@Test
public void isCommandAvailable_duringAd_isFalseForSeekCommands() throws Exception {
AdPlaybackState adPlaybackState =
- new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs...= */ 0)
+ new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs= */ 0)
.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1)
.withAvailableAdUri(
/* adGroupIndex= */ 0,
@@ -10026,7 +10024,7 @@ public final class ExoPlayerTest {
AdPlaybackState adPlaybackState =
FakeTimeline.createAdPlaybackState(
/* adsPerAdGroup= */ 1,
- /* adGroupTimesUs...= */ 0,
+ /* adGroupTimesUs= */ 0,
7 * C.MICROS_PER_SECOND,
C.TIME_END_OF_SOURCE);
TimelineWindowDefinition adTimelineDefinition =
@@ -10615,7 +10613,7 @@ public final class ExoPlayerTest {
AdPlaybackState adPlaybackState =
FakeTimeline.createAdPlaybackState(
/* adsPerAdGroup= */ 2,
- /* adGroupTimesUs...= */ 0,
+ /* adGroupTimesUs= */ 0,
7 * C.MICROS_PER_SECOND,
C.TIME_END_OF_SOURCE);
TimelineWindowDefinition adTimeline =
@@ -10752,7 +10750,7 @@ public final class ExoPlayerTest {
player.addListener(listener);
AdPlaybackState adPlaybackState =
FakeTimeline.createAdPlaybackState(
- /* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */ 2 * C.MICROS_PER_SECOND);
+ /* adsPerAdGroup= */ 1, /* adGroupTimesUs= */ 2 * C.MICROS_PER_SECOND);
TimelineWindowDefinition adTimeline =
new TimelineWindowDefinition(
/* periodCount= */ 1,
@@ -10841,7 +10839,7 @@ public final class ExoPlayerTest {
player.addListener(listener);
AdPlaybackState postRollAdPlaybackState =
FakeTimeline.createAdPlaybackState(
- /* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */ C.TIME_END_OF_SOURCE);
+ /* adsPerAdGroup= */ 1, /* adGroupTimesUs= */ C.TIME_END_OF_SOURCE);
TimelineWindowDefinition postRollWindow =
new TimelineWindowDefinition(
/* periodCount= */ 1,
@@ -10855,7 +10853,7 @@ public final class ExoPlayerTest {
/* windowOffsetInFirstPeriodUs= */ 0,
postRollAdPlaybackState);
AdPlaybackState preRollAdPlaybackState =
- FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */ 0);
+ FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */ 1, /* adGroupTimesUs= */ 0);
TimelineWindowDefinition preRollWindow =
new TimelineWindowDefinition(
/* periodCount= */ 1,
@@ -11755,7 +11753,7 @@ public final class ExoPlayerTest {
player.prepare();
TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY);
- player.seekTo(/* positionMs = */ 0);
+ player.seekTo(/* positionMs= */ 0);
player.seekToNext();
assertThat(player.getCurrentMediaItemIndex()).isEqualTo(0);
@@ -11893,8 +11891,7 @@ public final class ExoPlayerTest {
.build();
// Live stream timeline with unassigned next ad group.
AdPlaybackState initialAdPlaybackState =
- new AdPlaybackState(
- /* adsId= */ new Object(), /* adGroupTimesUs...= */ C.TIME_END_OF_SOURCE)
+ new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs= */ C.TIME_END_OF_SOURCE)
.withIsServerSideInserted(/* adGroupIndex= */ 0, /* isServerSideInserted= */ true)
.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1)
.withAdDurationsUs(new long[][] {new long[] {10 * C.MICROS_PER_SECOND}});
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/MediaPeriodQueueTest.java b/library/core/src/test/java/com/google/android/exoplayer2/MediaPeriodQueueTest.java
index db0f15cf11..4569d78bca 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/MediaPeriodQueueTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/MediaPeriodQueueTest.java
@@ -121,7 +121,7 @@ public final class MediaPeriodQueueTest {
@Test
public void getNextMediaPeriodInfo_withPrerollAd_returnsCorrectMediaPeriodInfos() {
- setupAdTimeline(/* adGroupTimesUs...= */ 0);
+ setupAdTimeline(/* adGroupTimesUs= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 0);
assertNextMediaPeriodInfoIsAd(
/* adGroupIndex= */ 0,
@@ -143,7 +143,7 @@ public final class MediaPeriodQueueTest {
@Test
public void getNextMediaPeriodInfo_withMidrollAds_returnsCorrectMediaPeriodInfos() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
/* periodUid= */ firstPeriodUid,
/* startPositionUs= */ 0,
@@ -199,7 +199,7 @@ public final class MediaPeriodQueueTest {
@Test
public void getNextMediaPeriodInfo_withMidrollAndPostroll_returnsCorrectMediaPeriodInfos() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, C.TIME_END_OF_SOURCE);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, C.TIME_END_OF_SOURCE);
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
/* periodUid= */ firstPeriodUid,
/* startPositionUs= */ 0,
@@ -253,7 +253,7 @@ public final class MediaPeriodQueueTest {
adPlaybackState =
new AdPlaybackState(
/* adsId= */ new Object(),
- /* adGroupTimesUs...= */ 0,
+ /* adGroupTimesUs= */ 0,
FIRST_AD_START_TIME_US,
C.TIME_END_OF_SOURCE)
.withContentDurationUs(CONTENT_DURATION_US)
@@ -324,7 +324,7 @@ public final class MediaPeriodQueueTest {
adPlaybackState =
new AdPlaybackState(
/* adsId= */ new Object(),
- /* adGroupTimesUs...= */ 0,
+ /* adGroupTimesUs= */ 0,
FIRST_AD_START_TIME_US,
SECOND_AD_START_TIME_US)
.withContentDurationUs(CONTENT_DURATION_US)
@@ -392,7 +392,7 @@ public final class MediaPeriodQueueTest {
@Test
public void getNextMediaPeriodInfo_withPostrollLoadError_returnsEmptyFinalMediaPeriodInfo() {
- setupAdTimeline(/* adGroupTimesUs...= */ C.TIME_END_OF_SOURCE);
+ setupAdTimeline(/* adGroupTimesUs= */ C.TIME_END_OF_SOURCE);
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
/* periodUid= */ firstPeriodUid,
/* startPositionUs= */ 0,
@@ -419,7 +419,7 @@ public final class MediaPeriodQueueTest {
@Test
public void getNextMediaPeriodInfo_withPlayedAdGroups_returnsCorrectMediaPeriodInfos() {
- setupAdTimeline(/* adGroupTimesUs...= */ 0, FIRST_AD_START_TIME_US, C.TIME_END_OF_SOURCE);
+ setupAdTimeline(/* adGroupTimesUs= */ 0, FIRST_AD_START_TIME_US, C.TIME_END_OF_SOURCE);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
setAdGroupLoaded(/* adGroupIndex= */ 2);
@@ -503,14 +503,14 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeInPlayingContent_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
enqueueNext(); // Content before ad.
enqueueNext(); // Ad.
enqueueNext(); // Content after ad.
// Change position of first ad (= change duration of playing content before first ad).
- updateAdPlaybackStateAndTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US - 2000);
+ updateAdPlaybackStateAndTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US - 2000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
long maxRendererReadPositionUs =
MediaPeriodQueue.INITIAL_RENDERER_POSITION_OFFSET_US + FIRST_AD_START_TIME_US - 3000;
@@ -531,14 +531,14 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeInPlayingContentAfterReadingPosition_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
enqueueNext(); // Content before ad.
enqueueNext(); // Ad.
enqueueNext(); // Content after ad.
// Change position of first ad (= change duration of playing content before first ad).
- updateAdPlaybackStateAndTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US - 2000);
+ updateAdPlaybackStateAndTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US - 2000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
long maxRendererReadPositionUs =
MediaPeriodQueue.INITIAL_RENDERER_POSITION_OFFSET_US + FIRST_AD_START_TIME_US - 1000;
@@ -573,7 +573,7 @@ public final class MediaPeriodQueueTest {
// Change position of first ad (= change duration of playing content before first ad).
adPlaybackState =
new AdPlaybackState(
- /* adsId= */ new Object(), /* adGroupTimesUs...= */ FIRST_AD_START_TIME_US - 2000)
+ /* adsId= */ new Object(), /* adGroupTimesUs= */ FIRST_AD_START_TIME_US - 2000)
.withIsServerSideInserted(/* adGroupIndex= */ 0, /* isServerSideInserted= */ true);
updateTimeline();
setAdGroupLoaded(/* adGroupIndex= */ 0);
@@ -596,7 +596,7 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeAfterReadingPeriod_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
enqueueNext(); // Content before first ad.
@@ -606,7 +606,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
updateAdPlaybackStateAndTimeline(
- /* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
+ /* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
boolean changeHandled =
@@ -622,7 +622,7 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeBeforeReadingPeriod_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
enqueueNext(); // Content before first ad.
@@ -635,7 +635,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
updateAdPlaybackStateAndTimeline(
- /* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
+ /* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
long maxRendererReadPositionUs =
@@ -653,7 +653,7 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeInReadingPeriodAfterReadingPosition_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
enqueueNext(); // Content before first ad.
@@ -665,7 +665,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
updateAdPlaybackStateAndTimeline(
- /* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
+ /* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
long readingPositionAtStartOfContentBetweenAds =
@@ -685,7 +685,7 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeInReadingPeriodBeforeReadingPosition_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
enqueueNext(); // Content before first ad.
@@ -697,7 +697,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
updateAdPlaybackStateAndTimeline(
- /* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
+ /* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
long readingPositionAtEndOfContentBetweenAds =
@@ -717,7 +717,7 @@ public final class MediaPeriodQueueTest {
@Test
public void
updateQueuedPeriods_withDurationChangeInReadingPeriodReadToEnd_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
- setupAdTimeline(/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
+ setupAdTimeline(/* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
enqueueNext(); // Content before first ad.
@@ -729,7 +729,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
updateAdPlaybackStateAndTimeline(
- /* adGroupTimesUs...= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
+ /* adGroupTimesUs= */ FIRST_AD_START_TIME_US, SECOND_AD_START_TIME_US - 1000);
setAdGroupLoaded(/* adGroupIndex= */ 0);
setAdGroupLoaded(/* adGroupIndex= */ 1);
boolean changeHandled =
@@ -832,7 +832,7 @@ public final class MediaPeriodQueueTest {
createMultiPeriodServerSideInsertedTimeline(
windowId,
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ true,
+ /* isAdPeriodFlags= */ true,
false,
true,
true,
@@ -867,7 +867,7 @@ public final class MediaPeriodQueueTest {
createMultiPeriodServerSideInsertedTimeline(
windowId,
/* numberOfPlayedAds= */ 4,
- /* isAdPeriodFlags...= */ true,
+ /* isAdPeriodFlags= */ true,
false,
true,
true,
@@ -902,7 +902,7 @@ public final class MediaPeriodQueueTest {
createMultiPeriodServerSideInsertedTimeline(
windowId,
/* numberOfPlayedAds= */ 2,
- /* isAdPeriodFlags...= */ true,
+ /* isAdPeriodFlags= */ true,
false,
true,
true,
@@ -926,7 +926,7 @@ public final class MediaPeriodQueueTest {
Object windowId = new Object();
Timeline timeline =
createMultiPeriodServerSideInsertedTimeline(
- windowId, /* numberOfPlayedAds= */ 0, /* isAdPeriodFlags...= */ false, true);
+ windowId, /* numberOfPlayedAds= */ 0, /* isAdPeriodFlags= */ false, true);
MediaPeriodId mediaPeriodId =
mediaPeriodQueue.resolveMediaPeriodIdForAdsAfterPeriodPositionChange(
@@ -945,7 +945,7 @@ public final class MediaPeriodQueueTest {
Object windowId = new Object();
Timeline timeline =
createMultiPeriodServerSideInsertedTimeline(
- windowId, /* numberOfPlayedAds= */ 0, /* isAdPeriodFlags...= */ false, true, false);
+ windowId, /* numberOfPlayedAds= */ 0, /* isAdPeriodFlags= */ false, true, false);
MediaPeriodId mediaPeriodId =
mediaPeriodQueue.resolveMediaPeriodIdForAdsAfterPeriodPositionChange(
@@ -964,7 +964,7 @@ public final class MediaPeriodQueueTest {
Object windowId = new Object();
Timeline timeline =
createMultiPeriodServerSideInsertedTimeline(
- windowId, /* numberOfPlayedAds= */ 1, /* isAdPeriodFlags...= */ false, true, false);
+ windowId, /* numberOfPlayedAds= */ 1, /* isAdPeriodFlags= */ false, true, false);
MediaPeriodId mediaPeriodId =
mediaPeriodQueue.resolveMediaPeriodIdForAdsAfterPeriodPositionChange(
@@ -983,7 +983,7 @@ public final class MediaPeriodQueueTest {
Object windowId = new Object();
Timeline timeline =
createMultiPeriodServerSideInsertedTimeline(
- windowId, /* numberOfPlayedAds= */ 2, /* isAdPeriodFlags...= */ true, true, false);
+ windowId, /* numberOfPlayedAds= */ 2, /* isAdPeriodFlags= */ true, true, false);
MediaPeriodId mediaPeriodId =
mediaPeriodQueue.resolveMediaPeriodIdForAdsAfterPeriodPositionChange(
timeline, new Pair<>(windowId, 0), /* positionUs= */ 0);
@@ -1003,7 +1003,7 @@ public final class MediaPeriodQueueTest {
createMultiPeriodServerSideInsertedTimeline(
windowId,
/* numberOfPlayedAds= */ 4,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
true,
true,
@@ -1026,12 +1026,7 @@ public final class MediaPeriodQueueTest {
Object windowId = new Object();
Timeline timeline =
createMultiPeriodServerSideInsertedTimeline(
- windowId,
- /* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ true,
- false,
- false,
- false);
+ windowId, /* numberOfPlayedAds= */ 0, /* isAdPeriodFlags= */ true, false, false, false);
MediaPeriodId mediaPeriodId =
mediaPeriodQueue.resolveMediaPeriodIdForAdsAfterPeriodPositionChange(
@@ -1052,7 +1047,7 @@ public final class MediaPeriodQueueTest {
createMultiPeriodServerSideInsertedTimeline(
windowId,
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
false,
false,
false);
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/MediaSourceListTest.java b/library/core/src/test/java/com/google/android/exoplayer2/MediaSourceListTest.java
index 71618bb690..58fdd77f9a 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/MediaSourceListTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/MediaSourceListTest.java
@@ -448,7 +448,7 @@ public class MediaSourceListTest {
@Test
public void setMediaSources_expectTimelineUsesCustomShuffleOrder() {
Timeline timeline =
- mediaSourceList.setMediaSources(createFakeHolders(), new FakeShuffleOrder(/* length=*/ 4));
+ mediaSourceList.setMediaSources(createFakeHolders(), new FakeShuffleOrder(/* length= */ 4));
assertTimelineUsesFakeShuffleOrder(timeline);
}
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultAnalyticsCollectorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultAnalyticsCollectorTest.java
index f62d75955d..dacfc436d7 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultAnalyticsCollectorTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultAnalyticsCollectorTest.java
@@ -1027,7 +1027,7 @@ public final class DefaultAnalyticsCollectorTest {
new AtomicReference<>(
FakeTimeline.createAdPlaybackState(
/* adsPerAdGroup= */ 1,
- /* adGroupTimesUs...= */ windowOffsetInFirstPeriodUs,
+ /* adGroupTimesUs= */ windowOffsetInFirstPeriodUs,
windowOffsetInFirstPeriodUs + 5 * C.MICROS_PER_SECOND,
C.TIME_END_OF_SOURCE));
AtomicInteger playedAdCount = new AtomicInteger(0);
@@ -1300,7 +1300,7 @@ public final class DefaultAnalyticsCollectorTest {
/* isDynamic= */ false,
10 * C.MICROS_PER_SECOND,
FakeTimeline.createAdPlaybackState(
- /* adsPerAdGroup= */ 1, /* adGroupTimesUs...= */
+ /* adsPerAdGroup= */ 1, /* adGroupTimesUs= */
windowOffsetInFirstPeriodUs + 5 * C.MICROS_PER_SECOND)));
FakeMediaSource fakeMediaSource =
new FakeMediaSource(
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultPlaybackSessionManagerTest.java b/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultPlaybackSessionManagerTest.java
index c9c3178255..64d7cc7d10 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultPlaybackSessionManagerTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/analytics/DefaultPlaybackSessionManagerTest.java
@@ -1285,7 +1285,7 @@ public final class DefaultPlaybackSessionManagerTest {
private static EventTime createEventTime(
Timeline timeline, int windowIndex, @Nullable MediaPeriodId mediaPeriodId) {
return new EventTime(
- /* realtimeMs = */ 0,
+ /* realtimeMs= */ 0,
timeline,
windowIndex,
mediaPeriodId,
@@ -1303,7 +1303,7 @@ public final class DefaultPlaybackSessionManagerTest {
@Nullable MediaPeriodId eventMediaPeriodId,
@Nullable MediaPeriodId currentMediaPeriodId) {
return new EventTime(
- /* realtimeMs = */ 0,
+ /* realtimeMs= */ 0,
timeline,
windowIndex,
eventMediaPeriodId,
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java
index 8176894702..6760e65e39 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java
@@ -289,11 +289,10 @@ public final class SilenceSkippingAudioProcessorTest {
Pcm16BitAudioBuilder audioBuilder = new Pcm16BitAudioBuilder(channelCount, totalFrameCount);
while (!audioBuilder.isFull()) {
int silenceDurationFrames = (silenceDurationMs * sampleRate) / 1000;
- audioBuilder.appendFrames(
- /* count= */ silenceDurationFrames, /* channelLevels...= */ (short) 0);
+ audioBuilder.appendFrames(/* count= */ silenceDurationFrames, /* channelLevels= */ (short) 0);
int noiseDurationFrames = (noiseDurationMs * sampleRate) / 1000;
audioBuilder.appendFrames(
- /* count= */ noiseDurationFrames, /* channelLevels...= */ Short.MAX_VALUE);
+ /* count= */ noiseDurationFrames, /* channelLevels= */ Short.MAX_VALUE);
}
return new InputBufferProvider(audioBuilder.build());
}
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java b/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java
index b78a7c4e0f..07892e3eb1 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java
@@ -363,7 +363,7 @@ public final class ConcatenatingMediaSourceTest {
new FakeMediaSource(Timeline.EMPTY),
new FakeMediaSource(Timeline.EMPTY),
};
- Timeline nonEmptyTimeline = new FakeTimeline(/* windowCount = */ 1);
+ Timeline nonEmptyTimeline = new FakeTimeline(/* windowCount= */ 1);
mediaSource.addMediaSources(Arrays.asList(childSources));
Timeline timeline = testRunner.prepareSource();
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/source/ads/AdsMediaSourceTest.java b/library/core/src/test/java/com/google/android/exoplayer2/source/ads/AdsMediaSourceTest.java
index 2c37607417..9e72e4bbda 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/source/ads/AdsMediaSourceTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/source/ads/AdsMediaSourceTest.java
@@ -78,7 +78,7 @@ public final class AdsMediaSourceTest {
CONTENT_TIMELINE.getUidOfPeriod(/* periodIndex= */ 0);
private static final AdPlaybackState AD_PLAYBACK_STATE =
- new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs...= */ 0)
+ new AdPlaybackState(/* adsId= */ new Object(), /* adGroupTimesUs= */ 0)
.withContentDurationUs(CONTENT_DURATION_US)
.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1)
.withAvailableAdUri(
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideAdInsertionMediaSourceTest.java b/library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideAdInsertionMediaSourceTest.java
index d87635c52d..f1d676a667 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideAdInsertionMediaSourceTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/source/ads/ServerSideAdInsertionMediaSourceTest.java
@@ -90,19 +90,16 @@ public final class ServerSideAdInsertionMediaSourceTest {
// Test with one ad group before the window, and the window starting within the second ad group.
AdPlaybackState adPlaybackState =
new AdPlaybackState(
- /* adsId= */ new Object(), /* adGroupTimesUs...= */
- 15_000_000,
- 41_500_000,
- 42_200_000)
+ /* adsId= */ new Object(), /* adGroupTimesUs= */ 15_000_000, 41_500_000, 42_200_000)
.withIsServerSideInserted(/* adGroupIndex= */ 0, /* isServerSideInserted= */ true)
.withIsServerSideInserted(/* adGroupIndex= */ 1, /* isServerSideInserted= */ true)
.withIsServerSideInserted(/* adGroupIndex= */ 2, /* isServerSideInserted= */ true)
.withAdCount(/* adGroupIndex= */ 0, /* adCount= */ 1)
.withAdCount(/* adGroupIndex= */ 1, /* adCount= */ 2)
.withAdCount(/* adGroupIndex= */ 2, /* adCount= */ 1)
- .withAdDurationsUs(/* adGroupIndex= */ 0, /* adDurationsUs...= */ 500_000)
- .withAdDurationsUs(/* adGroupIndex= */ 1, /* adDurationsUs...= */ 300_000, 100_000)
- .withAdDurationsUs(/* adGroupIndex= */ 2, /* adDurationsUs...= */ 400_000)
+ .withAdDurationsUs(/* adGroupIndex= */ 0, /* adDurationsUs= */ 500_000)
+ .withAdDurationsUs(/* adGroupIndex= */ 1, /* adDurationsUs= */ 300_000, 100_000)
+ .withAdDurationsUs(/* adGroupIndex= */ 2, /* adDurationsUs= */ 400_000)
.withContentResumeOffsetUs(/* adGroupIndex= */ 0, /* contentResumeOffsetUs= */ 100_000)
.withContentResumeOffsetUs(/* adGroupIndex= */ 1, /* contentResumeOffsetUs= */ 400_000)
.withContentResumeOffsetUs(/* adGroupIndex= */ 2, /* contentResumeOffsetUs= */ 200_000);
@@ -183,19 +180,19 @@ public final class ServerSideAdInsertionMediaSourceTest {
adPlaybackState,
/* fromPositionUs= */ 0,
/* contentResumeOffsetUs= */ 0,
- /* adDurationsUs...= */ 200_000);
+ /* adDurationsUs= */ 200_000);
adPlaybackState =
addAdGroupToAdPlaybackState(
adPlaybackState,
/* fromPositionUs= */ 400_000,
/* contentResumeOffsetUs= */ 1_000_000,
- /* adDurationsUs...= */ 300_000);
+ /* adDurationsUs= */ 300_000);
AdPlaybackState firstAdPlaybackState =
addAdGroupToAdPlaybackState(
adPlaybackState,
/* fromPositionUs= */ 900_000,
/* contentResumeOffsetUs= */ 0,
- /* adDurationsUs...= */ 100_000);
+ /* adDurationsUs= */ 100_000);
AtomicReference> checkPoints = new ArrayList<>();
AdaptiveTrackSelection.Factory factory =
new AdaptiveTrackSelection.Factory() {
@@ -621,9 +621,9 @@ public final class AdaptiveTrackSelectionTest {
TrackGroup trackGroup2 =
new TrackGroup(group2Format1, group2Format2, group2Format3, group2UnusedFormat);
TrackGroup fixedGroup = new TrackGroup(fixedFormat);
- Definition definition1 = new Definition(trackGroup1, /* tracks...= */ 0, 1);
- Definition definition2 = new Definition(trackGroup2, /* tracks...= */ 0, 1, 2);
- Definition fixedDefinition = new Definition(fixedGroup, /* tracks...= */ 0);
+ Definition definition1 = new Definition(trackGroup1, /* tracks= */ 0, 1);
+ Definition definition2 = new Definition(trackGroup2, /* tracks= */ 0, 1, 2);
+ Definition fixedDefinition = new Definition(fixedGroup, /* tracks= */ 0);
List
> checkPoints = new ArrayList<>();
AdaptiveTrackSelection.Factory factory =
new AdaptiveTrackSelection.Factory() {
diff --git a/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java
index c57f611752..56edf57147 100644
--- a/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java
+++ b/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java
@@ -2171,10 +2171,8 @@ public final class DefaultTrackSelectorTest {
TIMELINE);
assertThat(result.length).isEqualTo(2);
- assertAdaptiveSelection(
- result.selections[0], trackGroups.get(0), /* expectedTracks...= */ 1, 0);
- assertAdaptiveSelection(
- result.selections[1], trackGroups.get(1), /* expectedTracks...= */ 1, 0);
+ assertAdaptiveSelection(result.selections[0], trackGroups.get(0), /* expectedTracks= */ 1, 0);
+ assertAdaptiveSelection(result.selections[1], trackGroups.get(1), /* expectedTracks= */ 1, 0);
// Multiple adaptive selection disallowed.
trackSelector.setParameters(
@@ -2187,8 +2185,7 @@ public final class DefaultTrackSelectorTest {
TIMELINE);
assertThat(result.length).isEqualTo(2);
- assertAdaptiveSelection(
- result.selections[0], trackGroups.get(0), /* expectedTracks...= */ 1, 0);
+ assertAdaptiveSelection(result.selections[0], trackGroups.get(0), /* expectedTracks= */ 1, 0);
assertFixedSelection(result.selections[1], trackGroups.get(1), /* expectedTrack= */ 1);
}
@@ -2232,7 +2229,7 @@ public final class DefaultTrackSelectorTest {
trackSelector.selectTracks(
new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE);
assertThat(result.length).isEqualTo(1);
- assertAdaptiveSelection(result.selections[0], adaptiveGroup, /* expectedTracks...= */ 1, 0);
+ assertAdaptiveSelection(result.selections[0], adaptiveGroup, /* expectedTracks= */ 1, 0);
// Select default (=most tracks) if no preference is specified.
trackSelector.setParameters(defaultParameters.buildUpon().setPreferredVideoMimeType(null));
@@ -2240,7 +2237,7 @@ public final class DefaultTrackSelectorTest {
trackSelector.selectTracks(
new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE);
assertThat(result.length).isEqualTo(1);
- assertAdaptiveSelection(result.selections[0], adaptiveGroup, /* expectedTracks...= */ 1, 0);
+ assertAdaptiveSelection(result.selections[0], adaptiveGroup, /* expectedTracks= */ 1, 0);
}
/**
@@ -2419,7 +2416,7 @@ public final class DefaultTrackSelectorTest {
@Test
public void roundTripViaBundle_ofSelectionOverride_yieldsEqualInstance() {
SelectionOverride selectionOverrideToBundle =
- new SelectionOverride(/* groupIndex= */ 1, /* tracks...= */ 2, 3);
+ new SelectionOverride(/* groupIndex= */ 1, /* tracks= */ 2, 3);
SelectionOverride selectionOverrideFromBundle =
DefaultTrackSelector.SelectionOverride.CREATOR.fromBundle(
diff --git a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/ContrastPixelTest.java b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/ContrastPixelTest.java
index 9d5bc05e1c..915da42ee0 100644
--- a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/ContrastPixelTest.java
+++ b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/ContrastPixelTest.java
@@ -104,7 +104,7 @@ public class ContrastPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
- contrastProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ contrastProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -128,7 +128,7 @@ public class ContrastPixelTest {
Color.rgb(
OPENGL_NEUTRAL_RGB_VALUE, OPENGL_NEUTRAL_RGB_VALUE, OPENGL_NEUTRAL_RGB_VALUE));
- contrastProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ contrastProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -187,7 +187,7 @@ public class ContrastPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(MAXIMUM_CONTRAST_PNG_ASSET_PATH);
- contrastProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ contrastProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
diff --git a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/SingleColorLutPixelTest.java b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/SingleColorLutPixelTest.java
index 1aa735980a..6b12f104bf 100644
--- a/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/SingleColorLutPixelTest.java
+++ b/library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/SingleColorLutPixelTest.java
@@ -105,7 +105,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -126,7 +126,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -147,7 +147,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -168,7 +168,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -189,7 +189,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -212,7 +212,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(LUT_MAP_WHITE_TO_GREEN_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -233,7 +233,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(INVERT_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
@@ -254,7 +254,7 @@ public class SingleColorLutPixelTest {
setupOutputTexture(outputSize.first, outputSize.second);
Bitmap expectedBitmap = readBitmap(GRAYSCALE_PNG_ASSET_PATH);
- colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs = */ 0);
+ colorLutProcessor.drawFrame(inputTexId, /* presentationTimeUs= */ 0);
Bitmap actualBitmap =
createArgb8888BitmapFromCurrentGlFramebuffer(outputSize.first, outputSize.second);
diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/DefaultExtractorsFactory.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/DefaultExtractorsFactory.java
index 7d15ad1388..4038993d99 100644
--- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/DefaultExtractorsFactory.java
+++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/DefaultExtractorsFactory.java
@@ -447,7 +447,9 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
@Nullable
private static Constructor extends Extractor> getFlacExtractorConstructor()
- throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
+ throws ClassNotFoundException,
+ NoSuchMethodException,
+ InvocationTargetException,
IllegalAccessException {
@SuppressWarnings("nullness:argument")
boolean isFlacNativeLibraryAvailable =
@@ -468,7 +470,9 @@ public final class DefaultExtractorsFactory implements ExtractorsFactory {
public interface ConstructorSupplier {
@Nullable
Constructor extends Extractor> getConstructor()
- throws InvocationTargetException, IllegalAccessException, NoSuchMethodException,
+ throws InvocationTargetException,
+ IllegalAccessException,
+ NoSuchMethodException,
ClassNotFoundException;
}
diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
index 52dff7dfc3..c1895a5cc5 100644
--- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
+++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java
@@ -654,7 +654,7 @@ public class FragmentedMp4Extractor implements Extractor {
}
byte[] messageData = new byte[atom.bytesLeft()];
- atom.readBytes(messageData, /*offset=*/ 0, atom.bytesLeft());
+ atom.readBytes(messageData, /* offset= */ 0, atom.bytesLeft());
EventMessage eventMessage = new EventMessage(schemeIdUri, value, durationMs, id, messageData);
ParsableByteArray encodedEventMessage =
new ParsableByteArray(eventMessageEncoder.encode(eventMessage));
diff --git a/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaPeriod.java b/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaPeriod.java
index e215192ca3..e174c47936 100644
--- a/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaPeriod.java
+++ b/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaPeriod.java
@@ -687,7 +687,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsPlaylistTracker.Pla
sampleStreamWrapper.prepareWithMultivariantPlaylistInfo(
muxedTrackGroups.toArray(new TrackGroup[0]),
/* primaryTrackGroupIndex= */ 0,
- /* optionalTrackGroupsIndices...= */ muxedTrackGroups.indexOf(id3TrackGroup));
+ /* optionalTrackGroupsIndices= */ muxedTrackGroups.indexOf(id3TrackGroup));
}
}
diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java
index 8db69b3dc7..a3b4e39d1d 100644
--- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java
+++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java
@@ -107,7 +107,7 @@ public class FakeAdaptiveMediaPeriod
C.SELECTION_REASON_UNKNOWN,
/* trackSelectionData= */ null,
/* mediaStartTimeUs= */ 0,
- /* mediaEndTimeUs = */ C.TIME_UNSET);
+ /* mediaEndTimeUs= */ C.TIME_UNSET);
this.callback = callback;
prepared = true;
Util.castNonNull(this.callback).onPrepared(this);
@@ -126,7 +126,7 @@ public class FakeAdaptiveMediaPeriod
C.SELECTION_REASON_UNKNOWN,
/* trackSelectionData= */ null,
/* mediaStartTimeUs= */ 0,
- /* mediaEndTimeUs = */ C.TIME_UNSET);
+ /* mediaEndTimeUs= */ C.TIME_UNSET);
}
@Override
diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaPeriod.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaPeriod.java
index 1792ecbcde..16fdb60fe1 100644
--- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaPeriod.java
+++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaPeriod.java
@@ -232,7 +232,7 @@ public class FakeMediaPeriod implements MediaPeriod {
C.SELECTION_REASON_UNKNOWN,
/* trackSelectionData= */ null,
/* mediaStartTimeUs= */ 0,
- /* mediaEndTimeUs = */ C.TIME_UNSET);
+ /* mediaEndTimeUs= */ C.TIME_UNSET);
prepareCallback = callback;
if (deferOnPrepared) {
playerHandler = Util.createHandlerForCurrentLooper();
@@ -416,7 +416,7 @@ public class FakeMediaPeriod implements MediaPeriod {
C.SELECTION_REASON_UNKNOWN,
/* trackSelectionData= */ null,
/* mediaStartTimeUs= */ 0,
- /* mediaEndTimeUs = */ C.TIME_UNSET);
+ /* mediaEndTimeUs= */ C.TIME_UNSET);
}
private boolean isLoadingFinished() {
diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaSource.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaSource.java
index 715b02c24f..04d0db24c5 100644
--- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaSource.java
+++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeMediaSource.java
@@ -387,7 +387,7 @@ public class FakeMediaSource extends BaseMediaSource {
C.SELECTION_REASON_UNKNOWN,
/* trackSelectionData= */ null,
/* mediaStartTimeMs= */ C.TIME_UNSET,
- /* mediaEndTimeMs = */ C.TIME_UNSET);
+ /* mediaEndTimeMs= */ C.TIME_UNSET);
long elapsedRealTimeMs = SystemClock.elapsedRealtime();
MediaSourceEventListener.EventDispatcher eventDispatcher =
createEventDispatcher(/* mediaPeriodId= */ null);
diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTrackSelector.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTrackSelector.java
index 57d31bbe7f..05cf0c2b6f 100644
--- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTrackSelector.java
+++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTrackSelector.java
@@ -67,7 +67,7 @@ public class FakeTrackSelector extends DefaultTrackSelector {
boolean hasTracks = trackGroupArray.length > 0;
definitions[i] =
hasTracks
- ? new ExoTrackSelection.Definition(trackGroupArray.get(0), /* tracks...= */ 0)
+ ? new ExoTrackSelection.Definition(trackGroupArray.get(0), /* tracks= */ 0)
: null;
}
return definitions;
diff --git a/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java b/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java
index 7fba60ec24..830d4fce22 100644
--- a/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java
+++ b/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeClockTest.java
@@ -82,17 +82,17 @@ public final class FakeClockTest {
handler.obtainMessage(/* what= */ 2, /* obj= */ testObject).sendToTarget();
handler.obtainMessage(/* what= */ 3, /* arg1= */ 99, /* arg2= */ 44).sendToTarget();
handler
- .obtainMessage(/* what= */ 4, /* arg1= */ 88, /* arg2= */ 33, /* obj=*/ testObject)
+ .obtainMessage(/* what= */ 4, /* arg1= */ 88, /* arg2= */ 33, /* obj= */ testObject)
.sendToTarget();
ShadowLooper.idleMainLooper();
shadowOf(handler.getLooper()).idle();
assertThat(callback.messages)
.containsExactly(
- new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null),
- new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ testObject),
- new MessageData(/* what= */ 3, /* arg1= */ 99, /* arg2= */ 44, /* obj=*/ null),
- new MessageData(/* what= */ 4, /* arg1= */ 88, /* arg2= */ 33, /* obj=*/ testObject))
+ new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null),
+ new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ testObject),
+ new MessageData(/* what= */ 3, /* arg1= */ 99, /* arg2= */ 44, /* obj= */ null),
+ new MessageData(/* what= */ 4, /* arg1= */ 88, /* arg2= */ 33, /* obj= */ testObject))
.inOrder();
}
@@ -113,8 +113,8 @@ public final class FakeClockTest {
assertThat(callback.messages)
.containsExactly(
- new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null),
- new MessageData(/* what= */ 4, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null))
+ new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null),
+ new MessageData(/* what= */ 4, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null))
.inOrder();
fakeClock.advanceTime(50);
@@ -122,14 +122,14 @@ public final class FakeClockTest {
assertThat(callback.messages).hasSize(3);
assertThat(Iterables.getLast(callback.messages))
- .isEqualTo(new MessageData(/* what= */ 3, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null));
+ .isEqualTo(new MessageData(/* what= */ 3, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null));
fakeClock.advanceTime(50);
shadowOf(handler.getLooper()).idle();
assertThat(callback.messages).hasSize(4);
assertThat(Iterables.getLast(callback.messages))
- .isEqualTo(new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null));
+ .isEqualTo(new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null));
}
@Test
@@ -149,10 +149,10 @@ public final class FakeClockTest {
assertThat(callback.messages)
.containsExactly(
- new MessageData(/* what= */ 3, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null),
- new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null),
- new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null),
- new MessageData(/* what= */ 4, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null))
+ new MessageData(/* what= */ 3, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null),
+ new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null),
+ new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null),
+ new MessageData(/* what= */ 4, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null))
.inOrder();
}
@@ -223,14 +223,14 @@ public final class FakeClockTest {
assertThat(callback.messages)
.containsExactly(
- new MessageData(/* what= */ 3, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null));
+ new MessageData(/* what= */ 3, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null));
assertThat(testRunnable1.hasRun).isTrue();
assertThat(testRunnable2.hasRun).isTrue();
// Assert that message with same "what" on other handler wasn't removed.
assertThat(otherCallback.messages)
.containsExactly(
- new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null));
+ new MessageData(/* what= */ 2, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null));
}
@Test
@@ -266,7 +266,7 @@ public final class FakeClockTest {
// Assert that message on other handler wasn't removed.
assertThat(otherCallback.messages)
.containsExactly(
- new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj=*/ null));
+ new MessageData(/* what= */ 1, /* arg1= */ 0, /* arg2= */ 0, /* obj= */ null));
}
@Test
diff --git a/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeTimelineTest.java b/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeTimelineTest.java
index ac5ad1bbc8..ef5e29ec54 100644
--- a/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeTimelineTest.java
+++ b/testutils/src/test/java/com/google/android/exoplayer2/testutil/FakeTimelineTest.java
@@ -39,7 +39,7 @@ public class FakeTimelineTest {
FakeTimeline.createMultiPeriodAdTimeline(
windowId,
numberOfPlayedAds,
- /* isAdPeriodFlags...= */ true,
+ /* isAdPeriodFlags= */ true,
false,
true,
true,
@@ -94,7 +94,7 @@ public class FakeTimelineTest {
FakeTimeline.createMultiPeriodAdTimeline(
/* windowId= */ new Object(),
/* numberOfPlayedAds= */ 0,
- /* isAdPeriodFlags...= */ false,
+ /* isAdPeriodFlags= */ false,
true,
true,
false);