diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 10a1dcf9b8..9dd0ed3dfe 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -13,6 +13,8 @@ * Audio: * Support seeking for the AMR container format using constant bitrate seek map. + * Support seeking for the ADTS container format using constant bitrate seek + map ([#4548](https://github.com/google/ExoPlayer/issues/4548)). * Add support for mu-law and A-law PCM with the ffmpeg extension ([#4360](https://github.com/google/ExoPlayer/issues/4360)). * Increase `AudioTrack` buffer sizes to the theoretical maximum required for diff --git a/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractor.java b/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractor.java index 56197730f7..ef7b763306 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractor.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractor.java @@ -15,7 +15,11 @@ */ package com.google.android.exoplayer2.extractor.ts; +import android.support.annotation.IntDef; +import android.support.annotation.Nullable; import com.google.android.exoplayer2.C; +import com.google.android.exoplayer2.ParserException; +import com.google.android.exoplayer2.extractor.ConstantBitrateSeekMap; import com.google.android.exoplayer2.extractor.Extractor; import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorOutput; @@ -23,10 +27,13 @@ import com.google.android.exoplayer2.extractor.ExtractorsFactory; import com.google.android.exoplayer2.extractor.PositionHolder; import com.google.android.exoplayer2.extractor.SeekMap; import com.google.android.exoplayer2.extractor.ts.TsPayloadReader.TrackIdGenerator; +import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.ParsableBitArray; import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.Util; import java.io.IOException; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; /** * Extracts data from AAC bit streams with ADTS framing. @@ -36,28 +43,74 @@ public final class AdtsExtractor implements Extractor { /** Factory for {@link AdtsExtractor} instances. */ public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new AdtsExtractor()}; - private static final int MAX_PACKET_SIZE = 200; + /** Flags controlling the behavior of the extractor. */ + @Retention(RetentionPolicy.SOURCE) + @IntDef( + flag = true, + value = {FLAG_ENABLE_CONSTANT_BITRATE_SEEKING}) + public @interface Flags {} + /** + * Flag to force enable seeking using a constant bitrate assumption in cases where seeking would + * otherwise not be possible. + * + *

Note that this approach may result in approximated stream duration and seek position that + * are not precise, especially when the stream bitrate varies a lot. + */ + public static final int FLAG_ENABLE_CONSTANT_BITRATE_SEEKING = 1; + + private static final int MAX_PACKET_SIZE = 2 * 1024; private static final int ID3_TAG = Util.getIntegerCodeForString("ID3"); /** * The maximum number of bytes to search when sniffing, excluding the header, before giving up. * Frame sizes are represented by 13-bit fields, so expect a valid frame in the first 8192 bytes. */ private static final int MAX_SNIFF_BYTES = 8 * 1024; + /** + * The maximum number of frames to use when calculating the average frame size for constant + * bitrate seeking. + */ + private static final int NUM_FRAMES_FOR_AVERAGE_FRAME_SIZE = 1000; + + private final @Flags int flags; - private final long firstSampleTimestampUs; private final AdtsReader reader; private final ParsableByteArray packetBuffer; + private final ParsableByteArray scratch; + private final ParsableBitArray scratchBits; + private final long firstStreamSampleTimestampUs; + private @Nullable ExtractorOutput extractorOutput; + + private long firstSampleTimestampUs; + private long firstFramePosition; + private int averageFrameSize; + private boolean hasCalculatedAverageFrameSize; private boolean startedPacket; + private boolean hasOutputSeekMap; public AdtsExtractor() { this(0); } - public AdtsExtractor(long firstSampleTimestampUs) { - this.firstSampleTimestampUs = firstSampleTimestampUs; + public AdtsExtractor(long firstStreamSampleTimestampUs) { + this(/* firstStreamSampleTimestampUs= */ firstStreamSampleTimestampUs, /* flags= */ 0); + } + + /** + * @param firstStreamSampleTimestampUs The timestamp to be used for the first sample of the stream + * output from this extractor. + * @param flags Flags that control the extractor's behavior. + */ + public AdtsExtractor(long firstStreamSampleTimestampUs, @Flags int flags) { + this.firstStreamSampleTimestampUs = firstStreamSampleTimestampUs; + this.firstSampleTimestampUs = firstStreamSampleTimestampUs; + this.flags = flags; reader = new AdtsReader(true); packetBuffer = new ParsableByteArray(MAX_PACKET_SIZE); + averageFrameSize = C.LENGTH_UNSET; + firstFramePosition = C.POSITION_UNSET; + scratch = new ParsableByteArray(10); + scratchBits = new ParsableBitArray(scratch.data); } // Extractor implementation. @@ -65,41 +118,26 @@ public final class AdtsExtractor implements Extractor { @Override public boolean sniff(ExtractorInput input) throws IOException, InterruptedException { // Skip any ID3 headers. - ParsableByteArray scratch = new ParsableByteArray(10); - ParsableBitArray scratchBits = new ParsableBitArray(scratch.data); - int startPosition = 0; - while (true) { - input.peekFully(scratch.data, 0, 10); - scratch.setPosition(0); - if (scratch.readUnsignedInt24() != ID3_TAG) { - break; - } - scratch.skipBytes(3); - int length = scratch.readSynchSafeInt(); - startPosition += 10 + length; - input.advancePeekPosition(length); - } - input.resetPeekPosition(); - input.advancePeekPosition(startPosition); + int startPosition = peekId3Header(input); // Try to find four or more consecutive AAC audio frames, exceeding the MPEG TS packet size. int headerPosition = startPosition; - int validFramesSize = 0; + int totalValidFramesSize = 0; int validFramesCount = 0; while (true) { input.peekFully(scratch.data, 0, 2); scratch.setPosition(0); int syncBytes = scratch.readUnsignedShort(); - if ((syncBytes & 0xFFF6) != 0xFFF0) { + if (!AdtsReader.isAdtsSyncWord(syncBytes)) { validFramesCount = 0; - validFramesSize = 0; + totalValidFramesSize = 0; input.resetPeekPosition(); if (++headerPosition - startPosition >= MAX_SNIFF_BYTES) { return false; } input.advancePeekPosition(headerPosition); } else { - if (++validFramesCount >= 4 && validFramesSize > 188) { + if (++validFramesCount >= 4 && totalValidFramesSize > TsExtractor.TS_PACKET_SIZE) { return true; } @@ -112,22 +150,23 @@ public final class AdtsExtractor implements Extractor { return false; } input.advancePeekPosition(frameSize - 6); - validFramesSize += frameSize; + totalValidFramesSize += frameSize; } } } @Override public void init(ExtractorOutput output) { + this.extractorOutput = output; reader.createTracks(output, new TrackIdGenerator(0, 1)); output.endTracks(); - output.seekMap(new SeekMap.Unseekable(C.TIME_UNSET)); } @Override public void seek(long position, long timeUs) { startedPacket = false; reader.seek(); + firstSampleTimestampUs = firstStreamSampleTimestampUs + timeUs; } @Override @@ -138,8 +177,17 @@ public final class AdtsExtractor implements Extractor { @Override public int read(ExtractorInput input, PositionHolder seekPosition) throws IOException, InterruptedException { + long inputLength = input.getLength(); + boolean canUseConstantBitrateSeeking = + (flags & FLAG_ENABLE_CONSTANT_BITRATE_SEEKING) != 0 && inputLength != C.LENGTH_UNSET; + if (canUseConstantBitrateSeeking) { + calculateAverageFrameSize(input); + } + int bytesRead = input.read(packetBuffer.data, 0, MAX_PACKET_SIZE); - if (bytesRead == C.RESULT_END_OF_INPUT) { + boolean readEndOfStream = bytesRead == RESULT_END_OF_INPUT; + maybeOutputSeekMap(inputLength, canUseConstantBitrateSeeking, readEndOfStream); + if (readEndOfStream) { return RESULT_END_OF_INPUT; } @@ -158,4 +206,117 @@ public final class AdtsExtractor implements Extractor { return RESULT_CONTINUE; } + private int peekId3Header(ExtractorInput input) throws IOException, InterruptedException { + int firstFramePosition = 0; + while (true) { + input.peekFully(scratch.data, 0, 10); + scratch.setPosition(0); + if (scratch.readUnsignedInt24() != ID3_TAG) { + break; + } + scratch.skipBytes(3); + int length = scratch.readSynchSafeInt(); + firstFramePosition += 10 + length; + input.advancePeekPosition(length); + } + input.resetPeekPosition(); + input.advancePeekPosition(firstFramePosition); + if (this.firstFramePosition == C.POSITION_UNSET) { + this.firstFramePosition = firstFramePosition; + } + return firstFramePosition; + } + + private void maybeOutputSeekMap( + long inputLength, boolean canUseConstantBitrateSeeking, boolean readEndOfStream) { + if (hasOutputSeekMap) { + return; + } + boolean useConstantBitrateSeeking = canUseConstantBitrateSeeking && averageFrameSize > 0; + if (useConstantBitrateSeeking + && reader.getSampleDurationUs() == C.TIME_UNSET + && !readEndOfStream) { + // Wait for the sampleDurationUs to be available, or for the end of the stream to be reached, + // before creating seek map. + return; + } + + ExtractorOutput extractorOutput = Assertions.checkNotNull(this.extractorOutput); + if (useConstantBitrateSeeking && reader.getSampleDurationUs() != C.TIME_UNSET) { + extractorOutput.seekMap(getConstantBitrateSeekMap(inputLength)); + } else { + extractorOutput.seekMap(new SeekMap.Unseekable(C.TIME_UNSET)); + } + hasOutputSeekMap = true; + } + + private void calculateAverageFrameSize(ExtractorInput input) + throws IOException, InterruptedException { + if (hasCalculatedAverageFrameSize) { + return; + } + averageFrameSize = C.LENGTH_UNSET; + input.resetPeekPosition(); + if (input.getPosition() == 0) { + // Skip any ID3 headers. + peekId3Header(input); + } + + int numValidFrames = 0; + long totalValidFramesSize = 0; + while (input.peekFully( + scratch.data, /* offset= */ 0, /* length= */ 2, /* allowEndOfInput= */ true)) { + scratch.setPosition(0); + int syncBytes = scratch.readUnsignedShort(); + if (!AdtsReader.isAdtsSyncWord(syncBytes)) { + // Invalid sync byte pattern. + // Constant bit-rate seeking will probably fail for this stream. + numValidFrames = 0; + break; + } else { + // Read the frame size. + if (!input.peekFully( + scratch.data, /* offset= */ 0, /* length= */ 4, /* allowEndOfInput= */ true)) { + break; + } + scratchBits.setPosition(14); + int currentFrameSize = scratchBits.readBits(13); + // Either the stream is malformed OR we're not parsing an ADTS stream. + if (currentFrameSize <= 6) { + hasCalculatedAverageFrameSize = true; + throw new ParserException("Malformed ADTS stream"); + } + totalValidFramesSize += currentFrameSize; + if (++numValidFrames == NUM_FRAMES_FOR_AVERAGE_FRAME_SIZE) { + break; + } + if (!input.advancePeekPosition(currentFrameSize - 6, /* allowEndOfInput= */ true)) { + break; + } + } + } + input.resetPeekPosition(); + if (numValidFrames > 0) { + averageFrameSize = (int) (totalValidFramesSize / numValidFrames); + } else { + averageFrameSize = C.LENGTH_UNSET; + } + hasCalculatedAverageFrameSize = true; + } + + private SeekMap getConstantBitrateSeekMap(long inputLength) { + int bitrate = getBitrateFromFrameSize(averageFrameSize, reader.getSampleDurationUs()); + return new ConstantBitrateSeekMap(inputLength, firstFramePosition, bitrate, averageFrameSize); + } + + /** + * Returns the stream bitrate, given a frame size and the duration of that frame in microseconds. + * + * @param frameSize The size of each frame in the stream. + * @param durationUsPerFrame The duration of the given frame in microseconds. + * @return The stream bitrate. + */ + private static int getBitrateFromFrameSize(int frameSize, long durationUsPerFrame) { + return (int) ((frameSize * C.BITS_PER_BYTE * C.MICROS_PER_SECOND) / durationUsPerFrame); + } } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsReader.java b/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsReader.java index 96b964a4c4..7f6a22b58b 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsReader.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/extractor/ts/AdtsReader.java @@ -39,9 +39,10 @@ public final class AdtsReader implements ElementaryStreamReader { private static final String TAG = "AdtsReader"; private static final int STATE_FINDING_SAMPLE = 0; - private static final int STATE_READING_ID3_HEADER = 1; - private static final int STATE_READING_ADTS_HEADER = 2; - private static final int STATE_READING_SAMPLE = 3; + private static final int STATE_CHECKING_ADTS_HEADER = 1; + private static final int STATE_READING_ID3_HEADER = 2; + private static final int STATE_READING_ADTS_HEADER = 3; + private static final int STATE_READING_SAMPLE = 4; private static final int HEADER_SIZE = 5; private static final int CRC_SIZE = 2; @@ -56,6 +57,7 @@ public final class AdtsReader implements ElementaryStreamReader { private static final int ID3_HEADER_SIZE = 10; private static final int ID3_SIZE_OFFSET = 6; private static final byte[] ID3_IDENTIFIER = {'I', 'D', '3'}; + private static final int VERSION_UNSET = -1; private final boolean exposeId3; private final ParsableBitArray adtsScratch; @@ -72,6 +74,14 @@ public final class AdtsReader implements ElementaryStreamReader { private int matchState; private boolean hasCrc; + private boolean foundFirstFrame; + + // Used to verifies sync words + private int firstFrameVersion; + private int firstFrameSampleRateIndex; + + private int currentFrameVersion; + private int currentFrameSampleRateIndex; // Used when parsing the header. private boolean hasOutputFormat; @@ -99,13 +109,21 @@ public final class AdtsReader implements ElementaryStreamReader { adtsScratch = new ParsableBitArray(new byte[HEADER_SIZE + CRC_SIZE]); id3HeaderBuffer = new ParsableByteArray(Arrays.copyOf(ID3_IDENTIFIER, ID3_HEADER_SIZE)); setFindingSampleState(); + firstFrameVersion = VERSION_UNSET; + firstFrameSampleRateIndex = C.INDEX_UNSET; + sampleDurationUs = C.TIME_UNSET; this.exposeId3 = exposeId3; this.language = language; } + /** Returns whether an integer matches an ADTS SYNC word. */ + public static boolean isAdtsSyncWord(int candidateSyncWord) { + return (candidateSyncWord & 0xFFF6) == 0xFFF0; + } + @Override public void seek() { - setFindingSampleState(); + resetSync(); } @Override @@ -140,6 +158,9 @@ public final class AdtsReader implements ElementaryStreamReader { parseId3Header(); } break; + case STATE_CHECKING_ADTS_HEADER: + checkAdtsHeader(data); + break; case STATE_READING_ADTS_HEADER: int targetLength = hasCrc ? HEADER_SIZE + CRC_SIZE : HEADER_SIZE; if (continueRead(data, adtsScratch.data, targetLength)) { @@ -158,6 +179,19 @@ public final class AdtsReader implements ElementaryStreamReader { // Do nothing. } + /** + * Returns the duration in microseconds per sample, or {@link C#TIME_UNSET} if the sample duration + * is not available. + */ + public long getSampleDurationUs() { + return sampleDurationUs; + } + + private void resetSync() { + foundFirstFrame = false; + setFindingSampleState(); + } + /** * Continues a read from the provided {@code source} into a given {@code target}. It's assumed * that the data should be written into {@code target} starting from an offset of zero. @@ -219,6 +253,12 @@ public final class AdtsReader implements ElementaryStreamReader { bytesRead = 0; } + /** Sets the state to STATE_CHECKING_ADTS_HEADER. */ + private void setCheckingAdtsHeaderState() { + state = STATE_CHECKING_ADTS_HEADER; + bytesRead = 0; + } + /** * Locates the next sample start, advancing the position to the byte that immediately follows * identifier. If a sample was not located, the position is advanced to the limit. @@ -231,12 +271,21 @@ public final class AdtsReader implements ElementaryStreamReader { int endOffset = pesBuffer.limit(); while (position < endOffset) { int data = adtsData[position++] & 0xFF; - if (matchState == MATCH_STATE_FF && data >= 0xF0 && data != 0xFF) { - hasCrc = (data & 0x1) == 0; - setReadingAdtsHeaderState(); - pesBuffer.setPosition(position); - return; + if (matchState == MATCH_STATE_FF && isAdtsSyncBytes((byte) 0xFF, (byte) data)) { + if (foundFirstFrame + || checkSyncPositionValid(pesBuffer, /* syncPositionCandidate= */ position - 2)) { + currentFrameVersion = (data & 0x8) >> 3; + hasCrc = (data & 0x1) == 0; + if (!foundFirstFrame) { + setCheckingAdtsHeaderState(); + } else { + setReadingAdtsHeaderState(); + } + pesBuffer.setPosition(position); + return; + } } + switch (matchState | data) { case MATCH_STATE_START | 0xFF: matchState = MATCH_STATE_FF; @@ -264,6 +313,117 @@ public final class AdtsReader implements ElementaryStreamReader { pesBuffer.setPosition(position); } + /** + * Peeks the Adts header of the current frame and checks if it is valid. If the header is valid, + * transition to {@link #STATE_READING_ADTS_HEADER}; else, transition to {@link + * #STATE_FINDING_SAMPLE}. + */ + private void checkAdtsHeader(ParsableByteArray buffer) { + if (buffer.bytesLeft() == 0) { + // Not enough data to check yet, defer this check. + return; + } + // Peek the next byte of buffer into scratch array. + adtsScratch.data[0] = buffer.data[buffer.getPosition()]; + + adtsScratch.setPosition(2); + currentFrameSampleRateIndex = adtsScratch.readBits(4); + if (firstFrameSampleRateIndex != C.INDEX_UNSET + && currentFrameSampleRateIndex != firstFrameSampleRateIndex) { + // Invalid header. + resetSync(); + return; + } + + if (!foundFirstFrame) { + foundFirstFrame = true; + firstFrameVersion = currentFrameVersion; + firstFrameSampleRateIndex = currentFrameSampleRateIndex; + } + setReadingAdtsHeaderState(); + } + + /** + * Returns whether the given syncPositionCandidate is a real SYNC word. + * + *

SYNC word pattern can occur within AAC data, so we perform a few checks to make sure this is + * really a SYNC word. This includes: + * + *

+ * + * If the buffer runs out of data for any check, optimistically skip that check, because + * AdtsReader consumes each buffer as a whole. We will still run a header validity check later. + */ + private boolean checkSyncPositionValid(ParsableByteArray pesBuffer, int syncPositionCandidate) { + // The SYNC word contains 2 bytes, and the first byte may be in the previously consumed buffer. + // Hence the second byte of the SYNC word may be byte 0 of this buffer, and + // syncPositionCandidate (which indicates position of the first byte of the SYNC word) may be + // -1. + // Since the first byte of the SYNC word is always FF, which does not contain any informational + // bits, we set the byte position to be the second byte in the SYNC word to ensure it's always + // within this buffer. + pesBuffer.setPosition(syncPositionCandidate + 1); + if (!tryRead(pesBuffer, adtsScratch.data, 1)) { + return false; + } + + adtsScratch.setPosition(4); + int currentFrameVersion = adtsScratch.readBits(1); + if (firstFrameVersion != VERSION_UNSET && currentFrameVersion != firstFrameVersion) { + return false; + } + + if (firstFrameSampleRateIndex != C.INDEX_UNSET) { + if (!tryRead(pesBuffer, adtsScratch.data, 1)) { + return true; + } + adtsScratch.setPosition(2); + int currentFrameSampleRateIndex = adtsScratch.readBits(4); + if (currentFrameSampleRateIndex != firstFrameSampleRateIndex) { + return false; + } + pesBuffer.setPosition(syncPositionCandidate + 2); + } + + // Optionally check the byte after this frame matches SYNC word. + + if (!tryRead(pesBuffer, adtsScratch.data, 4)) { + return true; + } + adtsScratch.setPosition(14); + int frameSize = adtsScratch.readBits(13); + if (frameSize <= 6) { + // Not a frame. + return false; + } + int nextSyncPosition = syncPositionCandidate + frameSize; + if (nextSyncPosition + 1 >= pesBuffer.limit()) { + return true; + } + return (isAdtsSyncBytes(pesBuffer.data[nextSyncPosition], pesBuffer.data[nextSyncPosition + 1]) + && (firstFrameVersion == VERSION_UNSET + || ((pesBuffer.data[nextSyncPosition + 1] & 0x8) >> 3) == currentFrameVersion)); + } + + private boolean isAdtsSyncBytes(byte firstByte, byte secondByte) { + int syncWord = (firstByte & 0xFF) << 8 | (secondByte & 0xFF); + return isAdtsSyncWord(syncWord); + } + + /** Reads {@code targetLength} bytes into target, and returns whether the read succeeded. */ + private boolean tryRead(ParsableByteArray source, byte[] target, int targetLength) { + if (source.bytesLeft() < targetLength) { + return false; + } + source.readBytes(target, /* offset= */ 0, targetLength); + return true; + } + /** * Parses the Id3 header. */ @@ -296,12 +456,12 @@ public final class AdtsReader implements ElementaryStreamReader { audioObjectType = 2; } - int sampleRateIndex = adtsScratch.readBits(4); - adtsScratch.skipBits(1); + adtsScratch.skipBits(5); int channelConfig = adtsScratch.readBits(3); - byte[] audioSpecificConfig = CodecSpecificDataUtil.buildAacAudioSpecificConfig( - audioObjectType, sampleRateIndex, channelConfig); + byte[] audioSpecificConfig = + CodecSpecificDataUtil.buildAacAudioSpecificConfig( + audioObjectType, firstFrameSampleRateIndex, channelConfig); Pair audioParams = CodecSpecificDataUtil.parseAacAudioSpecificConfig( audioSpecificConfig); diff --git a/library/core/src/test/assets/amr/sample_nb_cbr.amr b/library/core/src/test/assets/amr/sample_nb_cbr.amr new file mode 100644 index 0000000000..2e21cc843c Binary files /dev/null and b/library/core/src/test/assets/amr/sample_nb_cbr.amr differ diff --git a/library/core/src/test/assets/amr/sample_nb_cbr.amr.0.dump b/library/core/src/test/assets/amr/sample_nb_cbr.amr.0.dump new file mode 100644 index 0000000000..e8ba3c3588 --- /dev/null +++ b/library/core/src/test/assets/amr/sample_nb_cbr.amr.0.dump @@ -0,0 +1,902 @@ +seekMap: + isSeekable = true + duration = 4360000 + getPosition(0) = [[timeUs=0, position=6]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/3gpp + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 8000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 2834 + sample count = 218 + sample 0: + time = 0 + flags = 1 + data = length 13, hash 371B046C + sample 1: + time = 20000 + flags = 1 + data = length 13, hash CE30BF5B + sample 2: + time = 40000 + flags = 1 + data = length 13, hash 19A59975 + sample 3: + time = 60000 + flags = 1 + data = length 13, hash 4879773C + sample 4: + time = 80000 + flags = 1 + data = length 13, hash E8F83019 + sample 5: + time = 100000 + flags = 1 + data = length 13, hash D265CDC9 + sample 6: + time = 120000 + flags = 1 + data = length 13, hash 91653DAA + sample 7: + time = 140000 + flags = 1 + data = length 13, hash C79456F6 + sample 8: + time = 160000 + flags = 1 + data = length 13, hash CDDC4422 + sample 9: + time = 180000 + flags = 1 + data = length 13, hash D9ED3AF1 + sample 10: + time = 200000 + flags = 1 + data = length 13, hash BAB75A33 + sample 11: + time = 220000 + flags = 1 + data = length 13, hash 2221B4FF + sample 12: + time = 240000 + flags = 1 + data = length 13, hash 96400A0B + sample 13: + time = 260000 + flags = 1 + data = length 13, hash 582E6FB + sample 14: + time = 280000 + flags = 1 + data = length 13, hash C4E878E5 + sample 15: + time = 300000 + flags = 1 + data = length 13, hash C849A1BD + sample 16: + time = 320000 + flags = 1 + data = length 13, hash CFA8A9ED + sample 17: + time = 340000 + flags = 1 + data = length 13, hash 70CA4907 + sample 18: + time = 360000 + flags = 1 + data = length 13, hash B47D4454 + sample 19: + time = 380000 + flags = 1 + data = length 13, hash 282998C1 + sample 20: + time = 400000 + flags = 1 + data = length 13, hash 3F3F7A65 + sample 21: + time = 420000 + flags = 1 + data = length 13, hash CC2EAB58 + sample 22: + time = 440000 + flags = 1 + data = length 13, hash 279EF712 + sample 23: + time = 460000 + flags = 1 + data = length 13, hash AA2F4B29 + sample 24: + time = 480000 + flags = 1 + data = length 13, hash F6F658C4 + sample 25: + time = 500000 + flags = 1 + data = length 13, hash D7DEBD17 + sample 26: + time = 520000 + flags = 1 + data = length 13, hash 6DAB9A17 + sample 27: + time = 540000 + flags = 1 + data = length 13, hash 6ECE1571 + sample 28: + time = 560000 + flags = 1 + data = length 13, hash B3D0507F + sample 29: + time = 580000 + flags = 1 + data = length 13, hash 21E356B9 + sample 30: + time = 600000 + flags = 1 + data = length 13, hash 410EA12 + sample 31: + time = 620000 + flags = 1 + data = length 13, hash 533895A8 + sample 32: + time = 640000 + flags = 1 + data = length 13, hash C61B3E5A + sample 33: + time = 660000 + flags = 1 + data = length 13, hash 982170E6 + sample 34: + time = 680000 + flags = 1 + data = length 13, hash 7A0468C5 + sample 35: + time = 700000 + flags = 1 + data = length 13, hash 9C85EAA7 + sample 36: + time = 720000 + flags = 1 + data = length 13, hash B6B341B6 + sample 37: + time = 740000 + flags = 1 + data = length 13, hash 6937532E + sample 38: + time = 760000 + flags = 1 + data = length 13, hash 8CF2A3A0 + sample 39: + time = 780000 + flags = 1 + data = length 13, hash D2682AC6 + sample 40: + time = 800000 + flags = 1 + data = length 13, hash BBC5710F + sample 41: + time = 820000 + flags = 1 + data = length 13, hash 59080B6C + sample 42: + time = 840000 + flags = 1 + data = length 13, hash E4118291 + sample 43: + time = 860000 + flags = 1 + data = length 13, hash A1E5B296 + sample 44: + time = 880000 + flags = 1 + data = length 13, hash D7B8F95B + sample 45: + time = 900000 + flags = 1 + data = length 13, hash CC839BE1 + sample 46: + time = 920000 + flags = 1 + data = length 13, hash D459DFCE + sample 47: + time = 940000 + flags = 1 + data = length 13, hash D6AD19EC + sample 48: + time = 960000 + flags = 1 + data = length 13, hash D05E373D + sample 49: + time = 980000 + flags = 1 + data = length 13, hash 6A4460C7 + sample 50: + time = 1000000 + flags = 1 + data = length 13, hash C9A0D93F + sample 51: + time = 1020000 + flags = 1 + data = length 13, hash 3FA819E7 + sample 52: + time = 1040000 + flags = 1 + data = length 13, hash 1D3CBDFC + sample 53: + time = 1060000 + flags = 1 + data = length 13, hash 8BBBB403 + sample 54: + time = 1080000 + flags = 1 + data = length 13, hash 21B4A0F9 + sample 55: + time = 1100000 + flags = 1 + data = length 13, hash C0F921D1 + sample 56: + time = 1120000 + flags = 1 + data = length 13, hash 5D812AAB + sample 57: + time = 1140000 + flags = 1 + data = length 13, hash 50C9F3F8 + sample 58: + time = 1160000 + flags = 1 + data = length 13, hash 5C2BB5D1 + sample 59: + time = 1180000 + flags = 1 + data = length 13, hash 6BF9BEA5 + sample 60: + time = 1200000 + flags = 1 + data = length 13, hash 2738C1E6 + sample 61: + time = 1220000 + flags = 1 + data = length 13, hash 5FC288A6 + sample 62: + time = 1240000 + flags = 1 + data = length 13, hash 7E8E442A + sample 63: + time = 1260000 + flags = 1 + data = length 13, hash AEAA2BBA + sample 64: + time = 1280000 + flags = 1 + data = length 13, hash 4E2ACD2F + sample 65: + time = 1300000 + flags = 1 + data = length 13, hash D6C90ACF + sample 66: + time = 1320000 + flags = 1 + data = length 13, hash 6FD8A944 + sample 67: + time = 1340000 + flags = 1 + data = length 13, hash A835BBF9 + sample 68: + time = 1360000 + flags = 1 + data = length 13, hash F7713830 + sample 69: + time = 1380000 + flags = 1 + data = length 13, hash 3AA966E5 + sample 70: + time = 1400000 + flags = 1 + data = length 13, hash F939E829 + sample 71: + time = 1420000 + flags = 1 + data = length 13, hash 7676DE49 + sample 72: + time = 1440000 + flags = 1 + data = length 13, hash 93BB890A + sample 73: + time = 1460000 + flags = 1 + data = length 13, hash B57DBEC8 + sample 74: + time = 1480000 + flags = 1 + data = length 13, hash 66B0A5B6 + sample 75: + time = 1500000 + flags = 1 + data = length 13, hash D733E0D + sample 76: + time = 1520000 + flags = 1 + data = length 13, hash 80941726 + sample 77: + time = 1540000 + flags = 1 + data = length 13, hash 556ED633 + sample 78: + time = 1560000 + flags = 1 + data = length 13, hash C5EDF4E1 + sample 79: + time = 1580000 + flags = 1 + data = length 13, hash 6B287445 + sample 80: + time = 1600000 + flags = 1 + data = length 13, hash DC97C4A7 + sample 81: + time = 1620000 + flags = 1 + data = length 13, hash DA8CBDF4 + sample 82: + time = 1640000 + flags = 1 + data = length 13, hash 6F60FF77 + sample 83: + time = 1660000 + flags = 1 + data = length 13, hash 3EB22B96 + sample 84: + time = 1680000 + flags = 1 + data = length 13, hash B3C31AF5 + sample 85: + time = 1700000 + flags = 1 + data = length 13, hash 1854AA92 + sample 86: + time = 1720000 + flags = 1 + data = length 13, hash 6488264B + sample 87: + time = 1740000 + flags = 1 + data = length 13, hash 4CC8C5C1 + sample 88: + time = 1760000 + flags = 1 + data = length 13, hash 19CC7523 + sample 89: + time = 1780000 + flags = 1 + data = length 13, hash 9BE7B928 + sample 90: + time = 1800000 + flags = 1 + data = length 13, hash 47EC7CFD + sample 91: + time = 1820000 + flags = 1 + data = length 13, hash EC940120 + sample 92: + time = 1840000 + flags = 1 + data = length 13, hash 73BDA6D0 + sample 93: + time = 1860000 + flags = 1 + data = length 13, hash FACB3314 + sample 94: + time = 1880000 + flags = 1 + data = length 13, hash EC61D13B + sample 95: + time = 1900000 + flags = 1 + data = length 13, hash B28C7B6C + sample 96: + time = 1920000 + flags = 1 + data = length 13, hash B1A4CECD + sample 97: + time = 1940000 + flags = 1 + data = length 13, hash 56D41BA6 + sample 98: + time = 1960000 + flags = 1 + data = length 13, hash 90499F4 + sample 99: + time = 1980000 + flags = 1 + data = length 13, hash 65D9A9D3 + sample 100: + time = 2000000 + flags = 1 + data = length 13, hash D9004CC + sample 101: + time = 2020000 + flags = 1 + data = length 13, hash 4139C6ED + sample 102: + time = 2040000 + flags = 1 + data = length 13, hash C4F8097C + sample 103: + time = 2060000 + flags = 1 + data = length 13, hash 94D424FA + sample 104: + time = 2080000 + flags = 1 + data = length 13, hash C2C6F5FD + sample 105: + time = 2100000 + flags = 1 + data = length 13, hash 15719008 + sample 106: + time = 2120000 + flags = 1 + data = length 13, hash 4F64F524 + sample 107: + time = 2140000 + flags = 1 + data = length 13, hash F9E01C1E + sample 108: + time = 2160000 + flags = 1 + data = length 13, hash 74C4EE74 + sample 109: + time = 2180000 + flags = 1 + data = length 13, hash 7EE7553D + sample 110: + time = 2200000 + flags = 1 + data = length 13, hash 62DE6539 + sample 111: + time = 2220000 + flags = 1 + data = length 13, hash 7F5EC222 + sample 112: + time = 2240000 + flags = 1 + data = length 13, hash 644067F + sample 113: + time = 2260000 + flags = 1 + data = length 13, hash CDF6C9DC + sample 114: + time = 2280000 + flags = 1 + data = length 13, hash 8B5DBC80 + sample 115: + time = 2300000 + flags = 1 + data = length 13, hash AD4BBA03 + sample 116: + time = 2320000 + flags = 1 + data = length 13, hash 7A76340 + sample 117: + time = 2340000 + flags = 1 + data = length 13, hash 3610F5B0 + sample 118: + time = 2360000 + flags = 1 + data = length 13, hash 430BC60B + sample 119: + time = 2380000 + flags = 1 + data = length 13, hash 99CF1CA6 + sample 120: + time = 2400000 + flags = 1 + data = length 13, hash 1331C70B + sample 121: + time = 2420000 + flags = 1 + data = length 13, hash BD76E69D + sample 122: + time = 2440000 + flags = 1 + data = length 13, hash 5DA652AC + sample 123: + time = 2460000 + flags = 1 + data = length 13, hash 3B7BF6CE + sample 124: + time = 2480000 + flags = 1 + data = length 13, hash ABBFD143 + sample 125: + time = 2500000 + flags = 1 + data = length 13, hash E9447166 + sample 126: + time = 2520000 + flags = 1 + data = length 13, hash EC40068C + sample 127: + time = 2540000 + flags = 1 + data = length 13, hash A2869400 + sample 128: + time = 2560000 + flags = 1 + data = length 13, hash C7E0746B + sample 129: + time = 2580000 + flags = 1 + data = length 13, hash 60601BB1 + sample 130: + time = 2600000 + flags = 1 + data = length 13, hash 975AAE9B + sample 131: + time = 2620000 + flags = 1 + data = length 13, hash 8BBC0EB2 + sample 132: + time = 2640000 + flags = 1 + data = length 13, hash 57FB39E5 + sample 133: + time = 2660000 + flags = 1 + data = length 13, hash 4CDCEEDB + sample 134: + time = 2680000 + flags = 1 + data = length 13, hash EA16E256 + sample 135: + time = 2700000 + flags = 1 + data = length 13, hash 287E7D9E + sample 136: + time = 2720000 + flags = 1 + data = length 13, hash 55AB8FB9 + sample 137: + time = 2740000 + flags = 1 + data = length 13, hash 129890EF + sample 138: + time = 2760000 + flags = 1 + data = length 13, hash 90834F57 + sample 139: + time = 2780000 + flags = 1 + data = length 13, hash 5B3228E0 + sample 140: + time = 2800000 + flags = 1 + data = length 13, hash DD19E175 + sample 141: + time = 2820000 + flags = 1 + data = length 13, hash EE7EA342 + sample 142: + time = 2840000 + flags = 1 + data = length 13, hash DB3AF473 + sample 143: + time = 2860000 + flags = 1 + data = length 13, hash 25AEC43F + sample 144: + time = 2880000 + flags = 1 + data = length 13, hash EE9BF97F + sample 145: + time = 2900000 + flags = 1 + data = length 13, hash FFFBE047 + sample 146: + time = 2920000 + flags = 1 + data = length 13, hash BEACFCB0 + sample 147: + time = 2940000 + flags = 1 + data = length 13, hash AEB5096C + sample 148: + time = 2960000 + flags = 1 + data = length 13, hash B0D381B + sample 149: + time = 2980000 + flags = 1 + data = length 13, hash 3D9D5122 + sample 150: + time = 3000000 + flags = 1 + data = length 13, hash 6C1DDB95 + sample 151: + time = 3020000 + flags = 1 + data = length 13, hash ADACADCF + sample 152: + time = 3040000 + flags = 1 + data = length 13, hash 159E321E + sample 153: + time = 3060000 + flags = 1 + data = length 13, hash B1466264 + sample 154: + time = 3080000 + flags = 1 + data = length 13, hash 4DDF7223 + sample 155: + time = 3100000 + flags = 1 + data = length 13, hash C9BDB82A + sample 156: + time = 3120000 + flags = 1 + data = length 13, hash A49B2D9D + sample 157: + time = 3140000 + flags = 1 + data = length 13, hash D645E7E5 + sample 158: + time = 3160000 + flags = 1 + data = length 13, hash 1C4232DC + sample 159: + time = 3180000 + flags = 1 + data = length 13, hash 83078219 + sample 160: + time = 3200000 + flags = 1 + data = length 13, hash D6D8B072 + sample 161: + time = 3220000 + flags = 1 + data = length 13, hash 975DB40 + sample 162: + time = 3240000 + flags = 1 + data = length 13, hash A15FDD05 + sample 163: + time = 3260000 + flags = 1 + data = length 13, hash 4B839E41 + sample 164: + time = 3280000 + flags = 1 + data = length 13, hash 7418F499 + sample 165: + time = 3300000 + flags = 1 + data = length 13, hash 7A4945E4 + sample 166: + time = 3320000 + flags = 1 + data = length 13, hash 6249558C + sample 167: + time = 3340000 + flags = 1 + data = length 13, hash BD4C5BE3 + sample 168: + time = 3360000 + flags = 1 + data = length 13, hash BAB30F1D + sample 169: + time = 3380000 + flags = 1 + data = length 13, hash 1E1C7012 + sample 170: + time = 3400000 + flags = 1 + data = length 13, hash 9A3F8A89 + sample 171: + time = 3420000 + flags = 1 + data = length 13, hash 20BE6D7B + sample 172: + time = 3440000 + flags = 1 + data = length 13, hash CAA0591D + sample 173: + time = 3460000 + flags = 1 + data = length 13, hash 6D554D17 + sample 174: + time = 3480000 + flags = 1 + data = length 13, hash D97C3B31 + sample 175: + time = 3500000 + flags = 1 + data = length 13, hash 75BC5C3 + sample 176: + time = 3520000 + flags = 1 + data = length 13, hash 7BA1784B + sample 177: + time = 3540000 + flags = 1 + data = length 13, hash 1D175D92 + sample 178: + time = 3560000 + flags = 1 + data = length 13, hash ADCA60FD + sample 179: + time = 3580000 + flags = 1 + data = length 13, hash 37018693 + sample 180: + time = 3600000 + flags = 1 + data = length 13, hash 4553606F + sample 181: + time = 3620000 + flags = 1 + data = length 13, hash CF434565 + sample 182: + time = 3640000 + flags = 1 + data = length 13, hash D264D757 + sample 183: + time = 3660000 + flags = 1 + data = length 13, hash 4FB493EF + sample 184: + time = 3680000 + flags = 1 + data = length 13, hash 919F53A + sample 185: + time = 3700000 + flags = 1 + data = length 13, hash C22B009B + sample 186: + time = 3720000 + flags = 1 + data = length 13, hash 5981470 + sample 187: + time = 3740000 + flags = 1 + data = length 13, hash A5D3937C + sample 188: + time = 3760000 + flags = 1 + data = length 13, hash A2504429 + sample 189: + time = 3780000 + flags = 1 + data = length 13, hash AD1B70BE + sample 190: + time = 3800000 + flags = 1 + data = length 13, hash 2E39ED5E + sample 191: + time = 3820000 + flags = 1 + data = length 13, hash 13A8BE8E + sample 192: + time = 3840000 + flags = 1 + data = length 13, hash 1ACD740B + sample 193: + time = 3860000 + flags = 1 + data = length 13, hash 80F38B3 + sample 194: + time = 3880000 + flags = 1 + data = length 13, hash DA9DA79F + sample 195: + time = 3900000 + flags = 1 + data = length 13, hash 21B95B7E + sample 196: + time = 3920000 + flags = 1 + data = length 13, hash CD22497B + sample 197: + time = 3940000 + flags = 1 + data = length 13, hash 718BB35D + sample 198: + time = 3960000 + flags = 1 + data = length 13, hash 69ABA6AD + sample 199: + time = 3980000 + flags = 1 + data = length 13, hash BAE19549 + sample 200: + time = 4000000 + flags = 1 + data = length 13, hash 2A792FB3 + sample 201: + time = 4020000 + flags = 1 + data = length 13, hash 71FCD8 + sample 202: + time = 4040000 + flags = 1 + data = length 13, hash 44D2B5B3 + sample 203: + time = 4060000 + flags = 1 + data = length 13, hash 1E87B11B + sample 204: + time = 4080000 + flags = 1 + data = length 13, hash 78CD2C11 + sample 205: + time = 4100000 + flags = 1 + data = length 13, hash 9F198DF0 + sample 206: + time = 4120000 + flags = 1 + data = length 13, hash B291F16A + sample 207: + time = 4140000 + flags = 1 + data = length 13, hash CF820EE0 + sample 208: + time = 4160000 + flags = 1 + data = length 13, hash 4E24F683 + sample 209: + time = 4180000 + flags = 1 + data = length 13, hash 52BCD68F + sample 210: + time = 4200000 + flags = 1 + data = length 13, hash 42588CB0 + sample 211: + time = 4220000 + flags = 1 + data = length 13, hash EBBFECA2 + sample 212: + time = 4240000 + flags = 1 + data = length 13, hash C11050CF + sample 213: + time = 4260000 + flags = 1 + data = length 13, hash 6F738603 + sample 214: + time = 4280000 + flags = 1 + data = length 13, hash DAD06E5 + sample 215: + time = 4300000 + flags = 1 + data = length 13, hash 5B036C64 + sample 216: + time = 4320000 + flags = 1 + data = length 13, hash A58DC12E + sample 217: + time = 4340000 + flags = 1 + data = length 13, hash AC59BA7C +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_nb_cbr.amr.1.dump b/library/core/src/test/assets/amr/sample_nb_cbr.amr.1.dump new file mode 100644 index 0000000000..d00ae65c7e --- /dev/null +++ b/library/core/src/test/assets/amr/sample_nb_cbr.amr.1.dump @@ -0,0 +1,614 @@ +seekMap: + isSeekable = true + duration = 4360000 + getPosition(0) = [[timeUs=0, position=6]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/3gpp + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 8000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 1898 + sample count = 146 + sample 0: + time = 1440000 + flags = 1 + data = length 13, hash 93BB890A + sample 1: + time = 1460000 + flags = 1 + data = length 13, hash B57DBEC8 + sample 2: + time = 1480000 + flags = 1 + data = length 13, hash 66B0A5B6 + sample 3: + time = 1500000 + flags = 1 + data = length 13, hash D733E0D + sample 4: + time = 1520000 + flags = 1 + data = length 13, hash 80941726 + sample 5: + time = 1540000 + flags = 1 + data = length 13, hash 556ED633 + sample 6: + time = 1560000 + flags = 1 + data = length 13, hash C5EDF4E1 + sample 7: + time = 1580000 + flags = 1 + data = length 13, hash 6B287445 + sample 8: + time = 1600000 + flags = 1 + data = length 13, hash DC97C4A7 + sample 9: + time = 1620000 + flags = 1 + data = length 13, hash DA8CBDF4 + sample 10: + time = 1640000 + flags = 1 + data = length 13, hash 6F60FF77 + sample 11: + time = 1660000 + flags = 1 + data = length 13, hash 3EB22B96 + sample 12: + time = 1680000 + flags = 1 + data = length 13, hash B3C31AF5 + sample 13: + time = 1700000 + flags = 1 + data = length 13, hash 1854AA92 + sample 14: + time = 1720000 + flags = 1 + data = length 13, hash 6488264B + sample 15: + time = 1740000 + flags = 1 + data = length 13, hash 4CC8C5C1 + sample 16: + time = 1760000 + flags = 1 + data = length 13, hash 19CC7523 + sample 17: + time = 1780000 + flags = 1 + data = length 13, hash 9BE7B928 + sample 18: + time = 1800000 + flags = 1 + data = length 13, hash 47EC7CFD + sample 19: + time = 1820000 + flags = 1 + data = length 13, hash EC940120 + sample 20: + time = 1840000 + flags = 1 + data = length 13, hash 73BDA6D0 + sample 21: + time = 1860000 + flags = 1 + data = length 13, hash FACB3314 + sample 22: + time = 1880000 + flags = 1 + data = length 13, hash EC61D13B + sample 23: + time = 1900000 + flags = 1 + data = length 13, hash B28C7B6C + sample 24: + time = 1920000 + flags = 1 + data = length 13, hash B1A4CECD + sample 25: + time = 1940000 + flags = 1 + data = length 13, hash 56D41BA6 + sample 26: + time = 1960000 + flags = 1 + data = length 13, hash 90499F4 + sample 27: + time = 1980000 + flags = 1 + data = length 13, hash 65D9A9D3 + sample 28: + time = 2000000 + flags = 1 + data = length 13, hash D9004CC + sample 29: + time = 2020000 + flags = 1 + data = length 13, hash 4139C6ED + sample 30: + time = 2040000 + flags = 1 + data = length 13, hash C4F8097C + sample 31: + time = 2060000 + flags = 1 + data = length 13, hash 94D424FA + sample 32: + time = 2080000 + flags = 1 + data = length 13, hash C2C6F5FD + sample 33: + time = 2100000 + flags = 1 + data = length 13, hash 15719008 + sample 34: + time = 2120000 + flags = 1 + data = length 13, hash 4F64F524 + sample 35: + time = 2140000 + flags = 1 + data = length 13, hash F9E01C1E + sample 36: + time = 2160000 + flags = 1 + data = length 13, hash 74C4EE74 + sample 37: + time = 2180000 + flags = 1 + data = length 13, hash 7EE7553D + sample 38: + time = 2200000 + flags = 1 + data = length 13, hash 62DE6539 + sample 39: + time = 2220000 + flags = 1 + data = length 13, hash 7F5EC222 + sample 40: + time = 2240000 + flags = 1 + data = length 13, hash 644067F + sample 41: + time = 2260000 + flags = 1 + data = length 13, hash CDF6C9DC + sample 42: + time = 2280000 + flags = 1 + data = length 13, hash 8B5DBC80 + sample 43: + time = 2300000 + flags = 1 + data = length 13, hash AD4BBA03 + sample 44: + time = 2320000 + flags = 1 + data = length 13, hash 7A76340 + sample 45: + time = 2340000 + flags = 1 + data = length 13, hash 3610F5B0 + sample 46: + time = 2360000 + flags = 1 + data = length 13, hash 430BC60B + sample 47: + time = 2380000 + flags = 1 + data = length 13, hash 99CF1CA6 + sample 48: + time = 2400000 + flags = 1 + data = length 13, hash 1331C70B + sample 49: + time = 2420000 + flags = 1 + data = length 13, hash BD76E69D + sample 50: + time = 2440000 + flags = 1 + data = length 13, hash 5DA652AC + sample 51: + time = 2460000 + flags = 1 + data = length 13, hash 3B7BF6CE + sample 52: + time = 2480000 + flags = 1 + data = length 13, hash ABBFD143 + sample 53: + time = 2500000 + flags = 1 + data = length 13, hash E9447166 + sample 54: + time = 2520000 + flags = 1 + data = length 13, hash EC40068C + sample 55: + time = 2540000 + flags = 1 + data = length 13, hash A2869400 + sample 56: + time = 2560000 + flags = 1 + data = length 13, hash C7E0746B + sample 57: + time = 2580000 + flags = 1 + data = length 13, hash 60601BB1 + sample 58: + time = 2600000 + flags = 1 + data = length 13, hash 975AAE9B + sample 59: + time = 2620000 + flags = 1 + data = length 13, hash 8BBC0EB2 + sample 60: + time = 2640000 + flags = 1 + data = length 13, hash 57FB39E5 + sample 61: + time = 2660000 + flags = 1 + data = length 13, hash 4CDCEEDB + sample 62: + time = 2680000 + flags = 1 + data = length 13, hash EA16E256 + sample 63: + time = 2700000 + flags = 1 + data = length 13, hash 287E7D9E + sample 64: + time = 2720000 + flags = 1 + data = length 13, hash 55AB8FB9 + sample 65: + time = 2740000 + flags = 1 + data = length 13, hash 129890EF + sample 66: + time = 2760000 + flags = 1 + data = length 13, hash 90834F57 + sample 67: + time = 2780000 + flags = 1 + data = length 13, hash 5B3228E0 + sample 68: + time = 2800000 + flags = 1 + data = length 13, hash DD19E175 + sample 69: + time = 2820000 + flags = 1 + data = length 13, hash EE7EA342 + sample 70: + time = 2840000 + flags = 1 + data = length 13, hash DB3AF473 + sample 71: + time = 2860000 + flags = 1 + data = length 13, hash 25AEC43F + sample 72: + time = 2880000 + flags = 1 + data = length 13, hash EE9BF97F + sample 73: + time = 2900000 + flags = 1 + data = length 13, hash FFFBE047 + sample 74: + time = 2920000 + flags = 1 + data = length 13, hash BEACFCB0 + sample 75: + time = 2940000 + flags = 1 + data = length 13, hash AEB5096C + sample 76: + time = 2960000 + flags = 1 + data = length 13, hash B0D381B + sample 77: + time = 2980000 + flags = 1 + data = length 13, hash 3D9D5122 + sample 78: + time = 3000000 + flags = 1 + data = length 13, hash 6C1DDB95 + sample 79: + time = 3020000 + flags = 1 + data = length 13, hash ADACADCF + sample 80: + time = 3040000 + flags = 1 + data = length 13, hash 159E321E + sample 81: + time = 3060000 + flags = 1 + data = length 13, hash B1466264 + sample 82: + time = 3080000 + flags = 1 + data = length 13, hash 4DDF7223 + sample 83: + time = 3100000 + flags = 1 + data = length 13, hash C9BDB82A + sample 84: + time = 3120000 + flags = 1 + data = length 13, hash A49B2D9D + sample 85: + time = 3140000 + flags = 1 + data = length 13, hash D645E7E5 + sample 86: + time = 3160000 + flags = 1 + data = length 13, hash 1C4232DC + sample 87: + time = 3180000 + flags = 1 + data = length 13, hash 83078219 + sample 88: + time = 3200000 + flags = 1 + data = length 13, hash D6D8B072 + sample 89: + time = 3220000 + flags = 1 + data = length 13, hash 975DB40 + sample 90: + time = 3240000 + flags = 1 + data = length 13, hash A15FDD05 + sample 91: + time = 3260000 + flags = 1 + data = length 13, hash 4B839E41 + sample 92: + time = 3280000 + flags = 1 + data = length 13, hash 7418F499 + sample 93: + time = 3300000 + flags = 1 + data = length 13, hash 7A4945E4 + sample 94: + time = 3320000 + flags = 1 + data = length 13, hash 6249558C + sample 95: + time = 3340000 + flags = 1 + data = length 13, hash BD4C5BE3 + sample 96: + time = 3360000 + flags = 1 + data = length 13, hash BAB30F1D + sample 97: + time = 3380000 + flags = 1 + data = length 13, hash 1E1C7012 + sample 98: + time = 3400000 + flags = 1 + data = length 13, hash 9A3F8A89 + sample 99: + time = 3420000 + flags = 1 + data = length 13, hash 20BE6D7B + sample 100: + time = 3440000 + flags = 1 + data = length 13, hash CAA0591D + sample 101: + time = 3460000 + flags = 1 + data = length 13, hash 6D554D17 + sample 102: + time = 3480000 + flags = 1 + data = length 13, hash D97C3B31 + sample 103: + time = 3500000 + flags = 1 + data = length 13, hash 75BC5C3 + sample 104: + time = 3520000 + flags = 1 + data = length 13, hash 7BA1784B + sample 105: + time = 3540000 + flags = 1 + data = length 13, hash 1D175D92 + sample 106: + time = 3560000 + flags = 1 + data = length 13, hash ADCA60FD + sample 107: + time = 3580000 + flags = 1 + data = length 13, hash 37018693 + sample 108: + time = 3600000 + flags = 1 + data = length 13, hash 4553606F + sample 109: + time = 3620000 + flags = 1 + data = length 13, hash CF434565 + sample 110: + time = 3640000 + flags = 1 + data = length 13, hash D264D757 + sample 111: + time = 3660000 + flags = 1 + data = length 13, hash 4FB493EF + sample 112: + time = 3680000 + flags = 1 + data = length 13, hash 919F53A + sample 113: + time = 3700000 + flags = 1 + data = length 13, hash C22B009B + sample 114: + time = 3720000 + flags = 1 + data = length 13, hash 5981470 + sample 115: + time = 3740000 + flags = 1 + data = length 13, hash A5D3937C + sample 116: + time = 3760000 + flags = 1 + data = length 13, hash A2504429 + sample 117: + time = 3780000 + flags = 1 + data = length 13, hash AD1B70BE + sample 118: + time = 3800000 + flags = 1 + data = length 13, hash 2E39ED5E + sample 119: + time = 3820000 + flags = 1 + data = length 13, hash 13A8BE8E + sample 120: + time = 3840000 + flags = 1 + data = length 13, hash 1ACD740B + sample 121: + time = 3860000 + flags = 1 + data = length 13, hash 80F38B3 + sample 122: + time = 3880000 + flags = 1 + data = length 13, hash DA9DA79F + sample 123: + time = 3900000 + flags = 1 + data = length 13, hash 21B95B7E + sample 124: + time = 3920000 + flags = 1 + data = length 13, hash CD22497B + sample 125: + time = 3940000 + flags = 1 + data = length 13, hash 718BB35D + sample 126: + time = 3960000 + flags = 1 + data = length 13, hash 69ABA6AD + sample 127: + time = 3980000 + flags = 1 + data = length 13, hash BAE19549 + sample 128: + time = 4000000 + flags = 1 + data = length 13, hash 2A792FB3 + sample 129: + time = 4020000 + flags = 1 + data = length 13, hash 71FCD8 + sample 130: + time = 4040000 + flags = 1 + data = length 13, hash 44D2B5B3 + sample 131: + time = 4060000 + flags = 1 + data = length 13, hash 1E87B11B + sample 132: + time = 4080000 + flags = 1 + data = length 13, hash 78CD2C11 + sample 133: + time = 4100000 + flags = 1 + data = length 13, hash 9F198DF0 + sample 134: + time = 4120000 + flags = 1 + data = length 13, hash B291F16A + sample 135: + time = 4140000 + flags = 1 + data = length 13, hash CF820EE0 + sample 136: + time = 4160000 + flags = 1 + data = length 13, hash 4E24F683 + sample 137: + time = 4180000 + flags = 1 + data = length 13, hash 52BCD68F + sample 138: + time = 4200000 + flags = 1 + data = length 13, hash 42588CB0 + sample 139: + time = 4220000 + flags = 1 + data = length 13, hash EBBFECA2 + sample 140: + time = 4240000 + flags = 1 + data = length 13, hash C11050CF + sample 141: + time = 4260000 + flags = 1 + data = length 13, hash 6F738603 + sample 142: + time = 4280000 + flags = 1 + data = length 13, hash DAD06E5 + sample 143: + time = 4300000 + flags = 1 + data = length 13, hash 5B036C64 + sample 144: + time = 4320000 + flags = 1 + data = length 13, hash A58DC12E + sample 145: + time = 4340000 + flags = 1 + data = length 13, hash AC59BA7C +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_nb_cbr.amr.2.dump b/library/core/src/test/assets/amr/sample_nb_cbr.amr.2.dump new file mode 100644 index 0000000000..f68b6df3a3 --- /dev/null +++ b/library/core/src/test/assets/amr/sample_nb_cbr.amr.2.dump @@ -0,0 +1,322 @@ +seekMap: + isSeekable = true + duration = 4360000 + getPosition(0) = [[timeUs=0, position=6]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/3gpp + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 8000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 949 + sample count = 73 + sample 0: + time = 2900000 + flags = 1 + data = length 13, hash FFFBE047 + sample 1: + time = 2920000 + flags = 1 + data = length 13, hash BEACFCB0 + sample 2: + time = 2940000 + flags = 1 + data = length 13, hash AEB5096C + sample 3: + time = 2960000 + flags = 1 + data = length 13, hash B0D381B + sample 4: + time = 2980000 + flags = 1 + data = length 13, hash 3D9D5122 + sample 5: + time = 3000000 + flags = 1 + data = length 13, hash 6C1DDB95 + sample 6: + time = 3020000 + flags = 1 + data = length 13, hash ADACADCF + sample 7: + time = 3040000 + flags = 1 + data = length 13, hash 159E321E + sample 8: + time = 3060000 + flags = 1 + data = length 13, hash B1466264 + sample 9: + time = 3080000 + flags = 1 + data = length 13, hash 4DDF7223 + sample 10: + time = 3100000 + flags = 1 + data = length 13, hash C9BDB82A + sample 11: + time = 3120000 + flags = 1 + data = length 13, hash A49B2D9D + sample 12: + time = 3140000 + flags = 1 + data = length 13, hash D645E7E5 + sample 13: + time = 3160000 + flags = 1 + data = length 13, hash 1C4232DC + sample 14: + time = 3180000 + flags = 1 + data = length 13, hash 83078219 + sample 15: + time = 3200000 + flags = 1 + data = length 13, hash D6D8B072 + sample 16: + time = 3220000 + flags = 1 + data = length 13, hash 975DB40 + sample 17: + time = 3240000 + flags = 1 + data = length 13, hash A15FDD05 + sample 18: + time = 3260000 + flags = 1 + data = length 13, hash 4B839E41 + sample 19: + time = 3280000 + flags = 1 + data = length 13, hash 7418F499 + sample 20: + time = 3300000 + flags = 1 + data = length 13, hash 7A4945E4 + sample 21: + time = 3320000 + flags = 1 + data = length 13, hash 6249558C + sample 22: + time = 3340000 + flags = 1 + data = length 13, hash BD4C5BE3 + sample 23: + time = 3360000 + flags = 1 + data = length 13, hash BAB30F1D + sample 24: + time = 3380000 + flags = 1 + data = length 13, hash 1E1C7012 + sample 25: + time = 3400000 + flags = 1 + data = length 13, hash 9A3F8A89 + sample 26: + time = 3420000 + flags = 1 + data = length 13, hash 20BE6D7B + sample 27: + time = 3440000 + flags = 1 + data = length 13, hash CAA0591D + sample 28: + time = 3460000 + flags = 1 + data = length 13, hash 6D554D17 + sample 29: + time = 3480000 + flags = 1 + data = length 13, hash D97C3B31 + sample 30: + time = 3500000 + flags = 1 + data = length 13, hash 75BC5C3 + sample 31: + time = 3520000 + flags = 1 + data = length 13, hash 7BA1784B + sample 32: + time = 3540000 + flags = 1 + data = length 13, hash 1D175D92 + sample 33: + time = 3560000 + flags = 1 + data = length 13, hash ADCA60FD + sample 34: + time = 3580000 + flags = 1 + data = length 13, hash 37018693 + sample 35: + time = 3600000 + flags = 1 + data = length 13, hash 4553606F + sample 36: + time = 3620000 + flags = 1 + data = length 13, hash CF434565 + sample 37: + time = 3640000 + flags = 1 + data = length 13, hash D264D757 + sample 38: + time = 3660000 + flags = 1 + data = length 13, hash 4FB493EF + sample 39: + time = 3680000 + flags = 1 + data = length 13, hash 919F53A + sample 40: + time = 3700000 + flags = 1 + data = length 13, hash C22B009B + sample 41: + time = 3720000 + flags = 1 + data = length 13, hash 5981470 + sample 42: + time = 3740000 + flags = 1 + data = length 13, hash A5D3937C + sample 43: + time = 3760000 + flags = 1 + data = length 13, hash A2504429 + sample 44: + time = 3780000 + flags = 1 + data = length 13, hash AD1B70BE + sample 45: + time = 3800000 + flags = 1 + data = length 13, hash 2E39ED5E + sample 46: + time = 3820000 + flags = 1 + data = length 13, hash 13A8BE8E + sample 47: + time = 3840000 + flags = 1 + data = length 13, hash 1ACD740B + sample 48: + time = 3860000 + flags = 1 + data = length 13, hash 80F38B3 + sample 49: + time = 3880000 + flags = 1 + data = length 13, hash DA9DA79F + sample 50: + time = 3900000 + flags = 1 + data = length 13, hash 21B95B7E + sample 51: + time = 3920000 + flags = 1 + data = length 13, hash CD22497B + sample 52: + time = 3940000 + flags = 1 + data = length 13, hash 718BB35D + sample 53: + time = 3960000 + flags = 1 + data = length 13, hash 69ABA6AD + sample 54: + time = 3980000 + flags = 1 + data = length 13, hash BAE19549 + sample 55: + time = 4000000 + flags = 1 + data = length 13, hash 2A792FB3 + sample 56: + time = 4020000 + flags = 1 + data = length 13, hash 71FCD8 + sample 57: + time = 4040000 + flags = 1 + data = length 13, hash 44D2B5B3 + sample 58: + time = 4060000 + flags = 1 + data = length 13, hash 1E87B11B + sample 59: + time = 4080000 + flags = 1 + data = length 13, hash 78CD2C11 + sample 60: + time = 4100000 + flags = 1 + data = length 13, hash 9F198DF0 + sample 61: + time = 4120000 + flags = 1 + data = length 13, hash B291F16A + sample 62: + time = 4140000 + flags = 1 + data = length 13, hash CF820EE0 + sample 63: + time = 4160000 + flags = 1 + data = length 13, hash 4E24F683 + sample 64: + time = 4180000 + flags = 1 + data = length 13, hash 52BCD68F + sample 65: + time = 4200000 + flags = 1 + data = length 13, hash 42588CB0 + sample 66: + time = 4220000 + flags = 1 + data = length 13, hash EBBFECA2 + sample 67: + time = 4240000 + flags = 1 + data = length 13, hash C11050CF + sample 68: + time = 4260000 + flags = 1 + data = length 13, hash 6F738603 + sample 69: + time = 4280000 + flags = 1 + data = length 13, hash DAD06E5 + sample 70: + time = 4300000 + flags = 1 + data = length 13, hash 5B036C64 + sample 71: + time = 4320000 + flags = 1 + data = length 13, hash A58DC12E + sample 72: + time = 4340000 + flags = 1 + data = length 13, hash AC59BA7C +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_nb_cbr.amr.3.dump b/library/core/src/test/assets/amr/sample_nb_cbr.amr.3.dump new file mode 100644 index 0000000000..da907e004f --- /dev/null +++ b/library/core/src/test/assets/amr/sample_nb_cbr.amr.3.dump @@ -0,0 +1,34 @@ +seekMap: + isSeekable = true + duration = 4360000 + getPosition(0) = [[timeUs=0, position=6]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/3gpp + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 8000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 13 + sample count = 1 + sample 0: + time = 4340000 + flags = 1 + data = length 13, hash AC59BA7C +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_nb_cbr.amr.unklen.dump b/library/core/src/test/assets/amr/sample_nb_cbr.amr.unklen.dump new file mode 100644 index 0000000000..e0dec9c62c --- /dev/null +++ b/library/core/src/test/assets/amr/sample_nb_cbr.amr.unklen.dump @@ -0,0 +1,902 @@ +seekMap: + isSeekable = false + duration = UNSET TIME + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/3gpp + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 8000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 2834 + sample count = 218 + sample 0: + time = 0 + flags = 1 + data = length 13, hash 371B046C + sample 1: + time = 20000 + flags = 1 + data = length 13, hash CE30BF5B + sample 2: + time = 40000 + flags = 1 + data = length 13, hash 19A59975 + sample 3: + time = 60000 + flags = 1 + data = length 13, hash 4879773C + sample 4: + time = 80000 + flags = 1 + data = length 13, hash E8F83019 + sample 5: + time = 100000 + flags = 1 + data = length 13, hash D265CDC9 + sample 6: + time = 120000 + flags = 1 + data = length 13, hash 91653DAA + sample 7: + time = 140000 + flags = 1 + data = length 13, hash C79456F6 + sample 8: + time = 160000 + flags = 1 + data = length 13, hash CDDC4422 + sample 9: + time = 180000 + flags = 1 + data = length 13, hash D9ED3AF1 + sample 10: + time = 200000 + flags = 1 + data = length 13, hash BAB75A33 + sample 11: + time = 220000 + flags = 1 + data = length 13, hash 2221B4FF + sample 12: + time = 240000 + flags = 1 + data = length 13, hash 96400A0B + sample 13: + time = 260000 + flags = 1 + data = length 13, hash 582E6FB + sample 14: + time = 280000 + flags = 1 + data = length 13, hash C4E878E5 + sample 15: + time = 300000 + flags = 1 + data = length 13, hash C849A1BD + sample 16: + time = 320000 + flags = 1 + data = length 13, hash CFA8A9ED + sample 17: + time = 340000 + flags = 1 + data = length 13, hash 70CA4907 + sample 18: + time = 360000 + flags = 1 + data = length 13, hash B47D4454 + sample 19: + time = 380000 + flags = 1 + data = length 13, hash 282998C1 + sample 20: + time = 400000 + flags = 1 + data = length 13, hash 3F3F7A65 + sample 21: + time = 420000 + flags = 1 + data = length 13, hash CC2EAB58 + sample 22: + time = 440000 + flags = 1 + data = length 13, hash 279EF712 + sample 23: + time = 460000 + flags = 1 + data = length 13, hash AA2F4B29 + sample 24: + time = 480000 + flags = 1 + data = length 13, hash F6F658C4 + sample 25: + time = 500000 + flags = 1 + data = length 13, hash D7DEBD17 + sample 26: + time = 520000 + flags = 1 + data = length 13, hash 6DAB9A17 + sample 27: + time = 540000 + flags = 1 + data = length 13, hash 6ECE1571 + sample 28: + time = 560000 + flags = 1 + data = length 13, hash B3D0507F + sample 29: + time = 580000 + flags = 1 + data = length 13, hash 21E356B9 + sample 30: + time = 600000 + flags = 1 + data = length 13, hash 410EA12 + sample 31: + time = 620000 + flags = 1 + data = length 13, hash 533895A8 + sample 32: + time = 640000 + flags = 1 + data = length 13, hash C61B3E5A + sample 33: + time = 660000 + flags = 1 + data = length 13, hash 982170E6 + sample 34: + time = 680000 + flags = 1 + data = length 13, hash 7A0468C5 + sample 35: + time = 700000 + flags = 1 + data = length 13, hash 9C85EAA7 + sample 36: + time = 720000 + flags = 1 + data = length 13, hash B6B341B6 + sample 37: + time = 740000 + flags = 1 + data = length 13, hash 6937532E + sample 38: + time = 760000 + flags = 1 + data = length 13, hash 8CF2A3A0 + sample 39: + time = 780000 + flags = 1 + data = length 13, hash D2682AC6 + sample 40: + time = 800000 + flags = 1 + data = length 13, hash BBC5710F + sample 41: + time = 820000 + flags = 1 + data = length 13, hash 59080B6C + sample 42: + time = 840000 + flags = 1 + data = length 13, hash E4118291 + sample 43: + time = 860000 + flags = 1 + data = length 13, hash A1E5B296 + sample 44: + time = 880000 + flags = 1 + data = length 13, hash D7B8F95B + sample 45: + time = 900000 + flags = 1 + data = length 13, hash CC839BE1 + sample 46: + time = 920000 + flags = 1 + data = length 13, hash D459DFCE + sample 47: + time = 940000 + flags = 1 + data = length 13, hash D6AD19EC + sample 48: + time = 960000 + flags = 1 + data = length 13, hash D05E373D + sample 49: + time = 980000 + flags = 1 + data = length 13, hash 6A4460C7 + sample 50: + time = 1000000 + flags = 1 + data = length 13, hash C9A0D93F + sample 51: + time = 1020000 + flags = 1 + data = length 13, hash 3FA819E7 + sample 52: + time = 1040000 + flags = 1 + data = length 13, hash 1D3CBDFC + sample 53: + time = 1060000 + flags = 1 + data = length 13, hash 8BBBB403 + sample 54: + time = 1080000 + flags = 1 + data = length 13, hash 21B4A0F9 + sample 55: + time = 1100000 + flags = 1 + data = length 13, hash C0F921D1 + sample 56: + time = 1120000 + flags = 1 + data = length 13, hash 5D812AAB + sample 57: + time = 1140000 + flags = 1 + data = length 13, hash 50C9F3F8 + sample 58: + time = 1160000 + flags = 1 + data = length 13, hash 5C2BB5D1 + sample 59: + time = 1180000 + flags = 1 + data = length 13, hash 6BF9BEA5 + sample 60: + time = 1200000 + flags = 1 + data = length 13, hash 2738C1E6 + sample 61: + time = 1220000 + flags = 1 + data = length 13, hash 5FC288A6 + sample 62: + time = 1240000 + flags = 1 + data = length 13, hash 7E8E442A + sample 63: + time = 1260000 + flags = 1 + data = length 13, hash AEAA2BBA + sample 64: + time = 1280000 + flags = 1 + data = length 13, hash 4E2ACD2F + sample 65: + time = 1300000 + flags = 1 + data = length 13, hash D6C90ACF + sample 66: + time = 1320000 + flags = 1 + data = length 13, hash 6FD8A944 + sample 67: + time = 1340000 + flags = 1 + data = length 13, hash A835BBF9 + sample 68: + time = 1360000 + flags = 1 + data = length 13, hash F7713830 + sample 69: + time = 1380000 + flags = 1 + data = length 13, hash 3AA966E5 + sample 70: + time = 1400000 + flags = 1 + data = length 13, hash F939E829 + sample 71: + time = 1420000 + flags = 1 + data = length 13, hash 7676DE49 + sample 72: + time = 1440000 + flags = 1 + data = length 13, hash 93BB890A + sample 73: + time = 1460000 + flags = 1 + data = length 13, hash B57DBEC8 + sample 74: + time = 1480000 + flags = 1 + data = length 13, hash 66B0A5B6 + sample 75: + time = 1500000 + flags = 1 + data = length 13, hash D733E0D + sample 76: + time = 1520000 + flags = 1 + data = length 13, hash 80941726 + sample 77: + time = 1540000 + flags = 1 + data = length 13, hash 556ED633 + sample 78: + time = 1560000 + flags = 1 + data = length 13, hash C5EDF4E1 + sample 79: + time = 1580000 + flags = 1 + data = length 13, hash 6B287445 + sample 80: + time = 1600000 + flags = 1 + data = length 13, hash DC97C4A7 + sample 81: + time = 1620000 + flags = 1 + data = length 13, hash DA8CBDF4 + sample 82: + time = 1640000 + flags = 1 + data = length 13, hash 6F60FF77 + sample 83: + time = 1660000 + flags = 1 + data = length 13, hash 3EB22B96 + sample 84: + time = 1680000 + flags = 1 + data = length 13, hash B3C31AF5 + sample 85: + time = 1700000 + flags = 1 + data = length 13, hash 1854AA92 + sample 86: + time = 1720000 + flags = 1 + data = length 13, hash 6488264B + sample 87: + time = 1740000 + flags = 1 + data = length 13, hash 4CC8C5C1 + sample 88: + time = 1760000 + flags = 1 + data = length 13, hash 19CC7523 + sample 89: + time = 1780000 + flags = 1 + data = length 13, hash 9BE7B928 + sample 90: + time = 1800000 + flags = 1 + data = length 13, hash 47EC7CFD + sample 91: + time = 1820000 + flags = 1 + data = length 13, hash EC940120 + sample 92: + time = 1840000 + flags = 1 + data = length 13, hash 73BDA6D0 + sample 93: + time = 1860000 + flags = 1 + data = length 13, hash FACB3314 + sample 94: + time = 1880000 + flags = 1 + data = length 13, hash EC61D13B + sample 95: + time = 1900000 + flags = 1 + data = length 13, hash B28C7B6C + sample 96: + time = 1920000 + flags = 1 + data = length 13, hash B1A4CECD + sample 97: + time = 1940000 + flags = 1 + data = length 13, hash 56D41BA6 + sample 98: + time = 1960000 + flags = 1 + data = length 13, hash 90499F4 + sample 99: + time = 1980000 + flags = 1 + data = length 13, hash 65D9A9D3 + sample 100: + time = 2000000 + flags = 1 + data = length 13, hash D9004CC + sample 101: + time = 2020000 + flags = 1 + data = length 13, hash 4139C6ED + sample 102: + time = 2040000 + flags = 1 + data = length 13, hash C4F8097C + sample 103: + time = 2060000 + flags = 1 + data = length 13, hash 94D424FA + sample 104: + time = 2080000 + flags = 1 + data = length 13, hash C2C6F5FD + sample 105: + time = 2100000 + flags = 1 + data = length 13, hash 15719008 + sample 106: + time = 2120000 + flags = 1 + data = length 13, hash 4F64F524 + sample 107: + time = 2140000 + flags = 1 + data = length 13, hash F9E01C1E + sample 108: + time = 2160000 + flags = 1 + data = length 13, hash 74C4EE74 + sample 109: + time = 2180000 + flags = 1 + data = length 13, hash 7EE7553D + sample 110: + time = 2200000 + flags = 1 + data = length 13, hash 62DE6539 + sample 111: + time = 2220000 + flags = 1 + data = length 13, hash 7F5EC222 + sample 112: + time = 2240000 + flags = 1 + data = length 13, hash 644067F + sample 113: + time = 2260000 + flags = 1 + data = length 13, hash CDF6C9DC + sample 114: + time = 2280000 + flags = 1 + data = length 13, hash 8B5DBC80 + sample 115: + time = 2300000 + flags = 1 + data = length 13, hash AD4BBA03 + sample 116: + time = 2320000 + flags = 1 + data = length 13, hash 7A76340 + sample 117: + time = 2340000 + flags = 1 + data = length 13, hash 3610F5B0 + sample 118: + time = 2360000 + flags = 1 + data = length 13, hash 430BC60B + sample 119: + time = 2380000 + flags = 1 + data = length 13, hash 99CF1CA6 + sample 120: + time = 2400000 + flags = 1 + data = length 13, hash 1331C70B + sample 121: + time = 2420000 + flags = 1 + data = length 13, hash BD76E69D + sample 122: + time = 2440000 + flags = 1 + data = length 13, hash 5DA652AC + sample 123: + time = 2460000 + flags = 1 + data = length 13, hash 3B7BF6CE + sample 124: + time = 2480000 + flags = 1 + data = length 13, hash ABBFD143 + sample 125: + time = 2500000 + flags = 1 + data = length 13, hash E9447166 + sample 126: + time = 2520000 + flags = 1 + data = length 13, hash EC40068C + sample 127: + time = 2540000 + flags = 1 + data = length 13, hash A2869400 + sample 128: + time = 2560000 + flags = 1 + data = length 13, hash C7E0746B + sample 129: + time = 2580000 + flags = 1 + data = length 13, hash 60601BB1 + sample 130: + time = 2600000 + flags = 1 + data = length 13, hash 975AAE9B + sample 131: + time = 2620000 + flags = 1 + data = length 13, hash 8BBC0EB2 + sample 132: + time = 2640000 + flags = 1 + data = length 13, hash 57FB39E5 + sample 133: + time = 2660000 + flags = 1 + data = length 13, hash 4CDCEEDB + sample 134: + time = 2680000 + flags = 1 + data = length 13, hash EA16E256 + sample 135: + time = 2700000 + flags = 1 + data = length 13, hash 287E7D9E + sample 136: + time = 2720000 + flags = 1 + data = length 13, hash 55AB8FB9 + sample 137: + time = 2740000 + flags = 1 + data = length 13, hash 129890EF + sample 138: + time = 2760000 + flags = 1 + data = length 13, hash 90834F57 + sample 139: + time = 2780000 + flags = 1 + data = length 13, hash 5B3228E0 + sample 140: + time = 2800000 + flags = 1 + data = length 13, hash DD19E175 + sample 141: + time = 2820000 + flags = 1 + data = length 13, hash EE7EA342 + sample 142: + time = 2840000 + flags = 1 + data = length 13, hash DB3AF473 + sample 143: + time = 2860000 + flags = 1 + data = length 13, hash 25AEC43F + sample 144: + time = 2880000 + flags = 1 + data = length 13, hash EE9BF97F + sample 145: + time = 2900000 + flags = 1 + data = length 13, hash FFFBE047 + sample 146: + time = 2920000 + flags = 1 + data = length 13, hash BEACFCB0 + sample 147: + time = 2940000 + flags = 1 + data = length 13, hash AEB5096C + sample 148: + time = 2960000 + flags = 1 + data = length 13, hash B0D381B + sample 149: + time = 2980000 + flags = 1 + data = length 13, hash 3D9D5122 + sample 150: + time = 3000000 + flags = 1 + data = length 13, hash 6C1DDB95 + sample 151: + time = 3020000 + flags = 1 + data = length 13, hash ADACADCF + sample 152: + time = 3040000 + flags = 1 + data = length 13, hash 159E321E + sample 153: + time = 3060000 + flags = 1 + data = length 13, hash B1466264 + sample 154: + time = 3080000 + flags = 1 + data = length 13, hash 4DDF7223 + sample 155: + time = 3100000 + flags = 1 + data = length 13, hash C9BDB82A + sample 156: + time = 3120000 + flags = 1 + data = length 13, hash A49B2D9D + sample 157: + time = 3140000 + flags = 1 + data = length 13, hash D645E7E5 + sample 158: + time = 3160000 + flags = 1 + data = length 13, hash 1C4232DC + sample 159: + time = 3180000 + flags = 1 + data = length 13, hash 83078219 + sample 160: + time = 3200000 + flags = 1 + data = length 13, hash D6D8B072 + sample 161: + time = 3220000 + flags = 1 + data = length 13, hash 975DB40 + sample 162: + time = 3240000 + flags = 1 + data = length 13, hash A15FDD05 + sample 163: + time = 3260000 + flags = 1 + data = length 13, hash 4B839E41 + sample 164: + time = 3280000 + flags = 1 + data = length 13, hash 7418F499 + sample 165: + time = 3300000 + flags = 1 + data = length 13, hash 7A4945E4 + sample 166: + time = 3320000 + flags = 1 + data = length 13, hash 6249558C + sample 167: + time = 3340000 + flags = 1 + data = length 13, hash BD4C5BE3 + sample 168: + time = 3360000 + flags = 1 + data = length 13, hash BAB30F1D + sample 169: + time = 3380000 + flags = 1 + data = length 13, hash 1E1C7012 + sample 170: + time = 3400000 + flags = 1 + data = length 13, hash 9A3F8A89 + sample 171: + time = 3420000 + flags = 1 + data = length 13, hash 20BE6D7B + sample 172: + time = 3440000 + flags = 1 + data = length 13, hash CAA0591D + sample 173: + time = 3460000 + flags = 1 + data = length 13, hash 6D554D17 + sample 174: + time = 3480000 + flags = 1 + data = length 13, hash D97C3B31 + sample 175: + time = 3500000 + flags = 1 + data = length 13, hash 75BC5C3 + sample 176: + time = 3520000 + flags = 1 + data = length 13, hash 7BA1784B + sample 177: + time = 3540000 + flags = 1 + data = length 13, hash 1D175D92 + sample 178: + time = 3560000 + flags = 1 + data = length 13, hash ADCA60FD + sample 179: + time = 3580000 + flags = 1 + data = length 13, hash 37018693 + sample 180: + time = 3600000 + flags = 1 + data = length 13, hash 4553606F + sample 181: + time = 3620000 + flags = 1 + data = length 13, hash CF434565 + sample 182: + time = 3640000 + flags = 1 + data = length 13, hash D264D757 + sample 183: + time = 3660000 + flags = 1 + data = length 13, hash 4FB493EF + sample 184: + time = 3680000 + flags = 1 + data = length 13, hash 919F53A + sample 185: + time = 3700000 + flags = 1 + data = length 13, hash C22B009B + sample 186: + time = 3720000 + flags = 1 + data = length 13, hash 5981470 + sample 187: + time = 3740000 + flags = 1 + data = length 13, hash A5D3937C + sample 188: + time = 3760000 + flags = 1 + data = length 13, hash A2504429 + sample 189: + time = 3780000 + flags = 1 + data = length 13, hash AD1B70BE + sample 190: + time = 3800000 + flags = 1 + data = length 13, hash 2E39ED5E + sample 191: + time = 3820000 + flags = 1 + data = length 13, hash 13A8BE8E + sample 192: + time = 3840000 + flags = 1 + data = length 13, hash 1ACD740B + sample 193: + time = 3860000 + flags = 1 + data = length 13, hash 80F38B3 + sample 194: + time = 3880000 + flags = 1 + data = length 13, hash DA9DA79F + sample 195: + time = 3900000 + flags = 1 + data = length 13, hash 21B95B7E + sample 196: + time = 3920000 + flags = 1 + data = length 13, hash CD22497B + sample 197: + time = 3940000 + flags = 1 + data = length 13, hash 718BB35D + sample 198: + time = 3960000 + flags = 1 + data = length 13, hash 69ABA6AD + sample 199: + time = 3980000 + flags = 1 + data = length 13, hash BAE19549 + sample 200: + time = 4000000 + flags = 1 + data = length 13, hash 2A792FB3 + sample 201: + time = 4020000 + flags = 1 + data = length 13, hash 71FCD8 + sample 202: + time = 4040000 + flags = 1 + data = length 13, hash 44D2B5B3 + sample 203: + time = 4060000 + flags = 1 + data = length 13, hash 1E87B11B + sample 204: + time = 4080000 + flags = 1 + data = length 13, hash 78CD2C11 + sample 205: + time = 4100000 + flags = 1 + data = length 13, hash 9F198DF0 + sample 206: + time = 4120000 + flags = 1 + data = length 13, hash B291F16A + sample 207: + time = 4140000 + flags = 1 + data = length 13, hash CF820EE0 + sample 208: + time = 4160000 + flags = 1 + data = length 13, hash 4E24F683 + sample 209: + time = 4180000 + flags = 1 + data = length 13, hash 52BCD68F + sample 210: + time = 4200000 + flags = 1 + data = length 13, hash 42588CB0 + sample 211: + time = 4220000 + flags = 1 + data = length 13, hash EBBFECA2 + sample 212: + time = 4240000 + flags = 1 + data = length 13, hash C11050CF + sample 213: + time = 4260000 + flags = 1 + data = length 13, hash 6F738603 + sample 214: + time = 4280000 + flags = 1 + data = length 13, hash DAD06E5 + sample 215: + time = 4300000 + flags = 1 + data = length 13, hash 5B036C64 + sample 216: + time = 4320000 + flags = 1 + data = length 13, hash A58DC12E + sample 217: + time = 4340000 + flags = 1 + data = length 13, hash AC59BA7C +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_wb_cbr.amr b/library/core/src/test/assets/amr/sample_wb_cbr.amr new file mode 100644 index 0000000000..14b85b553c Binary files /dev/null and b/library/core/src/test/assets/amr/sample_wb_cbr.amr differ diff --git a/library/core/src/test/assets/amr/sample_wb_cbr.amr.0.dump b/library/core/src/test/assets/amr/sample_wb_cbr.amr.0.dump new file mode 100644 index 0000000000..c987c6e357 --- /dev/null +++ b/library/core/src/test/assets/amr/sample_wb_cbr.amr.0.dump @@ -0,0 +1,706 @@ +seekMap: + isSeekable = true + duration = 3380000 + getPosition(0) = [[timeUs=0, position=9]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/amr-wb + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 16000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 4056 + sample count = 169 + sample 0: + time = 0 + flags = 1 + data = length 24, hash C3025798 + sample 1: + time = 20000 + flags = 1 + data = length 24, hash 39CABAE9 + sample 2: + time = 40000 + flags = 1 + data = length 24, hash 2752F470 + sample 3: + time = 60000 + flags = 1 + data = length 24, hash 394F76F6 + sample 4: + time = 80000 + flags = 1 + data = length 24, hash FF9EEF + sample 5: + time = 100000 + flags = 1 + data = length 24, hash 54ECB1B4 + sample 6: + time = 120000 + flags = 1 + data = length 24, hash 6D7A3A5F + sample 7: + time = 140000 + flags = 1 + data = length 24, hash 684CD144 + sample 8: + time = 160000 + flags = 1 + data = length 24, hash 87B7D176 + sample 9: + time = 180000 + flags = 1 + data = length 24, hash 4C02F9A5 + sample 10: + time = 200000 + flags = 1 + data = length 24, hash B4154108 + sample 11: + time = 220000 + flags = 1 + data = length 24, hash 4448F477 + sample 12: + time = 240000 + flags = 1 + data = length 24, hash 755A4939 + sample 13: + time = 260000 + flags = 1 + data = length 24, hash 8C8BC6C3 + sample 14: + time = 280000 + flags = 1 + data = length 24, hash BC37F63F + sample 15: + time = 300000 + flags = 1 + data = length 24, hash 3352C43C + sample 16: + time = 320000 + flags = 1 + data = length 24, hash 7998E1F2 + sample 17: + time = 340000 + flags = 1 + data = length 24, hash A8ECBEFC + sample 18: + time = 360000 + flags = 1 + data = length 24, hash 944AC118 + sample 19: + time = 380000 + flags = 1 + data = length 24, hash FD2C8E1F + sample 20: + time = 400000 + flags = 1 + data = length 24, hash B3D867AF + sample 21: + time = 420000 + flags = 1 + data = length 24, hash 3DC6E592 + sample 22: + time = 440000 + flags = 1 + data = length 24, hash 32B276CD + sample 23: + time = 460000 + flags = 1 + data = length 24, hash 5488AEF3 + sample 24: + time = 480000 + flags = 1 + data = length 24, hash 7A4D516 + sample 25: + time = 500000 + flags = 1 + data = length 24, hash 570AE83F + sample 26: + time = 520000 + flags = 1 + data = length 24, hash E5CB3477 + sample 27: + time = 540000 + flags = 1 + data = length 24, hash E04C00E4 + sample 28: + time = 560000 + flags = 1 + data = length 24, hash 21B7C97 + sample 29: + time = 580000 + flags = 1 + data = length 24, hash 1633F470 + sample 30: + time = 600000 + flags = 1 + data = length 24, hash 28D65CA6 + sample 31: + time = 620000 + flags = 1 + data = length 24, hash CC6A675C + sample 32: + time = 640000 + flags = 1 + data = length 24, hash 4C91080A + sample 33: + time = 660000 + flags = 1 + data = length 24, hash F6482FB5 + sample 34: + time = 680000 + flags = 1 + data = length 24, hash 2C76F48C + sample 35: + time = 700000 + flags = 1 + data = length 24, hash 6E3B0D72 + sample 36: + time = 720000 + flags = 1 + data = length 24, hash 799AA003 + sample 37: + time = 740000 + flags = 1 + data = length 24, hash DFC0BA81 + sample 38: + time = 760000 + flags = 1 + data = length 24, hash CBDF3826 + sample 39: + time = 780000 + flags = 1 + data = length 24, hash 16862B75 + sample 40: + time = 800000 + flags = 1 + data = length 24, hash 865A828E + sample 41: + time = 820000 + flags = 1 + data = length 24, hash 336BBDC9 + sample 42: + time = 840000 + flags = 1 + data = length 24, hash 6CFC6C34 + sample 43: + time = 860000 + flags = 1 + data = length 24, hash 32C8CD46 + sample 44: + time = 880000 + flags = 1 + data = length 24, hash 9FE11C4C + sample 45: + time = 900000 + flags = 1 + data = length 24, hash AA5A12B7 + sample 46: + time = 920000 + flags = 1 + data = length 24, hash AA0F4A4D + sample 47: + time = 940000 + flags = 1 + data = length 24, hash 34415484 + sample 48: + time = 960000 + flags = 1 + data = length 24, hash 5018928E + sample 49: + time = 980000 + flags = 1 + data = length 24, hash 4A04D162 + sample 50: + time = 1000000 + flags = 1 + data = length 24, hash 4C70F9F0 + sample 51: + time = 1020000 + flags = 1 + data = length 24, hash 99EF3168 + sample 52: + time = 1040000 + flags = 1 + data = length 24, hash C600DAF + sample 53: + time = 1060000 + flags = 1 + data = length 24, hash FDBB192E + sample 54: + time = 1080000 + flags = 1 + data = length 24, hash 99096A48 + sample 55: + time = 1100000 + flags = 1 + data = length 24, hash D793F88B + sample 56: + time = 1120000 + flags = 1 + data = length 24, hash EEB921BD + sample 57: + time = 1140000 + flags = 1 + data = length 24, hash 8B941A4C + sample 58: + time = 1160000 + flags = 1 + data = length 24, hash ED5F5FEE + sample 59: + time = 1180000 + flags = 1 + data = length 24, hash A588E0BB + sample 60: + time = 1200000 + flags = 1 + data = length 24, hash 588CBC01 + sample 61: + time = 1220000 + flags = 1 + data = length 24, hash DE22266C + sample 62: + time = 1240000 + flags = 1 + data = length 24, hash 921B6E5C + sample 63: + time = 1260000 + flags = 1 + data = length 24, hash EC11F041 + sample 64: + time = 1280000 + flags = 1 + data = length 24, hash 5BA9E0A3 + sample 65: + time = 1300000 + flags = 1 + data = length 24, hash DB6D52F3 + sample 66: + time = 1320000 + flags = 1 + data = length 24, hash 8EEBE525 + sample 67: + time = 1340000 + flags = 1 + data = length 24, hash 47A742AE + sample 68: + time = 1360000 + flags = 1 + data = length 24, hash E93F1E03 + sample 69: + time = 1380000 + flags = 1 + data = length 24, hash 3251F57C + sample 70: + time = 1400000 + flags = 1 + data = length 24, hash 3EDBBBDD + sample 71: + time = 1420000 + flags = 1 + data = length 24, hash 2E98465A + sample 72: + time = 1440000 + flags = 1 + data = length 24, hash A09EA52E + sample 73: + time = 1460000 + flags = 1 + data = length 24, hash A2A86FA6 + sample 74: + time = 1480000 + flags = 1 + data = length 24, hash 71DCD51C + sample 75: + time = 1500000 + flags = 1 + data = length 24, hash 2B02DEE1 + sample 76: + time = 1520000 + flags = 1 + data = length 24, hash 7A725192 + sample 77: + time = 1540000 + flags = 1 + data = length 24, hash 929AD483 + sample 78: + time = 1560000 + flags = 1 + data = length 24, hash 68440BF5 + sample 79: + time = 1580000 + flags = 1 + data = length 24, hash 5BD41AD6 + sample 80: + time = 1600000 + flags = 1 + data = length 24, hash 91A381 + sample 81: + time = 1620000 + flags = 1 + data = length 24, hash 8010C408 + sample 82: + time = 1640000 + flags = 1 + data = length 24, hash 482274BE + sample 83: + time = 1660000 + flags = 1 + data = length 24, hash D7DB8BCC + sample 84: + time = 1680000 + flags = 1 + data = length 24, hash 680BD9DD + sample 85: + time = 1700000 + flags = 1 + data = length 24, hash E313577C + sample 86: + time = 1720000 + flags = 1 + data = length 24, hash 9C10B0CD + sample 87: + time = 1740000 + flags = 1 + data = length 24, hash 2D90AC02 + sample 88: + time = 1760000 + flags = 1 + data = length 24, hash 64E8C245 + sample 89: + time = 1780000 + flags = 1 + data = length 24, hash 3954AC1B + sample 90: + time = 1800000 + flags = 1 + data = length 24, hash ACB8999F + sample 91: + time = 1820000 + flags = 1 + data = length 24, hash 43AE3957 + sample 92: + time = 1840000 + flags = 1 + data = length 24, hash 3C664DB7 + sample 93: + time = 1860000 + flags = 1 + data = length 24, hash 9354B576 + sample 94: + time = 1880000 + flags = 1 + data = length 24, hash B5B9C14E + sample 95: + time = 1900000 + flags = 1 + data = length 24, hash 7DA9C98F + sample 96: + time = 1920000 + flags = 1 + data = length 24, hash EFEE54C6 + sample 97: + time = 1940000 + flags = 1 + data = length 24, hash 79DC8CBD + sample 98: + time = 1960000 + flags = 1 + data = length 24, hash A71A475C + sample 99: + time = 1980000 + flags = 1 + data = length 24, hash CA1CBB94 + sample 100: + time = 2000000 + flags = 1 + data = length 24, hash 91922226 + sample 101: + time = 2020000 + flags = 1 + data = length 24, hash C90278BC + sample 102: + time = 2040000 + flags = 1 + data = length 24, hash BD51986F + sample 103: + time = 2060000 + flags = 1 + data = length 24, hash 90AEF368 + sample 104: + time = 2080000 + flags = 1 + data = length 24, hash 1D83C955 + sample 105: + time = 2100000 + flags = 1 + data = length 24, hash 8FA9A915 + sample 106: + time = 2120000 + flags = 1 + data = length 24, hash C6C753E0 + sample 107: + time = 2140000 + flags = 1 + data = length 24, hash 85FA27A7 + sample 108: + time = 2160000 + flags = 1 + data = length 24, hash A0277324 + sample 109: + time = 2180000 + flags = 1 + data = length 24, hash B7696535 + sample 110: + time = 2200000 + flags = 1 + data = length 24, hash D69D668C + sample 111: + time = 2220000 + flags = 1 + data = length 24, hash 34C057CD + sample 112: + time = 2240000 + flags = 1 + data = length 24, hash 4EC5E974 + sample 113: + time = 2260000 + flags = 1 + data = length 24, hash 1C1CD40D + sample 114: + time = 2280000 + flags = 1 + data = length 24, hash 76CC54BC + sample 115: + time = 2300000 + flags = 1 + data = length 24, hash D497ACF5 + sample 116: + time = 2320000 + flags = 1 + data = length 24, hash A1386080 + sample 117: + time = 2340000 + flags = 1 + data = length 24, hash 7ED36954 + sample 118: + time = 2360000 + flags = 1 + data = length 24, hash C11A3BF9 + sample 119: + time = 2380000 + flags = 1 + data = length 24, hash 8FB69488 + sample 120: + time = 2400000 + flags = 1 + data = length 24, hash C6225F59 + sample 121: + time = 2420000 + flags = 1 + data = length 24, hash 122AB6D2 + sample 122: + time = 2440000 + flags = 1 + data = length 24, hash 1E195E7D + sample 123: + time = 2460000 + flags = 1 + data = length 24, hash BD3DF418 + sample 124: + time = 2480000 + flags = 1 + data = length 24, hash D8AE4A5 + sample 125: + time = 2500000 + flags = 1 + data = length 24, hash 977BD182 + sample 126: + time = 2520000 + flags = 1 + data = length 24, hash F361F060 + sample 127: + time = 2540000 + flags = 1 + data = length 24, hash 11EC8CD0 + sample 128: + time = 2560000 + flags = 1 + data = length 24, hash 3798F3D2 + sample 129: + time = 2580000 + flags = 1 + data = length 24, hash B2C2517C + sample 130: + time = 2600000 + flags = 1 + data = length 24, hash FBE0D0D8 + sample 131: + time = 2620000 + flags = 1 + data = length 24, hash 7033172F + sample 132: + time = 2640000 + flags = 1 + data = length 24, hash BE760029 + sample 133: + time = 2660000 + flags = 1 + data = length 24, hash 590AF28C + sample 134: + time = 2680000 + flags = 1 + data = length 24, hash AD28C48F + sample 135: + time = 2700000 + flags = 1 + data = length 24, hash 640AA61B + sample 136: + time = 2720000 + flags = 1 + data = length 24, hash ABE659B + sample 137: + time = 2740000 + flags = 1 + data = length 24, hash ED2691D2 + sample 138: + time = 2760000 + flags = 1 + data = length 24, hash D998C80E + sample 139: + time = 2780000 + flags = 1 + data = length 24, hash 8DC0DF5C + sample 140: + time = 2800000 + flags = 1 + data = length 24, hash 7692247B + sample 141: + time = 2820000 + flags = 1 + data = length 24, hash C1D1CCB9 + sample 142: + time = 2840000 + flags = 1 + data = length 24, hash 362CE78E + sample 143: + time = 2860000 + flags = 1 + data = length 24, hash 54FA84A + sample 144: + time = 2880000 + flags = 1 + data = length 24, hash 29E88C84 + sample 145: + time = 2900000 + flags = 1 + data = length 24, hash 1CD848AC + sample 146: + time = 2920000 + flags = 1 + data = length 24, hash 5C3D4A79 + sample 147: + time = 2940000 + flags = 1 + data = length 24, hash 1AA8E604 + sample 148: + time = 2960000 + flags = 1 + data = length 24, hash 186A4316 + sample 149: + time = 2980000 + flags = 1 + data = length 24, hash 61ACE481 + sample 150: + time = 3000000 + flags = 1 + data = length 24, hash D0C42780 + sample 151: + time = 3020000 + flags = 1 + data = length 24, hash FAD51BA1 + sample 152: + time = 3040000 + flags = 1 + data = length 24, hash F1A9AC71 + sample 153: + time = 3060000 + flags = 1 + data = length 24, hash 24425449 + sample 154: + time = 3080000 + flags = 1 + data = length 24, hash 37AAC3E6 + sample 155: + time = 3100000 + flags = 1 + data = length 24, hash 91F68CB4 + sample 156: + time = 3120000 + flags = 1 + data = length 24, hash F8C92820 + sample 157: + time = 3140000 + flags = 1 + data = length 24, hash ECD39C3E + sample 158: + time = 3160000 + flags = 1 + data = length 24, hash B27D8F78 + sample 159: + time = 3180000 + flags = 1 + data = length 24, hash C9EB3DFB + sample 160: + time = 3200000 + flags = 1 + data = length 24, hash 88DC54A2 + sample 161: + time = 3220000 + flags = 1 + data = length 24, hash 7FC4C5BE + sample 162: + time = 3240000 + flags = 1 + data = length 24, hash E4F684EF + sample 163: + time = 3260000 + flags = 1 + data = length 24, hash 55C08B56 + sample 164: + time = 3280000 + flags = 1 + data = length 24, hash E5A0F006 + sample 165: + time = 3300000 + flags = 1 + data = length 24, hash DE3F3AA7 + sample 166: + time = 3320000 + flags = 1 + data = length 24, hash 3F28AE7F + sample 167: + time = 3340000 + flags = 1 + data = length 24, hash 3949CAFF + sample 168: + time = 3360000 + flags = 1 + data = length 24, hash 772665A0 +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_wb_cbr.amr.1.dump b/library/core/src/test/assets/amr/sample_wb_cbr.amr.1.dump new file mode 100644 index 0000000000..fad4565195 --- /dev/null +++ b/library/core/src/test/assets/amr/sample_wb_cbr.amr.1.dump @@ -0,0 +1,482 @@ +seekMap: + isSeekable = true + duration = 3380000 + getPosition(0) = [[timeUs=0, position=9]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/amr-wb + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 16000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 2712 + sample count = 113 + sample 0: + time = 1120000 + flags = 1 + data = length 24, hash EEB921BD + sample 1: + time = 1140000 + flags = 1 + data = length 24, hash 8B941A4C + sample 2: + time = 1160000 + flags = 1 + data = length 24, hash ED5F5FEE + sample 3: + time = 1180000 + flags = 1 + data = length 24, hash A588E0BB + sample 4: + time = 1200000 + flags = 1 + data = length 24, hash 588CBC01 + sample 5: + time = 1220000 + flags = 1 + data = length 24, hash DE22266C + sample 6: + time = 1240000 + flags = 1 + data = length 24, hash 921B6E5C + sample 7: + time = 1260000 + flags = 1 + data = length 24, hash EC11F041 + sample 8: + time = 1280000 + flags = 1 + data = length 24, hash 5BA9E0A3 + sample 9: + time = 1300000 + flags = 1 + data = length 24, hash DB6D52F3 + sample 10: + time = 1320000 + flags = 1 + data = length 24, hash 8EEBE525 + sample 11: + time = 1340000 + flags = 1 + data = length 24, hash 47A742AE + sample 12: + time = 1360000 + flags = 1 + data = length 24, hash E93F1E03 + sample 13: + time = 1380000 + flags = 1 + data = length 24, hash 3251F57C + sample 14: + time = 1400000 + flags = 1 + data = length 24, hash 3EDBBBDD + sample 15: + time = 1420000 + flags = 1 + data = length 24, hash 2E98465A + sample 16: + time = 1440000 + flags = 1 + data = length 24, hash A09EA52E + sample 17: + time = 1460000 + flags = 1 + data = length 24, hash A2A86FA6 + sample 18: + time = 1480000 + flags = 1 + data = length 24, hash 71DCD51C + sample 19: + time = 1500000 + flags = 1 + data = length 24, hash 2B02DEE1 + sample 20: + time = 1520000 + flags = 1 + data = length 24, hash 7A725192 + sample 21: + time = 1540000 + flags = 1 + data = length 24, hash 929AD483 + sample 22: + time = 1560000 + flags = 1 + data = length 24, hash 68440BF5 + sample 23: + time = 1580000 + flags = 1 + data = length 24, hash 5BD41AD6 + sample 24: + time = 1600000 + flags = 1 + data = length 24, hash 91A381 + sample 25: + time = 1620000 + flags = 1 + data = length 24, hash 8010C408 + sample 26: + time = 1640000 + flags = 1 + data = length 24, hash 482274BE + sample 27: + time = 1660000 + flags = 1 + data = length 24, hash D7DB8BCC + sample 28: + time = 1680000 + flags = 1 + data = length 24, hash 680BD9DD + sample 29: + time = 1700000 + flags = 1 + data = length 24, hash E313577C + sample 30: + time = 1720000 + flags = 1 + data = length 24, hash 9C10B0CD + sample 31: + time = 1740000 + flags = 1 + data = length 24, hash 2D90AC02 + sample 32: + time = 1760000 + flags = 1 + data = length 24, hash 64E8C245 + sample 33: + time = 1780000 + flags = 1 + data = length 24, hash 3954AC1B + sample 34: + time = 1800000 + flags = 1 + data = length 24, hash ACB8999F + sample 35: + time = 1820000 + flags = 1 + data = length 24, hash 43AE3957 + sample 36: + time = 1840000 + flags = 1 + data = length 24, hash 3C664DB7 + sample 37: + time = 1860000 + flags = 1 + data = length 24, hash 9354B576 + sample 38: + time = 1880000 + flags = 1 + data = length 24, hash B5B9C14E + sample 39: + time = 1900000 + flags = 1 + data = length 24, hash 7DA9C98F + sample 40: + time = 1920000 + flags = 1 + data = length 24, hash EFEE54C6 + sample 41: + time = 1940000 + flags = 1 + data = length 24, hash 79DC8CBD + sample 42: + time = 1960000 + flags = 1 + data = length 24, hash A71A475C + sample 43: + time = 1980000 + flags = 1 + data = length 24, hash CA1CBB94 + sample 44: + time = 2000000 + flags = 1 + data = length 24, hash 91922226 + sample 45: + time = 2020000 + flags = 1 + data = length 24, hash C90278BC + sample 46: + time = 2040000 + flags = 1 + data = length 24, hash BD51986F + sample 47: + time = 2060000 + flags = 1 + data = length 24, hash 90AEF368 + sample 48: + time = 2080000 + flags = 1 + data = length 24, hash 1D83C955 + sample 49: + time = 2100000 + flags = 1 + data = length 24, hash 8FA9A915 + sample 50: + time = 2120000 + flags = 1 + data = length 24, hash C6C753E0 + sample 51: + time = 2140000 + flags = 1 + data = length 24, hash 85FA27A7 + sample 52: + time = 2160000 + flags = 1 + data = length 24, hash A0277324 + sample 53: + time = 2180000 + flags = 1 + data = length 24, hash B7696535 + sample 54: + time = 2200000 + flags = 1 + data = length 24, hash D69D668C + sample 55: + time = 2220000 + flags = 1 + data = length 24, hash 34C057CD + sample 56: + time = 2240000 + flags = 1 + data = length 24, hash 4EC5E974 + sample 57: + time = 2260000 + flags = 1 + data = length 24, hash 1C1CD40D + sample 58: + time = 2280000 + flags = 1 + data = length 24, hash 76CC54BC + sample 59: + time = 2300000 + flags = 1 + data = length 24, hash D497ACF5 + sample 60: + time = 2320000 + flags = 1 + data = length 24, hash A1386080 + sample 61: + time = 2340000 + flags = 1 + data = length 24, hash 7ED36954 + sample 62: + time = 2360000 + flags = 1 + data = length 24, hash C11A3BF9 + sample 63: + time = 2380000 + flags = 1 + data = length 24, hash 8FB69488 + sample 64: + time = 2400000 + flags = 1 + data = length 24, hash C6225F59 + sample 65: + time = 2420000 + flags = 1 + data = length 24, hash 122AB6D2 + sample 66: + time = 2440000 + flags = 1 + data = length 24, hash 1E195E7D + sample 67: + time = 2460000 + flags = 1 + data = length 24, hash BD3DF418 + sample 68: + time = 2480000 + flags = 1 + data = length 24, hash D8AE4A5 + sample 69: + time = 2500000 + flags = 1 + data = length 24, hash 977BD182 + sample 70: + time = 2520000 + flags = 1 + data = length 24, hash F361F060 + sample 71: + time = 2540000 + flags = 1 + data = length 24, hash 11EC8CD0 + sample 72: + time = 2560000 + flags = 1 + data = length 24, hash 3798F3D2 + sample 73: + time = 2580000 + flags = 1 + data = length 24, hash B2C2517C + sample 74: + time = 2600000 + flags = 1 + data = length 24, hash FBE0D0D8 + sample 75: + time = 2620000 + flags = 1 + data = length 24, hash 7033172F + sample 76: + time = 2640000 + flags = 1 + data = length 24, hash BE760029 + sample 77: + time = 2660000 + flags = 1 + data = length 24, hash 590AF28C + sample 78: + time = 2680000 + flags = 1 + data = length 24, hash AD28C48F + sample 79: + time = 2700000 + flags = 1 + data = length 24, hash 640AA61B + sample 80: + time = 2720000 + flags = 1 + data = length 24, hash ABE659B + sample 81: + time = 2740000 + flags = 1 + data = length 24, hash ED2691D2 + sample 82: + time = 2760000 + flags = 1 + data = length 24, hash D998C80E + sample 83: + time = 2780000 + flags = 1 + data = length 24, hash 8DC0DF5C + sample 84: + time = 2800000 + flags = 1 + data = length 24, hash 7692247B + sample 85: + time = 2820000 + flags = 1 + data = length 24, hash C1D1CCB9 + sample 86: + time = 2840000 + flags = 1 + data = length 24, hash 362CE78E + sample 87: + time = 2860000 + flags = 1 + data = length 24, hash 54FA84A + sample 88: + time = 2880000 + flags = 1 + data = length 24, hash 29E88C84 + sample 89: + time = 2900000 + flags = 1 + data = length 24, hash 1CD848AC + sample 90: + time = 2920000 + flags = 1 + data = length 24, hash 5C3D4A79 + sample 91: + time = 2940000 + flags = 1 + data = length 24, hash 1AA8E604 + sample 92: + time = 2960000 + flags = 1 + data = length 24, hash 186A4316 + sample 93: + time = 2980000 + flags = 1 + data = length 24, hash 61ACE481 + sample 94: + time = 3000000 + flags = 1 + data = length 24, hash D0C42780 + sample 95: + time = 3020000 + flags = 1 + data = length 24, hash FAD51BA1 + sample 96: + time = 3040000 + flags = 1 + data = length 24, hash F1A9AC71 + sample 97: + time = 3060000 + flags = 1 + data = length 24, hash 24425449 + sample 98: + time = 3080000 + flags = 1 + data = length 24, hash 37AAC3E6 + sample 99: + time = 3100000 + flags = 1 + data = length 24, hash 91F68CB4 + sample 100: + time = 3120000 + flags = 1 + data = length 24, hash F8C92820 + sample 101: + time = 3140000 + flags = 1 + data = length 24, hash ECD39C3E + sample 102: + time = 3160000 + flags = 1 + data = length 24, hash B27D8F78 + sample 103: + time = 3180000 + flags = 1 + data = length 24, hash C9EB3DFB + sample 104: + time = 3200000 + flags = 1 + data = length 24, hash 88DC54A2 + sample 105: + time = 3220000 + flags = 1 + data = length 24, hash 7FC4C5BE + sample 106: + time = 3240000 + flags = 1 + data = length 24, hash E4F684EF + sample 107: + time = 3260000 + flags = 1 + data = length 24, hash 55C08B56 + sample 108: + time = 3280000 + flags = 1 + data = length 24, hash E5A0F006 + sample 109: + time = 3300000 + flags = 1 + data = length 24, hash DE3F3AA7 + sample 110: + time = 3320000 + flags = 1 + data = length 24, hash 3F28AE7F + sample 111: + time = 3340000 + flags = 1 + data = length 24, hash 3949CAFF + sample 112: + time = 3360000 + flags = 1 + data = length 24, hash 772665A0 +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_wb_cbr.amr.2.dump b/library/core/src/test/assets/amr/sample_wb_cbr.amr.2.dump new file mode 100644 index 0000000000..1f00a90739 --- /dev/null +++ b/library/core/src/test/assets/amr/sample_wb_cbr.amr.2.dump @@ -0,0 +1,258 @@ +seekMap: + isSeekable = true + duration = 3380000 + getPosition(0) = [[timeUs=0, position=9]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/amr-wb + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 16000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 1368 + sample count = 57 + sample 0: + time = 2240000 + flags = 1 + data = length 24, hash 4EC5E974 + sample 1: + time = 2260000 + flags = 1 + data = length 24, hash 1C1CD40D + sample 2: + time = 2280000 + flags = 1 + data = length 24, hash 76CC54BC + sample 3: + time = 2300000 + flags = 1 + data = length 24, hash D497ACF5 + sample 4: + time = 2320000 + flags = 1 + data = length 24, hash A1386080 + sample 5: + time = 2340000 + flags = 1 + data = length 24, hash 7ED36954 + sample 6: + time = 2360000 + flags = 1 + data = length 24, hash C11A3BF9 + sample 7: + time = 2380000 + flags = 1 + data = length 24, hash 8FB69488 + sample 8: + time = 2400000 + flags = 1 + data = length 24, hash C6225F59 + sample 9: + time = 2420000 + flags = 1 + data = length 24, hash 122AB6D2 + sample 10: + time = 2440000 + flags = 1 + data = length 24, hash 1E195E7D + sample 11: + time = 2460000 + flags = 1 + data = length 24, hash BD3DF418 + sample 12: + time = 2480000 + flags = 1 + data = length 24, hash D8AE4A5 + sample 13: + time = 2500000 + flags = 1 + data = length 24, hash 977BD182 + sample 14: + time = 2520000 + flags = 1 + data = length 24, hash F361F060 + sample 15: + time = 2540000 + flags = 1 + data = length 24, hash 11EC8CD0 + sample 16: + time = 2560000 + flags = 1 + data = length 24, hash 3798F3D2 + sample 17: + time = 2580000 + flags = 1 + data = length 24, hash B2C2517C + sample 18: + time = 2600000 + flags = 1 + data = length 24, hash FBE0D0D8 + sample 19: + time = 2620000 + flags = 1 + data = length 24, hash 7033172F + sample 20: + time = 2640000 + flags = 1 + data = length 24, hash BE760029 + sample 21: + time = 2660000 + flags = 1 + data = length 24, hash 590AF28C + sample 22: + time = 2680000 + flags = 1 + data = length 24, hash AD28C48F + sample 23: + time = 2700000 + flags = 1 + data = length 24, hash 640AA61B + sample 24: + time = 2720000 + flags = 1 + data = length 24, hash ABE659B + sample 25: + time = 2740000 + flags = 1 + data = length 24, hash ED2691D2 + sample 26: + time = 2760000 + flags = 1 + data = length 24, hash D998C80E + sample 27: + time = 2780000 + flags = 1 + data = length 24, hash 8DC0DF5C + sample 28: + time = 2800000 + flags = 1 + data = length 24, hash 7692247B + sample 29: + time = 2820000 + flags = 1 + data = length 24, hash C1D1CCB9 + sample 30: + time = 2840000 + flags = 1 + data = length 24, hash 362CE78E + sample 31: + time = 2860000 + flags = 1 + data = length 24, hash 54FA84A + sample 32: + time = 2880000 + flags = 1 + data = length 24, hash 29E88C84 + sample 33: + time = 2900000 + flags = 1 + data = length 24, hash 1CD848AC + sample 34: + time = 2920000 + flags = 1 + data = length 24, hash 5C3D4A79 + sample 35: + time = 2940000 + flags = 1 + data = length 24, hash 1AA8E604 + sample 36: + time = 2960000 + flags = 1 + data = length 24, hash 186A4316 + sample 37: + time = 2980000 + flags = 1 + data = length 24, hash 61ACE481 + sample 38: + time = 3000000 + flags = 1 + data = length 24, hash D0C42780 + sample 39: + time = 3020000 + flags = 1 + data = length 24, hash FAD51BA1 + sample 40: + time = 3040000 + flags = 1 + data = length 24, hash F1A9AC71 + sample 41: + time = 3060000 + flags = 1 + data = length 24, hash 24425449 + sample 42: + time = 3080000 + flags = 1 + data = length 24, hash 37AAC3E6 + sample 43: + time = 3100000 + flags = 1 + data = length 24, hash 91F68CB4 + sample 44: + time = 3120000 + flags = 1 + data = length 24, hash F8C92820 + sample 45: + time = 3140000 + flags = 1 + data = length 24, hash ECD39C3E + sample 46: + time = 3160000 + flags = 1 + data = length 24, hash B27D8F78 + sample 47: + time = 3180000 + flags = 1 + data = length 24, hash C9EB3DFB + sample 48: + time = 3200000 + flags = 1 + data = length 24, hash 88DC54A2 + sample 49: + time = 3220000 + flags = 1 + data = length 24, hash 7FC4C5BE + sample 50: + time = 3240000 + flags = 1 + data = length 24, hash E4F684EF + sample 51: + time = 3260000 + flags = 1 + data = length 24, hash 55C08B56 + sample 52: + time = 3280000 + flags = 1 + data = length 24, hash E5A0F006 + sample 53: + time = 3300000 + flags = 1 + data = length 24, hash DE3F3AA7 + sample 54: + time = 3320000 + flags = 1 + data = length 24, hash 3F28AE7F + sample 55: + time = 3340000 + flags = 1 + data = length 24, hash 3949CAFF + sample 56: + time = 3360000 + flags = 1 + data = length 24, hash 772665A0 +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_wb_cbr.amr.3.dump b/library/core/src/test/assets/amr/sample_wb_cbr.amr.3.dump new file mode 100644 index 0000000000..1ec8c6fdb7 --- /dev/null +++ b/library/core/src/test/assets/amr/sample_wb_cbr.amr.3.dump @@ -0,0 +1,34 @@ +seekMap: + isSeekable = true + duration = 3380000 + getPosition(0) = [[timeUs=0, position=9]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/amr-wb + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 16000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 24 + sample count = 1 + sample 0: + time = 3360000 + flags = 1 + data = length 24, hash 772665A0 +tracksEnded = true diff --git a/library/core/src/test/assets/amr/sample_wb_cbr.amr.unklen.dump b/library/core/src/test/assets/amr/sample_wb_cbr.amr.unklen.dump new file mode 100644 index 0000000000..1b3b8bd0dd --- /dev/null +++ b/library/core/src/test/assets/amr/sample_wb_cbr.amr.unklen.dump @@ -0,0 +1,706 @@ +seekMap: + isSeekable = false + duration = UNSET TIME + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 1 +track 0: + format: + bitrate = -1 + id = null + containerMimeType = null + sampleMimeType = audio/amr-wb + maxInputSize = 61 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 16000 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 4056 + sample count = 169 + sample 0: + time = 0 + flags = 1 + data = length 24, hash C3025798 + sample 1: + time = 20000 + flags = 1 + data = length 24, hash 39CABAE9 + sample 2: + time = 40000 + flags = 1 + data = length 24, hash 2752F470 + sample 3: + time = 60000 + flags = 1 + data = length 24, hash 394F76F6 + sample 4: + time = 80000 + flags = 1 + data = length 24, hash FF9EEF + sample 5: + time = 100000 + flags = 1 + data = length 24, hash 54ECB1B4 + sample 6: + time = 120000 + flags = 1 + data = length 24, hash 6D7A3A5F + sample 7: + time = 140000 + flags = 1 + data = length 24, hash 684CD144 + sample 8: + time = 160000 + flags = 1 + data = length 24, hash 87B7D176 + sample 9: + time = 180000 + flags = 1 + data = length 24, hash 4C02F9A5 + sample 10: + time = 200000 + flags = 1 + data = length 24, hash B4154108 + sample 11: + time = 220000 + flags = 1 + data = length 24, hash 4448F477 + sample 12: + time = 240000 + flags = 1 + data = length 24, hash 755A4939 + sample 13: + time = 260000 + flags = 1 + data = length 24, hash 8C8BC6C3 + sample 14: + time = 280000 + flags = 1 + data = length 24, hash BC37F63F + sample 15: + time = 300000 + flags = 1 + data = length 24, hash 3352C43C + sample 16: + time = 320000 + flags = 1 + data = length 24, hash 7998E1F2 + sample 17: + time = 340000 + flags = 1 + data = length 24, hash A8ECBEFC + sample 18: + time = 360000 + flags = 1 + data = length 24, hash 944AC118 + sample 19: + time = 380000 + flags = 1 + data = length 24, hash FD2C8E1F + sample 20: + time = 400000 + flags = 1 + data = length 24, hash B3D867AF + sample 21: + time = 420000 + flags = 1 + data = length 24, hash 3DC6E592 + sample 22: + time = 440000 + flags = 1 + data = length 24, hash 32B276CD + sample 23: + time = 460000 + flags = 1 + data = length 24, hash 5488AEF3 + sample 24: + time = 480000 + flags = 1 + data = length 24, hash 7A4D516 + sample 25: + time = 500000 + flags = 1 + data = length 24, hash 570AE83F + sample 26: + time = 520000 + flags = 1 + data = length 24, hash E5CB3477 + sample 27: + time = 540000 + flags = 1 + data = length 24, hash E04C00E4 + sample 28: + time = 560000 + flags = 1 + data = length 24, hash 21B7C97 + sample 29: + time = 580000 + flags = 1 + data = length 24, hash 1633F470 + sample 30: + time = 600000 + flags = 1 + data = length 24, hash 28D65CA6 + sample 31: + time = 620000 + flags = 1 + data = length 24, hash CC6A675C + sample 32: + time = 640000 + flags = 1 + data = length 24, hash 4C91080A + sample 33: + time = 660000 + flags = 1 + data = length 24, hash F6482FB5 + sample 34: + time = 680000 + flags = 1 + data = length 24, hash 2C76F48C + sample 35: + time = 700000 + flags = 1 + data = length 24, hash 6E3B0D72 + sample 36: + time = 720000 + flags = 1 + data = length 24, hash 799AA003 + sample 37: + time = 740000 + flags = 1 + data = length 24, hash DFC0BA81 + sample 38: + time = 760000 + flags = 1 + data = length 24, hash CBDF3826 + sample 39: + time = 780000 + flags = 1 + data = length 24, hash 16862B75 + sample 40: + time = 800000 + flags = 1 + data = length 24, hash 865A828E + sample 41: + time = 820000 + flags = 1 + data = length 24, hash 336BBDC9 + sample 42: + time = 840000 + flags = 1 + data = length 24, hash 6CFC6C34 + sample 43: + time = 860000 + flags = 1 + data = length 24, hash 32C8CD46 + sample 44: + time = 880000 + flags = 1 + data = length 24, hash 9FE11C4C + sample 45: + time = 900000 + flags = 1 + data = length 24, hash AA5A12B7 + sample 46: + time = 920000 + flags = 1 + data = length 24, hash AA0F4A4D + sample 47: + time = 940000 + flags = 1 + data = length 24, hash 34415484 + sample 48: + time = 960000 + flags = 1 + data = length 24, hash 5018928E + sample 49: + time = 980000 + flags = 1 + data = length 24, hash 4A04D162 + sample 50: + time = 1000000 + flags = 1 + data = length 24, hash 4C70F9F0 + sample 51: + time = 1020000 + flags = 1 + data = length 24, hash 99EF3168 + sample 52: + time = 1040000 + flags = 1 + data = length 24, hash C600DAF + sample 53: + time = 1060000 + flags = 1 + data = length 24, hash FDBB192E + sample 54: + time = 1080000 + flags = 1 + data = length 24, hash 99096A48 + sample 55: + time = 1100000 + flags = 1 + data = length 24, hash D793F88B + sample 56: + time = 1120000 + flags = 1 + data = length 24, hash EEB921BD + sample 57: + time = 1140000 + flags = 1 + data = length 24, hash 8B941A4C + sample 58: + time = 1160000 + flags = 1 + data = length 24, hash ED5F5FEE + sample 59: + time = 1180000 + flags = 1 + data = length 24, hash A588E0BB + sample 60: + time = 1200000 + flags = 1 + data = length 24, hash 588CBC01 + sample 61: + time = 1220000 + flags = 1 + data = length 24, hash DE22266C + sample 62: + time = 1240000 + flags = 1 + data = length 24, hash 921B6E5C + sample 63: + time = 1260000 + flags = 1 + data = length 24, hash EC11F041 + sample 64: + time = 1280000 + flags = 1 + data = length 24, hash 5BA9E0A3 + sample 65: + time = 1300000 + flags = 1 + data = length 24, hash DB6D52F3 + sample 66: + time = 1320000 + flags = 1 + data = length 24, hash 8EEBE525 + sample 67: + time = 1340000 + flags = 1 + data = length 24, hash 47A742AE + sample 68: + time = 1360000 + flags = 1 + data = length 24, hash E93F1E03 + sample 69: + time = 1380000 + flags = 1 + data = length 24, hash 3251F57C + sample 70: + time = 1400000 + flags = 1 + data = length 24, hash 3EDBBBDD + sample 71: + time = 1420000 + flags = 1 + data = length 24, hash 2E98465A + sample 72: + time = 1440000 + flags = 1 + data = length 24, hash A09EA52E + sample 73: + time = 1460000 + flags = 1 + data = length 24, hash A2A86FA6 + sample 74: + time = 1480000 + flags = 1 + data = length 24, hash 71DCD51C + sample 75: + time = 1500000 + flags = 1 + data = length 24, hash 2B02DEE1 + sample 76: + time = 1520000 + flags = 1 + data = length 24, hash 7A725192 + sample 77: + time = 1540000 + flags = 1 + data = length 24, hash 929AD483 + sample 78: + time = 1560000 + flags = 1 + data = length 24, hash 68440BF5 + sample 79: + time = 1580000 + flags = 1 + data = length 24, hash 5BD41AD6 + sample 80: + time = 1600000 + flags = 1 + data = length 24, hash 91A381 + sample 81: + time = 1620000 + flags = 1 + data = length 24, hash 8010C408 + sample 82: + time = 1640000 + flags = 1 + data = length 24, hash 482274BE + sample 83: + time = 1660000 + flags = 1 + data = length 24, hash D7DB8BCC + sample 84: + time = 1680000 + flags = 1 + data = length 24, hash 680BD9DD + sample 85: + time = 1700000 + flags = 1 + data = length 24, hash E313577C + sample 86: + time = 1720000 + flags = 1 + data = length 24, hash 9C10B0CD + sample 87: + time = 1740000 + flags = 1 + data = length 24, hash 2D90AC02 + sample 88: + time = 1760000 + flags = 1 + data = length 24, hash 64E8C245 + sample 89: + time = 1780000 + flags = 1 + data = length 24, hash 3954AC1B + sample 90: + time = 1800000 + flags = 1 + data = length 24, hash ACB8999F + sample 91: + time = 1820000 + flags = 1 + data = length 24, hash 43AE3957 + sample 92: + time = 1840000 + flags = 1 + data = length 24, hash 3C664DB7 + sample 93: + time = 1860000 + flags = 1 + data = length 24, hash 9354B576 + sample 94: + time = 1880000 + flags = 1 + data = length 24, hash B5B9C14E + sample 95: + time = 1900000 + flags = 1 + data = length 24, hash 7DA9C98F + sample 96: + time = 1920000 + flags = 1 + data = length 24, hash EFEE54C6 + sample 97: + time = 1940000 + flags = 1 + data = length 24, hash 79DC8CBD + sample 98: + time = 1960000 + flags = 1 + data = length 24, hash A71A475C + sample 99: + time = 1980000 + flags = 1 + data = length 24, hash CA1CBB94 + sample 100: + time = 2000000 + flags = 1 + data = length 24, hash 91922226 + sample 101: + time = 2020000 + flags = 1 + data = length 24, hash C90278BC + sample 102: + time = 2040000 + flags = 1 + data = length 24, hash BD51986F + sample 103: + time = 2060000 + flags = 1 + data = length 24, hash 90AEF368 + sample 104: + time = 2080000 + flags = 1 + data = length 24, hash 1D83C955 + sample 105: + time = 2100000 + flags = 1 + data = length 24, hash 8FA9A915 + sample 106: + time = 2120000 + flags = 1 + data = length 24, hash C6C753E0 + sample 107: + time = 2140000 + flags = 1 + data = length 24, hash 85FA27A7 + sample 108: + time = 2160000 + flags = 1 + data = length 24, hash A0277324 + sample 109: + time = 2180000 + flags = 1 + data = length 24, hash B7696535 + sample 110: + time = 2200000 + flags = 1 + data = length 24, hash D69D668C + sample 111: + time = 2220000 + flags = 1 + data = length 24, hash 34C057CD + sample 112: + time = 2240000 + flags = 1 + data = length 24, hash 4EC5E974 + sample 113: + time = 2260000 + flags = 1 + data = length 24, hash 1C1CD40D + sample 114: + time = 2280000 + flags = 1 + data = length 24, hash 76CC54BC + sample 115: + time = 2300000 + flags = 1 + data = length 24, hash D497ACF5 + sample 116: + time = 2320000 + flags = 1 + data = length 24, hash A1386080 + sample 117: + time = 2340000 + flags = 1 + data = length 24, hash 7ED36954 + sample 118: + time = 2360000 + flags = 1 + data = length 24, hash C11A3BF9 + sample 119: + time = 2380000 + flags = 1 + data = length 24, hash 8FB69488 + sample 120: + time = 2400000 + flags = 1 + data = length 24, hash C6225F59 + sample 121: + time = 2420000 + flags = 1 + data = length 24, hash 122AB6D2 + sample 122: + time = 2440000 + flags = 1 + data = length 24, hash 1E195E7D + sample 123: + time = 2460000 + flags = 1 + data = length 24, hash BD3DF418 + sample 124: + time = 2480000 + flags = 1 + data = length 24, hash D8AE4A5 + sample 125: + time = 2500000 + flags = 1 + data = length 24, hash 977BD182 + sample 126: + time = 2520000 + flags = 1 + data = length 24, hash F361F060 + sample 127: + time = 2540000 + flags = 1 + data = length 24, hash 11EC8CD0 + sample 128: + time = 2560000 + flags = 1 + data = length 24, hash 3798F3D2 + sample 129: + time = 2580000 + flags = 1 + data = length 24, hash B2C2517C + sample 130: + time = 2600000 + flags = 1 + data = length 24, hash FBE0D0D8 + sample 131: + time = 2620000 + flags = 1 + data = length 24, hash 7033172F + sample 132: + time = 2640000 + flags = 1 + data = length 24, hash BE760029 + sample 133: + time = 2660000 + flags = 1 + data = length 24, hash 590AF28C + sample 134: + time = 2680000 + flags = 1 + data = length 24, hash AD28C48F + sample 135: + time = 2700000 + flags = 1 + data = length 24, hash 640AA61B + sample 136: + time = 2720000 + flags = 1 + data = length 24, hash ABE659B + sample 137: + time = 2740000 + flags = 1 + data = length 24, hash ED2691D2 + sample 138: + time = 2760000 + flags = 1 + data = length 24, hash D998C80E + sample 139: + time = 2780000 + flags = 1 + data = length 24, hash 8DC0DF5C + sample 140: + time = 2800000 + flags = 1 + data = length 24, hash 7692247B + sample 141: + time = 2820000 + flags = 1 + data = length 24, hash C1D1CCB9 + sample 142: + time = 2840000 + flags = 1 + data = length 24, hash 362CE78E + sample 143: + time = 2860000 + flags = 1 + data = length 24, hash 54FA84A + sample 144: + time = 2880000 + flags = 1 + data = length 24, hash 29E88C84 + sample 145: + time = 2900000 + flags = 1 + data = length 24, hash 1CD848AC + sample 146: + time = 2920000 + flags = 1 + data = length 24, hash 5C3D4A79 + sample 147: + time = 2940000 + flags = 1 + data = length 24, hash 1AA8E604 + sample 148: + time = 2960000 + flags = 1 + data = length 24, hash 186A4316 + sample 149: + time = 2980000 + flags = 1 + data = length 24, hash 61ACE481 + sample 150: + time = 3000000 + flags = 1 + data = length 24, hash D0C42780 + sample 151: + time = 3020000 + flags = 1 + data = length 24, hash FAD51BA1 + sample 152: + time = 3040000 + flags = 1 + data = length 24, hash F1A9AC71 + sample 153: + time = 3060000 + flags = 1 + data = length 24, hash 24425449 + sample 154: + time = 3080000 + flags = 1 + data = length 24, hash 37AAC3E6 + sample 155: + time = 3100000 + flags = 1 + data = length 24, hash 91F68CB4 + sample 156: + time = 3120000 + flags = 1 + data = length 24, hash F8C92820 + sample 157: + time = 3140000 + flags = 1 + data = length 24, hash ECD39C3E + sample 158: + time = 3160000 + flags = 1 + data = length 24, hash B27D8F78 + sample 159: + time = 3180000 + flags = 1 + data = length 24, hash C9EB3DFB + sample 160: + time = 3200000 + flags = 1 + data = length 24, hash 88DC54A2 + sample 161: + time = 3220000 + flags = 1 + data = length 24, hash 7FC4C5BE + sample 162: + time = 3240000 + flags = 1 + data = length 24, hash E4F684EF + sample 163: + time = 3260000 + flags = 1 + data = length 24, hash 55C08B56 + sample 164: + time = 3280000 + flags = 1 + data = length 24, hash E5A0F006 + sample 165: + time = 3300000 + flags = 1 + data = length 24, hash DE3F3AA7 + sample 166: + time = 3320000 + flags = 1 + data = length 24, hash 3F28AE7F + sample 167: + time = 3340000 + flags = 1 + data = length 24, hash 3949CAFF + sample 168: + time = 3360000 + flags = 1 + data = length 24, hash 772665A0 +tracksEnded = true diff --git a/library/core/src/test/assets/ts/sample_cbs.adts b/library/core/src/test/assets/ts/sample_cbs.adts new file mode 100644 index 0000000000..abbaad0daf Binary files /dev/null and b/library/core/src/test/assets/ts/sample_cbs.adts differ diff --git a/library/core/src/test/assets/ts/sample_cbs.adts.0.dump b/library/core/src/test/assets/ts/sample_cbs.adts.0.dump new file mode 100644 index 0000000000..e535aa8cd7 --- /dev/null +++ b/library/core/src/test/assets/ts/sample_cbs.adts.0.dump @@ -0,0 +1,631 @@ +seekMap: + isSeekable = true + duration = 3356772 + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 2 +track 0: + format: + bitrate = -1 + id = 0 + containerMimeType = null + sampleMimeType = audio/mp4a-latm + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 44100 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + data = length 2, hash 5F7 + total output bytes = 30797 + sample count = 144 + sample 0: + time = 0 + flags = 1 + data = length 23, hash 47DE9131 + sample 1: + time = 23219 + flags = 1 + data = length 6, hash 31CF3A46 + sample 2: + time = 46438 + flags = 1 + data = length 6, hash 31CF3A46 + sample 3: + time = 69657 + flags = 1 + data = length 6, hash 31CF3A46 + sample 4: + time = 92876 + flags = 1 + data = length 6, hash 31EC5206 + sample 5: + time = 116095 + flags = 1 + data = length 171, hash 4F6478F6 + sample 6: + time = 139314 + flags = 1 + data = length 202, hash AF4068A3 + sample 7: + time = 162533 + flags = 1 + data = length 210, hash E4C10618 + sample 8: + time = 185752 + flags = 1 + data = length 217, hash 9ECCD0D9 + sample 9: + time = 208971 + flags = 1 + data = length 212, hash 6BAC2CD9 + sample 10: + time = 232190 + flags = 1 + data = length 223, hash 188B6010 + sample 11: + time = 255409 + flags = 1 + data = length 222, hash C1A04D0C + sample 12: + time = 278628 + flags = 1 + data = length 220, hash D65F9768 + sample 13: + time = 301847 + flags = 1 + data = length 227, hash B96C9E14 + sample 14: + time = 325066 + flags = 1 + data = length 229, hash 9FB09972 + sample 15: + time = 348285 + flags = 1 + data = length 220, hash 2271F053 + sample 16: + time = 371504 + flags = 1 + data = length 226, hash 5EDD2F4F + sample 17: + time = 394723 + flags = 1 + data = length 239, hash 957510E0 + sample 18: + time = 417942 + flags = 1 + data = length 224, hash 718A8F47 + sample 19: + time = 441161 + flags = 1 + data = length 225, hash 5E11E293 + sample 20: + time = 464380 + flags = 1 + data = length 227, hash FCE50D27 + sample 21: + time = 487599 + flags = 1 + data = length 212, hash 77908C40 + sample 22: + time = 510818 + flags = 1 + data = length 227, hash 34C4EB32 + sample 23: + time = 534037 + flags = 1 + data = length 231, hash 95488307 + sample 24: + time = 557256 + flags = 1 + data = length 226, hash 97F12D6F + sample 25: + time = 580475 + flags = 1 + data = length 236, hash 91A9D9A2 + sample 26: + time = 603694 + flags = 1 + data = length 227, hash 27A608F9 + sample 27: + time = 626913 + flags = 1 + data = length 229, hash 57DAAE4 + sample 28: + time = 650132 + flags = 1 + data = length 235, hash ED30AC34 + sample 29: + time = 673351 + flags = 1 + data = length 227, hash BD3D6280 + sample 30: + time = 696570 + flags = 1 + data = length 233, hash 694B1087 + sample 31: + time = 719789 + flags = 1 + data = length 232, hash 1EDFE047 + sample 32: + time = 743008 + flags = 1 + data = length 228, hash E2A831F4 + sample 33: + time = 766227 + flags = 1 + data = length 231, hash 757E6012 + sample 34: + time = 789446 + flags = 1 + data = length 223, hash 4003D791 + sample 35: + time = 812665 + flags = 1 + data = length 232, hash 3CF9A07C + sample 36: + time = 835884 + flags = 1 + data = length 228, hash 25AC3FF7 + sample 37: + time = 859103 + flags = 1 + data = length 220, hash 2C1824CE + sample 38: + time = 882322 + flags = 1 + data = length 229, hash 46FDD8FB + sample 39: + time = 905541 + flags = 1 + data = length 237, hash F6988018 + sample 40: + time = 928760 + flags = 1 + data = length 242, hash 60436B6B + sample 41: + time = 951979 + flags = 1 + data = length 275, hash 90EDFA8E + sample 42: + time = 975198 + flags = 1 + data = length 242, hash 5C86EFCB + sample 43: + time = 998417 + flags = 1 + data = length 233, hash E0A51B82 + sample 44: + time = 1021636 + flags = 1 + data = length 235, hash 590DF14F + sample 45: + time = 1044855 + flags = 1 + data = length 238, hash 69AF4E6E + sample 46: + time = 1068074 + flags = 1 + data = length 235, hash E745AE8D + sample 47: + time = 1091293 + flags = 1 + data = length 223, hash 295F2A13 + sample 48: + time = 1114512 + flags = 1 + data = length 228, hash E2F47B21 + sample 49: + time = 1137731 + flags = 1 + data = length 229, hash 262C3CFE + sample 50: + time = 1160950 + flags = 1 + data = length 232, hash 4B5BF5E8 + sample 51: + time = 1184169 + flags = 1 + data = length 233, hash F3D80836 + sample 52: + time = 1207388 + flags = 1 + data = length 237, hash 32E0A11E + sample 53: + time = 1230607 + flags = 1 + data = length 228, hash E1B89F13 + sample 54: + time = 1253826 + flags = 1 + data = length 237, hash 8BDD9E38 + sample 55: + time = 1277045 + flags = 1 + data = length 235, hash 3C84161F + sample 56: + time = 1300264 + flags = 1 + data = length 227, hash A47E1789 + sample 57: + time = 1323483 + flags = 1 + data = length 228, hash 869FDFD3 + sample 58: + time = 1346702 + flags = 1 + data = length 233, hash 272ECE2 + sample 59: + time = 1369921 + flags = 1 + data = length 227, hash DB6B9618 + sample 60: + time = 1393140 + flags = 1 + data = length 212, hash 63214325 + sample 61: + time = 1416359 + flags = 1 + data = length 221, hash 9BA588A1 + sample 62: + time = 1439578 + flags = 1 + data = length 225, hash 21EFD50C + sample 63: + time = 1462797 + flags = 1 + data = length 231, hash F3AD0BF + sample 64: + time = 1486016 + flags = 1 + data = length 224, hash 822C9210 + sample 65: + time = 1509235 + flags = 1 + data = length 195, hash D4EF53EE + sample 66: + time = 1532454 + flags = 1 + data = length 195, hash A816647A + sample 67: + time = 1555673 + flags = 1 + data = length 184, hash 9A2B7E6 + sample 68: + time = 1578892 + flags = 1 + data = length 210, hash 956E3600 + sample 69: + time = 1602111 + flags = 1 + data = length 234, hash 35CFDA0A + sample 70: + time = 1625330 + flags = 1 + data = length 239, hash 9E15AC1E + sample 71: + time = 1648549 + flags = 1 + data = length 228, hash F3B70641 + sample 72: + time = 1671768 + flags = 1 + data = length 237, hash 124E3194 + sample 73: + time = 1694987 + flags = 1 + data = length 231, hash 950CD7C8 + sample 74: + time = 1718206 + flags = 1 + data = length 236, hash A12E49AF + sample 75: + time = 1741425 + flags = 1 + data = length 242, hash 43BC9C24 + sample 76: + time = 1764644 + flags = 1 + data = length 241, hash DCF0B17 + sample 77: + time = 1787863 + flags = 1 + data = length 251, hash C0B99968 + sample 78: + time = 1811082 + flags = 1 + data = length 245, hash 9B38ED1C + sample 79: + time = 1834301 + flags = 1 + data = length 238, hash 1BA69079 + sample 80: + time = 1857520 + flags = 1 + data = length 233, hash 44C8C6BF + sample 81: + time = 1880739 + flags = 1 + data = length 231, hash EABBEE02 + sample 82: + time = 1903958 + flags = 1 + data = length 226, hash D09C44FB + sample 83: + time = 1927177 + flags = 1 + data = length 235, hash BE6A6608 + sample 84: + time = 1950396 + flags = 1 + data = length 235, hash 2735F454 + sample 85: + time = 1973615 + flags = 1 + data = length 238, hash B160DFE7 + sample 86: + time = 1996834 + flags = 1 + data = length 232, hash 1B217D2E + sample 87: + time = 2020053 + flags = 1 + data = length 251, hash D1C14CEA + sample 88: + time = 2043272 + flags = 1 + data = length 256, hash 97C87F08 + sample 89: + time = 2066491 + flags = 1 + data = length 237, hash 6645DB3 + sample 90: + time = 2089710 + flags = 1 + data = length 235, hash 727A1C82 + sample 91: + time = 2112929 + flags = 1 + data = length 234, hash 5015F8B5 + sample 92: + time = 2136148 + flags = 1 + data = length 241, hash 9102144B + sample 93: + time = 2159367 + flags = 1 + data = length 224, hash 64E0D807 + sample 94: + time = 2182586 + flags = 1 + data = length 228, hash 1922B852 + sample 95: + time = 2205805 + flags = 1 + data = length 224, hash 953502D8 + sample 96: + time = 2229024 + flags = 1 + data = length 214, hash 92B87FE7 + sample 97: + time = 2252243 + flags = 1 + data = length 213, hash BB0C8D86 + sample 98: + time = 2275462 + flags = 1 + data = length 206, hash 9AD21017 + sample 99: + time = 2298681 + flags = 1 + data = length 209, hash C479FE94 + sample 100: + time = 2321900 + flags = 1 + data = length 220, hash 3033DCE1 + sample 101: + time = 2345119 + flags = 1 + data = length 217, hash 7D589C94 + sample 102: + time = 2368338 + flags = 1 + data = length 216, hash AAF6C183 + sample 103: + time = 2391557 + flags = 1 + data = length 206, hash 1EE1207F + sample 104: + time = 2414776 + flags = 1 + data = length 204, hash 4BEB1210 + sample 105: + time = 2437995 + flags = 1 + data = length 213, hash 21A841C9 + sample 106: + time = 2461214 + flags = 1 + data = length 207, hash B80B0424 + sample 107: + time = 2484433 + flags = 1 + data = length 212, hash 4785A1C3 + sample 108: + time = 2507652 + flags = 1 + data = length 205, hash 59BF7229 + sample 109: + time = 2530871 + flags = 1 + data = length 208, hash FA313DDE + sample 110: + time = 2554090 + flags = 1 + data = length 211, hash 190D85FD + sample 111: + time = 2577309 + flags = 1 + data = length 211, hash BA050052 + sample 112: + time = 2600528 + flags = 1 + data = length 211, hash F3080F10 + sample 113: + time = 2623747 + flags = 1 + data = length 210, hash F41B7BE7 + sample 114: + time = 2646966 + flags = 1 + data = length 207, hash 2176C97E + sample 115: + time = 2670185 + flags = 1 + data = length 220, hash 32087455 + sample 116: + time = 2693404 + flags = 1 + data = length 213, hash 4E5649A8 + sample 117: + time = 2716623 + flags = 1 + data = length 213, hash 5F12FDCF + sample 118: + time = 2739842 + flags = 1 + data = length 204, hash 1E895C2A + sample 119: + time = 2763061 + flags = 1 + data = length 219, hash 45382270 + sample 120: + time = 2786280 + flags = 1 + data = length 205, hash D66C6A1D + sample 121: + time = 2809499 + flags = 1 + data = length 204, hash 467AD01F + sample 122: + time = 2832718 + flags = 1 + data = length 211, hash F0435574 + sample 123: + time = 2855937 + flags = 1 + data = length 206, hash 8C96B75F + sample 124: + time = 2879156 + flags = 1 + data = length 200, hash 82553248 + sample 125: + time = 2902375 + flags = 1 + data = length 180, hash 1E51E6CE + sample 126: + time = 2925594 + flags = 1 + data = length 196, hash 33151DC4 + sample 127: + time = 2948813 + flags = 1 + data = length 197, hash 1E62A7D6 + sample 128: + time = 2972032 + flags = 1 + data = length 206, hash 6A6C4CC9 + sample 129: + time = 2995251 + flags = 1 + data = length 209, hash A72FABAA + sample 130: + time = 3018470 + flags = 1 + data = length 217, hash BA33B985 + sample 131: + time = 3041689 + flags = 1 + data = length 235, hash 9919CFD9 + sample 132: + time = 3064908 + flags = 1 + data = length 236, hash A22C7267 + sample 133: + time = 3088127 + flags = 1 + data = length 213, hash 3D57C901 + sample 134: + time = 3111346 + flags = 1 + data = length 205, hash 47F68FDE + sample 135: + time = 3134565 + flags = 1 + data = length 210, hash 9A756E9C + sample 136: + time = 3157784 + flags = 1 + data = length 210, hash BD45C31F + sample 137: + time = 3181003 + flags = 1 + data = length 207, hash 8774FF7B + sample 138: + time = 3204222 + flags = 1 + data = length 149, hash 4678C0E5 + sample 139: + time = 3227441 + flags = 1 + data = length 161, hash E991035D + sample 140: + time = 3250660 + flags = 1 + data = length 197, hash C3013689 + sample 141: + time = 3273879 + flags = 1 + data = length 208, hash E6C0237 + sample 142: + time = 3297098 + flags = 1 + data = length 232, hash A330F188 + sample 143: + time = 3320317 + flags = 1 + data = length 174, hash 2B69C34E +track 1: + format: + bitrate = -1 + id = 1 + containerMimeType = null + sampleMimeType = application/id3 + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = -1 + sampleRate = -1 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 0 + sample count = 0 +tracksEnded = true diff --git a/library/core/src/test/assets/ts/sample_cbs.adts.1.dump b/library/core/src/test/assets/ts/sample_cbs.adts.1.dump new file mode 100644 index 0000000000..96d2fcfb39 --- /dev/null +++ b/library/core/src/test/assets/ts/sample_cbs.adts.1.dump @@ -0,0 +1,431 @@ +seekMap: + isSeekable = true + duration = 3356772 + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 2 +track 0: + format: + bitrate = -1 + id = 0 + containerMimeType = null + sampleMimeType = audio/mp4a-latm + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 44100 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + data = length 2, hash 5F7 + total output bytes = 20533 + sample count = 94 + sample 0: + time = 1118924 + flags = 1 + data = length 232, hash 4B5BF5E8 + sample 1: + time = 1142143 + flags = 1 + data = length 233, hash F3D80836 + sample 2: + time = 1165362 + flags = 1 + data = length 237, hash 32E0A11E + sample 3: + time = 1188581 + flags = 1 + data = length 228, hash E1B89F13 + sample 4: + time = 1211800 + flags = 1 + data = length 237, hash 8BDD9E38 + sample 5: + time = 1235019 + flags = 1 + data = length 235, hash 3C84161F + sample 6: + time = 1258238 + flags = 1 + data = length 227, hash A47E1789 + sample 7: + time = 1281457 + flags = 1 + data = length 228, hash 869FDFD3 + sample 8: + time = 1304676 + flags = 1 + data = length 233, hash 272ECE2 + sample 9: + time = 1327895 + flags = 1 + data = length 227, hash DB6B9618 + sample 10: + time = 1351114 + flags = 1 + data = length 212, hash 63214325 + sample 11: + time = 1374333 + flags = 1 + data = length 221, hash 9BA588A1 + sample 12: + time = 1397552 + flags = 1 + data = length 225, hash 21EFD50C + sample 13: + time = 1420771 + flags = 1 + data = length 231, hash F3AD0BF + sample 14: + time = 1443990 + flags = 1 + data = length 224, hash 822C9210 + sample 15: + time = 1467209 + flags = 1 + data = length 195, hash D4EF53EE + sample 16: + time = 1490428 + flags = 1 + data = length 195, hash A816647A + sample 17: + time = 1513647 + flags = 1 + data = length 184, hash 9A2B7E6 + sample 18: + time = 1536866 + flags = 1 + data = length 210, hash 956E3600 + sample 19: + time = 1560085 + flags = 1 + data = length 234, hash 35CFDA0A + sample 20: + time = 1583304 + flags = 1 + data = length 239, hash 9E15AC1E + sample 21: + time = 1606523 + flags = 1 + data = length 228, hash F3B70641 + sample 22: + time = 1629742 + flags = 1 + data = length 237, hash 124E3194 + sample 23: + time = 1652961 + flags = 1 + data = length 231, hash 950CD7C8 + sample 24: + time = 1676180 + flags = 1 + data = length 236, hash A12E49AF + sample 25: + time = 1699399 + flags = 1 + data = length 242, hash 43BC9C24 + sample 26: + time = 1722618 + flags = 1 + data = length 241, hash DCF0B17 + sample 27: + time = 1745837 + flags = 1 + data = length 251, hash C0B99968 + sample 28: + time = 1769056 + flags = 1 + data = length 245, hash 9B38ED1C + sample 29: + time = 1792275 + flags = 1 + data = length 238, hash 1BA69079 + sample 30: + time = 1815494 + flags = 1 + data = length 233, hash 44C8C6BF + sample 31: + time = 1838713 + flags = 1 + data = length 231, hash EABBEE02 + sample 32: + time = 1861932 + flags = 1 + data = length 226, hash D09C44FB + sample 33: + time = 1885151 + flags = 1 + data = length 235, hash BE6A6608 + sample 34: + time = 1908370 + flags = 1 + data = length 235, hash 2735F454 + sample 35: + time = 1931589 + flags = 1 + data = length 238, hash B160DFE7 + sample 36: + time = 1954808 + flags = 1 + data = length 232, hash 1B217D2E + sample 37: + time = 1978027 + flags = 1 + data = length 251, hash D1C14CEA + sample 38: + time = 2001246 + flags = 1 + data = length 256, hash 97C87F08 + sample 39: + time = 2024465 + flags = 1 + data = length 237, hash 6645DB3 + sample 40: + time = 2047684 + flags = 1 + data = length 235, hash 727A1C82 + sample 41: + time = 2070903 + flags = 1 + data = length 234, hash 5015F8B5 + sample 42: + time = 2094122 + flags = 1 + data = length 241, hash 9102144B + sample 43: + time = 2117341 + flags = 1 + data = length 224, hash 64E0D807 + sample 44: + time = 2140560 + flags = 1 + data = length 228, hash 1922B852 + sample 45: + time = 2163779 + flags = 1 + data = length 224, hash 953502D8 + sample 46: + time = 2186998 + flags = 1 + data = length 214, hash 92B87FE7 + sample 47: + time = 2210217 + flags = 1 + data = length 213, hash BB0C8D86 + sample 48: + time = 2233436 + flags = 1 + data = length 206, hash 9AD21017 + sample 49: + time = 2256655 + flags = 1 + data = length 209, hash C479FE94 + sample 50: + time = 2279874 + flags = 1 + data = length 220, hash 3033DCE1 + sample 51: + time = 2303093 + flags = 1 + data = length 217, hash 7D589C94 + sample 52: + time = 2326312 + flags = 1 + data = length 216, hash AAF6C183 + sample 53: + time = 2349531 + flags = 1 + data = length 206, hash 1EE1207F + sample 54: + time = 2372750 + flags = 1 + data = length 204, hash 4BEB1210 + sample 55: + time = 2395969 + flags = 1 + data = length 213, hash 21A841C9 + sample 56: + time = 2419188 + flags = 1 + data = length 207, hash B80B0424 + sample 57: + time = 2442407 + flags = 1 + data = length 212, hash 4785A1C3 + sample 58: + time = 2465626 + flags = 1 + data = length 205, hash 59BF7229 + sample 59: + time = 2488845 + flags = 1 + data = length 208, hash FA313DDE + sample 60: + time = 2512064 + flags = 1 + data = length 211, hash 190D85FD + sample 61: + time = 2535283 + flags = 1 + data = length 211, hash BA050052 + sample 62: + time = 2558502 + flags = 1 + data = length 211, hash F3080F10 + sample 63: + time = 2581721 + flags = 1 + data = length 210, hash F41B7BE7 + sample 64: + time = 2604940 + flags = 1 + data = length 207, hash 2176C97E + sample 65: + time = 2628159 + flags = 1 + data = length 220, hash 32087455 + sample 66: + time = 2651378 + flags = 1 + data = length 213, hash 4E5649A8 + sample 67: + time = 2674597 + flags = 1 + data = length 213, hash 5F12FDCF + sample 68: + time = 2697816 + flags = 1 + data = length 204, hash 1E895C2A + sample 69: + time = 2721035 + flags = 1 + data = length 219, hash 45382270 + sample 70: + time = 2744254 + flags = 1 + data = length 205, hash D66C6A1D + sample 71: + time = 2767473 + flags = 1 + data = length 204, hash 467AD01F + sample 72: + time = 2790692 + flags = 1 + data = length 211, hash F0435574 + sample 73: + time = 2813911 + flags = 1 + data = length 206, hash 8C96B75F + sample 74: + time = 2837130 + flags = 1 + data = length 200, hash 82553248 + sample 75: + time = 2860349 + flags = 1 + data = length 180, hash 1E51E6CE + sample 76: + time = 2883568 + flags = 1 + data = length 196, hash 33151DC4 + sample 77: + time = 2906787 + flags = 1 + data = length 197, hash 1E62A7D6 + sample 78: + time = 2930006 + flags = 1 + data = length 206, hash 6A6C4CC9 + sample 79: + time = 2953225 + flags = 1 + data = length 209, hash A72FABAA + sample 80: + time = 2976444 + flags = 1 + data = length 217, hash BA33B985 + sample 81: + time = 2999663 + flags = 1 + data = length 235, hash 9919CFD9 + sample 82: + time = 3022882 + flags = 1 + data = length 236, hash A22C7267 + sample 83: + time = 3046101 + flags = 1 + data = length 213, hash 3D57C901 + sample 84: + time = 3069320 + flags = 1 + data = length 205, hash 47F68FDE + sample 85: + time = 3092539 + flags = 1 + data = length 210, hash 9A756E9C + sample 86: + time = 3115758 + flags = 1 + data = length 210, hash BD45C31F + sample 87: + time = 3138977 + flags = 1 + data = length 207, hash 8774FF7B + sample 88: + time = 3162196 + flags = 1 + data = length 149, hash 4678C0E5 + sample 89: + time = 3185415 + flags = 1 + data = length 161, hash E991035D + sample 90: + time = 3208634 + flags = 1 + data = length 197, hash C3013689 + sample 91: + time = 3231853 + flags = 1 + data = length 208, hash E6C0237 + sample 92: + time = 3255072 + flags = 1 + data = length 232, hash A330F188 + sample 93: + time = 3278291 + flags = 1 + data = length 174, hash 2B69C34E +track 1: + format: + bitrate = -1 + id = 1 + containerMimeType = null + sampleMimeType = application/id3 + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = -1 + sampleRate = -1 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 0 + sample count = 0 +tracksEnded = true diff --git a/library/core/src/test/assets/ts/sample_cbs.adts.2.dump b/library/core/src/test/assets/ts/sample_cbs.adts.2.dump new file mode 100644 index 0000000000..2e581bca28 --- /dev/null +++ b/library/core/src/test/assets/ts/sample_cbs.adts.2.dump @@ -0,0 +1,251 @@ +seekMap: + isSeekable = true + duration = 3356772 + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 2 +track 0: + format: + bitrate = -1 + id = 0 + containerMimeType = null + sampleMimeType = audio/mp4a-latm + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 44100 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + data = length 2, hash 5F7 + total output bytes = 10161 + sample count = 49 + sample 0: + time = 2237848 + flags = 1 + data = length 224, hash 953502D8 + sample 1: + time = 2261067 + flags = 1 + data = length 214, hash 92B87FE7 + sample 2: + time = 2284286 + flags = 1 + data = length 213, hash BB0C8D86 + sample 3: + time = 2307505 + flags = 1 + data = length 206, hash 9AD21017 + sample 4: + time = 2330724 + flags = 1 + data = length 209, hash C479FE94 + sample 5: + time = 2353943 + flags = 1 + data = length 220, hash 3033DCE1 + sample 6: + time = 2377162 + flags = 1 + data = length 217, hash 7D589C94 + sample 7: + time = 2400381 + flags = 1 + data = length 216, hash AAF6C183 + sample 8: + time = 2423600 + flags = 1 + data = length 206, hash 1EE1207F + sample 9: + time = 2446819 + flags = 1 + data = length 204, hash 4BEB1210 + sample 10: + time = 2470038 + flags = 1 + data = length 213, hash 21A841C9 + sample 11: + time = 2493257 + flags = 1 + data = length 207, hash B80B0424 + sample 12: + time = 2516476 + flags = 1 + data = length 212, hash 4785A1C3 + sample 13: + time = 2539695 + flags = 1 + data = length 205, hash 59BF7229 + sample 14: + time = 2562914 + flags = 1 + data = length 208, hash FA313DDE + sample 15: + time = 2586133 + flags = 1 + data = length 211, hash 190D85FD + sample 16: + time = 2609352 + flags = 1 + data = length 211, hash BA050052 + sample 17: + time = 2632571 + flags = 1 + data = length 211, hash F3080F10 + sample 18: + time = 2655790 + flags = 1 + data = length 210, hash F41B7BE7 + sample 19: + time = 2679009 + flags = 1 + data = length 207, hash 2176C97E + sample 20: + time = 2702228 + flags = 1 + data = length 220, hash 32087455 + sample 21: + time = 2725447 + flags = 1 + data = length 213, hash 4E5649A8 + sample 22: + time = 2748666 + flags = 1 + data = length 213, hash 5F12FDCF + sample 23: + time = 2771885 + flags = 1 + data = length 204, hash 1E895C2A + sample 24: + time = 2795104 + flags = 1 + data = length 219, hash 45382270 + sample 25: + time = 2818323 + flags = 1 + data = length 205, hash D66C6A1D + sample 26: + time = 2841542 + flags = 1 + data = length 204, hash 467AD01F + sample 27: + time = 2864761 + flags = 1 + data = length 211, hash F0435574 + sample 28: + time = 2887980 + flags = 1 + data = length 206, hash 8C96B75F + sample 29: + time = 2911199 + flags = 1 + data = length 200, hash 82553248 + sample 30: + time = 2934418 + flags = 1 + data = length 180, hash 1E51E6CE + sample 31: + time = 2957637 + flags = 1 + data = length 196, hash 33151DC4 + sample 32: + time = 2980856 + flags = 1 + data = length 197, hash 1E62A7D6 + sample 33: + time = 3004075 + flags = 1 + data = length 206, hash 6A6C4CC9 + sample 34: + time = 3027294 + flags = 1 + data = length 209, hash A72FABAA + sample 35: + time = 3050513 + flags = 1 + data = length 217, hash BA33B985 + sample 36: + time = 3073732 + flags = 1 + data = length 235, hash 9919CFD9 + sample 37: + time = 3096951 + flags = 1 + data = length 236, hash A22C7267 + sample 38: + time = 3120170 + flags = 1 + data = length 213, hash 3D57C901 + sample 39: + time = 3143389 + flags = 1 + data = length 205, hash 47F68FDE + sample 40: + time = 3166608 + flags = 1 + data = length 210, hash 9A756E9C + sample 41: + time = 3189827 + flags = 1 + data = length 210, hash BD45C31F + sample 42: + time = 3213046 + flags = 1 + data = length 207, hash 8774FF7B + sample 43: + time = 3236265 + flags = 1 + data = length 149, hash 4678C0E5 + sample 44: + time = 3259484 + flags = 1 + data = length 161, hash E991035D + sample 45: + time = 3282703 + flags = 1 + data = length 197, hash C3013689 + sample 46: + time = 3305922 + flags = 1 + data = length 208, hash E6C0237 + sample 47: + time = 3329141 + flags = 1 + data = length 232, hash A330F188 + sample 48: + time = 3352360 + flags = 1 + data = length 174, hash 2B69C34E +track 1: + format: + bitrate = -1 + id = 1 + containerMimeType = null + sampleMimeType = application/id3 + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = -1 + sampleRate = -1 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 0 + sample count = 0 +tracksEnded = true diff --git a/library/core/src/test/assets/ts/sample_cbs.adts.3.dump b/library/core/src/test/assets/ts/sample_cbs.adts.3.dump new file mode 100644 index 0000000000..e134a711bf --- /dev/null +++ b/library/core/src/test/assets/ts/sample_cbs.adts.3.dump @@ -0,0 +1,59 @@ +seekMap: + isSeekable = true + duration = 3356772 + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 2 +track 0: + format: + bitrate = -1 + id = 0 + containerMimeType = null + sampleMimeType = audio/mp4a-latm + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 44100 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + data = length 2, hash 5F7 + total output bytes = 174 + sample count = 1 + sample 0: + time = 3356772 + flags = 1 + data = length 174, hash 2B69C34E +track 1: + format: + bitrate = -1 + id = 1 + containerMimeType = null + sampleMimeType = application/id3 + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = -1 + sampleRate = -1 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 0 + sample count = 0 +tracksEnded = true diff --git a/library/core/src/test/assets/ts/sample_cbs.adts.unklen.dump b/library/core/src/test/assets/ts/sample_cbs.adts.unklen.dump new file mode 100644 index 0000000000..93d7b776c0 --- /dev/null +++ b/library/core/src/test/assets/ts/sample_cbs.adts.unklen.dump @@ -0,0 +1,631 @@ +seekMap: + isSeekable = false + duration = UNSET TIME + getPosition(0) = [[timeUs=0, position=0]] +numberOfTracks = 2 +track 0: + format: + bitrate = -1 + id = 0 + containerMimeType = null + sampleMimeType = audio/mp4a-latm + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = 1 + sampleRate = 44100 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + data = length 2, hash 5F7 + total output bytes = 30797 + sample count = 144 + sample 0: + time = 0 + flags = 1 + data = length 23, hash 47DE9131 + sample 1: + time = 23219 + flags = 1 + data = length 6, hash 31CF3A46 + sample 2: + time = 46438 + flags = 1 + data = length 6, hash 31CF3A46 + sample 3: + time = 69657 + flags = 1 + data = length 6, hash 31CF3A46 + sample 4: + time = 92876 + flags = 1 + data = length 6, hash 31EC5206 + sample 5: + time = 116095 + flags = 1 + data = length 171, hash 4F6478F6 + sample 6: + time = 139314 + flags = 1 + data = length 202, hash AF4068A3 + sample 7: + time = 162533 + flags = 1 + data = length 210, hash E4C10618 + sample 8: + time = 185752 + flags = 1 + data = length 217, hash 9ECCD0D9 + sample 9: + time = 208971 + flags = 1 + data = length 212, hash 6BAC2CD9 + sample 10: + time = 232190 + flags = 1 + data = length 223, hash 188B6010 + sample 11: + time = 255409 + flags = 1 + data = length 222, hash C1A04D0C + sample 12: + time = 278628 + flags = 1 + data = length 220, hash D65F9768 + sample 13: + time = 301847 + flags = 1 + data = length 227, hash B96C9E14 + sample 14: + time = 325066 + flags = 1 + data = length 229, hash 9FB09972 + sample 15: + time = 348285 + flags = 1 + data = length 220, hash 2271F053 + sample 16: + time = 371504 + flags = 1 + data = length 226, hash 5EDD2F4F + sample 17: + time = 394723 + flags = 1 + data = length 239, hash 957510E0 + sample 18: + time = 417942 + flags = 1 + data = length 224, hash 718A8F47 + sample 19: + time = 441161 + flags = 1 + data = length 225, hash 5E11E293 + sample 20: + time = 464380 + flags = 1 + data = length 227, hash FCE50D27 + sample 21: + time = 487599 + flags = 1 + data = length 212, hash 77908C40 + sample 22: + time = 510818 + flags = 1 + data = length 227, hash 34C4EB32 + sample 23: + time = 534037 + flags = 1 + data = length 231, hash 95488307 + sample 24: + time = 557256 + flags = 1 + data = length 226, hash 97F12D6F + sample 25: + time = 580475 + flags = 1 + data = length 236, hash 91A9D9A2 + sample 26: + time = 603694 + flags = 1 + data = length 227, hash 27A608F9 + sample 27: + time = 626913 + flags = 1 + data = length 229, hash 57DAAE4 + sample 28: + time = 650132 + flags = 1 + data = length 235, hash ED30AC34 + sample 29: + time = 673351 + flags = 1 + data = length 227, hash BD3D6280 + sample 30: + time = 696570 + flags = 1 + data = length 233, hash 694B1087 + sample 31: + time = 719789 + flags = 1 + data = length 232, hash 1EDFE047 + sample 32: + time = 743008 + flags = 1 + data = length 228, hash E2A831F4 + sample 33: + time = 766227 + flags = 1 + data = length 231, hash 757E6012 + sample 34: + time = 789446 + flags = 1 + data = length 223, hash 4003D791 + sample 35: + time = 812665 + flags = 1 + data = length 232, hash 3CF9A07C + sample 36: + time = 835884 + flags = 1 + data = length 228, hash 25AC3FF7 + sample 37: + time = 859103 + flags = 1 + data = length 220, hash 2C1824CE + sample 38: + time = 882322 + flags = 1 + data = length 229, hash 46FDD8FB + sample 39: + time = 905541 + flags = 1 + data = length 237, hash F6988018 + sample 40: + time = 928760 + flags = 1 + data = length 242, hash 60436B6B + sample 41: + time = 951979 + flags = 1 + data = length 275, hash 90EDFA8E + sample 42: + time = 975198 + flags = 1 + data = length 242, hash 5C86EFCB + sample 43: + time = 998417 + flags = 1 + data = length 233, hash E0A51B82 + sample 44: + time = 1021636 + flags = 1 + data = length 235, hash 590DF14F + sample 45: + time = 1044855 + flags = 1 + data = length 238, hash 69AF4E6E + sample 46: + time = 1068074 + flags = 1 + data = length 235, hash E745AE8D + sample 47: + time = 1091293 + flags = 1 + data = length 223, hash 295F2A13 + sample 48: + time = 1114512 + flags = 1 + data = length 228, hash E2F47B21 + sample 49: + time = 1137731 + flags = 1 + data = length 229, hash 262C3CFE + sample 50: + time = 1160950 + flags = 1 + data = length 232, hash 4B5BF5E8 + sample 51: + time = 1184169 + flags = 1 + data = length 233, hash F3D80836 + sample 52: + time = 1207388 + flags = 1 + data = length 237, hash 32E0A11E + sample 53: + time = 1230607 + flags = 1 + data = length 228, hash E1B89F13 + sample 54: + time = 1253826 + flags = 1 + data = length 237, hash 8BDD9E38 + sample 55: + time = 1277045 + flags = 1 + data = length 235, hash 3C84161F + sample 56: + time = 1300264 + flags = 1 + data = length 227, hash A47E1789 + sample 57: + time = 1323483 + flags = 1 + data = length 228, hash 869FDFD3 + sample 58: + time = 1346702 + flags = 1 + data = length 233, hash 272ECE2 + sample 59: + time = 1369921 + flags = 1 + data = length 227, hash DB6B9618 + sample 60: + time = 1393140 + flags = 1 + data = length 212, hash 63214325 + sample 61: + time = 1416359 + flags = 1 + data = length 221, hash 9BA588A1 + sample 62: + time = 1439578 + flags = 1 + data = length 225, hash 21EFD50C + sample 63: + time = 1462797 + flags = 1 + data = length 231, hash F3AD0BF + sample 64: + time = 1486016 + flags = 1 + data = length 224, hash 822C9210 + sample 65: + time = 1509235 + flags = 1 + data = length 195, hash D4EF53EE + sample 66: + time = 1532454 + flags = 1 + data = length 195, hash A816647A + sample 67: + time = 1555673 + flags = 1 + data = length 184, hash 9A2B7E6 + sample 68: + time = 1578892 + flags = 1 + data = length 210, hash 956E3600 + sample 69: + time = 1602111 + flags = 1 + data = length 234, hash 35CFDA0A + sample 70: + time = 1625330 + flags = 1 + data = length 239, hash 9E15AC1E + sample 71: + time = 1648549 + flags = 1 + data = length 228, hash F3B70641 + sample 72: + time = 1671768 + flags = 1 + data = length 237, hash 124E3194 + sample 73: + time = 1694987 + flags = 1 + data = length 231, hash 950CD7C8 + sample 74: + time = 1718206 + flags = 1 + data = length 236, hash A12E49AF + sample 75: + time = 1741425 + flags = 1 + data = length 242, hash 43BC9C24 + sample 76: + time = 1764644 + flags = 1 + data = length 241, hash DCF0B17 + sample 77: + time = 1787863 + flags = 1 + data = length 251, hash C0B99968 + sample 78: + time = 1811082 + flags = 1 + data = length 245, hash 9B38ED1C + sample 79: + time = 1834301 + flags = 1 + data = length 238, hash 1BA69079 + sample 80: + time = 1857520 + flags = 1 + data = length 233, hash 44C8C6BF + sample 81: + time = 1880739 + flags = 1 + data = length 231, hash EABBEE02 + sample 82: + time = 1903958 + flags = 1 + data = length 226, hash D09C44FB + sample 83: + time = 1927177 + flags = 1 + data = length 235, hash BE6A6608 + sample 84: + time = 1950396 + flags = 1 + data = length 235, hash 2735F454 + sample 85: + time = 1973615 + flags = 1 + data = length 238, hash B160DFE7 + sample 86: + time = 1996834 + flags = 1 + data = length 232, hash 1B217D2E + sample 87: + time = 2020053 + flags = 1 + data = length 251, hash D1C14CEA + sample 88: + time = 2043272 + flags = 1 + data = length 256, hash 97C87F08 + sample 89: + time = 2066491 + flags = 1 + data = length 237, hash 6645DB3 + sample 90: + time = 2089710 + flags = 1 + data = length 235, hash 727A1C82 + sample 91: + time = 2112929 + flags = 1 + data = length 234, hash 5015F8B5 + sample 92: + time = 2136148 + flags = 1 + data = length 241, hash 9102144B + sample 93: + time = 2159367 + flags = 1 + data = length 224, hash 64E0D807 + sample 94: + time = 2182586 + flags = 1 + data = length 228, hash 1922B852 + sample 95: + time = 2205805 + flags = 1 + data = length 224, hash 953502D8 + sample 96: + time = 2229024 + flags = 1 + data = length 214, hash 92B87FE7 + sample 97: + time = 2252243 + flags = 1 + data = length 213, hash BB0C8D86 + sample 98: + time = 2275462 + flags = 1 + data = length 206, hash 9AD21017 + sample 99: + time = 2298681 + flags = 1 + data = length 209, hash C479FE94 + sample 100: + time = 2321900 + flags = 1 + data = length 220, hash 3033DCE1 + sample 101: + time = 2345119 + flags = 1 + data = length 217, hash 7D589C94 + sample 102: + time = 2368338 + flags = 1 + data = length 216, hash AAF6C183 + sample 103: + time = 2391557 + flags = 1 + data = length 206, hash 1EE1207F + sample 104: + time = 2414776 + flags = 1 + data = length 204, hash 4BEB1210 + sample 105: + time = 2437995 + flags = 1 + data = length 213, hash 21A841C9 + sample 106: + time = 2461214 + flags = 1 + data = length 207, hash B80B0424 + sample 107: + time = 2484433 + flags = 1 + data = length 212, hash 4785A1C3 + sample 108: + time = 2507652 + flags = 1 + data = length 205, hash 59BF7229 + sample 109: + time = 2530871 + flags = 1 + data = length 208, hash FA313DDE + sample 110: + time = 2554090 + flags = 1 + data = length 211, hash 190D85FD + sample 111: + time = 2577309 + flags = 1 + data = length 211, hash BA050052 + sample 112: + time = 2600528 + flags = 1 + data = length 211, hash F3080F10 + sample 113: + time = 2623747 + flags = 1 + data = length 210, hash F41B7BE7 + sample 114: + time = 2646966 + flags = 1 + data = length 207, hash 2176C97E + sample 115: + time = 2670185 + flags = 1 + data = length 220, hash 32087455 + sample 116: + time = 2693404 + flags = 1 + data = length 213, hash 4E5649A8 + sample 117: + time = 2716623 + flags = 1 + data = length 213, hash 5F12FDCF + sample 118: + time = 2739842 + flags = 1 + data = length 204, hash 1E895C2A + sample 119: + time = 2763061 + flags = 1 + data = length 219, hash 45382270 + sample 120: + time = 2786280 + flags = 1 + data = length 205, hash D66C6A1D + sample 121: + time = 2809499 + flags = 1 + data = length 204, hash 467AD01F + sample 122: + time = 2832718 + flags = 1 + data = length 211, hash F0435574 + sample 123: + time = 2855937 + flags = 1 + data = length 206, hash 8C96B75F + sample 124: + time = 2879156 + flags = 1 + data = length 200, hash 82553248 + sample 125: + time = 2902375 + flags = 1 + data = length 180, hash 1E51E6CE + sample 126: + time = 2925594 + flags = 1 + data = length 196, hash 33151DC4 + sample 127: + time = 2948813 + flags = 1 + data = length 197, hash 1E62A7D6 + sample 128: + time = 2972032 + flags = 1 + data = length 206, hash 6A6C4CC9 + sample 129: + time = 2995251 + flags = 1 + data = length 209, hash A72FABAA + sample 130: + time = 3018470 + flags = 1 + data = length 217, hash BA33B985 + sample 131: + time = 3041689 + flags = 1 + data = length 235, hash 9919CFD9 + sample 132: + time = 3064908 + flags = 1 + data = length 236, hash A22C7267 + sample 133: + time = 3088127 + flags = 1 + data = length 213, hash 3D57C901 + sample 134: + time = 3111346 + flags = 1 + data = length 205, hash 47F68FDE + sample 135: + time = 3134565 + flags = 1 + data = length 210, hash 9A756E9C + sample 136: + time = 3157784 + flags = 1 + data = length 210, hash BD45C31F + sample 137: + time = 3181003 + flags = 1 + data = length 207, hash 8774FF7B + sample 138: + time = 3204222 + flags = 1 + data = length 149, hash 4678C0E5 + sample 139: + time = 3227441 + flags = 1 + data = length 161, hash E991035D + sample 140: + time = 3250660 + flags = 1 + data = length 197, hash C3013689 + sample 141: + time = 3273879 + flags = 1 + data = length 208, hash E6C0237 + sample 142: + time = 3297098 + flags = 1 + data = length 232, hash A330F188 + sample 143: + time = 3320317 + flags = 1 + data = length 174, hash 2B69C34E +track 1: + format: + bitrate = -1 + id = 1 + containerMimeType = null + sampleMimeType = application/id3 + maxInputSize = -1 + width = -1 + height = -1 + frameRate = -1.0 + rotationDegrees = 0 + pixelWidthHeightRatio = 1.0 + channelCount = -1 + sampleRate = -1 + pcmEncoding = -1 + encoderDelay = 0 + encoderPadding = 0 + subsampleOffsetUs = 9223372036854775807 + selectionFlags = 0 + language = null + drmInitData = - + initializationData: + total output bytes = 0 + sample count = 0 +tracksEnded = true diff --git a/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorSeekTest.java b/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorSeekTest.java index b7098abfcf..9f9051087d 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorSeekTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorSeekTest.java @@ -17,23 +17,13 @@ package com.google.android.exoplayer2.extractor.amr; import static com.google.common.truth.Truth.assertThat; -import android.content.Context; import android.net.Uri; -import android.support.annotation.Nullable; -import com.google.android.exoplayer2.C; -import com.google.android.exoplayer2.extractor.DefaultExtractorInput; -import com.google.android.exoplayer2.extractor.Extractor; -import com.google.android.exoplayer2.extractor.ExtractorInput; -import com.google.android.exoplayer2.extractor.PositionHolder; import com.google.android.exoplayer2.extractor.SeekMap; -import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.testutil.FakeExtractorOutput; import com.google.android.exoplayer2.testutil.FakeTrackOutput; import com.google.android.exoplayer2.testutil.TestUtil; -import com.google.android.exoplayer2.upstream.DataSpec; import com.google.android.exoplayer2.upstream.DefaultDataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; -import com.google.android.exoplayer2.util.Util; import java.io.IOException; import java.util.List; import java.util.Random; @@ -43,7 +33,7 @@ import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; -/** Unit test for {@link AmrExtractor} narrow-band AMR file. */ +/** Unit test for {@link AmrExtractor}. */ @RunWith(RobolectricTestRunner.class) public final class AmrExtractorSeekTest { @@ -57,28 +47,28 @@ public final class AmrExtractorSeekTest { private FakeTrackOutput expectedTrackOutput; private DefaultDataSource dataSource; - private PositionHolder positionHolder; - - private long totalInputLength; @Before public void setUp() { dataSource = new DefaultDataSourceFactory(RuntimeEnvironment.application, "UserAgent") .createDataSource(); - positionHolder = new PositionHolder(); } @Test public void testAmrExtractorReads_returnSeekableSeekMap_forNarrowBandAmr() throws IOException, InterruptedException { String fileName = NARROW_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); - SeekMap seekMap = extractSeekMap(extractor, new FakeExtractorOutput(), fileName); + AmrExtractor extractor = createAmrExtractor(); + SeekMap seekMap = + TestUtil.extractSeekMap(extractor, new FakeExtractorOutput(), dataSource, fileUri); assertThat(seekMap).isNotNull(); assertThat(seekMap.getDurationUs()).isEqualTo(NARROW_BAND_FILE_DURATION_US); @@ -89,19 +79,23 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekingToPositionInFile_extractsCorrectFrame_forNarrowBandAmr() throws IOException, InterruptedException { String fileName = NARROW_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long targetSeekTimeUs = 980_000; int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -112,19 +106,23 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekToEoF_extractsLastFrame_forNarrowBandAmr() throws IOException, InterruptedException { String fileName = NARROW_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long targetSeekTimeUs = seekMap.getDurationUs(); int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -135,21 +133,25 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekingBackward_extractsCorrectFrames_forNarrowBandAmr() throws IOException, InterruptedException { String fileName = NARROW_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long firstSeekTimeUs = 980_000; - seekToTimeUs(extractor, seekMap, firstSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs(extractor, seekMap, firstSeekTimeUs, dataSource, trackOutput, fileUri); long targetSeekTimeUs = 0; int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -160,21 +162,25 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekingForward_extractsCorrectFrames_forNarrowBandAmr() throws IOException, InterruptedException { String fileName = NARROW_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long firstSeekTimeUs = 980_000; - seekToTimeUs(extractor, seekMap, firstSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs(extractor, seekMap, firstSeekTimeUs, dataSource, trackOutput, fileUri); long targetSeekTimeUs = 1_200_000; int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -185,20 +191,24 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesRandomSeeks_extractsCorrectFrames_forNarrowBandAmr() throws IOException, InterruptedException { String fileName = NARROW_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long numSeek = 100; for (long i = 0; i < numSeek; i++) { long targetSeekTimeUs = random.nextInt(NARROW_BAND_FILE_DURATION_US + 1); int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -210,12 +220,16 @@ public final class AmrExtractorSeekTest { public void testAmrExtractorReads_returnSeekableSeekMap_forWideBandAmr() throws IOException, InterruptedException { String fileName = WIDE_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); - SeekMap seekMap = extractSeekMap(extractor, new FakeExtractorOutput(), fileName); + AmrExtractor extractor = createAmrExtractor(); + SeekMap seekMap = + TestUtil.extractSeekMap(extractor, new FakeExtractorOutput(), dataSource, fileUri); assertThat(seekMap).isNotNull(); assertThat(seekMap.getDurationUs()).isEqualTo(WIDE_BAND_FILE_DURATION_US); @@ -226,19 +240,23 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekingToPositionInFile_extractsCorrectFrame_forWideBandAmr() throws IOException, InterruptedException { String fileName = WIDE_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long targetSeekTimeUs = 980_000; int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -249,19 +267,23 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekToEoF_extractsLastFrame_forWideBandAmr() throws IOException, InterruptedException { String fileName = WIDE_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long targetSeekTimeUs = seekMap.getDurationUs(); int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -272,21 +294,25 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekingBackward_extractsCorrectFrames_forWideBandAmr() throws IOException, InterruptedException { String fileName = WIDE_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long firstSeekTimeUs = 980_000; - seekToTimeUs(extractor, seekMap, firstSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs(extractor, seekMap, firstSeekTimeUs, dataSource, trackOutput, fileUri); long targetSeekTimeUs = 0; int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -297,21 +323,25 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesSeekingForward_extractsCorrectFrames_forWideBandAmr() throws IOException, InterruptedException { String fileName = WIDE_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long firstSeekTimeUs = 980_000; - seekToTimeUs(extractor, seekMap, firstSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs(extractor, seekMap, firstSeekTimeUs, dataSource, trackOutput, fileUri); long targetSeekTimeUs = 1_200_000; int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -322,20 +352,24 @@ public final class AmrExtractorSeekTest { public void testSeeking_handlesRandomSeeks_extractsCorrectFrames_forWideBandAmr() throws IOException, InterruptedException { String fileName = WIDE_BAND_AMR_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); expectedTrackOutput = - extractAllSamplesFromFileToExpectedOutput(RuntimeEnvironment.application, fileName); - totalInputLength = readInputLength(fileName); - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + TestUtil.extractAllSamplesFromFile( + createAmrExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AmrExtractor extractor = createAmrExtractor(); FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); - SeekMap seekMap = extractSeekMap(extractor, extractorOutput, fileName); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); long numSeek = 100; for (long i = 0; i < numSeek; i++) { long targetSeekTimeUs = random.nextInt(NARROW_BAND_FILE_DURATION_US + 1); int extractedFrameIndex = - seekToTimeUs(extractor, seekMap, targetSeekTimeUs, trackOutput, fileName); + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); assertThat(extractedFrameIndex).isNotEqualTo(-1); assertFirstFrameAfterSeekContainTargetSeekTime( @@ -345,82 +379,8 @@ public final class AmrExtractorSeekTest { // Internal methods - private static String assetPathForFile(String fileName) { - return "asset:///" + fileName; - } - - private long readInputLength(String fileName) throws IOException { - DataSpec dataSpec = - new DataSpec( - Uri.parse(assetPathForFile(fileName)), - /* absoluteStreamPosition= */ 0, - /* length= */ C.LENGTH_UNSET, - /* key= */ null); - long totalInputLength = dataSource.open(dataSpec); - Util.closeQuietly(dataSource); - return totalInputLength; - } - - /** - * Seeks to the given seek time and keeps reading from input until we can extract at least one - * frame from the seek position, or until end-of-input is reached. - * - * @return The index of the first extracted frame written to the given {@code trackOutput} after - * the seek is completed, or -1 if the seek is completed without any extracted frame. - */ - private int seekToTimeUs( - AmrExtractor amrExtractor, - SeekMap seekMap, - long seekTimeUs, - FakeTrackOutput trackOutput, - String fileName) - throws IOException, InterruptedException { - int numSampleBeforeSeek = trackOutput.getSampleCount(); - SeekMap.SeekPoints seekPoints = seekMap.getSeekPoints(seekTimeUs); - - long initialSeekLoadPosition = seekPoints.first.position; - amrExtractor.seek(initialSeekLoadPosition, seekTimeUs); - - positionHolder.position = C.POSITION_UNSET; - ExtractorInput extractorInput = - getExtractorInputFromPosition(initialSeekLoadPosition, fileName); - int extractorReadResult = Extractor.RESULT_CONTINUE; - while (true) { - try { - // Keep reading until we can read at least one frame after seek - while (extractorReadResult == Extractor.RESULT_CONTINUE - && trackOutput.getSampleCount() == numSampleBeforeSeek) { - extractorReadResult = amrExtractor.read(extractorInput, positionHolder); - } - } finally { - Util.closeQuietly(dataSource); - } - - if (extractorReadResult == Extractor.RESULT_SEEK) { - extractorInput = getExtractorInputFromPosition(positionHolder.position, fileName); - extractorReadResult = Extractor.RESULT_CONTINUE; - } else if (extractorReadResult == Extractor.RESULT_END_OF_INPUT) { - return -1; - } else if (trackOutput.getSampleCount() > numSampleBeforeSeek) { - // First index after seek = num sample before seek. - return numSampleBeforeSeek; - } - } - } - - private @Nullable SeekMap extractSeekMap( - AmrExtractor extractor, FakeExtractorOutput output, String fileName) - throws IOException, InterruptedException { - try { - ExtractorInput input = getExtractorInputFromPosition(/* position= */ 0, fileName); - extractor.init(output); - while (output.seekMap == null) { - extractor.read(input, positionHolder); - } - } finally { - Util.closeQuietly(dataSource); - } - return output.seekMap; + private AmrExtractor createAmrExtractor() { + return new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); } private void assertFirstFrameAfterSeekContainTargetSeekTime( @@ -447,26 +407,4 @@ public final class AmrExtractorSeekTest { } return sampleTimes.size() - 1; } - - private ExtractorInput getExtractorInputFromPosition(long position, String fileName) - throws IOException { - DataSpec dataSpec = - new DataSpec( - Uri.parse(assetPathForFile(fileName)), position, totalInputLength, /* key= */ null); - dataSource.open(dataSpec); - return new DefaultExtractorInput(dataSource, position, totalInputLength); - } - - private FakeTrackOutput extractAllSamplesFromFileToExpectedOutput( - Context context, String fileName) throws IOException, InterruptedException { - byte[] data = TestUtil.getByteArray(context, fileName); - - AmrExtractor extractor = new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); - FakeExtractorOutput expectedOutput = new FakeExtractorOutput(); - extractor.init(expectedOutput); - FakeExtractorInput input = new FakeExtractorInput.Builder().setData(data).build(); - - while (extractor.read(input, new PositionHolder()) != Extractor.RESULT_END_OF_INPUT) {} - return expectedOutput.trackOutputs.get(0); - } } diff --git a/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorTest.java index b46612e7c3..39c1bfe05b 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/extractor/amr/AmrExtractorTest.java @@ -179,12 +179,26 @@ public final class AmrExtractorTest { @Test public void testExtractingNarrowBandSamples() throws Exception { - ExtractorAsserts.assertBehavior(createAmrExtractorFactory(), "amr/sample_nb.amr"); + ExtractorAsserts.assertBehavior( + createAmrExtractorFactory(/* withSeeking= */ false), "amr/sample_nb.amr"); } @Test public void testExtractingWideBandSamples() throws Exception { - ExtractorAsserts.assertBehavior(createAmrExtractorFactory(), "amr/sample_wb.amr"); + ExtractorAsserts.assertBehavior( + createAmrExtractorFactory(/* withSeeking= */ false), "amr/sample_wb.amr"); + } + + @Test + public void testExtractingNarrowBandSamples_withSeeking() throws Exception { + ExtractorAsserts.assertBehavior( + createAmrExtractorFactory(/* withSeeking= */ true), "amr/sample_nb_cbr.amr"); + } + + @Test + public void testExtractingWideBandSamples_withSeeking() throws Exception { + ExtractorAsserts.assertBehavior( + createAmrExtractorFactory(/* withSeeking= */ true), "amr/sample_wb_cbr.amr"); } private byte[] newWideBandAmrFrameWithType(int frameType) { @@ -235,11 +249,15 @@ public final class AmrExtractorTest { } @NonNull - private static ExtractorAsserts.ExtractorFactory createAmrExtractorFactory() { + private static ExtractorAsserts.ExtractorFactory createAmrExtractorFactory(boolean withSeeking) { return new ExtractorAsserts.ExtractorFactory() { @Override public Extractor create() { - return new AmrExtractor(); + if (!withSeeking) { + return new AmrExtractor(); + } else { + return new AmrExtractor(AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + } } }; } diff --git a/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorSeekTest.java b/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorSeekTest.java new file mode 100644 index 0000000000..d5103aa682 --- /dev/null +++ b/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorSeekTest.java @@ -0,0 +1,256 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.android.exoplayer2.extractor.ts; + +import static com.google.common.truth.Truth.assertThat; + +import android.net.Uri; +import com.google.android.exoplayer2.extractor.SeekMap; +import com.google.android.exoplayer2.testutil.FakeExtractorOutput; +import com.google.android.exoplayer2.testutil.FakeTrackOutput; +import com.google.android.exoplayer2.testutil.TestUtil; +import com.google.android.exoplayer2.upstream.DefaultDataSource; +import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; +import java.io.IOException; +import java.util.Arrays; +import java.util.Random; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.RuntimeEnvironment; + +/** Unit test for {@link AdtsExtractor}. */ +@RunWith(RobolectricTestRunner.class) +public final class AdtsExtractorSeekTest { + + private static final Random random = new Random(1234L); + + private static final String TEST_FILE = "ts/sample.adts"; + private static final int FILE_DURATION_US = 3_356_772; + private static final long DELTA_TIMESTAMP_THRESHOLD_US = 200_000; + + private FakeTrackOutput expectedTrackOutput; + private DefaultDataSource dataSource; + + @Before + public void setUp() { + dataSource = + new DefaultDataSourceFactory(RuntimeEnvironment.application, "UserAgent") + .createDataSource(); + } + + @Test + public void testAdtsExtractorReads_returnSeekableSeekMap() + throws IOException, InterruptedException { + String fileName = TEST_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); + expectedTrackOutput = + TestUtil.extractAllSamplesFromFile( + createAdtsExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + + AdtsExtractor extractor = createAdtsExtractor(); + SeekMap seekMap = + TestUtil.extractSeekMap(extractor, new FakeExtractorOutput(), dataSource, fileUri); + + assertThat(seekMap).isNotNull(); + assertThat(seekMap.getDurationUs()).isEqualTo(FILE_DURATION_US); + assertThat(seekMap.isSeekable()).isTrue(); + } + + @Test + public void testSeeking_handlesSeekingToPositionInFile_extractsCorrectSample() + throws IOException, InterruptedException { + String fileName = TEST_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); + expectedTrackOutput = + TestUtil.extractAllSamplesFromFile( + createAdtsExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + + AdtsExtractor extractor = createAdtsExtractor(); + + FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); + FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); + + long targetSeekTimeUs = 3330033; // 980_000; + int extractedSampleIndex = + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); + + assertThat(extractedSampleIndex).isNotEqualTo(-1); + assertFirstSampleAfterSeekContainTargetSeekTime( + trackOutput, targetSeekTimeUs, extractedSampleIndex); + } + + @Test + public void testSeeking_handlesSeekToEoF_extractsLastSample() + throws IOException, InterruptedException { + String fileName = TEST_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); + expectedTrackOutput = + TestUtil.extractAllSamplesFromFile( + createAdtsExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AdtsExtractor extractor = createAdtsExtractor(); + + FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); + FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); + + long targetSeekTimeUs = seekMap.getDurationUs(); + + int extractedSampleIndex = + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); + + assertThat(extractedSampleIndex).isNotEqualTo(-1); + assertFirstSampleAfterSeekContainTargetSeekTime( + trackOutput, targetSeekTimeUs, extractedSampleIndex); + } + + @Test + public void testSeeking_handlesSeekingBackward_extractsCorrectSamples() + throws IOException, InterruptedException { + String fileName = TEST_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); + expectedTrackOutput = + TestUtil.extractAllSamplesFromFile( + createAdtsExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AdtsExtractor extractor = createAdtsExtractor(); + + FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); + FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); + + long firstSeekTimeUs = 980_000; + TestUtil.seekToTimeUs(extractor, seekMap, firstSeekTimeUs, dataSource, trackOutput, fileUri); + + long targetSeekTimeUs = 0; + int extractedSampleIndex = + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); + + assertThat(extractedSampleIndex).isNotEqualTo(-1); + assertFirstSampleAfterSeekContainTargetSeekTime( + trackOutput, targetSeekTimeUs, extractedSampleIndex); + } + + @Test + public void testSeeking_handlesSeekingForward_extractsCorrectSamples() + throws IOException, InterruptedException { + String fileName = TEST_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); + expectedTrackOutput = + TestUtil.extractAllSamplesFromFile( + createAdtsExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AdtsExtractor extractor = createAdtsExtractor(); + + FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); + FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); + + long firstSeekTimeUs = 980_000; + TestUtil.seekToTimeUs(extractor, seekMap, firstSeekTimeUs, dataSource, trackOutput, fileUri); + + long targetSeekTimeUs = 1_200_000; + int extractedSampleIndex = + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); + + assertThat(extractedSampleIndex).isNotEqualTo(-1); + assertFirstSampleAfterSeekContainTargetSeekTime( + trackOutput, targetSeekTimeUs, extractedSampleIndex); + } + + @Test + public void testSeeking_handlesRandomSeeks_extractsCorrectSamples() + throws IOException, InterruptedException { + String fileName = TEST_FILE; + Uri fileUri = TestUtil.buildAssetUri(fileName); + expectedTrackOutput = + TestUtil.extractAllSamplesFromFile( + createAdtsExtractor(), RuntimeEnvironment.application, fileName) + .trackOutputs + .get(0); + AdtsExtractor extractor = createAdtsExtractor(); + + FakeExtractorOutput extractorOutput = new FakeExtractorOutput(); + SeekMap seekMap = TestUtil.extractSeekMap(extractor, extractorOutput, dataSource, fileUri); + FakeTrackOutput trackOutput = extractorOutput.trackOutputs.get(0); + + long numSeek = 100; + for (long i = 0; i < numSeek; i++) { + long targetSeekTimeUs = random.nextInt(FILE_DURATION_US + 1); + int extractedSampleIndex = + TestUtil.seekToTimeUs( + extractor, seekMap, targetSeekTimeUs, dataSource, trackOutput, fileUri); + + assertThat(extractedSampleIndex).isNotEqualTo(-1); + assertFirstSampleAfterSeekContainTargetSeekTime( + trackOutput, targetSeekTimeUs, extractedSampleIndex); + } + } + + // Internal methods + + private static AdtsExtractor createAdtsExtractor() { + return new AdtsExtractor( + /* firstStreamSampleTimestampUs= */ 0, + /* flags= */ AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + } + + private void assertFirstSampleAfterSeekContainTargetSeekTime( + FakeTrackOutput trackOutput, long seekTimeUs, int firstSampleIndexAfterSeek) { + long outputSampleTimeUs = trackOutput.getSampleTimeUs(firstSampleIndexAfterSeek); + int expectedSampleIndex = + findOutputSampleInExpectedOutput(trackOutput.getSampleData(firstSampleIndexAfterSeek)); + // Assert that after seeking, the first sample written to output exists in the sample list + assertThat(expectedSampleIndex).isNotEqualTo(-1); + // Assert that the timestamp output for first sample after seek is near the seek point. + // For ADTS seeking, unfortunately we can't guarantee exact sample seeking, since most ADTS + // stream use VBR. + assertThat(Math.abs(outputSampleTimeUs - seekTimeUs)).isLessThan(DELTA_TIMESTAMP_THRESHOLD_US); + assertThat( + Math.abs(outputSampleTimeUs - expectedTrackOutput.getSampleTimeUs(expectedSampleIndex))) + .isLessThan(DELTA_TIMESTAMP_THRESHOLD_US); + trackOutput.assertSample( + firstSampleIndexAfterSeek, + expectedTrackOutput.getSampleData(expectedSampleIndex), + outputSampleTimeUs, + expectedTrackOutput.getSampleFlags(expectedSampleIndex), + expectedTrackOutput.getSampleCryptoData(expectedSampleIndex)); + } + + private int findOutputSampleInExpectedOutput(byte[] sampleData) { + for (int i = 0; i < expectedTrackOutput.getSampleCount(); i++) { + byte[] currentSampleData = expectedTrackOutput.getSampleData(i); + if (Arrays.equals(currentSampleData, sampleData)) { + return i; + } + } + return -1; + } +} diff --git a/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorTest.java index 048a23cd67..fe2046cbe4 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsExtractorTest.java @@ -37,4 +37,18 @@ public final class AdtsExtractorTest { }, "ts/sample.adts"); } + + @Test + public void testSample_withSeeking() throws Exception { + ExtractorAsserts.assertBehavior( + new ExtractorFactory() { + @Override + public Extractor create() { + return new AdtsExtractor( + /* firstStreamSampleTimestampUs= */ 0, + /* flags= */ AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING); + } + }, + "ts/sample_cbs.adts"); + } } diff --git a/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsReaderTest.java b/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsReaderTest.java index 1098ba7563..f7cfd6ccaf 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsReaderTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/extractor/ts/AdtsReaderTest.java @@ -93,14 +93,26 @@ public class AdtsReaderTest { data = new ParsableByteArray( TestUtil.joinByteArrays( + ADTS_HEADER, + ADTS_CONTENT, ADTS_HEADER, ADTS_CONTENT, // Adts sample missing the first sync byte + // The Reader should be able to read the next sample. Arrays.copyOfRange(ADTS_HEADER, 1, ADTS_HEADER.length), + ADTS_CONTENT, + ADTS_HEADER, ADTS_CONTENT)); feed(); - assertSampleCounts(0, 1); - adtsOutput.assertSample(0, ADTS_CONTENT, 0, C.BUFFER_FLAG_KEY_FRAME, null); + assertSampleCounts(0, 3); + for (int i = 0; i < 3; i++) { + adtsOutput.assertSample( + /* index= */ i, + /* data= */ ADTS_CONTENT, + /* timeUs= */ ADTS_SAMPLE_DURATION * i, + /* flags= */ C.BUFFER_FLAG_KEY_FRAME, + /* cryptoData= */ null); + } } @Test diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java index 9a92ab62e8..652183a91a 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java @@ -22,8 +22,13 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; +import android.net.Uri; import com.google.android.exoplayer2.C; +import com.google.android.exoplayer2.extractor.DefaultExtractorInput; import com.google.android.exoplayer2.extractor.Extractor; +import com.google.android.exoplayer2.extractor.ExtractorInput; +import com.google.android.exoplayer2.extractor.PositionHolder; +import com.google.android.exoplayer2.extractor.SeekMap; import com.google.android.exoplayer2.testutil.FakeExtractorInput.SimulatedIOException; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DataSpec; @@ -223,4 +228,150 @@ public class TestUtil { mse / (255.0 * 255.0 * 3.0 * firstBitmap.getWidth() * firstBitmap.getHeight()); return 10 * Math.log10(1.0 / normalizedMse); } + + /** Returns the {@link Uri} for the given asset path. */ + public static Uri buildAssetUri(String assetPath) { + return Uri.parse("asset:///" + assetPath); + } + + /** + * Reads from the given input using the given {@link Extractor}, until it can produce the {@link + * SeekMap} and all of the tracks have been identified, or until the extractor encounters EOF. + * + * @param extractor The {@link Extractor} to extractor from input. + * @param output The {@link FakeTrackOutput} to store the extracted {@link SeekMap} and track. + * @param dataSource The {@link DataSource} that will be used to read from the input. + * @param uri The Uri of the input. + * @return The extracted {@link SeekMap}. + * @throws IOException If an error occurred reading from the input, or if the extractor finishes + * reading from input without extracting any {@link SeekMap}. + * @throws InterruptedException If the thread was interrupted. + */ + public static SeekMap extractSeekMap( + Extractor extractor, FakeExtractorOutput output, DataSource dataSource, Uri uri) + throws IOException, InterruptedException { + ExtractorInput input = getExtractorInputFromPosition(dataSource, /* position= */ 0, uri); + extractor.init(output); + PositionHolder positionHolder = new PositionHolder(); + int readResult = Extractor.RESULT_CONTINUE; + while (true) { + try { + // Keep reading until we can get the seek map + while (readResult == Extractor.RESULT_CONTINUE + && (output.seekMap == null || !output.tracksEnded)) { + readResult = extractor.read(input, positionHolder); + } + } finally { + Util.closeQuietly(dataSource); + } + + if (readResult == Extractor.RESULT_SEEK) { + input = getExtractorInputFromPosition(dataSource, positionHolder.position, uri); + readResult = Extractor.RESULT_CONTINUE; + } else if (readResult == Extractor.RESULT_END_OF_INPUT) { + throw new IOException("EOF encountered without seekmap"); + } + if (output.seekMap != null) { + return output.seekMap; + } + } + } + + /** + * Extracts all samples from the given file into a {@link FakeTrackOutput}. + * + * @param extractor The {@link Extractor} to extractor from input. + * @param context A {@link Context}. + * @param fileName The name of the input file. + * @return The {@link FakeTrackOutput} containing the extracted samples. + * @throws IOException If an error occurred reading from the input, or if the extractor finishes + * reading from input without extracting any {@link SeekMap}. + * @throws InterruptedException If the thread was interrupted. + */ + public static FakeExtractorOutput extractAllSamplesFromFile( + Extractor extractor, Context context, String fileName) + throws IOException, InterruptedException { + byte[] data = TestUtil.getByteArray(context, fileName); + FakeExtractorOutput expectedOutput = new FakeExtractorOutput(); + extractor.init(expectedOutput); + FakeExtractorInput input = new FakeExtractorInput.Builder().setData(data).build(); + + PositionHolder positionHolder = new PositionHolder(); + int readResult = Extractor.RESULT_CONTINUE; + while (readResult != Extractor.RESULT_END_OF_INPUT) { + while (readResult == Extractor.RESULT_CONTINUE) { + readResult = extractor.read(input, positionHolder); + } + if (readResult == Extractor.RESULT_SEEK) { + input.setPosition((int) positionHolder.position); + readResult = Extractor.RESULT_CONTINUE; + } + } + return expectedOutput; + } + + /** + * Seeks to the given seek time of the stream from the given input, and keeps reading from the + * input until we can extract at least one sample following the seek position, or until + * end-of-input is reached. + * + * @param extractor The {@link Extractor} to extractor from input. + * @param seekMap The {@link SeekMap} of the stream from the given input. + * @param seekTimeUs The seek time, in micro-seconds. + * @param trackOutput The {@link FakeTrackOutput} to store the extracted samples. + * @param dataSource The {@link DataSource} that will be used to read from the input. + * @param uri The Uri of the input. + * @return The index of the first extracted sample written to the given {@code trackOutput} after + * the seek is completed, or -1 if the seek is completed without any extracted sample. + */ + public static int seekToTimeUs( + Extractor extractor, + SeekMap seekMap, + long seekTimeUs, + DataSource dataSource, + FakeTrackOutput trackOutput, + Uri uri) + throws IOException, InterruptedException { + int numSampleBeforeSeek = trackOutput.getSampleCount(); + SeekMap.SeekPoints seekPoints = seekMap.getSeekPoints(seekTimeUs); + + long initialSeekLoadPosition = seekPoints.first.position; + extractor.seek(initialSeekLoadPosition, seekTimeUs); + + PositionHolder positionHolder = new PositionHolder(); + positionHolder.position = C.POSITION_UNSET; + ExtractorInput extractorInput = + TestUtil.getExtractorInputFromPosition(dataSource, initialSeekLoadPosition, uri); + int extractorReadResult = Extractor.RESULT_CONTINUE; + while (true) { + try { + // Keep reading until we can read at least one sample after seek + while (extractorReadResult == Extractor.RESULT_CONTINUE + && trackOutput.getSampleCount() == numSampleBeforeSeek) { + extractorReadResult = extractor.read(extractorInput, positionHolder); + } + } finally { + Util.closeQuietly(dataSource); + } + + if (extractorReadResult == Extractor.RESULT_SEEK) { + extractorInput = + TestUtil.getExtractorInputFromPosition(dataSource, positionHolder.position, uri); + extractorReadResult = Extractor.RESULT_CONTINUE; + } else if (extractorReadResult == Extractor.RESULT_END_OF_INPUT) { + return -1; + } else if (trackOutput.getSampleCount() > numSampleBeforeSeek) { + // First index after seek = num sample before seek. + return numSampleBeforeSeek; + } + } + } + + /** Returns an {@link ExtractorInput} to read from the given input at given position. */ + private static ExtractorInput getExtractorInputFromPosition( + DataSource dataSource, long position, Uri uri) throws IOException { + DataSpec dataSpec = new DataSpec(uri, position, C.LENGTH_UNSET, /* key= */ null); + long inputLength = dataSource.open(dataSpec); + return new DefaultExtractorInput(dataSource, position, inputLength); + } }