Repository navigation
test/ci: unit tests + lint in CI (#34); fix H.265 FU NAL header (#43) - #44
Conversation
The start fragment wrote only the first byte of the 2-byte NAL header and then copied from the FU header, so the FU header became the second byte (nuh_layer_id 18, TemporalId 2 for an IDR). Conforming decoders ignore such NAL units. Copy the layer-id/TID byte from the payload header, mask the FU type with 0x3F and skip payload header + FU header (fixes #43).
28 tests for the pure logic: SDP parsing and AudioConfig, G.711/L16 conversion, AAC AudioSpecificConfig and AU-header bit reading, RTP header length/padding, RTP-over-TCP framing (EOF, truncation, resync), RTSP response parsing and NalAssembler (H.264 single/FU-A, H.265 single/FU, codec switch). android.jar stubs return default values. The lint baseline records the 16 known findings, so lintDebug only fails on new ones.
A new 'test' job runs testDebugUnitTest and lintDebug on every push and pull request (including forks, no secrets needed) and uploads the reports on failure. The signed build depends on it and is skipped for pull requests (fixes #34).
PR Summary by QodoAdd JVM tests and CI checks; fix H.265 FU reassembly
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
- AudioManager.splitAdts() and splitAuHeaders() are now static helpers (behaviour unchanged) with tests for single and multiple frames, bad sync, layer bits, too-small and truncated frames, two AUs, fragmented AUs and short payloads. - CI: when a manual build targets a commit without lint-baseline.xml, unit tests still run but lint is skipped, so older commits can still be released.
Fixes #34, fixes #43.
Tests (#34)
28 JVM unit tests in
android/app/src/test. No device or emulator is needed;unitTests.returnDefaultValues = truelets theandroid.jarstubs (such asLog) return defaults.SdpParserTestmpeg4-genericwith fmtp, fmtp before rtpmap, invalid AU-header layout, static PT 0/8, L16, video and audio sharing a PT number, Opus, no audioAudioDecodeTestRtpTestRtspResponseTestNalAssemblerTestLint
android/app/lint-baseline.xmlrecords the 16 existing findings (errors and warnings).lintDebugpasses now and fails only on new errors. As existing issues get fixed (#30, #35, ...), the baseline should be regenerated with./gradlew updateLintBaseline.CI
testjob:./gradlew testDebugUnitTest lintDebugon every push and pull request, including PRs from forks, since no secrets are needed. Reports are uploaded as an artifact when the job fails.buildjob (signed release, release upload, Telegram) now runs only aftertestsucceeds, and is skipped for pull requests.Bug found by the tests (#43)
NalAssemblerbuilt the 2-byte H.265 NAL header of a fragmented unit with the FU header as the second byte. For an IDR that gives26 93instead of26 01, which reads asnuh_layer_id = 18. Conforming decoders drop such NAL units. Fixed in a separate commit (4b90de4); theh265Futest failed before the fix and passes after it.Verification
testDebugUnitTest28/28,lintDebugOK,assembleDebugOK.basicalready wrote the second byte the same way (0x01). It is still worth checking that H.265 cameras play on a device after the merge.