Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"Bash(cargo *)",
"Bash(bun *)",
"Bash(ffprobe:*)",
"Bash(rs/libmoq/build.sh:*)",
"Bash(rs/moq-c/build.sh:*)",
"WebFetch(domain:www.ietf.org)",
"WebFetch(domain:datatracker.ietf.org)",
"WebFetch(domain:docs.rs)",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
- Cachix
- Docker
- Interop
- libmoq
- moq-c
- moq-cli
- moq-gst
- moq-relay
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'moq-relay-v*'
- 'moq-cli-v*'
- 'moq-boy-v*'
- 'libmoq-v*'
- 'moq-c-v*'
- 'moq-gst-v*'

jobs:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
env:
REF_NAME: ${{ github.ref_name }}
run: |
re='^(moq-relay|moq-cli|moq-boy|libmoq|moq-gst)-v([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$'
re='^(moq-relay|moq-cli|moq-boy|moq-c|moq-gst)-v([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$'
if [[ ! "$REF_NAME" =~ $re ]]; then
echo "Tag format not recognized: $REF_NAME" >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
extra-trusted-public-keys = kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk=

# Reuse ~/.cargo + ./target across nightly runs so only changed crates
# recompile (the relay, cli, moq-ffi, and libmoq all build from source).
# recompile (the relay, cli, moq-ffi, and moq-c all build from source).
- name: Rust cache
uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
with:
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/libmoq.yml → .github/workflows/moq-c.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: libmoq
name: moq-c

on:
push:
tags:
- "libmoq-v*"
- "moq-c-v*"
# Dry-run: build everything, publish nothing. Nightly calls every release
# workflow this way so a broken build surfaces before the tag is cut.
workflow_call:
Expand Down Expand Up @@ -55,20 +55,20 @@ jobs:
- name: Parse version
id: parse
shell: bash
run: .github/scripts/release.sh parse-version libmoq
run: .github/scripts/release.sh parse-version moq-c

- name: Build and package
shell: bash
run: |
./rs/libmoq/build.sh \
./rs/moq-c/build.sh \
--target ${{ matrix.target }} \
--version ${{ steps.parse.outputs.version }} \
--output dist

- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: libmoq-${{ matrix.target }}
name: moq-c-${{ matrix.target }}
path: dist/*

release:
Expand All @@ -87,11 +87,11 @@ jobs:

- name: Parse version
id: parse
run: .github/scripts/release.sh parse-version libmoq
run: .github/scripts/release.sh parse-version moq-c

- name: Find previous tag
id: prev_tag
run: .github/scripts/release.sh prev-tag libmoq
run: .github/scripts/release.sh prev-tag moq-c

- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
Expand All @@ -103,14 +103,14 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
RELEASE_TITLE: "libmoq v${{ steps.parse.outputs.version }}"
RELEASE_TITLE: "moq-c v${{ steps.parse.outputs.version }}"
RELEASE_PREV_TAG: ${{ steps.prev_tag.outputs.tag }}
run: .github/scripts/release.sh create artifacts

# The OBS plugin (cpp/obs) statically links libmoq, so it ships with every
# libmoq release: rebuild it against the release we just published (no
# The OBS plugin (cpp/obs) statically links moq-c, so it ships with every
# moq-c release: rebuild it against the release we just published (no
# second cargo build, guaranteed-matching ABI) and cut a parallel
# obs-moq-v<version> release. Runs after `release` so the libmoq archives
# obs-moq-v<version> release. Runs after `release` so the moq-c archives
# the plugin's CMake fetches are already live.
obs-build:
name: OBS plugin (${{ matrix.target }})
Expand Down Expand Up @@ -140,17 +140,17 @@ jobs:
- name: Parse version
id: parse
shell: bash
run: .github/scripts/release.sh parse-version libmoq
run: .github/scripts/release.sh parse-version moq-c

# Native Xcode / Visual Studio; libobs/Qt6/ffmpeg come from the obs-deps
# bundle and libmoq from the release we just published (--libmoq-release).
# bundle and moq-c from the release we just published (--moq-c-release).
- name: Build and package
shell: bash
env:
TARGET: ${{ matrix.target }}
VERSION: ${{ steps.parse.outputs.version }}
run: |
./cpp/obs/build.sh --target "$TARGET" --libmoq-release "$VERSION" --output dist
./cpp/obs/build.sh --target "$TARGET" --moq-c-release "$VERSION" --output dist

- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
Expand All @@ -173,10 +173,10 @@ jobs:

- name: Parse version
id: parse
run: .github/scripts/release.sh parse-version libmoq
run: .github/scripts/release.sh parse-version moq-c

# Only the obs-moq archives: the libmoq-* artifacts from the build job
# belong to the libmoq release, not this one.
# Only the obs-moq archives: the moq-c-* artifacts from the build job
# belong to the moq-c release, not this one.
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
Expand All @@ -185,7 +185,7 @@ jobs:
merge-multiple: true

# release.sh prev-tag keys off the current tag, but the trigger here is a
# libmoq-v* tag, so it can't find the previous obs-moq tag. Take the
# moq-c-v* tag, so it can't find the previous obs-moq tag. Take the
# newest existing obs-moq tag (excluding this version, for safe re-runs)
# so the release notes span only since the last obs-moq release.
- name: Find previous obs-moq tag
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ jobs:
if: ${{ !cancelled() }}
run: nix develop --command just rs audit

# The OBS plugin and libmoq's C fixtures are the only things that link
# libmoq.a from outside cargo, so a stale `rs/libmoq/native-libs/*.txt`
# The OBS plugin and moq-c's C fixtures are the only things that link
# libmoq.a from outside cargo, so a stale `rs/moq-c/native-libs/*.txt`
# breaks them and nothing else. obs.yml lists the inputs that can do that,
# but a list of paths can't be complete: a build script emitting
# `cargo::rustc-link-lib` needs no manifest change, and widening that
Expand All @@ -102,7 +102,7 @@ jobs:
if: ${{ !cancelled() }}
run: nix develop --command just obs ci

- name: libmoq C fixtures
- name: moq-c C fixtures
if: ${{ !cancelled() }}
run: nix develop --command just rs c-tests

Expand Down Expand Up @@ -190,9 +190,9 @@ jobs:
contents: write
id-token: write

release-libmoq:
name: libmoq
uses: ./.github/workflows/libmoq.yml
release-moq-c:
name: moq-c
uses: ./.github/workflows/moq-c.yml
permissions:
contents: write

Expand Down Expand Up @@ -308,8 +308,8 @@ jobs:
# encode/decode and its ScreenCaptureKit / AVFoundation capture, plus
# moq-audio's ScreenCaptureKit system audio and its TCC permission pre-check.
# The Linux gate skips all of it. moq-video has a release-time backstop, since
# libmoq's `libmoq-v*` tag build compiles it on Apple Silicon, but moq-audio
# has none: libmoq and moq-ffi take it codecs-only, so no release build ever
# moq-c's `moq-c-v*` tag build compiles it on Apple Silicon, but moq-audio
# has none: moq-c and moq-ffi take it codecs-only, so no release build ever
# compiles its capture backend.
#
# Same shape as `windows` and for the same reasons: a separate job because it
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/obs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ name: OBS
#
# Linux is the platform that needs no bundle at all -- nixpkgs has obs-studio,
# Qt6 and ffmpeg, so the dev shell is the whole dependency set. The plugin is
# platform-independent C++ over libmoq's C ABI, so a Linux compile catches the
# platform-independent C++ over moq-c's C ABI, so a Linux compile catches the
# breakage a macOS developer would otherwise ship uncompiled.
#
# Narrow trigger, like swift.yml: the plugin's own sources, the libmoq header
# Narrow trigger, like swift.yml: the plugin's own sources, the moq-c header
# they call through, and the flake that supplies the toolchain.
#
# libmoq's own C fixtures (`just rs c-tests`) run here too. They link libmoq.a
# moq-c's own C fixtures (`just rs c-tests`) run here too. They link libmoq.a
# from outside cargo the same way, which is too slow for nextest's hang budget
# and needs the debug staticlib this job has just built, so this is the one
# PR gate that already has everything they need. They also compile the C doc
# samples, hence `doc/lib/c/**` in the trigger.
#
# The manifests and Cargo.lock are in there for the one way a crate the plugin
# never names can break it: linking libmoq.a from outside cargo needs the native
# libraries in `rs/libmoq/native-libs/*.txt`, which are maintained by hand. A
# libraries in `rs/moq-c/native-libs/*.txt`, which are maintained by hand. A
# dependency that starts pulling in a new one leaves that list stale, and every
# Rust gate stays green, because cargo passes the flag itself and only this job
# links without it.
#
# Manifests and build scripts rather than Cargo.lock alone, because neither a
# feature toggle nor a build script has to touch the lockfile. libmoq takes
# feature toggle nor a build script has to touch the lockfile. moq-c takes
# moq-native with default features, so flipping one of those defaults on
# (`jemalloc` gates `dep:tikv-jemallocator`) changes what libmoq.a needs at link
# time while Cargo.lock stays byte-identical, since moq-relay already put that
Expand All @@ -49,7 +49,7 @@ on:
types: [opened, synchronize, reopened, closed]
paths:
- "cpp/obs/**"
- "rs/libmoq/**"
- "rs/moq-c/**"
- "doc/lib/c/**"
- "doc/lib/samples.sh"
- "rs/**/Cargo.toml"
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

# cache.yml warms the default-branch store on `main`. Pull requests restore
# it; the action refuses to publish from a pull request. It holds
# dev-profile artifacts, which is why `just obs ci` builds libmoq in debug
# dev-profile artifacts, which is why `just obs ci` builds moq-c in debug
# rather than the preset's release.
- name: Rust cache
uses: ./.github/actions/rust-cache
Expand All @@ -106,5 +106,5 @@ jobs:

# The plugin build above already produced the debug libmoq.a, so the
# cargo step inside is a no-op and this is just a cc and a run.
- name: libmoq C fixtures
- name: moq-c C fixtures
run: nix develop --command just rs c-tests
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"css.lint.unknownAtRules": "ignore",
"biome.lsp.bin": "./node_modules/.bin/biome",
"cmake.sourceDirectory": "./rs/libmoq"
"cmake.sourceDirectory": "./rs/moq-c"
}
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ These diff the branch against its base and only run the affected packages.

| Change in | Also update |
|---|---|
| `rs/moq-ffi` | `rs/libmoq`, `{py,swift,kt,dart}/`, `go/wrapper/moq/*.go` (the `go/ffi` and `dart/moq_ffi` bindings regenerate automatically, but a new method needs a hand-written wrapper too, like `py/moq-rs` or `dart/moq`), `doc/lib/{py,swift,kt,go,dart,c}` |
| `rs/moq-ffi` | `rs/moq-c`, `{py,swift,kt,dart}/`, `go/wrapper/moq/*.go` (the `go/ffi` and `dart/moq_ffi` bindings regenerate automatically, but a new method needs a hand-written wrapper too, like `py/moq-rs` or `dart/moq`), `doc/lib/{py,swift,kt,go,dart,c}` |
| `rs/moq-net` wire/API | `js/net`, `doc/concept`, `drafts/draft-lcurley-moq-lite.md` (if the wire spec changes) |
| `rs/hang` catalog/container | `js/hang`, `doc/concept`, `drafts/draft-lcurley-moq-hang.md` (if the format spec changes) |
| `rs/moq-token` | `js/token` |
Expand All @@ -102,7 +102,7 @@ These diff the branch against its base and only run the affected packages.
| `rs/moq-cli` | `doc/bin/cli.md` |
| `rs/moq-token-cli` | `doc/bin/relay/auth.md`, `doc/lib/rs/moq-token.md`, `doc/lib/rs/index.md` |
| `rs/moq-gst` | `doc/bin/gstreamer.md` |
| `rs/libmoq` C ABI (`moq.h`) | `cpp/obs/src`, `doc/bin/obs.md` |
| `rs/moq-c` C ABI (`moq.h`) | `cpp/obs/src`, `doc/bin/obs.md` |
| `js/{watch,publish}` UI/API | `demo/web` if it consumes the API |
| a kramdown-rfc construct new to `drafts/` | `doc/.vitepress/drafts.ts`, which translates the drafts into `/draft/` site pages |

Expand Down
44 changes: 24 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"rs/moq-bench",
"rs/moq-binary",
"rs/moq-boy",
"rs/moq-c",
"rs/moq-cli",
"rs/moq-e2ee",
"rs/moq-ffi",
Expand Down Expand Up @@ -44,7 +45,7 @@ members = [
default-members = [
"rs/kio",
"rs/hang",
# "rs/libmoq", # requires C toolchain
# "rs/moq-c", # requires C toolchain
"rs/moq-archive",
"rs/moq-auth",
"rs/moq-boy",
Expand Down Expand Up @@ -186,7 +187,7 @@ moq-vaapi = "0.1.0"
# cross-compiled Python, Swift, Kotlin, and Go builds have no use for: adding
# `features = ["capture"]` to a consumer that ships in those bindings pulls the
# whole device graph into every one of them. Codec features are independent of
# that argument, so moq-ffi and libmoq opt NVIDIA, OpenH264, and VAAPI back in.
# that argument, so moq-ffi and moq-c opt NVIDIA, OpenH264, and VAAPI back in.
moq-video = { version = "0.1.5", path = "rs/moq-video", default-features = false }
nix = { version = "0.31.3", features = ["net", "socket", "uio"] }
# Upstream noq-proto, only for iroh's controller factory types.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ This repository provides both [Rust](rs) and [TypeScript](js) libraries with sim
| [moq-relay](rs/moq-relay) | A clusterable relay server. This relay performs fan-out connecting multiple clients and servers together. | |
| [moq-auth](rs/moq-auth) | The authorization contract `moq-relay` speaks: requests, grants, leases, and the JWT that rides them. `moq auth` is the CLI. | [![docs.rs](https://docs.rs/moq-auth/badge.svg)](https://docs.rs/moq-auth) |
| [moq-tokio](rs/moq-tokio) | Opinionated helpers to configure a Quinn QUIC endpoint. It's harder than it should be. | [![docs.rs](https://docs.rs/moq-tokio/badge.svg)](https://docs.rs/moq-tokio) |
| [libmoq](rs/libmoq) | C bindings for `moq-net`. | [![docs.rs](https://docs.rs/libmoq/badge.svg)](https://docs.rs/libmoq) |
| [moq-c](rs/moq-c) | C bindings for `moq-net`. | [![docs.rs](https://docs.rs/moq-c/badge.svg)](https://docs.rs/moq-c) |
| [hang](rs/hang) | Media-specific encoding/streaming layered on top of `moq-net`. Can be used as a library. | [![docs.rs](https://docs.rs/hang/badge.svg)](https://docs.rs/hang) |
| [moq-cli](rs/moq-cli) | A CLI for publishing media to MoQ relays. | |
| [moq-mux](rs/moq-mux) | Media muxers and demuxers (fMP4/CMAF, HLS) for importing content into MoQ broadcasts. | [![docs.rs](https://docs.rs/moq-mux/badge.svg)](https://docs.rs/moq-mux) |
Expand Down Expand Up @@ -144,4 +144,4 @@ Licensed under either:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)

**Exception:** the OBS plugin under [`cpp/obs/`](cpp/obs) is licensed under **GPL-2.0-or-later** (see [`cpp/obs/LICENSE`](cpp/obs/LICENSE)), because it links OBS Studio's `libobs`, which is GPL-2.0. This is a separately-distributable work; per GPLv2 its presence in this repository is mere aggregation and does not affect the MIT/Apache licensing of the rest of the project. `libmoq` and the other moq crates remain MIT/Apache.
**Exception:** the OBS plugin under [`cpp/obs/`](cpp/obs) is licensed under **GPL-2.0-or-later** (see [`cpp/obs/LICENSE`](cpp/obs/LICENSE)), because it links OBS Studio's `libobs`, which is GPL-2.0. This is a separately-distributable work; per GPLv2 its presence in this repository is mere aggregation and does not affect the MIT/Apache licensing of the rest of the project. `moq-c` and the other moq crates remain MIT/Apache.
Loading
Loading