mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove some occurrences of dummy
Remove occurrences in comments and private fields. ISSUE: #7565 PiperOrigin-RevId: 320948364
This commit is contained in:
parent
5c9c0e2073
commit
92437f3a0f
18 changed files with 50 additions and 54 deletions
|
|
@ -690,7 +690,7 @@ public final class C {
|
||||||
public static final int TRACK_TYPE_METADATA = 4;
|
public static final int TRACK_TYPE_METADATA = 4;
|
||||||
/** A type constant for camera motion tracks. */
|
/** A type constant for camera motion tracks. */
|
||||||
public static final int TRACK_TYPE_CAMERA_MOTION = 5;
|
public static final int TRACK_TYPE_CAMERA_MOTION = 5;
|
||||||
/** A type constant for a dummy or empty track. */
|
/** A type constant for a fake or empty track. */
|
||||||
public static final int TRACK_TYPE_NONE = 6;
|
public static final int TRACK_TYPE_NONE = 6;
|
||||||
/**
|
/**
|
||||||
* Applications or extensions may define custom {@code TRACK_TYPE_*} constants greater than or
|
* Applications or extensions may define custom {@code TRACK_TYPE_*} constants greater than or
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,9 @@ import org.junit.runner.RunWith;
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class DashManifestTest {
|
public class DashManifestTest {
|
||||||
|
|
||||||
private static final UtcTimingElement DUMMY_UTC_TIMING = new UtcTimingElement("", "");
|
private static final UtcTimingElement UTC_TIMING = new UtcTimingElement("", "");
|
||||||
private static final SingleSegmentBase DUMMY_SEGMENT_BASE = new SingleSegmentBase();
|
private static final SingleSegmentBase SEGMENT_BASE = new SingleSegmentBase();
|
||||||
private static final Format DUMMY_FORMAT = new Format.Builder().build();
|
private static final Format FORMAT = new Format.Builder().build();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void copy() {
|
public void copy() {
|
||||||
|
|
@ -214,8 +214,7 @@ public class DashManifestTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Representation newRepresentation() {
|
private static Representation newRepresentation() {
|
||||||
return Representation.newInstance(
|
return Representation.newInstance(/* revisionId= */ 0, FORMAT, /* baseUrl= */ "", SEGMENT_BASE);
|
||||||
/* revisionId= */ 0, DUMMY_FORMAT, /* baseUrl= */ "", DUMMY_SEGMENT_BASE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DashManifest newDashManifest(int duration, Period... periods) {
|
private static DashManifest newDashManifest(int duration, Period... periods) {
|
||||||
|
|
@ -229,7 +228,7 @@ public class DashManifestTest {
|
||||||
/* suggestedPresentationDelayMs= */ 4,
|
/* suggestedPresentationDelayMs= */ 4,
|
||||||
/* publishTimeMs= */ 12345,
|
/* publishTimeMs= */ 12345,
|
||||||
/* programInformation= */ null,
|
/* programInformation= */ null,
|
||||||
DUMMY_UTC_TIMING,
|
UTC_TIMING,
|
||||||
Uri.EMPTY,
|
Uri.EMPTY,
|
||||||
Arrays.asList(periods));
|
Arrays.asList(periods));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,12 @@ public class DownloadManagerDashTest {
|
||||||
private StreamKey fakeStreamKey2;
|
private StreamKey fakeStreamKey2;
|
||||||
private TestDownloadManagerListener downloadManagerListener;
|
private TestDownloadManagerListener downloadManagerListener;
|
||||||
private DefaultDownloadIndex downloadIndex;
|
private DefaultDownloadIndex downloadIndex;
|
||||||
private DummyMainThread dummyMainThread;
|
private DummyMainThread testThread;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
ShadowLog.stream = System.out;
|
ShadowLog.stream = System.out;
|
||||||
dummyMainThread = new DummyMainThread();
|
testThread = new DummyMainThread();
|
||||||
Context context = ApplicationProvider.getApplicationContext();
|
Context context = ApplicationProvider.getApplicationContext();
|
||||||
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
|
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
|
||||||
File cacheFolder = new File(tempFolder, "cache");
|
File cacheFolder = new File(tempFolder, "cache");
|
||||||
|
|
@ -105,7 +105,7 @@ public class DownloadManagerDashTest {
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
runOnMainThread(() -> downloadManager.release());
|
runOnMainThread(() -> downloadManager.release());
|
||||||
Util.recursiveDelete(tempFolder);
|
Util.recursiveDelete(tempFolder);
|
||||||
dummyMainThread.release();
|
testThread.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disabled due to flakiness.
|
// Disabled due to flakiness.
|
||||||
|
|
@ -144,7 +144,7 @@ public class DownloadManagerDashTest {
|
||||||
// Revert fakeDataSet to normal.
|
// Revert fakeDataSet to normal.
|
||||||
fakeDataSet.setData(TEST_MPD_URI, TEST_MPD);
|
fakeDataSet.setData(TEST_MPD_URI, TEST_MPD);
|
||||||
|
|
||||||
dummyMainThread.runOnMainThread(this::createDownloadManager);
|
testThread.runOnMainThread(this::createDownloadManager);
|
||||||
|
|
||||||
// Block on the test thread.
|
// Block on the test thread.
|
||||||
downloadManagerListener.blockUntilIdleAndThrowAnyFailure();
|
downloadManagerListener.blockUntilIdleAndThrowAnyFailure();
|
||||||
|
|
@ -252,6 +252,6 @@ public class DownloadManagerDashTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runOnMainThread(TestRunnable r) {
|
private void runOnMainThread(TestRunnable r) {
|
||||||
dummyMainThread.runTestOnMainThread(r);
|
testThread.runTestOnMainThread(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,11 +72,11 @@ public class DownloadServiceDashTest {
|
||||||
private DownloadService dashDownloadService;
|
private DownloadService dashDownloadService;
|
||||||
private ConditionVariable pauseDownloadCondition;
|
private ConditionVariable pauseDownloadCondition;
|
||||||
private TestDownloadManagerListener downloadManagerListener;
|
private TestDownloadManagerListener downloadManagerListener;
|
||||||
private DummyMainThread dummyMainThread;
|
private DummyMainThread testThread;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws IOException {
|
public void setUp() throws IOException {
|
||||||
dummyMainThread = new DummyMainThread();
|
testThread = new DummyMainThread();
|
||||||
context = ApplicationProvider.getApplicationContext();
|
context = ApplicationProvider.getApplicationContext();
|
||||||
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
|
tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
|
||||||
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
|
cache = new SimpleCache(tempFolder, new NoOpCacheEvictor());
|
||||||
|
|
@ -109,7 +109,7 @@ public class DownloadServiceDashTest {
|
||||||
fakeStreamKey1 = new StreamKey(0, 0, 0);
|
fakeStreamKey1 = new StreamKey(0, 0, 0);
|
||||||
fakeStreamKey2 = new StreamKey(0, 1, 0);
|
fakeStreamKey2 = new StreamKey(0, 1, 0);
|
||||||
|
|
||||||
dummyMainThread.runTestOnMainThread(
|
testThread.runTestOnMainThread(
|
||||||
() -> {
|
() -> {
|
||||||
DefaultDownloadIndex downloadIndex =
|
DefaultDownloadIndex downloadIndex =
|
||||||
new DefaultDownloadIndex(TestUtil.getInMemoryDatabaseProvider());
|
new DefaultDownloadIndex(TestUtil.getInMemoryDatabaseProvider());
|
||||||
|
|
@ -148,9 +148,9 @@ public class DownloadServiceDashTest {
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
dummyMainThread.runOnMainThread(() -> dashDownloadService.onDestroy());
|
testThread.runOnMainThread(() -> dashDownloadService.onDestroy());
|
||||||
Util.recursiveDelete(tempFolder);
|
Util.recursiveDelete(tempFolder);
|
||||||
dummyMainThread.release();
|
testThread.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore // b/78877092
|
@Ignore // b/78877092
|
||||||
|
|
@ -192,7 +192,7 @@ public class DownloadServiceDashTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeAll() {
|
private void removeAll() {
|
||||||
dummyMainThread.runOnMainThread(
|
testThread.runOnMainThread(
|
||||||
() -> {
|
() -> {
|
||||||
Intent startIntent =
|
Intent startIntent =
|
||||||
DownloadService.buildRemoveDownloadIntent(
|
DownloadService.buildRemoveDownloadIntent(
|
||||||
|
|
@ -212,7 +212,7 @@ public class DownloadServiceDashTest {
|
||||||
keysList,
|
keysList,
|
||||||
/* customCacheKey= */ null,
|
/* customCacheKey= */ null,
|
||||||
null);
|
null);
|
||||||
dummyMainThread.runOnMainThread(
|
testThread.runOnMainThread(
|
||||||
() -> {
|
() -> {
|
||||||
Intent startIntent =
|
Intent startIntent =
|
||||||
DownloadService.buildAddDownloadIntent(
|
DownloadService.buildAddDownloadIntent(
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.google.android.exoplayer2.extractor;
|
package com.google.android.exoplayer2.extractor;
|
||||||
|
|
||||||
/** A dummy {@link ExtractorOutput} implementation. */
|
/** A fake {@link ExtractorOutput} implementation. */
|
||||||
public final class DummyExtractorOutput implements ExtractorOutput {
|
public final class DummyExtractorOutput implements ExtractorOutput {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/** A fake {@link TrackOutput} implementation. */
|
||||||
* A dummy {@link TrackOutput} implementation.
|
|
||||||
*/
|
|
||||||
public final class DummyTrackOutput implements TrackOutput {
|
public final class DummyTrackOutput implements TrackOutput {
|
||||||
|
|
||||||
// Even though read data is discarded, data source implementations could be making use of the
|
// Even though read data is discarded, data source implementations could be making use of the
|
||||||
|
|
|
||||||
|
|
@ -246,8 +246,8 @@ public class MatroskaExtractor implements Extractor {
|
||||||
* <p>The display time of each subtitle is passed as {@code timeUs} to {@link
|
* <p>The display time of each subtitle is passed as {@code timeUs} to {@link
|
||||||
* TrackOutput#sampleMetadata}. The start and end timecodes in this template are relative to
|
* TrackOutput#sampleMetadata}. The start and end timecodes in this template are relative to
|
||||||
* {@code timeUs}. Hence the start timecode is always zero. The 12 byte end timecode starting at
|
* {@code timeUs}. Hence the start timecode is always zero. The 12 byte end timecode starting at
|
||||||
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a dummy value, and must be replaced with
|
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a placeholder value, and must be replaced
|
||||||
* the duration of the subtitle.
|
* with the duration of the subtitle.
|
||||||
*
|
*
|
||||||
* <p>Equivalent to the UTF-8 string: "1\n00:00:00,000 --> 00:00:00,000\n".
|
* <p>Equivalent to the UTF-8 string: "1\n00:00:00,000 --> 00:00:00,000\n".
|
||||||
*/
|
*/
|
||||||
|
|
@ -281,8 +281,8 @@ public class MatroskaExtractor implements Extractor {
|
||||||
* <p>The display time of each subtitle is passed as {@code timeUs} to {@link
|
* <p>The display time of each subtitle is passed as {@code timeUs} to {@link
|
||||||
* TrackOutput#sampleMetadata}. The start and end timecodes in this template are relative to
|
* TrackOutput#sampleMetadata}. The start and end timecodes in this template are relative to
|
||||||
* {@code timeUs}. Hence the start timecode is always zero. The 12 byte end timecode starting at
|
* {@code timeUs}. Hence the start timecode is always zero. The 12 byte end timecode starting at
|
||||||
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a dummy value, and must be replaced with
|
* {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a placeholder value, and must be replaced
|
||||||
* the duration of the subtitle.
|
* with the duration of the subtitle.
|
||||||
*
|
*
|
||||||
* <p>Equivalent to the UTF-8 string: "Dialogue: 0:00:00:00,0:00:00:00,".
|
* <p>Equivalent to the UTF-8 string: "Dialogue: 0:00:00:00,0:00:00:00,".
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -576,8 +576,8 @@ public final class TsExtractor implements Extractor {
|
||||||
if (mode == MODE_HLS && id3Reader == null) {
|
if (mode == MODE_HLS && id3Reader == null) {
|
||||||
// Setup an ID3 track regardless of whether there's a corresponding entry, in case one
|
// Setup an ID3 track regardless of whether there's a corresponding entry, in case one
|
||||||
// appears intermittently during playback. See [Internal: b/20261500].
|
// appears intermittently during playback. See [Internal: b/20261500].
|
||||||
EsInfo dummyEsInfo = new EsInfo(TS_STREAM_TYPE_ID3, null, null, Util.EMPTY_BYTE_ARRAY);
|
EsInfo id3EsInfo = new EsInfo(TS_STREAM_TYPE_ID3, null, null, Util.EMPTY_BYTE_ARRAY);
|
||||||
id3Reader = payloadReaderFactory.createPayloadReader(TS_STREAM_TYPE_ID3, dummyEsInfo);
|
id3Reader = payloadReaderFactory.createPayloadReader(TS_STREAM_TYPE_ID3, id3EsInfo);
|
||||||
id3Reader.init(timestampAdjuster, output,
|
id3Reader.init(timestampAdjuster, output,
|
||||||
new TrackIdGenerator(programNumber, TS_STREAM_TYPE_ID3, MAX_PID_PLUS_ONE));
|
new TrackIdGenerator(programNumber, TS_STREAM_TYPE_ID3, MAX_PID_PLUS_ONE));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtractor {
|
public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtractor {
|
||||||
|
|
||||||
private static final PositionHolder DUMMY_POSITION_HOLDER = new PositionHolder();
|
private static final PositionHolder POSITION_HOLDER = new PositionHolder();
|
||||||
|
|
||||||
@VisibleForTesting /* package */ final Extractor extractor;
|
@VisibleForTesting /* package */ final Extractor extractor;
|
||||||
private final Format masterPlaylistFormat;
|
private final Format masterPlaylistFormat;
|
||||||
|
|
@ -64,7 +64,7 @@ public final class BundledHlsMediaChunkExtractor implements HlsMediaChunkExtract
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean read(ExtractorInput extractorInput) throws IOException {
|
public boolean read(ExtractorInput extractorInput) throws IOException {
|
||||||
return extractor.read(extractorInput, DUMMY_POSITION_HOLDER) == Extractor.RESULT_CONTINUE;
|
return extractor.read(extractorInput, POSITION_HOLDER) == Extractor.RESULT_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -941,7 +941,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
|
|
||||||
if (trackOutput == null) {
|
if (trackOutput == null) {
|
||||||
if (tracksEnded) {
|
if (tracksEnded) {
|
||||||
return createDummyTrackOutput(id, type);
|
return createFakeTrackOutput(id, type);
|
||||||
} else {
|
} else {
|
||||||
// The relevant SampleQueue hasn't been constructed yet - so construct it.
|
// The relevant SampleQueue hasn't been constructed yet - so construct it.
|
||||||
trackOutput = createSampleQueue(id, type);
|
trackOutput = createSampleQueue(id, type);
|
||||||
|
|
@ -985,7 +985,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
}
|
}
|
||||||
return sampleQueueTrackIds[sampleQueueIndex] == id
|
return sampleQueueTrackIds[sampleQueueIndex] == id
|
||||||
? sampleQueues[sampleQueueIndex]
|
? sampleQueues[sampleQueueIndex]
|
||||||
: createDummyTrackOutput(id, type);
|
: createFakeTrackOutput(id, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SampleQueue createSampleQueue(int id, int type) {
|
private SampleQueue createSampleQueue(int id, int type) {
|
||||||
|
|
@ -1459,7 +1459,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DummyTrackOutput createDummyTrackOutput(int id, int type) {
|
private static DummyTrackOutput createFakeTrackOutput(int id, int type) {
|
||||||
Log.w(TAG, "Unmapped track with id " + id + " of type " + type);
|
Log.w(TAG, "Unmapped track with id " + id + " of type " + type);
|
||||||
return new DummyTrackOutput();
|
return new DummyTrackOutput();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,7 @@ public class HlsMediaPlaylistParserTest {
|
||||||
+ "#EXT-X-KEY:METHOD=NONE\n"
|
+ "#EXT-X-KEY:METHOD=NONE\n"
|
||||||
+ "#EXTINF:5.005,\n"
|
+ "#EXTINF:5.005,\n"
|
||||||
+ "#EXT-X-GAP \n"
|
+ "#EXT-X-GAP \n"
|
||||||
+ "../dummy.ts\n"
|
+ "../test.ts\n"
|
||||||
+ "#EXT-X-KEY:METHOD=AES-128,URI=\"https://key-service.bamgrid.com/1.0/key?"
|
+ "#EXT-X-KEY:METHOD=AES-128,URI=\"https://key-service.bamgrid.com/1.0/key?"
|
||||||
+ "hex-value=9FB8989D15EEAAF8B21B860D7ED3072A\",IV=0x410C8AC18AA42EFA18B5155484F5FC34\n"
|
+ "hex-value=9FB8989D15EEAAF8B21B860D7ED3072A\",IV=0x410C8AC18AA42EFA18B5155484F5FC34\n"
|
||||||
+ "#EXTINF:5.005,\n"
|
+ "#EXTINF:5.005,\n"
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class TouchTrackerTest {
|
||||||
private TouchTracker tracker;
|
private TouchTracker tracker;
|
||||||
private float yaw;
|
private float yaw;
|
||||||
private float pitch;
|
private float pitch;
|
||||||
private float[] dummyMatrix;
|
private float[] matrix;
|
||||||
|
|
||||||
private static void swipe(TouchTracker tracker, float x0, float y0, float x1, float y1) {
|
private static void swipe(TouchTracker tracker, float x0, float y0, float x1, float y1) {
|
||||||
tracker.onTouch(null, MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, x0, y0, 0));
|
tracker.onTouch(null, MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, x0, y0, 0));
|
||||||
|
|
@ -54,8 +54,8 @@ public class TouchTrackerTest {
|
||||||
yaw = scrollOffsetDegrees.x;
|
yaw = scrollOffsetDegrees.x;
|
||||||
},
|
},
|
||||||
PX_PER_DEGREES);
|
PX_PER_DEGREES);
|
||||||
dummyMatrix = new float[16];
|
matrix = new float[16];
|
||||||
tracker.onOrientationChange(dummyMatrix, 0);
|
tracker.onOrientationChange(matrix, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -111,7 +111,7 @@ public class TouchTrackerTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void withRoll90() {
|
public void withRoll90() {
|
||||||
tracker.onOrientationChange(dummyMatrix, (float) Math.toRadians(90));
|
tracker.onOrientationChange(matrix, (float) Math.toRadians(90));
|
||||||
|
|
||||||
// Y-axis should now control yaw.
|
// Y-axis should now control yaw.
|
||||||
swipe(tracker, 0, 0, 0, 2 * SWIPE_PX);
|
swipe(tracker, 0, 0, 0, 2 * SWIPE_PX);
|
||||||
|
|
@ -124,7 +124,7 @@ public class TouchTrackerTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void withRoll180() {
|
public void withRoll180() {
|
||||||
tracker.onOrientationChange(dummyMatrix, (float) Math.toRadians(180));
|
tracker.onOrientationChange(matrix, (float) Math.toRadians(180));
|
||||||
|
|
||||||
// X-axis should now control reverse yaw.
|
// X-axis should now control reverse yaw.
|
||||||
swipe(tracker, 0, 0, -2 * SWIPE_PX, 0);
|
swipe(tracker, 0, 0, -2 * SWIPE_PX, 0);
|
||||||
|
|
@ -137,7 +137,7 @@ public class TouchTrackerTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void withRoll270() {
|
public void withRoll270() {
|
||||||
tracker.onOrientationChange(dummyMatrix, (float) Math.toRadians(270));
|
tracker.onOrientationChange(matrix, (float) Math.toRadians(270));
|
||||||
|
|
||||||
// Y-axis should now control reverse yaw.
|
// Y-axis should now control reverse yaw.
|
||||||
swipe(tracker, 0, 0, 0, -2 * SWIPE_PX);
|
swipe(tracker, 0, 0, 0, -2 * SWIPE_PX);
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
||||||
<Representation id="140" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="144000">
|
<Representation id="140" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="144000">
|
||||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||||
<BaseURL>http://www.dummy.url/</BaseURL>
|
<BaseURL>http://www.test.url/</BaseURL>
|
||||||
</Representation>
|
</Representation>
|
||||||
</AdaptationSet>
|
</AdaptationSet>
|
||||||
<AdaptationSet id="1" mimeType="video/mp4" subsegmentAlignment="true">
|
<AdaptationSet id="1" mimeType="video/mp4" subsegmentAlignment="true">
|
||||||
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
||||||
<Representation id="133" codecs="avc1.4d4015" width="426" height="240" startWithSAP="1" maxPlayoutRate="1" bandwidth="258000" frameRate="30">
|
<Representation id="133" codecs="avc1.4d4015" width="426" height="240" startWithSAP="1" maxPlayoutRate="1" bandwidth="258000" frameRate="30">
|
||||||
<BaseURL>http://www.dummy.url/</BaseURL>
|
<BaseURL>http://www.test.url/</BaseURL>
|
||||||
</Representation>
|
</Representation>
|
||||||
</AdaptationSet>
|
</AdaptationSet>
|
||||||
</Period>
|
</Period>
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,13 @@
|
||||||
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
||||||
<Representation id="140" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="144000">
|
<Representation id="140" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="144000">
|
||||||
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
|
||||||
<BaseURL>http://www.dummy.url/</BaseURL>
|
<BaseURL>http://www.test.url/</BaseURL>
|
||||||
</Representation>
|
</Representation>
|
||||||
</AdaptationSet>
|
</AdaptationSet>
|
||||||
<AdaptationSet id="1" mimeType="video/mp4" subsegmentAlignment="true">
|
<AdaptationSet id="1" mimeType="video/mp4" subsegmentAlignment="true">
|
||||||
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
<Role schemeIdUri="urn:mpeg:DASH:role:2011" value="main"/>
|
||||||
<Representation id="133" codecs="avc1.4d4015" width="426" height="240" startWithSAP="1" maxPlayoutRate="1" bandwidth="258000" frameRate="30">
|
<Representation id="133" codecs="avc1.4d4015" width="426" height="240" startWithSAP="1" maxPlayoutRate="1" bandwidth="258000" frameRate="30">
|
||||||
<BaseURL>http://www.dummy.url/</BaseURL>
|
<BaseURL>http://www.test.url/</BaseURL>
|
||||||
</Representation>
|
</Representation>
|
||||||
</AdaptationSet>
|
</AdaptationSet>
|
||||||
</Period>
|
</Period>
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,7 @@ public final class FakeTimeline extends Timeline {
|
||||||
public final AdPlaybackState adPlaybackState;
|
public final AdPlaybackState adPlaybackState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a window definition that corresponds to a dummy placeholder timeline using the given
|
* Creates a window definition that corresponds to a placeholder timeline using the given tag.
|
||||||
* tag.
|
|
||||||
*
|
*
|
||||||
* @param tag The tag to use in the timeline.
|
* @param tag The tag to use in the timeline.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -199,9 +199,9 @@ public final class MediaPeriodAsserts {
|
||||||
|
|
||||||
private static TrackGroupArray prepareAndGetTrackGroups(MediaPeriod mediaPeriod) {
|
private static TrackGroupArray prepareAndGetTrackGroups(MediaPeriod mediaPeriod) {
|
||||||
AtomicReference<TrackGroupArray> trackGroupArray = new AtomicReference<>();
|
AtomicReference<TrackGroupArray> trackGroupArray = new AtomicReference<>();
|
||||||
DummyMainThread dummyMainThread = new DummyMainThread();
|
DummyMainThread testThread = new DummyMainThread();
|
||||||
ConditionVariable preparedCondition = new ConditionVariable();
|
ConditionVariable preparedCondition = new ConditionVariable();
|
||||||
dummyMainThread.runOnMainThread(
|
testThread.runOnMainThread(
|
||||||
() ->
|
() ->
|
||||||
mediaPeriod.prepare(
|
mediaPeriod.prepare(
|
||||||
new Callback() {
|
new Callback() {
|
||||||
|
|
@ -222,7 +222,7 @@ public final class MediaPeriodAsserts {
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
}
|
}
|
||||||
dummyMainThread.release();
|
testThread.release();
|
||||||
return trackGroupArray.get();
|
return trackGroupArray.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,17 +198,17 @@ public class TestUtil {
|
||||||
return ImmutableList.copyOf(Bytes.asList(createByteArray(bytes)));
|
return ImmutableList.copyOf(Bytes.asList(createByteArray(bytes)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes one byte long dummy test data to the file and returns it. */
|
/** Writes one byte long test data to the file and returns it. */
|
||||||
public static File createTestFile(File directory, String name) throws IOException {
|
public static File createTestFile(File directory, String name) throws IOException {
|
||||||
return createTestFile(directory, name, /* length= */ 1);
|
return createTestFile(directory, name, /* length= */ 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes dummy test data with the specified length to the file and returns it. */
|
/** Writes test data with the specified length to the file and returns it. */
|
||||||
public static File createTestFile(File directory, String name, long length) throws IOException {
|
public static File createTestFile(File directory, String name, long length) throws IOException {
|
||||||
return createTestFile(new File(directory, name), length);
|
return createTestFile(new File(directory, name), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes dummy test data with the specified length to the file and returns it. */
|
/** Writes test data with the specified length to the file and returns it. */
|
||||||
public static File createTestFile(File file, long length) throws IOException {
|
public static File createTestFile(File file, long length) throws IOException {
|
||||||
FileOutputStream output = new FileOutputStream(file);
|
FileOutputStream output = new FileOutputStream(file);
|
||||||
for (long i = 0; i < length; i++) {
|
for (long i = 0; i < length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public final class FakeDataSourceTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDummyData() throws IOException {
|
public void testFakeData() throws IOException {
|
||||||
FakeDataSource dataSource =
|
FakeDataSource dataSource =
|
||||||
new FakeDataSource(
|
new FakeDataSource(
|
||||||
new FakeDataSet()
|
new FakeDataSet()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue