# clouddevopshub/vlc architecture

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

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

## Overview

#### Purpose and entry points
VLC is a native, cross-platform multimedia player, streaming/conversion engine, and embeddable libVLC API. The desktop executable begins in `bin/vlc.c`; platform launch variants include `bin/winvlc.c` and `bin/darwinvlc.m`. Core process initialization is in `src/libvlc.c`, while the public embedding boundary is `include/vlc/libvlc.h` implemented by `lib/`.

#### Core runtime and plugin model
`libvlccore` owns lifecycle, configuration, objects, threading, module discovery, and runtime plugin selection. Modules implement typed capabilities and isolate format, device, protocol, GUI, and platform-specific implementations behind core interfaces.
- `src/libvlc.c`
- `src/modules/modules.c`
- `src/modules/bank.c`
- `include/vlc_modules.h`

#### Playback orchestration
The playlist selects media and owns user-level ordering/preparsing; the player controls a current input, tracks, timing, audio/video outputs, metadata, and state events. Interfaces and libVLC drive this layer rather than directly owning decoders.
- `src/playlist/playlist.c`
- `src/player/player.c`
- `src/input/input.c`

#### Media ingestion pipeline
An input resolves an MRL into an access source (file, disc, capture device, or network), optional stream filters/extractors, then a demuxer. Demuxers emit elementary streams; packetizers normalize compressed framing before decoder selection. This is the principal boundary between container/network transport and codec processing.
- `src/input/access.c`
- `src/input/stream.c`
- `src/input/demux.c`
- `modules/access/http/access.c`
- `modules/demux/mp4/mp4.c`
- `modules/packetizer/h264.c`

#### Decode, render, and synchronization
Decoder modules produce audio samples, video pictures, and subtitles. Core audio output applies filter chains/mixing and selects an OS audio backend; video output composes pictures/subpictures and delegates display/windowing to backend modules. Hardware paths can retain GPU surfaces through decoder and display interop boundaries.
- `src/input/decoder.c`
- `src/audio_output/output.c`
- `src/video_output/video_output.c`
- `modules/codec/avcodec/avcodec.c`
- `modules/video_output/opengl/display.c`
- `modules/hw/d3d11/d3d11_decoder.cpp`

#### Streaming, conversion, and network services
The same input elementary streams can feed stream-output chains for transcode, mux, recording, RTP/RTSP, HTTP, Chromecast, or DLNA rather than local playback. Core networking provides TCP/UDP/TLS/HTTP server primitives; access and output modules implement protocol-specific behavior.
- `src/stream_output/stream_output.c`
- `modules/stream_out/transcode/transcode.c`
- `modules/mux/mp4/mp4.c`
- `modules/stream_out/rtp.c`
- `src/network/httpd.c`
- `modules/stream_out/chromecast/cast.cpp`

#### User/API control surfaces
libVLC exposes stable C APIs for applications; the executable loads interface modules. Primary desktop UI is Qt/C++ with QML, with macOS native UI and CLI/DBus alternatives. Lua supplies extensions, playlist parsing, metadata, and an HTTP remote interface.
- `lib/media_player.c`
- `modules/gui/qt/qt.cpp`
- `modules/gui/macosx/main/macosx.m`
- `modules/control/dbus/dbus.c`
- `modules/lua/intf.c`
- `share/lua/http/index.html`

#### Build, platforms, and dependencies
The project is chiefly C/C++, plus Objective-C, assembly, Lua, and generated/QML assets. Autotools configures builds; `contrib` pins, patches, and cross-builds substantial dependencies such as FFmpeg, Qt, GnuTLS, libplacebo, and codec libraries. Supported runtime integrations span Windows, macOS, Linux/BSD, Android, Emscripten, and OS/2; packaging scripts produce platform artifacts.
- `configure.ac`
- `contrib/src/main.mak`
- `contrib/src/ffmpeg/rules.mak`
- `extras/package/win32/build.sh`
- `extras/package/macosx/build.sh`

Main entry points: [`src/modules/modules.c`](https://github.com/clouddevopshub/vlc/blob/master/src/modules/modules.c) (Module discovery & selection), [`src/libvlc.c`](https://github.com/clouddevopshub/vlc/blob/master/src/libvlc.c) (libvlccore), [`src/input/demux.c`](https://github.com/clouddevopshub/vlc/blob/master/src/input/demux.c) (Demux), [`src/input/decoder.c`](https://github.com/clouddevopshub/vlc/blob/master/src/input/decoder.c) (Decoders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; API"]
  node_vlc_exe["VLC executable<br/>native entry point<br/>[vlc.c]"]
  node_libvlc_api["libVLC public API<br/>embedding API<br/>[libvlc.h]"]
  node_libvlc_impl["libVLC implementation<br/>API facade<br/>[media_player.c]"]
end

subgraph group_core["Core orchestration"]
  node_core{{"libvlccore<br/>runtime core<br/>[libvlc.c]"}}
  node_module_loader{{"Module discovery &amp; selection<br/>plugin runtime<br/>[modules.c]"}}
  node_playlist["Playlist<br/>media orchestration<br/>[playlist.c]"]
  node_player["Player<br/>playback controller<br/>[player.c]"]
end

subgraph group_ingest["Media pipeline"]
  node_input["Input<br/>media session<br/>[input.c]"]
  node_access_stream["Access &amp; stream filters<br/>source ingestion<br/>[access.c]"]
  node_demux["Demux<br/>container reader<br/>[demux.c]"]
  node_packetizer["Packetizers<br/>compressed stream framing<br/>[h264.c]"]
end

subgraph group_outputs["Playback &amp; streaming"]
  node_decoder["Decoders<br/>codec processing<br/>[decoder.c]"]
  node_audio_output["Audio output<br/>audio render pipeline<br/>[output.c]"]
  node_video_output["Video output<br/>video render pipeline<br/>[video_output.c]"]
  node_stream_output["Stream output<br/>conversion &amp; delivery<br/>[stream_output.c]"]
  node_network_httpd["Network HTTP server<br/>network primitive<br/>[httpd.c]"]
end

subgraph group_surfaces["Interfaces &amp; build"]
  node_ui_extensions["UI &amp; control modules<br/>interface plugins<br/>[qt.cpp]"]
  node_build_deps["Build &amp; contrib dependencies<br/>build system<br/>[configure.ac]"]
end

node_vlc_exe -->|"initializes"| node_core
node_libvlc_api -->|"declares"| node_libvlc_impl
node_libvlc_impl -->|"controls"| node_core
node_core -->|"loads capabilities"| node_module_loader
node_core -->|"creates"| node_playlist
node_ui_extensions -->|"controls"| node_playlist
node_playlist -->|"selects media for"| node_player
node_player -->|"owns current"| node_input
node_input -->|"opens MRL"| node_access_stream
node_access_stream -->|"supplies stream"| node_demux
node_demux -->|"emits elementary streams"| node_packetizer
node_packetizer -->|"normalizes for"| node_decoder
node_decoder -->|"audio samples"| node_audio_output
node_decoder -->|"pictures/subtitles"| node_video_output
node_demux -->|"elementary streams"| node_stream_output
node_stream_output -->|"uses server primitives"| node_network_httpd
node_module_loader -.->|"selects implementations"| node_access_stream
node_module_loader -.->|"selects implementations"| node_demux
node_module_loader -.->|"selects codec modules"| node_decoder
node_module_loader -.->|"selects backends"| node_audio_output
node_module_loader -.->|"selects display backends"| node_video_output
node_module_loader -.->|"selects output chains"| node_stream_output
node_build_deps -.->|"builds"| node_core
node_build_deps -.->|"builds platform integrations"| node_ui_extensions

click node_vlc_exe "https://github.com/clouddevopshub/vlc/blob/master/bin/vlc.c"
click node_libvlc_api "https://github.com/clouddevopshub/vlc/blob/master/include/vlc/libvlc.h"
click node_libvlc_impl "https://github.com/clouddevopshub/vlc/blob/master/lib/media_player.c"
click node_core "https://github.com/clouddevopshub/vlc/blob/master/src/libvlc.c"
click node_module_loader "https://github.com/clouddevopshub/vlc/blob/master/src/modules/modules.c"
click node_playlist "https://github.com/clouddevopshub/vlc/blob/master/src/playlist/playlist.c"
click node_player "https://github.com/clouddevopshub/vlc/blob/master/src/player/player.c"
click node_input "https://github.com/clouddevopshub/vlc/blob/master/src/input/input.c"
click node_access_stream "https://github.com/clouddevopshub/vlc/blob/master/src/input/access.c"
click node_demux "https://github.com/clouddevopshub/vlc/blob/master/src/input/demux.c"
click node_packetizer "https://github.com/clouddevopshub/vlc/blob/master/modules/packetizer/h264.c"
click node_decoder "https://github.com/clouddevopshub/vlc/blob/master/src/input/decoder.c"
click node_audio_output "https://github.com/clouddevopshub/vlc/blob/master/src/audio_output/output.c"
click node_video_output "https://github.com/clouddevopshub/vlc/blob/master/src/video_output/video_output.c"
click node_stream_output "https://github.com/clouddevopshub/vlc/blob/master/src/stream_output/stream_output.c"
click node_network_httpd "https://github.com/clouddevopshub/vlc/blob/master/src/network/httpd.c"
click node_ui_extensions "https://github.com/clouddevopshub/vlc/blob/master/modules/gui/qt/qt.cpp"
click node_build_deps "https://github.com/clouddevopshub/vlc/blob/master/configure.ac"

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_vlc_exe,node_libvlc_api,node_libvlc_impl toneBlue
class node_core,node_module_loader,node_playlist,node_player toneAmber
class node_input,node_access_stream,node_demux,node_packetizer toneMint
class node_decoder,node_audio_output,node_video_output,node_stream_output,node_network_httpd toneRose
class node_ui_extensions,node_build_deps toneIndigo
```

## Components

### Entry & API

- [VLC executable](https://github.com/clouddevopshub/vlc/blob/master/bin/vlc.c): native entry point · `bin/vlc.c`
- [libVLC public API](https://github.com/clouddevopshub/vlc/blob/master/include/vlc/libvlc.h): embedding API · `include/vlc/libvlc.h`
- [libVLC implementation](https://github.com/clouddevopshub/vlc/blob/master/lib/media_player.c): API facade · `lib/media_player.c`

### Core orchestration

- [libvlccore](https://github.com/clouddevopshub/vlc/blob/master/src/libvlc.c): runtime core · Owns lifecycle, configuration, objects, and threading. · `src/libvlc.c`
- [Module discovery & selection](https://github.com/clouddevopshub/vlc/blob/master/src/modules/modules.c): plugin runtime · Selects typed capability implementations at runtime. · `src/modules/modules.c`
- [Playlist](https://github.com/clouddevopshub/vlc/blob/master/src/playlist/playlist.c): media orchestration · `src/playlist/playlist.c`
- [Player](https://github.com/clouddevopshub/vlc/blob/master/src/player/player.c): playback controller · `src/player/player.c`

### Media pipeline

- [Input](https://github.com/clouddevopshub/vlc/blob/master/src/input/input.c): media session · Resolves media and coordinates ingestion, tracks, and decoding. · `src/input/input.c`
- [Access & stream filters](https://github.com/clouddevopshub/vlc/blob/master/src/input/access.c): source ingestion · Opens files, devices, discs, and network MRLs before extraction. · `src/input/access.c`
- [Demux](https://github.com/clouddevopshub/vlc/blob/master/src/input/demux.c): container reader · Emits elementary streams from source containers. · `src/input/demux.c`
- [Packetizers](https://github.com/clouddevopshub/vlc/blob/master/modules/packetizer/h264.c): compressed stream framing · `modules/packetizer/h264.c`

### Playback & streaming

- [Decoders](https://github.com/clouddevopshub/vlc/blob/master/src/input/decoder.c): codec processing · Produces audio, video, and subtitle outputs. · `src/input/decoder.c`
- [Audio output](https://github.com/clouddevopshub/vlc/blob/master/src/audio_output/output.c): audio render pipeline · Applies filters and mixing before backend output. · `src/audio_output/output.c`
- [Video output](https://github.com/clouddevopshub/vlc/blob/master/src/video_output/video_output.c): video render pipeline · Composes pictures and delegates display/windowing. · `src/video_output/video_output.c`
- [Stream output](https://github.com/clouddevopshub/vlc/blob/master/src/stream_output/stream_output.c): conversion & delivery · Routes elementary streams to transcode, mux, recording, and network outputs. · `src/stream_output/stream_output.c`
- [Network HTTP server](https://github.com/clouddevopshub/vlc/blob/master/src/network/httpd.c): network primitive · `src/network/httpd.c`

### Interfaces & build

- [UI & control modules](https://github.com/clouddevopshub/vlc/blob/master/modules/gui/qt/qt.cpp): interface plugins · Qt, native, CLI/DBus, and Lua control surfaces. · `modules/gui/qt/qt.cpp`
- [Build & contrib dependencies](https://github.com/clouddevopshub/vlc/blob/master/configure.ac): build system · Autotools and cross-built third-party dependencies support platform artifacts. · `configure.ac`

## Connections

- VLC executable → libvlccore: initializes
- libVLC public API → libVLC implementation: declares
- libVLC implementation → libvlccore: controls
- libvlccore → Module discovery & selection: loads capabilities
- libvlccore → Playlist: creates
- UI & control modules → Playlist: controls
- Playlist → Player: selects media for
- Player → Input: owns current
- Input → Access & stream filters: opens MRL
- Access & stream filters → Demux: supplies stream
- Demux → Packetizers: emits elementary streams
- Packetizers → Decoders: normalizes for
- Decoders → Audio output: audio samples
- Decoders → Video output: pictures/subtitles
- Demux → Stream output: elementary streams
- Stream output → Network HTTP server: uses server primitives
- Module discovery & selection → Access & stream filters: selects implementations
- Module discovery & selection → Demux: selects implementations
- Module discovery & selection → Decoders: selects codec modules
- Module discovery & selection → Audio output: selects backends
- Module discovery & selection → Video output: selects display backends
- Module discovery & selection → Stream output: selects output chains
- Build & contrib dependencies → libvlccore: builds
- Build & contrib dependencies → UI & control modules: builds platform integrations
