MOQX.Catalog.Track (moqx v0.7.1)

Copy Markdown View Source

A single track entry from a CMSF catalog.

Tracks represent individual media streams (video, audio, timeline, etc.) discovered from a remote relay's catalog. Use the fields directly to inspect track metadata such as codec, role, or packaging.

The raw field preserves the original JSON map for forward compatibility with catalog fields not yet modeled as struct keys.

Beyond raw access, this module also provides:

Summary

Functions

Returns %{explicit: ..., inferred: ..., extra: ...} for one track.

Returns normalized metadata explicitly signaled by the catalog for this track.

Returns raw catalog keys not currently modeled as known metadata fields.

Returns best-effort inferred metadata derived from explicit fields.

Types

inferred_container()

@type inferred_container() :: :cmaf | :fmp4 | nil

t()

@type t() :: %MOQX.Catalog.Track{
  codec: String.t() | nil,
  depends: [String.t()],
  init_data: binary() | nil,
  name: String.t(),
  packaging: String.t() | nil,
  raw: map(),
  role: String.t() | nil
}

Functions

describe(track)

@spec describe(t()) :: %{explicit: map(), inferred: map(), extra: map()}

Returns %{explicit: ..., inferred: ..., extra: ...} for one track.

explicit_metadata(track)

@spec explicit_metadata(t()) :: map()

Returns normalized metadata explicitly signaled by the catalog for this track.

Fields absent from the catalog are omitted from the returned map.

extra_metadata(track)

@spec extra_metadata(t()) :: map()

Returns raw catalog keys not currently modeled as known metadata fields.

inferred_metadata(track)

@spec inferred_metadata(t()) :: map()

Returns best-effort inferred metadata derived from explicit fields.

This does not replace explicit catalog signaling. It adds practical hints, such as inferred container type.