com.google.android.exoplayer.extractor.ChunkIndex

Here are the examples of the java api class com.google.android.exoplayer.extractor.ChunkIndex taken from open source projects.

1. WebmExtractorTest#assertIndex()

Project: ExoPlayer
Source File: WebmExtractorTest.java
View license
private void assertIndex(int timecodeScale, int cuePointCount) {
    ChunkIndex index = (ChunkIndex) extractorOutput.seekMap;
    assertEquals(cuePointCount, index.length);
    for (int i = 0; i < cuePointCount - 1; i++) {
        assertEquals(Util.scaleLargeTimestamp(10 * i, timecodeScale, 1000), index.timesUs[i]);
        assertEquals(Util.scaleLargeTimestamp(10, timecodeScale, 1000), index.durationsUs[i]);
        assertEquals(0, index.sizes[i]);
    }
    int lastIndex = cuePointCount - 1;
    long lastTimecode = 10 * lastIndex;
    long lastDurationTimecode = TEST_DURATION_TIMECODE - lastTimecode;
    assertEquals(Util.scaleLargeTimestamp(lastTimecode, timecodeScale, 1000), index.timesUs[lastIndex]);
    assertEquals(Util.scaleLargeTimestamp(lastDurationTimecode, timecodeScale, 1000), index.durationsUs[lastIndex]);
}