Cross-reference

getUserMedia & MediaStreamTrack

Where it enters the lineage

This concept is first developed in § m2-l5 — The Signaling Void: Your First Peer Connection. The historical problem there matters: WebRTC components are not arbitrary layers; each is a repair for a specific limit in the system before it.

1What it is

Capture basics as met in m2-l5: getUserMedia and the permission model, secure contexts, and permission-free synthetic sources (canvas.captureStream, AudioContext oscillators). Extended in m4-l2 with the constraints/fitness-distance system, track lifecycle, and enumerateDevices privacy.

Capture is permissioned and constrained, and tracks have independent lifecycle state. Tests can avoid permission prompts with canvas.captureStream, Web Audio sources, or transceivers that negotiate media without a physical device.

2How to reason about it

The operational claim is precise: Capture basics as met in m2-l5: getUserMedia and the permission model, secure contexts, and permission-free synthetic sources (canvas.captureStream, AudioContext oscillators). Extended in m4-l2 with the constraints/fitness-distance system, track lifecycle, and enumerateDevices privacy. Treat it as an observable contract. Record the state transition or counter that proves it, test the failure path as well as the happy path, and keep units and clock domains explicit. That discipline is what separates a plausible WebRTC explanation from a production diagnosis.

Separate the control plane from the data plane, then name the clock, identifier, and unit attached to each observation. Ask what is negotiated, what is measured live, and what is merely configured. A robust explanation predicts both a successful trace and the characteristic failure trace.

inputstate · packet · framegetUserMedia & MediaStmechanismprooftrace
Concept plate — Follow the mechanism to an observation that can falsify your model.

3Its role in WebRTC

In an application, this concept does not stand alone. It participates in a chain of negotiation, transport, media processing, and feedback. The practical boundary is the API, SDP attribute, RTP/RTCP field, or stats record where the browser exposes it. Use that boundary in tests: feed controlled input, observe the named output, and verify fallback behavior when the preferred path is unavailable.

A useful study method is to draw three columns: configured, negotiated, and observed. Put application preferences and constraints in the first, the answer's accepted parameters in the second, and live packet, state, or stats evidence in the third. Disagreements between columns are diagnostic information. They reveal fallback, unsupported capability, stale state, or a mistaken assumption about which endpoint controls the behavior. This method scales from a single codec preference to an ICE restart or a multi-layer SFU route.

Diagnostic discipline

Do not infer success from configuration alone. A codec in capabilities is not necessarily negotiated; a candidate in SDP is not necessarily selected; a connected peer connection is not necessarily receiving decodable frames. Prefer the narrowest live evidence.

4Failure questions

QuestionEvidence
Was it negotiated or selected?Inspect the answer and the live stats graph.
Did the state transition complete?Record ordered events with timestamps.
Are counters moving in the expected direction?Compute deltas; never compare unrelated cumulative samples.
What happens beyond the latency or capacity budget?Inject delay, loss, reordering, or constrained bandwidth.

5Related concepts

  • Color Spaces & Chroma Subsampling — Y'CbCr from NTSC backward compatibility to BT.709, full vs limited range, and 4:2:0 subsampling as psychovisual exploitation — with its screen-content failure modes.
  • ICE (incl. Trickle & mDNS) — The complete RFC 8445 machine: candidates, priorities, checklists, roles, nomination — plus Trickle ICE, mDNS privacy candidates, consent freshness, and ICE restarts.
  • The Video Codec Wars: H.264, VP8/VP9, AV1 — The licensing-encumbered incumbent versus the open line: H.264 profiles and levels, NAL/FU-A packetization (RFC 6184), the OpenH264 gambit, hardware-encode dominance and the HEVC licensing pathology sidebar; and Google's On2/VP8 gambit through VP9 to AOMedia's AV1 — payload formats, SVC support, royalty-free politics, and the CPU-cost realities that decide deployment.
  • The Voice Pipeline: AEC, NS, AGC — GIPS's crown jewels: adaptive-filter echo cancellation (delay estimation, double-talk, AEC3), noise suppression, gain control, VAD and comfort noise — and the constraints that toggle them.

6Further reading

WebRTC: From First Principles · Concept reference