Play H.264 in the old VfW MKV wrapper (Dragon Ball GT): Orbit's copy of Media3's Matroska reader
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user