Repository navigation
NAT-547: Add cancellable Media3 SDR conversion adapter - #170
Conversation
b982df4 to
487a15c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 487a15c. Configure here.
487a15c to
10889a3
Compare
|
@daytime-em thanks for the review, I've added changes you requested. |
1cc4386 to
54b04f9
Compare
54b04f9 to
fff4029
Compare
daytime-em
left a comment
There was a problem hiding this comment.
Approved, with one question
| .setHdrMode(Composition.HDR_MODE_KEEP_HDR).build() | ||
| val exporter = Transformer.Builder(context) | ||
| .setLooper(looper) | ||
| .setPortraitEncodingEnabled(true) |
There was a problem hiding this comment.
Is there a particular reason why you chose to enable this? Landscape with a rotation matrix might be better supported by on-device encoders and I don't think standard input is opinionated here.
There was a problem hiding this comment.
Good point, thanks. I’ll address this in a later PR in the stack.
094af9b
into
feature/nat-534-hevc-standard-ingest

Description
Add a cancellable Media3 adapter for whole-file SDR conversion. Generated files preserve the planned codec family and dimensions and must pass output validation before they can be selected for upload.
Changes
Validation
Note
Medium Risk
New on-device transcode path touches MediaCodec/Media3 export, file lifecycle, and strict codec contracts; failures are gated by validation but bugs could reject valid inputs or leak partial files.
Overview
Adds a cancellable Media3 SDR conversion path for standard-input uploads:
SdrConversionAdapterruns preflight, disk allocation, export, and shared output validation on coroutines, delivers a single terminalSdrConversionResult, and deletes or retains partial outputs viaSdrGeneratedFilewhen cleanup fails.Encoding is intentionally strict.
SdrEncodingTargetsderives H.264/HEVC bitrate, GOP, and audio plans (including VFR keyframe windows from real presentation timestamps) and rejects HDR, linear transfer, upscaling, and other unproven plans.SdrCapabilityPreflightbounds codec capability queries;Media3SdrExportEnginedrives Transformer with no encoder fallback, pinned profiles viaStrictSdrEncoderFactory, container-first audio viaFirstAudioTrackSelector, and failures on muxer errors or Media3 transformation fallback.Robolectric tests cover GOP math, adapter lifecycle/cancellation, and Media3 configuration edge cases (device/SOC encoder hints, query budgets).
Reviewed by Cursor Bugbot for commit fff4029. Bugbot is set up for automated code reviews on this repo. Configure here.