use of com.google.android.exoplayer2.extractor.ExtractorInput in project ExoPlayer by google.
the class DefaultEbmlReaderTest method testFloatElementEightBytes.
public void testFloatElementEightBytes() throws IOException, InterruptedException {
ExtractorInput input = createTestInput(0x44, 0x89, 0x88, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
TestOutput expected = new TestOutput();
expected.floatElement(TestOutput.ID_DURATION, -2.0);
assertEvents(input, expected.events);
}
use of com.google.android.exoplayer2.extractor.ExtractorInput in project ExoPlayer by google.
the class DefaultEbmlReaderTest method testMasterElement.
public void testMasterElement() throws IOException, InterruptedException {
ExtractorInput input = createTestInput(0x1A, 0x45, 0xDF, 0xA3, 0x84, 0x42, 0x85, 0x81, 0x01);
TestOutput expected = new TestOutput();
expected.startMasterElement(TestOutput.ID_EBML, 5, 4);
expected.integerElement(TestOutput.ID_DOC_TYPE_READ_VERSION, 1);
expected.endMasterElement(TestOutput.ID_EBML);
assertEvents(input, expected.events);
}
use of com.google.android.exoplayer2.extractor.ExtractorInput in project ExoPlayer by google.
the class DefaultEbmlReaderTest method testUnsignedIntegerElementTooLargeBecomesNegative.
public void testUnsignedIntegerElementTooLargeBecomesNegative() throws IOException, InterruptedException {
ExtractorInput input = createTestInput(0x42, 0xF7, 0x88, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
TestOutput expected = new TestOutput();
expected.integerElement(TestOutput.ID_EBML_READ_VERSION, -1);
assertEvents(input, expected.events);
}
use of com.google.android.exoplayer2.extractor.ExtractorInput in project ExoPlayer by google.
the class DefaultEbmlReaderTest method testFloatElementFourBytes.
public void testFloatElementFourBytes() throws IOException, InterruptedException {
ExtractorInput input = createTestInput(0x44, 0x89, 0x84, 0x3F, 0x80, 0x00, 0x00);
TestOutput expected = new TestOutput();
expected.floatElement(TestOutput.ID_DURATION, 1.0);
assertEvents(input, expected.events);
}
use of com.google.android.exoplayer2.extractor.ExtractorInput in project ExoPlayer by google.
the class VarintReaderTest method testReadVarint.
private static void testReadVarint(VarintReader reader, boolean removeMask, byte[] data, int expectedLength, long expectedValue) throws IOException, InterruptedException {
ExtractorInput input = new FakeExtractorInput.Builder().setData(data).setSimulateUnknownLength(true).build();
long result = reader.readUnsignedVarint(input, false, removeMask, 8);
assertEquals(expectedLength, input.getPosition());
assertEquals(expectedValue, result);
}
Aggregations