Reeve Docs

Docs / Architecture

Camera WebRTC signalling: what the host relays, and what it never touches

Some cameras cannot be proxied. A Matter 1.5 camera speaks WebRTC and nothing else: its WebRtcTransportProvider cluster carries SDP strings and candidate lists, and there is no HTTP origin to dial. For those, ICameraMediaSource has nothing to return, and the picture is only reachable if the viewer and the camera become peers, or if the shared media plane pulls the camera and becomes the viewer's peer instead.

ICameraWebRtcSource is the second, optional camera interface. A plugin that implements it can negotiate a peer connection between the viewer and its camera, with the backend relaying the negotiation and carrying none of the media. The proxy contract and the media plane's own rules are on camera-media.md.

viewer --ws--> backend --in-process--> plugin --> camera
       <--ws--         <--callback--          <--

media:  viewer ===============================> camera
        viewer <=fMP4= backend <=== workload

with a media plane deployed, for a camera the plane can pull:

viewer --ws--> backend --WHEP--> media plane --RTSP--> camera
       <--ws--         <--------

media:  viewer ===========================> media plane ==> camera

The route and the vocabulary

GET /api/devices/{id}/camera/webrtc.ws is a WebSocket, session cookie only, authorised and slot-gated exactly like stream.ws. One socket is one negotiation, and closing it ends the session on the device.

Seven message kinds, all JSON, all {"type": …}:

type direction carries
ice-servers host → viewer iceServers and iceTransportPolicy: empty and all unless viewer STUN is configured. Always first, and the go-ahead to build
outcome viewer → host how a configured negotiation ended; read by the host's codec before it is parsed as a signal, and never a CameraSignal; see What the viewer builds and reports
keepalive host → viewer nothing; it exists so an idle socket is not read as a dead one
offer viewer → camera sdp
answer camera → viewer sdp, and via (see below)
candidate both candidate, sdpMid, sdpMLineIndex. A viewer's candidate is one line of at most 1024 characters or it is dropped; on a configured plane session it is forwarded to the plane by a WHEP PATCH
end both reason, the sentence only

CameraEndReason is host-side vocabulary and does not travel: the plugin's machine-readable reason decides what the host does and what Matter is told, and the viewer is shown the sentence beside it.

The host reads the envelope, not the payload

Sdp and candidate are strings it forwards verbatim, with two exceptions that sit in the plane's session and nowhere else: a configured session reads each viewer candidate it forwards and the plane's answer (see A configured session forwards the viewer's candidates), and a host-negotiated ingest splices the camera's candidates into its answer. The codec checks that a viewer's candidate is a single line of at most 1024 characters on every route, so a plugin or the plane is never handed a second SDP line through it.

via is the host's measurement of its own routing

It is the one field the host adds to a relayed message, and it names which hop produced the answer: media-plane, or camera for everything else. The viewer cannot work this out itself, since an answer from the plane and one from the camera behind it are the same shape, and which one arrived is the first thing a stalled picture turns on. It is enforced in both directions: the host stamps camera on any answer reaching it unstamped, and the sink handed to a plugin clears the field on everything it raises, so a plugin naming a hop never reaches the viewer.

Only the host originates ice-servers

A client that sends one is not relayed: the policy is the host's decision, not something a viewer may assert. Anything else unreadable is dropped and the negotiation carries on, because the viewer writes every byte on this socket and a fumbled candidate must not end a session.

Both camera sockets need their own proxy location in Compose

On Kubernetes /api is routed straight at the backend Service and nginx-ingress upgrades on its own. In Compose the frontend container is the shared origin, and its /api/ proxy forwards no Upgrade header, so stream.ws and webrtc.ws each have their own location in frontend/nginx.conf.

The relay

Signalling is bounded with backpressure, not loss

The relay carries signalling both ways and never touches media. The queue from the camera holds 256 signals, a full candidate exchange several times over, and a full queue makes the writer wait rather than dropping: a dropped ICE candidate half-connects a session, which is worse than a slow one.

A keepalive runs well under the front proxy's idle limit

Once the peers are talking this socket carries nothing, so the relay sends a keepalive every 20 seconds, well under the 60 seconds the front proxy allows an idle response on the API prefix.

The negotiation loop is the socket's only writer

A WebSocket forbids two concurrent sends, so every send goes through the negotiation loop, apart from the shutdown close, which takes the send lock.

The camera's teardown is bounded, and the encoder is released before the slot

Disposing the plugin's session ends it on the device. The relay waits at most ten seconds for that before giving the viewer slot back regardless, because a plugin dialling a vanished workload can hang for as long as its own timeout; a hang then costs the encoder, not the gate. The encoder is released before the slot that admitted it.

A refusal is an HTTP answer

The socket is accepted only once the plugin has a session, so a refusal reaches the viewer as an HTTP status and a sentence; nothing may escape after the 101.

The viewer offers

Both back ends accept a remote offer (Matter through ProvideOffer, go2rtc through webrtc/offer), so the viewer offering gives the player one code path. It also settles who the peers are: with the viewer's own SDP on the wire, the backend cannot be a party to the connection, because it never holds a fingerprint.

The third path: a camera the media plane pulls

An operator may deploy a shared media server, and a plugin may say where that server can pull one of its cameras from. When both are true the far peer is the plane rather than the camera, and the host answers the negotiation itself: it registers a path over the plane's control API, posts the viewer's offer to WHEP and relays the answer back. The socket, the vocabulary and the ladder are unchanged, and the viewer is never told the plane exists. The plane's ownership, path and switch rules, and how its own timers are rendered from the same number, are in Media plane.

A viewer's candidates go nowhere, unless viewer STUN is configured

The plane's answer carries every candidate it has, and where it has a public address the viewer's own connectivity checks reach its one muxed port, so the connection comes up from an offer that carried none and the host parses no viewer SDP. Where the plane's only off-LAN address is one it learned by STUN, a viewer off the LAN connects only if the plane sends first, and the plane can send only to an address it has been told: that is the one case in which the host forwards candidates.

The ladder is committed by the answer, not by the session

A plane that will not take the registration, cannot be reached to take it, or takes it and then refuses the viewer, leaves the camera on the transport it already had: the host opens the plugin's own negotiation instead and passes it the same offer, so the viewer is answered by the camera rather than told there was no room. Only after an answer has gone out is the choice final; a plane that fails later ends that negotiation, and the client drops to the rung below on its own. The client knows a single WebRTC route, so from there the next rung is fMP4, not the direct peer connection. Before spending anything on the device the host asks two questions, in order: whether this replica's own ingest already holds that camera (a host-negotiated pull holds the encoder a fallback would ask for, and a second request turns a refusal into a broken camera), and then CanNegotiateAsync, the contract's allocation-free probe. When the camera refuses anyway, the viewer is shown the camera's reason rather than the plane's.

The window is the viewer's, and every other budget derives from it

The browser gives the negotiation twenty seconds from the moment the player mounts, cleared only by media arriving. Everything below it is sized to fit:

budget value derives from
the viewer's window 20 s (MEDIA_DEADLINE_MS) the authority; nothing above it
the backend's WHEP wait 16 s (WhepWait) the plane's own, plus one step
the plane's own source dial 14 s (cameras.mediaPlane.readTimeout) the one configured number
one host-negotiated ingest 12 s (IngestBudget) the plane's own, less one step; it holds a camera that answers ten seconds after the offer, as one with no route to the internet does while it waits on its own STUN server, plus the candidate grace
a held path's wait to be ready 4 s (PathReadyWait, at most 8 s) spent before the viewer is offered to the plane, for a held path only; neither adds to the 16 s. A held camera that never comes up is refused after the wait, and the viewer falls back with the rest of its twenty seconds

Only the middle number is configured. The two either side are derived from it in CameraMediaPlaneOptions, one LadderStep (2 s) apart, so the three cannot be moved independently. The chart refuses a readTimeout outside 10 s to 16 s, because at seventeen the backend is still waiting for the plane after the browser has given up.

The backend's sixteen seconds let the plane's own verdict arrive rather than being cut off. Typically, a viewer reaching a cold on-demand path is answered in about 2.5 s, a warm one in 0.1 s, and a path whose source is slow or absent is refused with 400 at the plane's readTimeout, not a hang. That refusal fires the fallback, and the viewer keeps the rest of its twenty seconds to dial the camera.

A camera the plane cannot dial is pulled from the backend

A Matter camera has no address for anybody: it negotiates, and only the backend can hold that negotiation. Such a plugin declares CameraPlaneIngest.HostNegotiated, and the host registers a path pointing at itself: the plane pulls over WHEP from a route on the backend, offers recvonly, and the route answers with the camera's own SDP. The scheme follows the ingest address, whep for http and wheps for https. The viewer's side is unchanged: it reads from the plane, which is the leg the fMP4 remux is cut from.

Facts that shape that route:

  • The plane gives it readTimeout, cut to the second. The whole exchange with the device (reaching the plugin, offering, waiting for the answer and its candidates) fits inside the 12-second IngestBudget, under the plane's own so a camera that is too slow is refused here rather than cut there, where nothing says why. Nothing can be cached between attempts, because each offer carries new ICE credentials. Neither the per-path whepHandshakeTimeout nor the global webrtcHandshakeTimeout is this budget.
  • The path is on demand, so it is dialled once per reader and not retried. With no reader no request reaches the route; with one reader, exactly one, cut at readTimeout, after which the source is destroyed rather than re-offered. A camera that cannot answer in time costs that viewer their click and nothing else, and nothing warms up behind a failure.
  • The negotiation sends no ICE servers and the answer carries its candidates. The plane applies an answer once and takes no candidate after it, so the host buffers the camera's early candidates until the answer can be sent whole, waits a grace for more (IngestCandidateGrace, 750 ms) for a camera that never says it has sent its last, and splices the trickled candidates into the answer's own media section, back to front, changing nothing else. An answer that already carries them is passed through untouched. mDNS candidate names are refused on this route.
  • The teardown follows the Location. The session Location is absolute and names the replica that answered (IngestAddress is the replica's own address, not the Service's), so the session is ended where it lives rather than on whichever replica a Service would pick.
  • One camera, one ingest session. The camera has one encoder, so a session the replica still holds is ended before the new offer is answered: a fresh ProvideOffer while the previous session holds the encoder is refused by the camera itself. A fallback viewer is not sent to the device while the plane holds it. The capacity ceiling (IngestCapacity, 32 per replica) counts cameras, so a replica at its limit can still renegotiate anything it already holds. Sessions outlive the request, are identified by the handle in the URL the plane receives, and are refused when the replica is going down. A session is always disposed on abandon, or an encoder keeps running on a device nobody watches.

The route is authenticated by a credential derived per camera path from one configured secret and compared in fixed time, presented as HTTP Basic because that is what the plane sends when the address it was told to pull carries a userinfo. A credential that leaks opens that one camera's negotiation and no other; without the secret the host serves no ingest.

ICameraPlaneIngestSource is what a plugin implements to take part: one call answering how the plane may get a device (an address to dial, a negotiation to ask for, or null for neither). The plugin deploys nothing, holds no credential for the plane and never calls it.

A camera that declares an ingest is served by the plane even if its plugin could also peer with the viewer directly: the plugin is the only party that knows whether its own peering is reachable, so declaring the ingest is how it says which it wants.

A camera's path outlives its viewers. It is registered on the first negotiation and left there, because the plane dials the camera on demand and drops it when the last viewer goes; the host rewrites the path only when the camera's address has changed. See deployment for what the operator deploys and configuration for the settings.

Remote viewers reach the plane through STUN first

Without a forwarded port the plane's only off-LAN address is one it learned by STUN, and a viewer reaches it only if the plane sends to the viewer's own mapped address first. The offer carries no candidates and the plane cannot learn the address as peer-reflexive until a check gets through, so without forwarding every off-LAN session fails. STUN comes before TURN because it needs no account, no credential and no budget, and the statistics below show whether anyone needs more. The public-port setup is an equally supported setup: it reaches networks STUN cannot, and the choice is the operator's.

Viewer STUN is opt-in and validated entry by entry

With nothing configured, ice-servers stays [] and all, viewer candidates for a plane session are dropped, the viewer sends nothing new and no statistics are collected. The browser's STUN list is its own option, Cameras:MediaPlane:ViewerStunUrls. An invalid entry (anything but stun:host[:port]) is dropped with a startup warning naming its index, never its value, and the valid entries stay; an empty one is skipped silently, because an unset Compose variable binds "". Plane STUN never implies viewer STUN: on a port forward behind a node's source NAT, viewer STUN and trickle make the plane's checks leave from the node's address rather than the forwarded one, and remote viewers fall back where empty ICE servers connect.

A configured session forwards the viewer's candidates

A session is configured when its ice-servers message carried servers, which is when Cameras:MediaPlane:ViewerStunUrls holds a valid entry, the plane is configured and the session is a plane session. An unconfigured session, and every camera-direct one, drops viewer candidates bound for the plane; a fallen-back camera gets every candidate.

  • Each candidate is one PATCH, in arrival order, to the resource the WHEP POST returned, as an application/trickle-ice-sdpfrag body: the offer's m= line for the section the candidate's sdpMid names (else its sdpMLineIndex, else the first), a=mid: with that section's index, and the candidate verbatim. No fragment carries ice-ufrag or ice-pwd, so none can restart ICE. An mDNS (.local) host and the empty end-of-candidates value are not forwarded: the plane cannot use the first and has nothing to apply for the second.
  • A failure never ends the session. A network error, a timeout, a 502, 503 or 504 is retried once after 250 ms. A 4xx or a 500 is not, because the plane answers 500 to a fragment it cannot apply and a repeat gets the same answer. Each attempt is cut at one second, since the PATCH runs inline in the viewer's pump. A failure after the retry is counted and logged at debug. At most 50 candidates are forwarded per session; later ones are dropped and counted.
  • What the host reads. Each forwarded candidate for its address and type, and the plane's answer for srflx and public host candidates. From the two the session derives home, outside or unknown for the viewer, and discards the addresses.
  • The outcome. The relay hands a configured plane session the first outcome it receives and ignores the rest; on any other session it drops it. Because the viewer reports after it has been told the negotiation ended, a host-originated end on a configured plane session keeps the reader going for up to five seconds, until the outcome arrives or the viewer closes. An unconfigured session is torn down at once.
  • The record. When a configured plane session is disposed, once, it hands one record to a recorder that counts it and writes a media_plane_viewer_negotiations row on the thread pool. Nothing waits for the insert, so it cannot delay the viewer slot or the plane's DELETE; a failed insert is logged and dropped, as is the row of a session that ends while its replica drains. A session that never reported is recorded as unreported. The columns are flags and classes (answered, plane_srflx, plane_public_host, viewer_srflx, viewer_network, result, pair, ice_connected), and check constraints refuse anything else, so no address can be stored: addresses are gone before the record exists. The table is a hypertable on started_at with 62 days of retention.
  • What reads it. GET api/admin/media-plane/viewer-stats?window=24h|30d answers counts by network, result and pair, the ICE-failure share among answered outside viewers, and the same for answered viewers with no srflx while the plane had a public address. status.viewerIce exists only while viewer STUN is on, and flags the plane when the last five answered negotiations in 15 minutes all lacked both a plane server-reflexive and a public plane host candidate; that is all the host knows, not why. Each share also counts the answered sessions that never reported. Both read cameras.media.view. A failure counts only when the viewer reported it with ICE never connected.

A viewer can falsify its own outcome, so the figures are operator statistics and never a security decision. Viewers on networks STUN cannot cross keep fMP4, and a camera with no fMP4 rung has no picture there.

No relay, and no disclosure policy

A viewer that cannot route to a camera reaches the media plane, which answers with its own addresses and keeps the camera off the wire, without a component to operate, a shared secret to hold or a credential to mint per viewer. The host originates the ice-servers message only as the go-ahead a client waits for before building anything. Without viewer STUN it is a literal: an empty list and all. The viewer STUN setting can fill the list with stun: servers, and nothing else.

What the viewer builds and reports

The viewer builds its RTCPeerConnection from the ice-servers message: iceServers and iceTransportPolicy, each server urls as a string or strings plus optional username and credential. The check is on shape only. Anything of the wrong shape, from one bad entry to an unknown policy, makes the whole payload [] with no policy, which is the unconfigured case. The offer and the trickled candidates are unchanged, and a failed negotiation takes the ladder's existing routes out.

A configured session, and only that one, reports. It sends one outcome message on the signalling socket, at most once:

{"type":"outcome","result":"connected","pair":"stun"}
{"type":"outcome","result":"fell-back","iceConnected":false}
  • connected is sent on the first frame over WebRTC: the element playing, or the decoder reporting a frame (see When the viewer gives up). pair is the selected pair's class, decided in the browser from getStats(): relay when the local candidate is a relay, lan when the remote address is private (RFC 1918, link-local, loopback, shared 100.64/10, unique-local IPv6 or an mDNS name), public-port when it is a public host candidate, and stun for any other public address or an address the browser withholds (a peer-reflexive remote). A first frame whose stats name no pair sends no outcome, and the host records the session as unreported.
  • fell-back or no-fallback is sent when the negotiation fails, by whether the camera has an fMP4 rung (CameraWebRtcVideo's hasFallback, true when the preview has a socket URL), with iceConnected saying whether ICE reached connected first. Each negotiation reports on its own socket, so the retry after a silent failure reports separately.
  • A failure the socket itself caused, a close or an error, cannot be reported, and a loss after the first frame is a drop that sends no failure report. It follows connected except when the failure lands before the stats call resolves or that call fails, and then the session is unreported.
  • A URL of the right shape that the browser cannot parse makes the constructor throw, and that session fails like any other.
  • No message carries an address: the classes are all the host receives.

An unconfigured session, which is every session on an installation without viewer STUN, sends no outcome.

The ladder

stream-info states which rungs exist; the client climbs down them.

  1. A peer connection, when the plugin negotiates. Nothing on the host side gates it, so no setting turns live view off and an installation configures nothing for it.
  2. fMP4 over the socket, when it does not, or when the negotiation fails.
  3. Snapshots, and then a notice.

A failed negotiation drops to the socket quietly: it is no evidence about the socket, so it must not spend the socket's escalation or ask the backend anything. On a camera that publishes no proxied media at all, the negotiation is the live transport and escalates like one.

stream-info does not require a media origin: a camera that only negotiates has none, and demanding one would answer 503 for a camera that works.

When the viewer gives up

The player writes the negotiation off when the socket closes, when the camera sends end, when ICE reaches failed, when ICE stays disconnected for eight seconds, when no track has arrived twenty seconds after the socket opened, or when the element refuses the media it was given.

  • Only media stops the clock, not ICE connecting. A pair can come up and carry nothing: the camera accepted the session, allocated no encoder, and says so to no one. Clearing the deadline on connected would leave that viewer watching a black box with no state left to move.
  • Media is either proof: the element's playing or the decoder's frames. While ICE is connected and nothing has played, the player reads getStats() every second. A video inbound-rtp framesDecoded above its value when the pair (re)connected counts as the first frame if the element is playing, or once a paused element's play() resolves; a refused play() counts for nothing and the deadline runs on. The check stops while ICE is disconnected, so a frame decoded before a drop cannot pass for one during the grace. Received bytes with no decoded frame are still no picture.
  • disconnected is not failed. ICE recovers from a lost path on its own, so failing on the first one would drop a working session over a Wi-Fi handover. A camera taken off the network settles in disconnected and never leaves, so the state cannot be ignored either; hence a grace rather than a verdict either way.

ontrack may arrive with an empty streams: grouping tracks into a stream is the sender's choice, and Matter cameras need not make it. The player collects bare tracks into one stream of its own, so the sound arriving after the picture adds to it rather than replacing it.

A deadline buys one more attempt; anything the far end said demotes at once

A deadline passing is the absence of evidence, so it buys one more attempt rather than a verdict: the first attempt is what started the plane's on-demand pull, and the source it timed out on is up by the time the second arrives (about 2.5 s cold against 0.1 s warm). The second attempt is given eight seconds rather than another twenty. Every other route out (an end frame, a closed socket, ICE failing, an element refusing the media) carries something the far end said, and re-asking only delays the same answer. A played frame clears a half-spent count; it never revives a spent one, because by then the socket is carrying the picture and yanking it back would cost a working stream.

A drop after the first frame opens an outage

Once the element has played, any of those routes out is reported as a drop, and the player hangs up at once so the dead session holds no viewer slot. A camera switched to privacy does exactly this: it stops its media without a word and the plane ends every reader. So a drop opens an outage, whose contract is the reverse of a verdict's:

  • A drop does not demote at once. The viewer redials on the transport's recovery backoff (four redials, 2, 5, 15 and 30 seconds apart), and every failure of a redial that never plays counts against that run. A private camera refuses each offer, so the viewer neither hot-loops nor gives the rung up on the first refusal. The outage is remembered against the negotiated route, so a stream-info refetch mid-outage does not turn the next refusal into a verdict.
  • A pair must hold to earn this. A drop after at least ten seconds of picture starts a fresh run; a shorter play continues the run it is in. A pair that only ever flaps spends one run and is then written off for the page.
  • A spent run hands the socket a turn, not a verdict. A pair that never comes back may be the path rather than the camera, and the socket may still reach it. The outage then alternates the two rungs, one attempt every thirty seconds. While the socket stands in for a held pair, its own escalation does not run: it never freezes, never paces itself in minutes and never settles on stills.
  • The outage ends when the camera is seen again. A picture on either rung ends it. When the socket is what plays, the pair gets its turn back as an ordinary first attempt; if that fails without playing it is written off for the page with fMP4 carrying the live picture, which stops the two rungs trading places.

A device panel also knows the camera's livestream-privacy state. While it is on, the panel shows that instead of a picture and runs no live rung; when it turns off, the player starts over with every budget fresh. Surfaces without device state rely on the outage handling above.

Where the negotiation drops to depends on what else the camera publishes. With a socket below it, the demotion is silent and remembered against the negotiated route alone; a still URL that gains a token is not a reason to retry a failed transport. With nothing below it, the negotiation rebuilds on the transport's own backoff and settles a verdict only once that is spent; its recovery probe is then the still route, which cannot say whether a viewer slot came free, but not healing at all is worse.

What this does not change

  • The backend carries no media. CameraSignal holds SDP and candidate strings; there is no byte channel and no URL a plugin could hand back for the host to read frames from. A plugin that must terminate a session publishes fMP4 through ICameraMediaSource.
  • A viewer is a viewer. A negotiation takes a slot from the same per-camera budget as a stream, renewed and released on the same terms.
  • The camera's own budget is the binding one. The host gates on MaxViewers; a camera gates on its encoders, and the reference Matter hardware reports one. That limit is invisible here, so the plugin refuses with a reason naming the device rather than letting the host's larger number promise something the camera will not give.
  • The phone keeps fMP4. The mobile app ships no WebRTC stack and is a read-oriented companion, so MSE stays the floor and the fMP4 rung must remain.

What a plugin has to do

Implement ICameraWebRtcSource on the plugin instance. OpenWebRtcSessionAsync answers with a CameraWebRtcOpening: a session the host pushes viewer signals into, NotSupported when the device has no WebRTC, or Refused(reason, detail) when it has one and cannot give it now. The refusal is not decoration: the reference Matter camera reports one encoder, so "busy" is the ordinary answer, and the detail is what the viewer is shown. Name the camera, not the gate.

CanNegotiateAsync is the side-effect-free half. It defaults to true, and a plugin that owns every camera it publishes can leave it alone. Override it where that is not so: a plugin object lives on every backend replica while the workload it drives lives on exactly one, so a non-owning replica that answers true advertises a transport each session then fails. A false answer therefore holds for the asking replica only.

The rules the types cannot state:

  • Opening is all or nothing. A call that allocates on the device and then throws leaves an encoder the host has no handle to release. The host turns a throw into a refusal, so it never sees the session.
  • The sink is live from the call, not from the return. A camera that signals before the socket is pumping is queued, not lost. It stops accepting once the negotiation ends; a signal raised after that is discarded rather than faulted, so a plugin flushing from its own teardown does not hang.
  • Order is preserved on the way to the viewer, and the plugin owes the same. A transport that can reorder or drop, such as a message plane with a bounded drop-oldest queue, must restore order before raising, because a candidate that arrives after the answer is a session that half-connects.
  • SendAsync throwing ends the negotiation. The host does not retry it, and the viewer sees no error page: the ladder drops a rung.
  • Disposal must end the session on the device, and is bounded: the host waits ten seconds before giving the viewer slot back regardless.
  • CameraWebRtcSessionOptions carries nothing. It is an empty record. Build the camera's peer with no ICE servers. A camera-direct session gives the viewer none either.

A workload on the pod network has no candidate a browser can reach, so a plugin whose camera is its own workload is reachable through a media plane the operator deployed, or not at all.

A plugin that implements ICameraPlaneIngestSource as well owes one more thing: the address it declares is dialled by the plane, not by the host, so it has to be one the plane can reach and it must carry the camera's own credentials rather than a viewer's.

What the host does and does not enforce

Nothing about the media path. The host forwards candidates in both directions without choosing among them, and reads them only where a configured plane session needs a viewer's address or type, so what each peer discloses is what its own stack chose to gather. The only lever is which of the two the viewer negotiates with, the camera or the plane. On a home network both peers are already on the LAN, so in a camera-direct session each learns the other's address.

Where the plane carries the camera, the camera is not a peer at all: the plane pulls it over RTSP or from this backend, and the viewer learns the plane's addresses instead, which belong to a server the operator deployed, published a media port for and pointed viewers at.