# rdkcentral/aamp architecture

> Architecture diagram of the GitHub repository rdkcentral/aamp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rdkcentral/aamp
- Repository: https://github.com/rdkcentral/aamp

## Overview

AAMP is a native GStreamer-based video engine. An application initiates playback through the player, which coordinates stream abstraction, manifest/fragment collection, adaptive bitrate selection, downloading, and output; supporting branches handle ads, DRM, subtitles, and time-shift buffering. The README documents HLS, DASH, progressive playback, and DRM. Some subsystem links below rely on explicit README statements or SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`priv_aamp.h`](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/priv_aamp.h) (Player runtime), [`StreamAbstractionAAMP.h`](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/StreamAbstractionAAMP.h) (Stream abstraction), [`main_aamp.cpp`](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/main_aamp.cpp) (AAMP player), [`fragmentcollector_mpd.cpp`](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_mpd.cpp) (DASH collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_playback["Playback orchestration"]
  node_player["AAMP player<br/>[main_aamp.cpp]"]
  node_private["Player runtime<br/>[priv_aamp.h]"]
  node_config["Configuration<br/>[AampConfig.h]"]
  node_events["Events<br/>[AampEvent.h]"]
end

subgraph group_streaming["Streaming and selection"]
  node_stream["Stream abstraction"]
  node_hls["HLS collection"]
  node_dash["DASH collection"]
  node_progressive["Progressive playback"]
  node_mpd["DASH manifest model<br/>[MPDModel.cpp]"]
  node_downloader["HTTP downloader"]
  node_abr["Bitrate estimation<br/>[abr.cpp]"]
  node_hybridabr["Hybrid ABR"]
end

subgraph group_services["Playback services"]
  node_ads["DASH ad insertion<br/>[admanager_mpd.cpp]"]
  node_drm["DRM licensing"]
  node_subtitle["WebVTT subtitles<br/>[webvttParser.cpp]"]
  node_tsb["Time-shift session"]
  node_tsbstore[("Time-shift storage<br/>[TsbStore.cpp]")]
end

subgraph group_output["Media output"]
  node_sink["Stream sink manager"]
  node_gstreamer["GStreamer pipeline<br/>[aampgstplayer.cpp]"]
end

node_app(("Playback application"))

node_app -->|"starts playback"| node_player
node_player -.->|"coordinates"| node_private
node_private -->|"uses settings"| node_config
node_private -->|"uses events"| node_events
node_private -->|"coordinates streams"| node_stream
node_stream -->|"collects HLS"| node_hls
node_stream -->|"collects DASH"| node_dash
node_stream -->|"collects progressive"| node_progressive
node_dash -.->|"parses manifest"| node_mpd
node_private -->|"uses ABR"| node_abr
node_abr -.->|"supports hybrid ABR"| node_hybridabr
node_private -.->|"supports ad insertion"| node_ads
node_private -->|"uses DRM"| node_drm
node_private -->|"creates session"| node_tsb
node_tsb -.->|"stores fragments"| node_tsbstore
node_private -->|"manages sinks"| node_sink
node_sink -->|"uses player"| node_gstreamer
node_stream -.->|"supports subtitles"| node_subtitle
node_stream -.->|"downloads media"| node_downloader

click node_player "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/main_aamp.cpp"
click node_private "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/priv_aamp.h"
click node_config "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampConfig.h"
click node_events "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampEvent.h"
click node_stream "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/StreamAbstractionAAMP.h"
click node_hls "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_hls.cpp"
click node_dash "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_mpd.cpp"
click node_progressive "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_progressive.cpp"
click node_mpd "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/dash/mpd/MPDModel.cpp"
click node_downloader "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/downloader/AampCurlDownloader.cpp"
click node_abr "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/abr/abr.cpp"
click node_hybridabr "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/support/aampabr/HybridABRManager.cpp"
click node_ads "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/admanager_mpd.cpp"
click node_drm "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/drm/AampDRMLicManager.cpp"
click node_subtitle "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/subtitle/webvttParser.cpp"
click node_tsb "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampTSBSessionManager.cpp"
click node_tsbstore "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/tsb/src/TsbStore.cpp"
click node_sink "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampStreamSinkManager.cpp"
click node_gstreamer "https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/aampgstplayer.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_player,node_private,node_config,node_events toneBlue
class node_stream,node_hls,node_dash,node_progressive,node_mpd,node_downloader,node_abr,node_hybridabr toneAmber
class node_ads,node_drm,node_subtitle,node_tsb,node_tsbstore toneMint
class node_sink,node_gstreamer toneRose
class node_app toneIndigo
```

## Components

### Playback orchestration

- [AAMP player](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/main_aamp.cpp): `main_aamp.cpp`
- [Player runtime](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/priv_aamp.h): `priv_aamp.h`
- [Configuration](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampConfig.h): `AampConfig.h`
- [Events](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampEvent.h): `AampEvent.h`

### Streaming and selection

- [Stream abstraction](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/StreamAbstractionAAMP.h): `StreamAbstractionAAMP.h`
- [HLS collection](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_hls.cpp): `fragmentcollector_hls.cpp`
- [DASH collection](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_mpd.cpp): `fragmentcollector_mpd.cpp`
- [Progressive playback](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/fragmentcollector_progressive.cpp): `fragmentcollector_progressive.cpp`
- [DASH manifest model](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/dash/mpd/MPDModel.cpp): `dash/mpd/MPDModel.cpp`
- [HTTP downloader](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/downloader/AampCurlDownloader.cpp): `downloader/AampCurlDownloader.cpp`
- [Bitrate estimation](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/abr/abr.cpp): `abr/abr.cpp`
- [Hybrid ABR](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/support/aampabr/HybridABRManager.cpp): `support/aampabr/HybridABRManager.cpp`

### Playback services

- [DASH ad insertion](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/admanager_mpd.cpp): `admanager_mpd.cpp`
- [DRM licensing](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/drm/AampDRMLicManager.cpp): `drm/AampDRMLicManager.cpp`
- [WebVTT subtitles](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/subtitle/webvttParser.cpp): `subtitle/webvttParser.cpp`
- [Time-shift session](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampTSBSessionManager.cpp): `AampTSBSessionManager.cpp`
- [Time-shift storage](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/tsb/src/TsbStore.cpp): `tsb/src/TsbStore.cpp`

### Media output

- [Stream sink manager](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/AampStreamSinkManager.cpp): `AampStreamSinkManager.cpp`
- [GStreamer pipeline](https://github.com/rdkcentral/aamp/blob/dev_sprint_25_2/aampgstplayer.cpp): `aampgstplayer.cpp`

### Other components

- **Playback application**

## Connections

- Playback application → AAMP player: starts playback (evidence: `README.md`)
- AAMP player → Player runtime: coordinates
- Player runtime → Configuration: uses settings (evidence: `priv_aamp.h`)
- Player runtime → Events: uses events (evidence: `priv_aamp.h`)
- Player runtime → Stream abstraction: coordinates streams (evidence: `priv_aamp.h`)
- Stream abstraction → HLS collection: collects HLS (evidence: `README.md`)
- Stream abstraction → DASH collection: collects DASH (evidence: `README.md`)
- Stream abstraction → Progressive playback: collects progressive (evidence: `README.md`)
- DASH collection → DASH manifest model: parses manifest
- Player runtime → Bitrate estimation: uses ABR (evidence: `priv_aamp.h`)
- Bitrate estimation → Hybrid ABR: supports hybrid ABR
- Player runtime → DASH ad insertion: supports ad insertion
- Player runtime → DRM licensing: uses DRM (evidence: `drm/AampDRMLicManager.cpp`)
- Player runtime → Time-shift session: creates session (evidence: `priv_aamp.h`)
- Time-shift session → Time-shift storage: stores fragments
- Player runtime → Stream sink manager: manages sinks (evidence: `AampStreamSinkManager.cpp`)
- Stream sink manager → GStreamer pipeline: uses player
- Stream abstraction → WebVTT subtitles: supports subtitles
- Stream abstraction → HTTP downloader: downloads media
