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 testReadVarintEndOfInputAtStart.
public void testReadVarintEndOfInputAtStart() throws IOException, InterruptedException {
VarintReader reader = new VarintReader();
// Build an input with no data.
ExtractorInput input = new FakeExtractorInput.Builder().setSimulateUnknownLength(true).build();
// End of input allowed.
long result = reader.readUnsignedVarint(input, true, false, 8);
assertEquals(C.RESULT_END_OF_INPUT, result);
// End of input not allowed.
try {
reader.readUnsignedVarint(input, false, false, 8);
fail();
} catch (EOFException e) {
// Expected.
}
}
Aggregations