mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix ParameterName warnings in core tests
PiperOrigin-RevId: 285716982
This commit is contained in:
parent
80e3152e8c
commit
27b06e9ad9
3 changed files with 20 additions and 19 deletions
|
|
@ -81,7 +81,7 @@ public final class MediaPeriodQueueTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getNextMediaPeriodInfo_withPrerollAd_returnsCorrectMediaPeriodInfos() {
|
public void getNextMediaPeriodInfo_withPrerollAd_returnsCorrectMediaPeriodInfos() {
|
||||||
setupTimeline(/* initialPositionUs= */ 0, /* adGroupTimesUs= */ 0);
|
setupTimeline(/* initialPositionUs= */ 0, /* adGroupTimesUs...= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
assertNextMediaPeriodInfoIsAd(/* adGroupIndex= */ 0, /* contentPositionUs= */ 0);
|
assertNextMediaPeriodInfoIsAd(/* adGroupIndex= */ 0, /* contentPositionUs= */ 0);
|
||||||
advance();
|
advance();
|
||||||
|
|
@ -97,7 +97,7 @@ public final class MediaPeriodQueueTest {
|
||||||
public void getNextMediaPeriodInfo_withMidrollAds_returnsCorrectMediaPeriodInfos() {
|
public void getNextMediaPeriodInfo_withMidrollAds_returnsCorrectMediaPeriodInfos() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
|
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
|
||||||
/* startPositionUs= */ 0,
|
/* startPositionUs= */ 0,
|
||||||
|
|
@ -135,7 +135,7 @@ public final class MediaPeriodQueueTest {
|
||||||
public void getNextMediaPeriodInfo_withMidrollAndPostroll_returnsCorrectMediaPeriodInfos() {
|
public void getNextMediaPeriodInfo_withMidrollAndPostroll_returnsCorrectMediaPeriodInfos() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
C.TIME_END_OF_SOURCE);
|
C.TIME_END_OF_SOURCE);
|
||||||
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
|
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
|
||||||
/* startPositionUs= */ 0,
|
/* startPositionUs= */ 0,
|
||||||
|
|
@ -169,7 +169,7 @@ public final class MediaPeriodQueueTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getNextMediaPeriodInfo_withPostrollLoadError_returnsEmptyFinalMediaPeriodInfo() {
|
public void getNextMediaPeriodInfo_withPostrollLoadError_returnsEmptyFinalMediaPeriodInfo() {
|
||||||
setupTimeline(/* initialPositionUs= */ 0, /* adGroupTimesUs= */ C.TIME_END_OF_SOURCE);
|
setupTimeline(/* initialPositionUs= */ 0, /* adGroupTimesUs...= */ C.TIME_END_OF_SOURCE);
|
||||||
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
|
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod(
|
||||||
/* startPositionUs= */ 0,
|
/* startPositionUs= */ 0,
|
||||||
/* endPositionUs= */ C.TIME_END_OF_SOURCE,
|
/* endPositionUs= */ C.TIME_END_OF_SOURCE,
|
||||||
|
|
@ -191,7 +191,7 @@ public final class MediaPeriodQueueTest {
|
||||||
updateQueuedPeriods_withDurationChangeAfterReadingPeriod_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
|
updateQueuedPeriods_withDurationChangeAfterReadingPeriod_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -204,7 +204,7 @@ public final class MediaPeriodQueueTest {
|
||||||
// Change position of second ad (= change duration of content between ads).
|
// Change position of second ad (= change duration of content between ads).
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US + 1);
|
SECOND_AD_START_TIME_US + 1);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -221,7 +221,7 @@ public final class MediaPeriodQueueTest {
|
||||||
updateQueuedPeriods_withDurationChangeBeforeReadingPeriod_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
|
updateQueuedPeriods_withDurationChangeBeforeReadingPeriod_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -235,7 +235,7 @@ public final class MediaPeriodQueueTest {
|
||||||
// Change position of first ad (= change duration of content before first ad).
|
// Change position of first ad (= change duration of content before first ad).
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US + 1,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US + 1,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -252,7 +252,7 @@ public final class MediaPeriodQueueTest {
|
||||||
updateQueuedPeriods_withDurationChangeInReadingPeriodAfterReadingPosition_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
|
updateQueuedPeriods_withDurationChangeInReadingPeriodAfterReadingPosition_handlesChangeAndRemovesPeriodsAfterChangedPeriod() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -267,7 +267,7 @@ public final class MediaPeriodQueueTest {
|
||||||
// Change position of second ad (= change duration of content between ads).
|
// Change position of second ad (= change duration of content between ads).
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US - 1000);
|
SECOND_AD_START_TIME_US - 1000);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -286,7 +286,7 @@ public final class MediaPeriodQueueTest {
|
||||||
updateQueuedPeriods_withDurationChangeInReadingPeriodBeforeReadingPosition_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
|
updateQueuedPeriods_withDurationChangeInReadingPeriodBeforeReadingPosition_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -301,7 +301,7 @@ public final class MediaPeriodQueueTest {
|
||||||
// Change position of second ad (= change duration of content between ads).
|
// Change position of second ad (= change duration of content between ads).
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US - 1000);
|
SECOND_AD_START_TIME_US - 1000);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -320,7 +320,7 @@ public final class MediaPeriodQueueTest {
|
||||||
updateQueuedPeriods_withDurationChangeInReadingPeriodReadToEnd_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
|
updateQueuedPeriods_withDurationChangeInReadingPeriodReadToEnd_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod() {
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US);
|
SECOND_AD_START_TIME_US);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
@ -335,7 +335,7 @@ public final class MediaPeriodQueueTest {
|
||||||
// Change position of second ad (= change duration of content between ads).
|
// Change position of second ad (= change duration of content between ads).
|
||||||
setupTimeline(
|
setupTimeline(
|
||||||
/* initialPositionUs= */ 0,
|
/* initialPositionUs= */ 0,
|
||||||
/* adGroupTimesUs= */ FIRST_AD_START_TIME_US,
|
/* adGroupTimesUs...= */ FIRST_AD_START_TIME_US,
|
||||||
SECOND_AD_START_TIME_US - 1000);
|
SECOND_AD_START_TIME_US - 1000);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
setAdGroupLoaded(/* adGroupIndex= */ 0);
|
||||||
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
setAdGroupLoaded(/* adGroupIndex= */ 1);
|
||||||
|
|
|
||||||
|
|
@ -268,10 +268,11 @@ public final class SilenceSkippingAudioProcessorTest {
|
||||||
Pcm16BitAudioBuilder audioBuilder = new Pcm16BitAudioBuilder(channelCount, totalFrameCount);
|
Pcm16BitAudioBuilder audioBuilder = new Pcm16BitAudioBuilder(channelCount, totalFrameCount);
|
||||||
while (!audioBuilder.isFull()) {
|
while (!audioBuilder.isFull()) {
|
||||||
int silenceDurationFrames = (silenceDurationMs * sampleRate) / 1000;
|
int silenceDurationFrames = (silenceDurationMs * sampleRate) / 1000;
|
||||||
audioBuilder.appendFrames(/* count= */ silenceDurationFrames, /* channelLevels= */ (short) 0);
|
audioBuilder.appendFrames(
|
||||||
|
/* count= */ silenceDurationFrames, /* channelLevels...= */ (short) 0);
|
||||||
int noiseDurationFrames = (noiseDurationMs * sampleRate) / 1000;
|
int noiseDurationFrames = (noiseDurationMs * sampleRate) / 1000;
|
||||||
audioBuilder.appendFrames(
|
audioBuilder.appendFrames(
|
||||||
/* count= */ noiseDurationFrames, /* channelLevels= */ Short.MAX_VALUE);
|
/* count= */ noiseDurationFrames, /* channelLevels...= */ Short.MAX_VALUE);
|
||||||
}
|
}
|
||||||
return new InputBufferProvider(audioBuilder.build());
|
return new InputBufferProvider(audioBuilder.build());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1078,7 +1078,7 @@ public final class SampleQueueTest {
|
||||||
* filled with the specified sample data.
|
* filled with the specified sample data.
|
||||||
*
|
*
|
||||||
* @param timeUs The expected buffer timestamp.
|
* @param timeUs The expected buffer timestamp.
|
||||||
* @param isKeyframe The expected keyframe flag.
|
* @param isKeyFrame The expected keyframe flag.
|
||||||
* @param isEncrypted The expected encrypted flag.
|
* @param isEncrypted The expected encrypted flag.
|
||||||
* @param sampleData An array containing the expected sample data.
|
* @param sampleData An array containing the expected sample data.
|
||||||
* @param offset The offset in {@code sampleData} of the expected sample data.
|
* @param offset The offset in {@code sampleData} of the expected sample data.
|
||||||
|
|
@ -1086,7 +1086,7 @@ public final class SampleQueueTest {
|
||||||
*/
|
*/
|
||||||
private void assertReadSample(
|
private void assertReadSample(
|
||||||
long timeUs,
|
long timeUs,
|
||||||
boolean isKeyframe,
|
boolean isKeyFrame,
|
||||||
boolean isEncrypted,
|
boolean isEncrypted,
|
||||||
byte[] sampleData,
|
byte[] sampleData,
|
||||||
int offset,
|
int offset,
|
||||||
|
|
@ -1104,7 +1104,7 @@ public final class SampleQueueTest {
|
||||||
assertThat(formatHolder.format).isNull();
|
assertThat(formatHolder.format).isNull();
|
||||||
// inputBuffer should be populated.
|
// inputBuffer should be populated.
|
||||||
assertThat(inputBuffer.timeUs).isEqualTo(timeUs);
|
assertThat(inputBuffer.timeUs).isEqualTo(timeUs);
|
||||||
assertThat(inputBuffer.isKeyFrame()).isEqualTo(isKeyframe);
|
assertThat(inputBuffer.isKeyFrame()).isEqualTo(isKeyFrame);
|
||||||
assertThat(inputBuffer.isDecodeOnly()).isFalse();
|
assertThat(inputBuffer.isDecodeOnly()).isFalse();
|
||||||
assertThat(inputBuffer.isEncrypted()).isEqualTo(isEncrypted);
|
assertThat(inputBuffer.isEncrypted()).isEqualTo(isEncrypted);
|
||||||
inputBuffer.flip();
|
inputBuffer.flip();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue