Package msf implements the MOQT Streaming Format catalog and timeline data model from draft-ietf-moq-msf-01.
It focuses on:
- parsing independent catalogs and catalog deltas
- validating MSF catalog constraints
- applying delta updates to a base catalog
- encoding and decoding timeline record formats (including media-timeline templates)
- modeling draft-01 catalog features: publish tracks, initialization data list, encryption metadata, authorization info, accessibility descriptors, and variable substitution
- optionally exposing a small catalog-aware
moqt.TrackHandlerviaBroadcast
Most of the package is transport-agnostic. The networking primitives themselves still live in ../moqt.
import "github.com/qumo-dev/gomoqt/msf"catalog, err := msf.ParseCatalog(raw)
if err != nil {
// invalid JSON or wrong catalog shape
}
if err := catalog.Validate(); err != nil {
// syntactically valid, but violates MSF rules
}base, err := msf.ParseCatalog(baseJSON)
if err != nil {
// handle error
}
delta, err := msf.ParseCatalogDelta(deltaJSON)
if err != nil {
// handle error
}
updated, err := base.ApplyDelta(delta)
if err != nil {
// handle validation or merge error
}broadcast, err := msf.NewBroadcast(msf.Catalog{Version: 1})
if err != nil {
// handle error
}
err = broadcast.RegisterTrack(msf.Track{
Name: "video",
Packaging: msf.PackagingLOC,
IsLive: new(bool),
}, myHandler)
if err != nil {
// handle error
}Catalog— independent MSF catalog snapshotCatalogDelta— incremental update for an existing catalogTrack— track entry in an independent catalog or add operationTrackRef— minimal track identity used byremoveTracksTrackClone— clone operation withparentName/parentNamespaceand overridesInitDataRef— entry in the catalog Initialization Data List, referenced by trackinitRefTemplate— media-timeline template for fixed-duration segmentsMediaTimelineEntry— media-time to object-location mappingEventTimelineRecord— event timeline record with a single index selectorBroadcast— optional helper that serves the reserved catalog track and routes registered track handlers
- Optional catalog fields use pointer types where the package needs to preserve the difference between “field omitted” and “field explicitly set to zero”.
- Unknown JSON properties are preserved in
ExtraFieldsso catalogs can be round-tripped without dropping extensions. CatalogandCatalogDeltaare intentionally separate types so independent snapshots and incremental updates cannot be confused accidentally.Broadcastroutes non-catalog tracks byTrack.Name, so it rejects catalogs that reuse the same name in multiple namespaces.
- MSF draft-ietf-moq-msf-01
- CMSF draft-ietf-moq-cmsf-00 (non-spec extension; not part of MSF-01)
- Core
moqtpackage - Root project README