Search in sources :

Example 1 with ExtractorInput

use of androidx.media3.extractor.ExtractorInput in project ExoPlayer by google.

the class DefaultEbmlReaderTest method testBinaryElement.

public void testBinaryElement() throws IOException, InterruptedException {
    ExtractorInput input = createTestInput(0xA3, 0x88, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08);
    TestOutput expected = new TestOutput();
    expected.binaryElement(TestOutput.ID_SIMPLE_BLOCK, 8, createTestInput(0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08));
    assertEvents(input, expected.events);
}
Also used : ExtractorInput(com.google.android.exoplayer2.extractor.ExtractorInput) FakeExtractorInput(com.google.android.exoplayer2.testutil.FakeExtractorInput)

Example 2 with ExtractorInput

use of androidx.media3.extractor.ExtractorInput in project ExoPlayer by google.

the class DefaultEbmlReaderTest method testStringElement.

public void testStringElement() throws IOException, InterruptedException {
    ExtractorInput input = createTestInput(0x42, 0x82, 0x86, 0x41, 0x62, 0x63, 0x31, 0x32, 0x33);
    TestOutput expected = new TestOutput();
    expected.stringElement(TestOutput.ID_DOC_TYPE, "Abc123");
    assertEvents(input, expected.events);
}
Also used : ExtractorInput(com.google.android.exoplayer2.extractor.ExtractorInput) FakeExtractorInput(com.google.android.exoplayer2.testutil.FakeExtractorInput)

Example 3 with ExtractorInput

use of androidx.media3.extractor.ExtractorInput in project ExoPlayer by google.

the class DefaultEbmlReaderTest method testUnsignedIntegerElement.

public void testUnsignedIntegerElement() throws IOException, InterruptedException {
    // 0xFE is chosen because for signed integers it should be interpreted as -2
    ExtractorInput input = createTestInput(0x42, 0xF7, 0x81, 0xFE);
    TestOutput expected = new TestOutput();
    expected.integerElement(TestOutput.ID_EBML_READ_VERSION, 254);
    assertEvents(input, expected.events);
}
Also used : ExtractorInput(com.google.android.exoplayer2.extractor.ExtractorInput) FakeExtractorInput(com.google.android.exoplayer2.testutil.FakeExtractorInput)

Example 4 with ExtractorInput

use of androidx.media3.extractor.ExtractorInput in project ExoPlayer by google.

the class DefaultEbmlReaderTest method testUnsignedIntegerElementLarge.

public void testUnsignedIntegerElementLarge() throws IOException, InterruptedException {
    ExtractorInput input = createTestInput(0x42, 0xF7, 0x88, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
    TestOutput expected = new TestOutput();
    expected.integerElement(TestOutput.ID_EBML_READ_VERSION, Long.MAX_VALUE);
    assertEvents(input, expected.events);
}
Also used : ExtractorInput(com.google.android.exoplayer2.extractor.ExtractorInput) FakeExtractorInput(com.google.android.exoplayer2.testutil.FakeExtractorInput)

Example 5 with ExtractorInput

use of androidx.media3.extractor.ExtractorInput in project ExoPlayer by google.

the class DefaultEbmlReaderTest method testStringElementEmpty.

public void testStringElementEmpty() throws IOException, InterruptedException {
    ExtractorInput input = createTestInput(0x42, 0x82, 0x80);
    TestOutput expected = new TestOutput();
    expected.stringElement(TestOutput.ID_DOC_TYPE, "");
    assertEvents(input, expected.events);
}
Also used : ExtractorInput(com.google.android.exoplayer2.extractor.ExtractorInput) FakeExtractorInput(com.google.android.exoplayer2.testutil.FakeExtractorInput)

Aggregations

Test (org.junit.Test)94 FakeExtractorInput (androidx.media3.test.utils.FakeExtractorInput)68 ExtractorInput (com.google.android.exoplayer2.extractor.ExtractorInput)59 FakeExtractorInput (com.google.android.exoplayer2.testutil.FakeExtractorInput)41 ExtractorInput (androidx.media3.extractor.ExtractorInput)38 ParsableByteArray (androidx.media3.common.util.ParsableByteArray)34 FlacStreamMetadataHolder (androidx.media3.extractor.FlacMetadataReader.FlacStreamMetadataHolder)20 DefaultExtractorInput (com.google.android.exoplayer2.extractor.DefaultExtractorInput)17 Nullable (androidx.annotation.Nullable)16 DataSpec (androidx.media3.datasource.DataSpec)15 DefaultExtractorInput (androidx.media3.extractor.DefaultExtractorInput)14 Metadata (androidx.media3.common.Metadata)13 DataSpec (com.google.android.exoplayer2.upstream.DataSpec)10 EOFException (java.io.EOFException)10 SampleNumberHolder (androidx.media3.extractor.FlacFrameReader.SampleNumberHolder)9 FakeDataSource (androidx.media3.test.utils.FakeDataSource)9 RequiresNonNull (org.checkerframework.checker.nullness.qual.RequiresNonNull)9 SeekPoint (androidx.media3.extractor.SeekPoint)7 IOException (java.io.IOException)7 SeekMap (androidx.media3.extractor.SeekMap)5