Repository navigation
feat(dart): ship codecs and expose audio and video namespaces - #5839
Conversation
|
Outcome: the quest is implemented. Local This PR stays a draft for one open decision: the variant constructor names ( The size and build-time figures come from CI runners (Nightly 38897397428), not the loaded local host. (written by Claude Opus 5.5) |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 seconds. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughDart FFI builds now use Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4874c93c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import 'package:moq_ffi/moq_ffi.dart'; | ||
|
|
||
| /// Encodes PCM and publishes it as a track; construct it from the broadcast's `CatalogProducer`. | ||
| typedef Producer = MoqAudioProducer; |
There was a problem hiding this comment.
Raise the moq_ffi dependency floor
When an existing application has moq_ffi 0.4.3 locked and upgrades moq, the unchanged ^0.4.3 constraint in dart/moq/pubspec.yaml permits that resolution, but that raw binding does not define MoqAudioProducer or the other newly aliased codec types, so the package fails to compile. Raise the dependency floor to the first codec-enabled moq_ffi release so every allowed resolution provides this API.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I disagree with fixing this in this PR. The floor was already stale on main: media.dart aliases MoqMediaCatalogProducer and MoqMediaTimebase, which no published moq_ffi has, 0.4.16 included. The correct floor is a release that hasn't been cut yet, and package versions are bumped at release time. I added the floor bump to /quest/m2/release/dart-publish.md so it lands with the next moq-dart-v* tag.
(written by Claude Opus 5.5)
cfe3bd6 to
1685da0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1685da0133
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6537c85 to
213b42a
Compare
|
Ready for review. Decision (a) is recorded in the PR body: the Go-style variant aliases stay as shipped. Since the draft:
CI: 20 checks passed, 9 skipped, on head (written by Claude Opus 5.5) |
|
Merging. Summary:
(written by Claude Opus 5.5) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Dart libraries now build moq-ffi with its default features, like the Kotlin and Swift ones, so `package:moq/video.dart` and `package:moq/audio.dart` expose the native encoders, producers, and decoding consumers. A Dart test decodes a subscribed H.264 rendition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebased onto #5844, which added the audio consumer's playout delay and assigned its Dart exposure to this quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
213b42a to
332cad7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 332cad7a64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-enqueueing. The first queue attempt dropped for a merge conflict with #5844, which added the audio playout delay and assigned its Dart exposure to this quest. Since then:
(written by Claude Opus 5.5) |
Problem
Dart was the only binding that couldn't originate media. Its libraries were built
--no-default-features, so they had noMoqAudioProducer, noMoqVideoProducer, and no encoder or decoder. The codec namespaces (#5694) have landed, so the Dart wrapper can now expose them in their final shape in one go.Approach
sh/dart/generate.sh, the Native Assets hook's from-source build, andrelease-dart-ffi.yml. Bindings are regenerated.release-ffi.yml'sdefault-featuresinput, so this PR removes the input.package:moq/video.dartandpackage:moq/audio.dartlibraries mirror Kotlin'sdev.moq.video/dev.moq.audio. They are typedefs over the generated types (Producer,Encoder,Consumer,EncoderInput,EncoderOutput,DecoderOutput,Frame, ...) plusDurationviews (timestamp,maxDelay,frameDuration).audioalso aliasesPresetand exposes the playout delay from feat(ffi): configure and observe audio playout delay in every binding #5844 asDurationviews (DecoderOutput.delay,Consumer.delay). Video also getsDecodedFrame,Surface, andPixelBuffer, plus the variant constructorsAutoEncoder()/HardwareEncoder()/SoftwareEncoder()/NamedEncoder(name)andKeyframe(interval).decoded video frame owns its picturesoftware-encodes H.264, subscribes throughvideo.Consumer, and checks the I420 and RGBA pixel sizes plus RGBA alpha, matching the Kotlin test. A delay test checks that a fixed playout delay reads back unchanged and an estimated one moves as frames arrive. Another test checks the Opusaudio.Producer, and the Duration test now covers the codec records. CI runs them throughjust dart check(check.yml's dispatcher selectsdartforrs/moq-ffi/anddart/changes).doc/lib/dartdrops the "No codecs" caveat and adds encode and decode samples, which the doc-sample check compiles.doc/lib/index.mddrops the Dart exception. Package READMEs and.github/ffi.mdare updated too.Cost
Numbers come from Nightly run 38897397428, which builds the same targets both ways: minimal Dart, and default-feature shared builds for Go, Kotlin and Swift. CI runners, not this host.
Shipped shared library, uncompressed:
Per-target release build job: +0 to +3 minutes. For example, Windows went from 21 to 24, Android armv7 from 7 to 9, and iOS from 12 to 14. Across Dart's 11 targets that is roughly +10 to 15 runner-minutes per nightly or tag. Locally, the extra codec compile in
just dart checkwas about 6 minutes cold on a loaded host and is cached afterwards.Deployment floors are unchanged (Android API 24, iOS 16).
Impact
package:moq/video.dartandpackage:moq/audio.dart, listed above.package:moq_ffinow exports everyMoqAudio*/MoqVideo*codec type, includingMoqVideoConsumerandMoqVideoDecodedFrame.moq_ffinative assets now carry the audio and video codecs, about 9 to 11% larger.release-ffi.ymlloses itsdefault-featuresinput.Decisions
video.AutoEncoder()/HardwareEncoder()/SoftwareEncoder()/NamedEncoder(name),video.Keyframe(interval), andvideo.PixelBuffer. These mirror Go andmedia.dart'sNamed/Requested. The rejected options were Kotlin-style constants and leaving the variants unaliased.Alternatives
release-shared-ffi.ymlnow that its libraries match the shared default-feature ones. That would save about 9 duplicate native builds per run, but it changes the tag-triggered release path, and the shared set would needx86_64-apple-darwinandx86_64-apple-iosadded. Left as a follow-up.frames()Streamhelper overvideo.Consumer/audio.Consumer, as Kotlin does. Skipped because Dart has no Stream helper formedia.TrackConsumereither. Better added for all consumers at once.Follow-ups
MoqAudioPreset(Go and now Dart do), and all of them call audio frames "interleaved" even with the planar formats.moq'smoq_ffi: ^0.4.3floor is stale: no publishedmoq_ffihas the media or codec types. Raising it is now a step in /quest/m2/release/dart-publish.md, to land with the release cut.reuse-native), dropping its duplicate default-feature builds.rs/moq-ffi/build.sh --no-default-featureshas no CI caller left. Drop it, or keep it for local minimal builds.sh/sizehas no Dart history keys, so this size jump isn't tracked byShipping sizes.(written by Claude Opus 5.5)
🤖 Generated with Claude Code