Media Subsystem
High-performance video and audio decoding, rendering, and WebRTC integration directly in the browser core layer.
Capabilities
Video Decoding
GPU-accelerated video decoding via native platform integrations, supporting AV1, VP9, and H.264 profiles.
Audio Engine
Low-latency audio mixing and rendering with robust nxaudio integration and spatial audio support.
WebRTC Support
Real-time peer-to-peer communication stack natively integrated with the media source manager.
Key Components
Manages hardware-accelerated video frame extraction pipeline and demuxing routines.
Handles sample rate conversions, buffering, and interfacing with the platform audio sink.
The primary component binding HTML5 <video> and <audio> tags to the underlying decoders.
Establishes peer connections, manages ICE candidates, and routes media streams contextually.
Manages HTTP byte range requests, adaptive bitrate streaming (HLS/DASH), and cache buffering.
Pipeline Architecture
┌────────────────────────────────────────────────────────┐
│ Browser Core │
│ HTMLMediaElement (src/dom) <--> WebCore Binding │
└───────────────────────────┬────────────────────────────┘
│ media_player.cpp
┌───────────────────────────▼────────────────────────────┐
│ Media Subsystem │
│ │
│ ┌──────────────┐ ┌─────────────────┐ │
│ │ media_source │───────────▶│ webrtc_manager │ │
│ └──────┬───────┘ └─────────────────┘ │
│ │ Demuxer │
│ ▼ │
│ ┌──────────────┐ ┌─────────────────┐ │
│ │video_decoder │ │ audio_decoder │ │
│ └──────┬───────┘ └─────────┬───────┘ │
└────────────│─────────────────────────────│─────────────┘
▼ Frames ▼ PCM Audio
┌────────────┴─────────────┐ ┌───────────┴─────────────┐
│ GPU Texture Uploader │ │ Native Audio Sink │
└──────────────────────────┘ └─────────────────────────┘