wasm: stabilize media device enumeration order and defaults


The camera and audio device lists were stored in QMaps keyed by the
browser's opaque deviceId, so QMediaDevices returned them sorted by a
random hash. Hot-plugging a device could reorder the lists, silently
switching index-based consumers (e.g. a ComboBox bound to videoInputs)
to the new device. Store them in insertion-ordered QLists instead.

The default was whichever device was enumerated first. Chrome and Edge
enumerate a synthetic "default" entry ahead of the real devices, so the
flag landed on an alias rather than on the device it points at, and
never moved once the system default changed. Resolve that entry back to
the real device through the groupId they share, and drop it from the
lists along with "communications", where both appeared as duplicates.

Firefox and Safari have no such entry and enumerate the default first,
so first-in-wins remains the fallback, cameras have no default entry in
any browser and always take that path. The flag is recomputed on every
enumeration, so it also follows hot-plug and system default changes.

Pick-to: 6.12
Change-Id: I086c2c506ab1e6a9f0d8acb688ed9b2d4008efb6
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
commit6638e0706039a081990b8a697cfd378455ff818d
parent78c1e33dbf9f872b95ee749963801bd3ac95f931
authorLorn Potter <lorn.potter@qt.io>
committerLorn Potter <lorn.potter@qt.io>
commit timeTue, 4 Aug 2026 03:35:03 +0000