feat(libmoq)!: configure and label media renditions - #2831
Open
sreejon wants to merge 7 commits into
Open
Conversation
moq_publish_media now takes name/name_len, letting the caller pick the track name instead of always deriving it from the format. Either way the name goes through broadcast.unique_name, so a repeated name gets a fresh index prefix rather than colliding. This changes the C ABI (7 args instead of 5), so the OBS plugin calls and its test stub pass NULL/0 to keep the previous behavior.
sreejon
marked this pull request as ready for review
August 13, 2026 18:25
…ature from_rgb and from_yuyv are only used by the V4L2 capture path (Linux), which lives behind the capture feature. When moq-video is compiled as a dependency with capture disabled (as libmoq does), the functions are orphaned on Linux, triggering a dead_code error with -D warnings.
Co-authored-by: GPT-5 <noreply@openai.com>
Co-Authored-By: GPT-5 <noreply@openai.com>
`Container::new` and `ContainerStream::new` took a format and a buffer, so the
`label` and `video` fields of the caller's `Init` had nowhere to go and were
dropped. `publish_media("fmp4", init, label="English")` returned success and
silently discarded the label, on every language surface. The `video` hint had
the same hole before labels existed.
Both constructors now take the `Init` and reject either field, so the rule lives
where the dispatch does rather than in each of the three callers. The format is
matched first, so a codec format still reports `UnknownFormat` and the caller's
fallback to `Track::new` is unchanged.
Also:
- Document that an explicit `VideoHint::label` beats `Init::label`, and pin it
with a test. Both reach `VideoConfig::label` and the precedence was unstated.
- Drop `Init::with_label`, unused outside tests. Its one production call site
holds an `Option` and assigns the field, which is how every sibling config in
the tree is built.
- Note in libmoq's changelog that `moq_video_config` / `moq_audio_config`
growing is a recompile, not a drop-in header swap: both are caller-allocated
and the consume calls write into them.
- Carry the container caveat into the Python, Swift, Kotlin, Go, and C docs,
which described the label with no mention of it.
- Restore the `lang` / `label` guidance the hang draft lost when `label` moved
into the common rendition fields, and stop calling that section
audio-and-video only now that it covers text.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
moq_publish_mediaarguments with an extensiblemoq_media_config, following the C configuration pattern established by refactor(libmoq)!: replace the client setters with a config struct #2880.Public API changes
Breaking:
moq_publish_medianow takes(uint32_t broadcast, const moq_media_config *config)instead of positional format, init, and label arguments.Additive:
moq_media_configwith required format plus optional init bytes and label. Optional fields use zero defaults, and future fields can be appended.label.moq_video_configandmoq_audio_configappendlabelandlabel_len.MoqInitgains an optional label through moq-ffi and generated bindings.WithLabel.The C signature break keeps this PR targeted at
dev.Test plan
just rs check -p libmoqjust rs test -p libmoq(66 passed)moq.hsignature and append-only struct field order inspectedjust obs checkjust obs testjust obs buildjust test smoke-full(all Rust, Python, JS, C, and GStreamer combinations passed)just checkandjust testCross-package sync
(Written by GPT-5)