From ed55855db374a64cfd71c6539e660a1b9ab0d852 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 20 Oct 2026 12:59:23 -0700 Subject: [PATCH 1/5] chore: claim bindings documentation quest Co-Authored-By: GPT-6 From d901092838ff5874fe0abd870ac3e6fd838a159d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Tue, 20 Oct 2026 13:13:20 -0700 Subject: [PATCH 2/5] docs(bindings): document the public Rust and C surfaces Co-Authored-By: GPT-6 --- go/wrapper/errors.go | 2 +- .../kotlin/dev/moq/audio/Audio.kt | 2 +- quest/m1/README.md | 1 - quest/m1/docs-bindings.md | 22 --- rs/moq-c/src/api.rs | 63 ++++++++ rs/moq-c/src/audio.rs | 27 +++- rs/moq-c/src/error.rs | 39 +++++ rs/moq-c/src/lib.rs | 2 + rs/moq-c/src/video.rs | 11 ++ rs/moq-ffi/src/audio.rs | 19 ++- rs/moq-ffi/src/consumer.rs | 17 ++- rs/moq-ffi/src/error.rs | 134 +++++++++++++++--- rs/moq-ffi/src/lib.rs | 1 + rs/moq-ffi/src/media.rs | 52 ++++++- rs/moq-ffi/src/origin.rs | 25 +++- rs/moq-ffi/src/producer.rs | 6 + rs/moq-ffi/src/server.rs | 2 + rs/moq-ffi/src/session.rs | 3 + rs/moq-ffi/src/video.rs | 17 ++- swift/Sources/Moq/Aliases.swift | 2 +- 20 files changed, 379 insertions(+), 68 deletions(-) delete mode 100644 quest/m1/docs-bindings.md diff --git a/go/wrapper/errors.go b/go/wrapper/errors.go index fb6df76c5cb..2dfb8be0d63 100644 --- a/go/wrapper/errors.go +++ b/go/wrapper/errors.go @@ -41,7 +41,7 @@ var ( ErrVideo = ffi.ErrMoqErrorVideo // ErrURL matches a malformed URL passed when connecting or publishing. ErrURL = ffi.ErrMoqErrorUrl - // ErrTimeOverflow matches a timestamp that overflowed its timescale. + // ErrTimeOverflow matches a timestamp outside the supported range. ErrTimeOverflow = ffi.ErrMoqErrorTimeOverflow // ErrLogLevel matches an unparseable log level string passed to LogLevel. ErrLogLevel = ffi.ErrMoqErrorLogLevel diff --git a/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/audio/Audio.kt b/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/audio/Audio.kt index ac9e6d37e16..bbead7c43fc 100644 --- a/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/audio/Audio.kt +++ b/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/audio/Audio.kt @@ -12,7 +12,7 @@ typealias EncoderInput = uniffi.moq.MoqAudioEncoderInput typealias EncoderOutput = uniffi.moq.MoqAudioEncoderOutput /** The PCM layout a [Consumer] delivers, how stale a group may get, and its playout delay. */ typealias DecoderOutput = uniffi.moq.MoqAudioDecoderOutput -/** Interleaved PCM with its presentation timestamp. */ +/** PCM samples in the configured layout with their presentation timestamp. */ typealias Frame = uniffi.moq.MoqAudioFrame /** One encoded payload from an [Encoder]. */ typealias Packet = uniffi.moq.MoqAudioPacket diff --git a/quest/m1/README.md b/quest/m1/README.md index 0520ca02390..2a5a1191b11 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -118,7 +118,6 @@ lands before the cut. - [lite-06 max sequence](/quest/m1/lite06-max-sequence.md) - group sequence 2^62-1 reaches a lite-06 subscriber or is refused loudly, instead of vanishing - [Track live signal](/quest/m1/track-live.md) - a reader can wait for its track's feed to be live, so a player skips old cached groups while a fresh upstream subscription starts - [moq-mux docs](/quest/m1/docs-mux.md) - every public moq-mux item has rustdoc and the crate warns on missing docs -- [Binding docs](/quest/m1/docs-bindings.md) - every public moq-ffi and moq-c item has rustdoc, carried into the generated bindings and `moq.h` - [JS export docs](/quest/m1/docs-js.md) - every public JS export and class member has TSDoc, and `just check` enforces it - [C++ and OBS package proof](/quest/m1/cpp-package-check.md) - the installed artifacts pass before their first release diff --git a/quest/m1/docs-bindings.md b/quest/m1/docs-bindings.md deleted file mode 100644 index c89a595def3..00000000000 --- a/quest/m1/docs-bindings.md +++ /dev/null @@ -1,22 +0,0 @@ -# [M] Document the moq-ffi and moq-c APIs - -## Goal - -Every public item in `moq-ffi` and `moq-c` has a one-line rustdoc, so the -generated bindings and `moq.h` carry it, and both crates set -`#![warn(missing_docs)]`. - -## Plan - -The m0 documentation audit (2026-10-19) found 116 undocumented public items -in `moq-ffi` (42 in `error.rs`, the rest across `media`, `audio`, `origin`, -`video`, and the producer and consumer types) and 133 in `moq-c` (39 in -`error.rs`, 63 in `api.rs`, plus `audio` and `video`). Error codes and -variants make up most of it. - -Count them with `cargo rustdoc -p --lib --all-features -- -W -missing_docs`. Check that the docs reach the outputs a binding user reads: -UniFFI copies rustdoc into the generated Python, Swift, Kotlin, and Go code, -and cbindgen copies it into `moq.h`. The hand-written wrappers listed in the -Cross-Package Sync table keep their own docs; align them where they restate -the same item. diff --git a/rs/moq-c/src/api.rs b/rs/moq-c/src/api.rs index 7948ed0c53e..d0dd5b11642 100644 --- a/rs/moq-c/src/api.rs +++ b/rs/moq-c/src/api.rs @@ -44,6 +44,7 @@ pub struct moq_container { /// The CMAF init segment (ftyp+moov), or NULL. /// Read only when `kind` is `MOQ_CONTAINER_KIND_CMAF`, where it is required. pub init: *const u8, + /// The length in bytes of `init`. pub init_len: usize, } @@ -321,10 +322,12 @@ fn container_format_from_u32(value: u32) -> Result Result