Skip to content

feat(libmoq)!: configure and label media renditions - #2831

Open
sreejon wants to merge 7 commits into
moq-dev:devfrom
sreejon:feat/libmoq-media-track-name
Open

feat(libmoq)!: configure and label media renditions#2831
sreejon wants to merge 7 commits into
moq-dev:devfrom
sreejon:feat/libmoq-media-track-name

Conversation

@sreejon

@sreejon sreejon commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • Add optional human-readable labels to audio and video rendition catalog entries while keeping generated transport track names as internal identifiers.
  • Propagate labels through Hang, the muxer, libmoq, moq-ffi, and the Python, Swift, Go, Kotlin, and C documentation surfaces.
  • Replace libmoq's positional moq_publish_media arguments with an extensible moq_media_config, following the C configuration pattern established by refactor(libmoq)!: replace the client setters with a config struct #2880.
  • Update the Hang draft and the OBS consumer to match the new API.

Public API changes

Breaking:

  • C moq_publish_media now takes (uint32_t broadcast, const moq_media_config *config) instead of positional format, init, and label arguments.

Additive:

  • New C moq_media_config with required format plus optional init bytes and label. Optional fields use zero defaults, and future fields can be appended.
  • Hang Rust and TypeScript audio/video catalog configs gain an optional label.
  • C moq_video_config and moq_audio_config append label and label_len.
  • MoqInit gains an optional label through moq-ffi and generated bindings.
  • Python and Swift media publishing gain optional label arguments, and Go gains WithLabel.

The C signature break keeps this PR targeted at dev.

Test plan

  • just rs check -p libmoq
  • just rs test -p libmoq (66 passed)
  • Generated moq.h signature and append-only struct field order inspected
  • just obs check
  • just obs test
  • just obs build
  • just test smoke-full (all Rust, Python, JS, C, and GStreamer combinations passed)
  • GitHub Actions just check and just test

Cross-package sync

  • Updated the Hang draft and concept documentation for the catalog field.
  • Updated libmoq's OBS consumer, C documentation, tests, and changelog.
  • Updated moq-ffi wrappers and documentation across Python, Swift, Kotlin, and Go.

(Written by GPT-5)

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
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.
@kixelated kixelated changed the title feat!(libmoq): add an optional track name to moq_publish_media feat(libmoq)!: label media renditions Aug 16, 2026
Co-Authored-By: GPT-5 <noreply@openai.com>
@kixelated kixelated changed the title feat(libmoq)!: label media renditions feat(libmoq)!: configure and label media renditions Aug 16, 2026
`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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants