# naresh-nkg/vlc architecture

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

- Interactive diagram: https://gitdiagram.com/naresh-nkg/vlc
- Repository: https://github.com/naresh-nkg/vlc

## Overview

#### Purpose and entry points
VLC is a cross-platform native media player and multimedia engine: it plays local files, discs, capture devices, and network streams; it can also transcode, mux, and stream output. The executable startup layer is in `bin/vlc.c` and platform launchers such as `bin/winvlc.c`. Core initialization and lifecycle are in `src/libvlc.c` and `src/libvlc-module.c`.

#### Core runtime and extension boundary
`libvlccore` provides object lifecycle, configuration, threading, networking, timing, module discovery, and shared media abstractions. Key module-loading boundary: `src/modules/modules.c`, `src/modules/bank.c`, and public plugin contracts in `include/vlc_plugin.h` / `include/vlc_modules.h`. Most feature implementation is dynamically selectable modules under `modules/`; the core chooses implementations according to media type, platform, capabilities, and configuration.

#### Playback control plane
The playlist owns ordered media items and requests playback; the player coordinates a current input, track selection, timing, audio/video outputs, and user-visible state. Primary paths are `src/playlist/playlist.c`, `src/player/player.c`, and `src/player/input.c`. Interfaces, GUIs, remote controls, and libVLC call into this control plane rather than directly driving decoders.

#### Media ingestion pipeline
Input processing forms the principal data path: access modules open files, devices, or protocols; stream filters optionally cache/decompress/record; demuxers identify containers and emit elementary streams; packetizers normalize codec framing; decoders produce audio, video, and subtitle representations. Orchestration is in `src/input/input.c`, `src/input/access.c`, and `src/input/demux.c`; extensible implementations reside in `modules/access/`, `modules/demux/`, `modules/packetizer/`, and `modules/codec/`. Network and adaptive sources cross external protocol boundaries including HTTP(S), RTP/RTSP, SRT, SMB, NFS, and HLS/DASH.

#### Rendering and audio pipeline
Decoded audio flows through filter/mixer/output selection, centered on `src/audio_output/output.c`, with plugins in `modules/audio_filter/` and `modules/audio_output/`. Video passes through output, subtitle composition, chroma conversion, and display/window modules from `src/video_output/video_output.c`, `src/video_output/display.c`, and `modules/video_output/`. Hardware-specific paths support Direct3D, VA-API, VDPAU, NVDEC, OpenGL, Vulkan, Apple frameworks, and platform windows via `modules/hw/` and `modules/video_output/`.

#### Streaming, conversion, and external control
The stream-output subsystem can branch input streams, transcode, mux, and publish to files or network destinations. Its core assembly is `src/stream_output/stream_output.c`; implementations include `modules/stream_out/transcode/transcode.c`, `modules/mux/`, and `modules/access_output/`. Control surfaces include CLI, D-Bus, HTTP/Lua, and UPnP: `modules/control/cli/cli.c`, `modules/control/dbus/dbus.c`, `modules/lua/intf.c`, and HTTP assets in `share/lua/http/`.

#### Public embedding API and user interfaces
The LGPL libVLC API wraps core/player services for external applications, with exported C headers in `include/vlc/libvlc.h`, `include/vlc/libvlc_media_player.h`, and implementations in `lib/core.c` and `lib/media_player.c`. The desktop UI is itself a module: Qt/C++/QML in `modules/gui/qt/qt.cpp` and `modules/gui/qt/maininterface/`, plus macOS and skins interfaces in `modules/gui/macosx/` and `modules/gui/skins2/`.

#### Build, dependencies, and portability
The codebase is primarily C, with C++, Objective-C, assembly, Lua, QML, and Rust integration. Autotools and Meson builds coexist (`configure.ac`, `meson.build`); Cargo builds Rust support under `src/rust/`. `contrib/src/` defines reproducible source/patch rules for major external dependencies such as FFmpeg, Qt, GnuTLS, SQLite, and codec libraries. `compat/` and OS-specific source directories isolate platform API differences for Windows, macOS, Linux/BSD, Android, OS/2, and Emscripten.

Main entry points: [`modules`](https://github.com/naresh-nkg/vlc/tree/master/modules) (Feature modules), [`src/libvlc.c`](https://github.com/naresh-nkg/vlc/blob/master/src/libvlc.c) (Core lifecycle), [`modules/codec`](https://github.com/naresh-nkg/vlc/tree/master/modules/codec) (Codec decoding), [`src/modules/modules.c`](https://github.com/naresh-nkg/vlc/blob/master/src/modules/modules.c) (Module loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; APIs"]
  node_launcher["VLC launchers<br/>native entry<br/>[vlc.c]"]
  node_libvlc_api["libVLC API<br/>embedding API<br/>[libvlc.h]"]
  node_interfaces["UI &amp; remote control<br/>interface modules<br/>[qt.cpp]"]
end

subgraph group_core["Core Control"]
  node_lifecycle["Core lifecycle<br/>libvlccore bootstrap<br/>[libvlc.c]"]
  node_core_services{{"Core services<br/>libvlccore"}}
  node_module_loader{{"Module loader<br/>plugin selection<br/>[modules.c]"}}
  node_playlist["Playlist<br/>playback queue<br/>[playlist.c]"]
  node_player["Player control<br/>playback coordinator<br/>[player.c]"]
end

subgraph group_input["Media Pipeline"]
  node_input_orchestrator["Input orchestration<br/>media input core<br/>[input.c]"]
  node_access_stream["Access &amp; stream filters<br/>source modules"]
  node_demux["Demux &amp; packetize<br/>container pipeline"]
  node_decoders["Codec decoding<br/>codec modules"]
end

subgraph group_output["Output &amp; Streaming"]
  node_audio["Audio pipeline<br/>audio output core<br/>[output.c]"]
  node_video["Video pipeline<br/>video output core<br/>[video_output.c]"]
  node_stream_output["Stream output<br/>transcode/mux/publish<br/>[stream_output.c]"]
end

subgraph group_extensions["Modules &amp; Platform"]
  node_plugin_contracts["Plugin contracts<br/>public module ABI<br/>[vlc_plugin.h]"]
  node_feature_modules{{"Feature modules<br/>dynamic plugins"}}
  node_platform_support["Platform compatibility<br/>portability layer"]
  node_build_deps["Build &amp; dependencies<br/>build toolchain"]
end

node_launcher -->|"starts"| node_lifecycle
node_libvlc_api -->|"wraps"| node_lifecycle
node_interfaces -->|"controls"| node_playlist
node_libvlc_api -->|"controls"| node_player
node_lifecycle -->|"initializes"| node_core_services
node_lifecycle -->|"initializes"| node_module_loader
node_module_loader -->|"uses ABI"| node_plugin_contracts
node_module_loader -->|"loads"| node_feature_modules
node_playlist -->|"requests playback"| node_player
node_player -->|"creates input"| node_input_orchestrator
node_input_orchestrator -->|"opens source"| node_access_stream
node_access_stream -->|"stream bytes"| node_demux
node_demux -->|"elementary streams"| node_decoders
node_decoders -->|"decoded audio"| node_audio
node_decoders -->|"decoded video/subtitles"| node_video
node_input_orchestrator -->|"branches streams"| node_stream_output
node_feature_modules -.->|"implements"| node_access_stream
node_feature_modules -.->|"implements"| node_decoders
node_feature_modules -.->|"implements outputs"| node_audio
node_feature_modules -.->|"implements displays"| node_video
node_feature_modules -.->|"implements transcode/mux"| node_stream_output
node_platform_support -.->|"adapts OS APIs"| node_core_services
node_build_deps -.->|"builds dependencies"| node_feature_modules

click node_launcher "https://github.com/naresh-nkg/vlc/blob/master/bin/vlc.c"
click node_libvlc_api "https://github.com/naresh-nkg/vlc/blob/master/include/vlc/libvlc.h"
click node_interfaces "https://github.com/naresh-nkg/vlc/blob/master/modules/gui/qt/qt.cpp"
click node_lifecycle "https://github.com/naresh-nkg/vlc/blob/master/src/libvlc.c"
click node_module_loader "https://github.com/naresh-nkg/vlc/blob/master/src/modules/modules.c"
click node_playlist "https://github.com/naresh-nkg/vlc/blob/master/src/playlist/playlist.c"
click node_player "https://github.com/naresh-nkg/vlc/blob/master/src/player/player.c"
click node_input_orchestrator "https://github.com/naresh-nkg/vlc/blob/master/src/input/input.c"
click node_access_stream "https://github.com/naresh-nkg/vlc/tree/master/modules/access"
click node_demux "https://github.com/naresh-nkg/vlc/tree/master/modules/demux"
click node_decoders "https://github.com/naresh-nkg/vlc/tree/master/modules/codec"
click node_audio "https://github.com/naresh-nkg/vlc/blob/master/src/audio_output/output.c"
click node_video "https://github.com/naresh-nkg/vlc/blob/master/src/video_output/video_output.c"
click node_stream_output "https://github.com/naresh-nkg/vlc/blob/master/src/stream_output/stream_output.c"
click node_plugin_contracts "https://github.com/naresh-nkg/vlc/blob/master/include/vlc_plugin.h"
click node_feature_modules "https://github.com/naresh-nkg/vlc/tree/master/modules"
click node_platform_support "https://github.com/naresh-nkg/vlc/tree/master/compat"
click node_build_deps "https://github.com/naresh-nkg/vlc/tree/master/contrib/src"

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_launcher,node_libvlc_api,node_interfaces toneBlue
class node_lifecycle,node_core_services,node_module_loader,node_playlist,node_player toneAmber
class node_input_orchestrator,node_access_stream,node_demux,node_decoders toneMint
class node_audio,node_video,node_stream_output toneRose
class node_plugin_contracts,node_feature_modules,node_platform_support,node_build_deps toneIndigo
```

## Components

### Entry & APIs

- [VLC launchers](https://github.com/naresh-nkg/vlc/blob/master/bin/vlc.c): native entry · Starts the native player on each platform. · `bin/vlc.c`
- [libVLC API](https://github.com/naresh-nkg/vlc/blob/master/include/vlc/libvlc.h): embedding API · Public API used by external applications. · `include/vlc/libvlc.h`
- [UI & remote control](https://github.com/naresh-nkg/vlc/blob/master/modules/gui/qt/qt.cpp): interface modules · Qt, CLI, D-Bus, Lua HTTP, and other control surfaces. · `modules/gui/qt/qt.cpp`

### Core Control

- [Core lifecycle](https://github.com/naresh-nkg/vlc/blob/master/src/libvlc.c): libvlccore bootstrap · Initializes runtime services and shutdown. · `src/libvlc.c`
- **Core services**: libvlccore · Objects, config, threads, networking, timing, and media abstractions.
- [Module loader](https://github.com/naresh-nkg/vlc/blob/master/src/modules/modules.c): plugin selection · Discovers and selects feature implementations. · `src/modules/modules.c`
- [Playlist](https://github.com/naresh-nkg/vlc/blob/master/src/playlist/playlist.c): playback queue · Owns ordered media items and requests playback. · `src/playlist/playlist.c`
- [Player control](https://github.com/naresh-nkg/vlc/blob/master/src/player/player.c): playback coordinator · Coordinates input, tracks, timing, outputs, and state. · `src/player/player.c`

### Media Pipeline

- [Input orchestration](https://github.com/naresh-nkg/vlc/blob/master/src/input/input.c): media input core · Builds and runs the source-to-elementary-stream pipeline. · `src/input/input.c`
- [Access & stream filters](https://github.com/naresh-nkg/vlc/tree/master/modules/access): source modules · Opens files, devices, protocols, and optional stream filters. · `modules/access`
- [Demux & packetize](https://github.com/naresh-nkg/vlc/tree/master/modules/demux): container pipeline · Identifies containers and normalizes elementary-stream framing. · `modules/demux`
- [Codec decoding](https://github.com/naresh-nkg/vlc/tree/master/modules/codec): codec modules · Produces decoded audio, video, and subtitle data. · `modules/codec`

### Output & Streaming

- [Audio pipeline](https://github.com/naresh-nkg/vlc/blob/master/src/audio_output/output.c): audio output core · Selects filters, mixing, and audio output. · `src/audio_output/output.c`
- [Video pipeline](https://github.com/naresh-nkg/vlc/blob/master/src/video_output/video_output.c): video output core · Composes subtitles, converts chroma, and drives display windows. · `src/video_output/video_output.c`
- [Stream output](https://github.com/naresh-nkg/vlc/blob/master/src/stream_output/stream_output.c): transcode/mux/publish · Branches streams for conversion, muxing, and delivery. · `src/stream_output/stream_output.c`

### Modules & Platform

- [Plugin contracts](https://github.com/naresh-nkg/vlc/blob/master/include/vlc_plugin.h): public module ABI · Defines module registration and loading contracts. · `include/vlc_plugin.h`
- [Feature modules](https://github.com/naresh-nkg/vlc/tree/master/modules): dynamic plugins · Selectable access, codecs, outputs, interfaces, muxers, and platform features. · `modules`
- [Platform compatibility](https://github.com/naresh-nkg/vlc/tree/master/compat): portability layer · Isolates OS API differences and hardware paths. · `compat`
- [Build & dependencies](https://github.com/naresh-nkg/vlc/tree/master/contrib/src): build toolchain · Autotools, Meson, Cargo, and reproducible third-party dependencies. · `contrib/src`

## Connections

- VLC launchers → Core lifecycle: starts
- libVLC API → Core lifecycle: wraps
- UI & remote control → Playlist: controls
- libVLC API → Player control: controls
- Core lifecycle → Core services: initializes
- Core lifecycle → Module loader: initializes
- Module loader → Plugin contracts: uses ABI
- Module loader → Feature modules: loads
- Playlist → Player control: requests playback
- Player control → Input orchestration: creates input
- Input orchestration → Access & stream filters: opens source
- Access & stream filters → Demux & packetize: stream bytes
- Demux & packetize → Codec decoding: elementary streams
- Codec decoding → Audio pipeline: decoded audio
- Codec decoding → Video pipeline: decoded video/subtitles
- Input orchestration → Stream output: branches streams
- Feature modules → Access & stream filters: implements
- Feature modules → Codec decoding: implements
- Feature modules → Audio pipeline: implements outputs
- Feature modules → Video pipeline: implements displays
- Feature modules → Stream output: implements transcode/mux
- Platform compatibility → Core services: adapts OS APIs
- Build & dependencies → Feature modules: builds dependencies
