Play H.264 in the old VfW MKV wrapper (Dragon Ball GT): Orbit's copy of Media3's Matroska reader
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 2m39s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m46s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-04 22:17:58 +00:00
co-authored by Claude Opus 5.5
parent 99d45ba10c
commit 7b1e4c3220
11 changed files with 3486 additions and 3 deletions
@@ -0,0 +1,29 @@
package tv.orbit.classic
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import java.nio.ByteBuffer
import java.nio.ByteOrder
/** Orbit's Matroska reader: H.264 in the Video for Windows wrapper gets a picture (Dragon Ball GT, 4 November 2026); nothing else changes. */
class OrbitMatroskaTest {
private fun code(fourCc: String) = ByteBuffer.wrap(fourCc.toByteArray(Charsets.US_ASCII)).order(ByteOrder.LITTLE_ENDIAN).int.toLong() and 0xFFFFFFFFL
@Test fun h264InTheOldWrapperIsReadAsH264() {
for (fourCc in listOf("H264", "h264", "X264", "x264", "AVC1", "avc1", "DAVC", "VSSH")) assertTrue(fourCc, tv.orbit.classic.mkv.MatroskaExtractor.h264FourCc(code(fourCc)))
}
@Test fun otherFourCcsAreLeftToMedia3() {
for (fourCc in listOf("XVID", "DIVX", "H263", "WVC1", "ABCD")) assertFalse(fourCc, tv.orbit.classic.mkv.MatroskaExtractor.h264FourCc(code(fourCc)))
}
@Test fun onlyTheMatroskaReaderIsSwapped() {
val factory = OrbitExtractorsFactory()
val media3 = arrayOf<androidx.media3.extractor.Extractor>(androidx.media3.extractor.mp4.Mp4Extractor(androidx.media3.extractor.text.DefaultSubtitleParserFactory()),
androidx.media3.extractor.mkv.MatroskaExtractor(androidx.media3.extractor.text.DefaultSubtitleParserFactory()))
val ours = factory.swap(media3)
assertTrue(ours[0] === media3[0])
assertTrue(ours[1] is tv.orbit.classic.mkv.MatroskaExtractor)
}
}