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: 0 additions & 2 deletions .github/workflows/release-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
- "rs/moq-loc/**"
- "rs/moq-msf/**"
- "rs/moq-json/**"
- "rs/moq-flate/**"
- "rs/moq-pattern/**"
- "rs/hang/**"
- "rs/kio/**"
Expand Down Expand Up @@ -234,7 +233,6 @@ jobs:
- "rs/moq-cli/**"
- "rs/moq-clock/**"
- "rs/moq-congestion/**"
- "rs/moq-flate/**"
- "rs/moq-hls/**"
- "rs/moq-ice/**"
- "rs/moq-json/**"
Expand Down
2 changes: 1 addition & 1 deletion .oss-scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN rustup show active-toolchain || rustup toolchain install \
&& curl -LsSf "https://get.nexte.st/latest/$nextest" | tar zxf - -C "$CARGO_HOME/bin" \
&& cargo nextest --version

ARG CRATES="kio hang moq-auth moq-clock moq-e2ee moq-flate moq-hls moq-ice moq-json moq-loc moq-msf moq-mux moq-net moq-pattern moq-quic moq-relay moq-rtc moq-rtmp moq-rtsp moq-sock moq-srt moq-stats moq-tokio moq-uring moq-cli"
ARG CRATES="kio hang moq-auth moq-clock moq-e2ee moq-hls moq-ice moq-json moq-loc moq-msf moq-mux moq-net moq-pattern moq-quic moq-relay moq-rtc moq-rtmp moq-rtsp moq-sock moq-srt moq-stats moq-tokio moq-uring moq-cli"

# Path specs, because the lockfile also has published copies of some workspace crates.
# io-uring compiles the relay's io_uring QUIC workers (`--runtime-io-uring`), which the default features leave out.
Expand Down
2 changes: 1 addition & 1 deletion .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Most important, in this order:
2. Authorization: a session publishing, subscribing, or seeing announcements outside its grant, or reaching another root (tenant) through path tricks, revalidation, mounts, or cluster links.
3. `rs/moq-mux` and `rs/hang`: container, codec, and catalog parsing of publisher-controlled bytes.
4. The ingest gateways: `rs/moq-rtmp`, `rs/moq-rtsp`, `rs/moq-srt`, `rs/moq-rtc`, `rs/moq-ice`, `rs/moq-hls`.
5. `rs/moq-e2ee`, `rs/moq-cli`, `rs/moq-flate`, `rs/moq-json`, `rs/moq-stats`, `rs/kio`, `rs/moq-clock`.
5. `rs/moq-e2ee`, `rs/moq-cli`, `rs/moq-json`, `rs/moq-stats`, `rs/kio`, `rs/moq-clock`.

`unsafe` is rare and worth reading closely where it appears: `rs/moq-quic`, `rs/moq-net/src/model`, `rs/moq-net/src/util/cell.rs`, `rs/moq-net/src/transport.rs`, and `rs/moq-relay/src/uring.rs`.

Expand Down
15 changes: 0 additions & 15 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ default-members = [
"rs/moq-e2ee",
# "rs/moq-ffi", # requires Python/maturin
# "rs/moq-gst", # requires GStreamer
"rs/moq-flate",
"rs/moq-hls",
"rs/moq-ice",
"rs/moq-json",
Expand Down Expand Up @@ -142,7 +141,6 @@ moq-auth = { version = "0.2.1", path = "rs/moq-auth" }
moq-clock = { version = "0.11.0", path = "rs/moq-clock" }
moq-clock-macros = { version = "0.1.0", path = "rs/moq-clock/macros" }
moq-congestion = { version = "0.1.0", path = "rs/moq-congestion" }
moq-flate = { version = "0.2.0", path = "rs/moq-flate" }
moq-hls = { version = "0.5.11", path = "rs/moq-hls", default-features = false }
moq-ice = { version = "0.1.0", path = "rs/moq-ice" }
moq-json = { version = "0.5.8", path = "rs/moq-json" }
Expand Down
23 changes: 1 addition & 22 deletions bun.lock

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

6 changes: 6 additions & 0 deletions dart/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Compression moves to the track

`package:moq/flate.dart` is removed: publish opaque bytes on a `TrackProducer`.
`SnapshotConfig` and `WindowConfig` lose `compression`, and `StreamConfig` is removed. Publish the track with `MoqTrackInfo(compress: true)` instead.
`StreamProducer` drops its `config`, and `SnapshotConsumer`, `StreamConsumer`, and `WindowConsumer` take only the track.

### Paths with an empty segment are refused ([#6648](https://github.com/moq-dev/moq/pull/6648))

Publishing, serving, or requesting a broadcast at a path with a leading, trailing, or doubled `/` throws instead of collapsing it. Pass the canonical path, such as `room/cam`.
Expand Down
13 changes: 0 additions & 13 deletions dart/moq/lib/flate.dart

This file was deleted.

18 changes: 10 additions & 8 deletions dart/moq/lib/json.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
/// Each type wraps a track: a producer takes over a `TrackProducer` (the
/// snapshot and stream producers also advertise it in the broadcast's catalog,
/// which has no window mode), and a consumer takes over a `TrackConsumer` that
/// has not read a group yet. Values cross as JSON
/// strings. Import it with a prefix, since `dart:convert` has a `json` too:
/// has not read a group yet. Values cross as JSON strings. Compression is the
/// track's: publish JSON with `MoqTrackInfo(compress: true)`, and a consumer
/// reads it with no option of its own. Import it with a prefix, since
/// `dart:convert` has a `json` too:
///
/// ```dart
/// import 'package:moq/json.dart' as moq_json;
///
/// final status = moq_json.SnapshotProducer(
/// broadcast: broadcast,
/// track: broadcast.publishTrack(name: 'status', info: null),
/// track: broadcast.publishTrack(
/// name: 'status',
/// info: MoqTrackInfo(compress: true),
/// ),
/// config: moq_json.SnapshotConfig(),
/// );
/// ```
Expand All @@ -26,7 +31,7 @@ typedef SnapshotProducer = MoqJsonSnapshotProducer;
/// the newest with `latest()`.
typedef SnapshotConsumer = MoqJsonSnapshotConsumer;

/// Configures a lossy latest-value JSON track.
/// Configures a lossy latest-value JSON producer.
typedef SnapshotConfig = MoqJsonSnapshotConfig;

/// Publishes a lossless stream of JSON records on a track it takes over.
Expand All @@ -35,9 +40,6 @@ typedef StreamProducer = MoqJsonStreamProducer;
/// Consumes a lossless stream of JSON records from a track it takes over.
typedef StreamConsumer = MoqJsonStreamConsumer;

/// Configures a lossless JSON stream track.
typedef StreamConfig = MoqJsonStreamConfig;

/// A JSON string read from a track, with the timestamp of the frame that
/// carried it in microseconds, or null when untimed. Rounded down to a whole
/// microsecond, so a tick on a track like 90 kHz may not survive a read and
Expand All @@ -52,7 +54,7 @@ typedef WindowProducer = MoqJsonWindowProducer;
/// over. Group rolls never surface.
typedef WindowConsumer = MoqJsonWindowConsumer;

/// Configures a JSON window track.
/// Configures a JSON window producer.
typedef WindowConfig = MoqJsonWindowConfig;

/// One change to a window: [WindowEventPush], [WindowEventPop], or
Expand Down
50 changes: 5 additions & 45 deletions dart/moq/test/moq_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'dart:typed_data';

import 'package:moq/audio.dart' as moq_audio;
import 'package:moq/media.dart' as moq_media;
import 'package:moq/flate.dart' as moq_flate;
import 'package:moq/json.dart' as moq_json;
import 'package:moq/moq.dart';
import 'package:moq/video.dart' as moq_video;
Expand Down Expand Up @@ -56,39 +55,6 @@ void main() {
expect(() => catalog.now(), throwsA(isA<ClosedMoqException>()));
});

for (final timestamp in <int?>[null, 123456]) {
for (final mode in ['snapshot', 'stream']) {
test('flate $mode preserves timestamp $timestamp', () async {
final broadcast = BroadcastProducer();
final info = timestamp == null ? null : TrackInfo(timescale: 1000000);
final track = broadcast.publishTrack(name: 'data', info: info);
final consumer = track.consume(subscription: null);
final payload = utf8.encode('payload');
if (mode == 'snapshot') {
final producer = moq_flate.SnapshotProducer(
broadcast: broadcast,
track: track,
config: moq_flate.Config(),
);
producer.update(payload: payload, timestampUs: timestamp);
producer.finish();
} else {
final producer = moq_flate.StreamProducer(
broadcast: broadcast,
track: track,
config: moq_flate.Config(),
);
producer.append(payload: payload, timestampUs: timestamp);
producer.finish();
}
final frame = await consumer.readFrame().timeout(timeout);
expect(frame?.payload, payload);
expect(frame?.timestampUs, timestamp);
broadcast.close();
});
}
}

test('raw writes without timestamps stay untimed', () async {
final broadcast = BroadcastProducer();
final track = broadcast.publishTrack(name: 'untimed', info: null);
Expand Down Expand Up @@ -544,18 +510,15 @@ void main() {
broadcast: broadcast,
track: broadcast.publishTrack(
name: 'status',
info: MoqTrackInfo(timescale: 1000000),
info: MoqTrackInfo(timescale: 1000000, compress: true),
),
config: moq_json.SnapshotConfig(),
);
final track = await broadcast
.consume()
.subscribeTrack(name: 'status', subscription: null)
.timeout(timeout);
final consumer = moq_json.SnapshotConsumer(
track: track,
config: moq_json.SnapshotConfig(),
);
final consumer = moq_json.SnapshotConsumer(track: track);

for (var n = 1; n <= 4; n++) {
producer.update(value: jsonEncode({'n': n}), timestampUs: n * 1000);
Expand All @@ -581,18 +544,15 @@ void main() {
final producer = moq_json.WindowProducer(
track: broadcast.publishTrack(
name: 'log',
info: MoqTrackInfo(timescale: 1000000),
info: MoqTrackInfo(timescale: 1000000, compress: true),
),
config: moq_json.WindowConfig(compression: true),
config: moq_json.WindowConfig(),
);
final track = await broadcast
.consume()
.subscribeTrack(name: 'log', subscription: null)
.timeout(timeout);
final consumer = moq_json.WindowConsumer(
track: track,
config: moq_json.WindowConfig(compression: true),
);
final consumer = moq_json.WindowConsumer(track: track);

for (var n = 0; n < 3; n++) {
producer.push(value: jsonEncode({'n': n}), timestampUs: n * 1000);
Expand Down
Loading
Loading