Skip to content

Commit 746f3ce

Browse files
kixelatedclaude
andauthored
moq-lite-05: add Start Frame to FETCH (#24)
* moq-lite-05: add Start Frame to FETCH Allow a subscriber to begin a FETCH partway through a group instead of always at frame 0, enabling resumption of a partially-received group. A Start Frame past the end of the group returns no frames. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * moq-lite-05: rename Start/End Group to Group Start/Group End Use entity-first naming consistent with Group Sequence and the new Frame Start field. Wire format is unchanged. The moq-lite-03 changelog keeps the original names since those drafts shipped with them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * moq-lite-05: clarify Frame Start timing for in-progress groups Define when the out-of-range case is evaluated: for an open group the publisher waits and delivers frame Frame Start (and later) as they arrive, like a live subscription; the empty/out-of-range result is only resolved against the final frame count once the group closes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5510ab2 commit 746f3ce

1 file changed

Lines changed: 28 additions & 16 deletions

File tree

draft-lcurley-moq-lite.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Either endpoint MAY reset/cancel the stream at any time.
295295
### Fetch
296296
A subscriber opens a Fetch Stream (0x3) to request a single Group from a Track.
297297

298-
The subscriber sends a FETCH message containing the broadcast path, track name, priority, and group sequence.
298+
The subscriber sends a FETCH message containing the broadcast path, track name, priority, group sequence, and the frame index at which to start.
299299
Unlike Group Streams (which MUST start with a GROUP message), the publisher responds with FRAME messages directly on the same bidirectional stream — there is no preceding GROUP header.
300300
The Subscribe ID and Group Sequence for the returned FRAME messages are implicit, taken from the original FETCH request.
301301
The publisher FINs the stream after the last frame, or resets the stream on error.
@@ -608,8 +608,8 @@ SUBSCRIBE Message {
608608
Subscriber Priority (8)
609609
Subscriber Ordered (8)
610610
Subscriber Stale (i)
611-
Start Group (i)
612-
End Group (i)
611+
Group Start (i)
612+
Group End (i)
613613
}
614614
~~~
615615

@@ -635,12 +635,12 @@ A value of `0` means the subscriber wants only the latest group in live delivery
635635
This is a delivery-time preference, not a retention rule: the publisher's cache (see `Publisher Cache` in [SUBSCRIBE_OK](#subscribe-ok)) may still hold these groups for FETCH or future subscriptions.
636636
See the [Expiration](#expiration) section for more information.
637637

638-
**Start Group**:
638+
**Group Start**:
639639
The first group to deliver.
640640
A value of 0 means the latest group (default).
641641
A non-zero value is the absolute group sequence + 1.
642642

643-
**End Group**:
643+
**Group End**:
644644
The last group to deliver (inclusive).
645645
A value of 0 means unbounded (default).
646646
A non-zero value is the absolute group sequence + 1.
@@ -657,8 +657,8 @@ SUBSCRIBE_UPDATE Message {
657657
Subscriber Priority (8)
658658
Subscriber Ordered (8)
659659
Subscriber Stale (i)
660-
Start Group (i)
661-
End Group (i)
660+
Group Start (i)
661+
Group End (i)
662662
}
663663
~~~
664664

@@ -677,8 +677,8 @@ SUBSCRIBE_OK Message {
677677
Publisher Priority (8)
678678
Publisher Ordered (8)
679679
Publisher Cache (i)
680-
Start Group (i)
681-
End Group (i)
680+
Group Start (i)
681+
Group End (i)
682682
Publisher Timescale (i)
683683
Publisher Compression (i)
684684
}
@@ -687,12 +687,12 @@ SUBSCRIBE_OK Message {
687687
**Type**:
688688
Set to 0x0 to indicate a SUBSCRIBE_OK message.
689689

690-
**Start Group**:
690+
**Group Start**:
691691
The resolved absolute start group sequence.
692692
A value of 0 means the start group is not yet known; the publisher MUST send a subsequent SUBSCRIBE_OK with a resolved value.
693693
A non-zero value is the absolute group sequence + 1.
694694

695-
**End Group**:
695+
**Group End**:
696696
The resolved absolute end group sequence (inclusive).
697697
A value of 0 means unbounded.
698698
A non-zero value is the absolute group sequence + 1.
@@ -709,7 +709,7 @@ The minimum age, in milliseconds, the publisher guarantees to retain a group pas
709709
Applies only to non-latest groups; the latest group is always retained.
710710
Analogous to HTTP `Cache-Control: max-age` as a lower bound:
711711

712-
- A subscriber MAY issue a SUBSCRIBE or FETCH with an older `Start Group` and expect the publisher to still have it, as long as the group's age does not exceed `Publisher Cache`.
712+
- A subscriber MAY issue a SUBSCRIBE or FETCH with an older `Group Start` and expect the publisher to still have it, as long as the group's age does not exceed `Publisher Cache`.
713713
- The publisher MAY retain groups longer than `Publisher Cache` (a best-effort cache beyond the guarantee); subscribers MUST NOT assume older groups are unavailable.
714714

715715
A value of `0` means no retention guarantee beyond live delivery; older groups MAY still be available but the publisher makes no promise.
@@ -744,19 +744,19 @@ A SUBSCRIBE_DROP message is sent by the publisher on the Subscribe Stream when g
744744
SUBSCRIBE_DROP Message {
745745
Type (i) = 0x1
746746
Message Length (i)
747-
Start Group (i)
748-
End Group (i)
747+
Group Start (i)
748+
Group End (i)
749749
Error Code (i)
750750
}
751751
~~~
752752

753753
**Type**:
754754
Set to 0x1 to indicate a SUBSCRIBE_DROP message.
755755

756-
**Start Group**:
756+
**Group Start**:
757757
The first absolute group sequence in the dropped range.
758758

759-
**End Group**:
759+
**Group End**:
760760
The last absolute group sequence in the dropped range (inclusive).
761761

762762
**Error Code**:
@@ -773,6 +773,7 @@ FETCH Message {
773773
Track Name (s)
774774
Subscriber Priority (8)
775775
Group Sequence (i)
776+
Frame Start (i)
776777
}
777778
~~~
778779

@@ -789,6 +790,15 @@ See the [Prioritization](#prioritization) section for more information.
789790
**Group Sequence**:
790791
The sequence number of the group to fetch.
791792

793+
**Frame Start**:
794+
The index of the first frame to return, counting from `0` for the first frame in the group.
795+
The publisher skips all frames before this index and begins the response at this frame, allowing a subscriber to resume partway through a group.
796+
A value of `0` returns the entire group.
797+
If the group is still in progress and frame `Frame Start` has not yet been produced, the publisher waits and delivers it (and any later frames) as they arrive, just like a live subscription; it does not return early.
798+
Only once the group is complete is the out-of-range case resolved: if `Frame Start` is greater than or equal to the group's final frame count, the publisher returns no FRAME messages and FINs the stream.
799+
800+
The returned FRAME messages are otherwise unchanged: when the Track's `Publisher Timescale` is non-zero, the first returned frame's `Timestamp Delta` is delta-encoded from `0` (i.e. its absolute timestamp), not from the timestamp of the skipped frame (see [FRAME](#frame)).
801+
792802
The publisher responds with FRAME messages on the same stream.
793803
The publisher FINs the stream after the last frame, or resets on error.
794804

@@ -897,6 +907,8 @@ A generic library or relay MUST NOT inspect or modify the decompressed contents
897907
# Appendix A: Changelog
898908

899909
## moq-lite-05
910+
- Added `Frame Start` to FETCH so a subscriber can begin partway through a group instead of always at frame `0`, allowing resumption of a partially-received group.
911+
- Renamed `Start Group`/`End Group` to `Group Start`/`Group End` in SUBSCRIBE, SUBSCRIBE_UPDATE, SUBSCRIBE_OK, and SUBSCRIBE_DROP for consistency with the entity-first naming used elsewhere (e.g. `Group Sequence`). Wire format unchanged.
900912
- Allowed a duplicate `active` ANNOUNCE to atomically replace the prior advertisement (equivalent to UNANNOUNCE+ANNOUNCE). Used when only the origin or hop path changes (e.g. relay failover) without interrupting the broadcast. No new wire enum value — the existing `active` status carries the new metadata.
901913
- Added ANNOUNCE_OK message, sent once at the head of the Announce Stream response. Carries the publisher's `Hop ID` (hoisted out of every ANNOUNCE's Hop ID list) and an `Active Count` so subscribers can batch the initial set instead of reporting each ANNOUNCE as it trickles in.
902914
- Added `Publisher Timescale` to SUBSCRIBE_OK for per-track timestamp negotiation. When `Publisher Timescale` is 0, the per-frame timestamp/duration fields are omitted entirely from FRAME and datagram bodies.

0 commit comments

Comments
 (0)