# gstreamer/gst-plugins-base architecture

> Architecture diagram of the GitHub repository gstreamer/gst-plugins-base, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gstreamer/gst-plugins-base
- Repository: https://github.com/gstreamer/gst-plugins-base

## Overview

##### Project type and purpose
- This is GStreamer 1.19.x, an open-source, C-based framework for streaming media.
- It provides a core “pipeline” engine plus a large collection of plug-ins (audio, video, network, codec, GL, etc.) that can be assembled into custom media-processing graphs.

##### File structure
- Top-level build files: meson.build, meson_options.txt, .gitlab-ci.yml, scripts/
- Core libraries: gst-libs/gst/… (allocator, audio, video, gl, rtp, rtsp, sdp, tag, pbutils)
- Base plug-ins: gst/… under gst-plugins-base (adder, app, audioconvert, audioresample, decoder, encoder, compositor, etc.)
- External plug-ins: ext/… (alsa, ogg, theora, vorbis, opus, pango, gl effects, libvisual, cdparanoia)
- Tools: tools/… (gst-launch, gst-play, gst-discoverer, gst-device-monitor)
- Tests & examples: tests/… including check suites, validate tests, examples, icles benchmarks
- Documentation: docs/… (API reference, tutorials, plugin docs)
- Subprojects: subprojects/… (gl-headers, graphene)
- Localization: po/… (translations)

##### README for additional insights
- Describes the four plug-in modules (base, good, ugly, bad) and their intended use.
- Emphasizes core vs. plug-in separation, extensibility by third-party codecs, and multi-platform support (Linux, BSD, macOS, Windows, Android, iOS).
- Mentions Meson/Ninja build and example gst-launch pipelines.

##### Final recommendations
- Every layer: from source code (meson.build) through compiled libs and .so plug-ins, up to user-facing tools and applications.
- Dependency directions and data paths, not just static modules.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Core Engine"
        CoreAPI["Core Engine\n(API, Pipeline Manager,\nPlugin Loader,\nElement Factory,\nBuffer & Allocator,\nMessage Bus)"]:::core
    end
    click CoreAPI "https://github.com/gstreamer/gst-plugins-base/tree/master/gst-libs/gst/"

    subgraph "Base Plugins"
        BasePlugins["Base Plugin Module\n(Audio/Video I/O,\nFormat Conversion,\nSources/Sinks)"]:::base
    end
    click BasePlugins "https://github.com/gstreamer/gst-plugins-base/tree/master/gst/"

    subgraph "External Plugins"
        ALSA["ALSA"]:::ext
        click ALSA "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/alsa/"
        CDP["cdparanoia"]:::ext
        click CDP "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/cdparanoia/"
        GLE["GL Effects"]:::ext
        click GLE "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/gl/effects/"
        LIBV["libvisual"]:::ext
        click LIBV "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/libvisual/"
        OGG["Ogg"]:::ext
        click OGG "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/ogg/"
        VORB["Vorbis"]:::ext
        click VORB "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/vorbis/"
        THEO["Theora"]:::ext
        click THEO "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/theora/"
        OPUS["Opus"]:::ext
        click OPUS "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/opus/"
        PANGO["Pango"]:::ext
        click PANGO "https://github.com/gstreamer/gst-plugins-base/tree/master/ext/pango/"
    end

    subgraph "CLI Tools"
        GSTLAUNCH["gst-launch-1.0"]:::tools
        GSTPLAY["gst-play-1.0"]:::tools
        GSTDISC["gst-discoverer-1.0"]:::tools
        click GSTDISC "https://github.com/gstreamer/gst-plugins-base/blob/master/tools/gst-discoverer.c"
        GSTDM["gst-device-monitor-1.0"]:::tools
        click GSTDM "https://github.com/gstreamer/gst-plugins-base/blob/master/tools/gst-device-monitor.c"
    end

    Applications["Applications\n(User code/GUI\nlinking libgstreamer)"]:::apps

    subgraph "Build & CI"
        MesonFiles["meson.build\nmeson_options.txt"]:::infra
        click MesonFiles "https://github.com/gstreamer/gst-plugins-base/blob/master/meson.build"
        CI[".gitlab-ci.yml"]:::infra
        click CI "https://github.com/gstreamer/gst-plugins-base/blob/master/.gitlab-ci.yml"
        Scripts["Helper Scripts\n(scripts/)"]:::infra
        click Scripts "https://github.com/gstreamer/gst-plugins-base/tree/master/scripts/"
    end

    subgraph "Tests & Examples"
        Check["Check Suites\n(tests/check/)"]:::infra
        click Check "https://github.com/gstreamer/gst-plugins-base/tree/master/tests/check/"
        Validate["Validate Tests\n(tests/validate/)"]:::infra
        click Validate "https://github.com/gstreamer/gst-plugins-base/tree/master/tests/validate/"
        Examples["Examples\n(tests/examples/)"]:::infra
        click Examples "https://github.com/gstreamer/gst-plugins-base/tree/master/tests/examples/"
        Icles["Icles Benchmarks\n(tests/icles/)"]:::infra
        click Icles "https://github.com/gstreamer/gst-plugins-base/tree/master/tests/icles/"
    end

    subgraph "Documentation"
        DocsLib["API Reference\n(docs/libs/)"]:::infra
        click DocsLib "https://github.com/gstreamer/gst-plugins-base/tree/master/docs/libs/"
        DocsPlg["Plugin Docs\n(docs/plugins/)"]:::infra
        click DocsPlg "https://github.com/gstreamer/gst-plugins-base/tree/master/docs/plugins/"
        DocsMB["docs/meson.build"]:::infra
        click DocsMB "https://github.com/gstreamer/gst-plugins-base/blob/master/docs/meson.build"
        DocsIdx["docs/index.md"]:::infra
        click DocsIdx "https://github.com/gstreamer/gst-plugins-base/blob/master/docs/index.md"
    end

    subgraph "Localization"
        POFiles["Translations\n(po/*.po)"]:::infra
        click POFiles "https://github.com/gstreamer/gst-plugins-base/blob/master/po/*.po"
        POMB["po/meson.build"]:::infra
        click POMB "https://github.com/gstreamer/gst-plugins-base/blob/master/po/meson.build"
    end

    subgraph "Subprojects"
        SubProj["Subprojects\n(gl-headers, graphene)"]:::infra
        click SubProj "https://github.com/gstreamer/gst-plugins-base/tree/master/subprojects/"
    end

    Applications -->|"uses API"| CoreAPI
    GSTLAUNCH -->|"uses API"| CoreAPI
    GSTPLAY -->|"uses API"| CoreAPI
    GSTDISC -->|"uses API"| CoreAPI
    GSTDM -->|"uses API"| CoreAPI

    CoreAPI -->|"loads"| BasePlugins
    CoreAPI -->|"loads"| ALSA
    CoreAPI -->|"loads"| CDP
    CoreAPI -->|"loads"| GLE
    CoreAPI -->|"loads"| LIBV
    CoreAPI -->|"loads"| OGG
    CoreAPI -->|"loads"| VORB
    CoreAPI -->|"loads"| THEO
    CoreAPI -->|"loads"| OPUS
    CoreAPI -->|"loads"| PANGO

    MesonFiles --> CoreAPI
    MesonFiles --> BasePlugins
    MesonFiles --> ALSA
    MesonFiles --> GSTLAUNCH
    MesonFiles --> Check

    CI --> CoreAPI
    CI --> BasePlugins
    CI --> ALSA
    CI --> GSTLAUNCH
    CI --> Check

    Scripts --> CoreAPI
    Scripts --> BasePlugins
    Scripts --> ALSA
    Scripts --> GSTLAUNCH
    Scripts --> Check

    Check --> CoreAPI
    Validate --> CoreAPI
    Examples --> CoreAPI
    Icles --> CoreAPI

    classDef core fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef base fill:#d4edda,stroke:#333,stroke-width:1px
    classDef ext fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef tools fill:#e2d6f3,stroke:#333,stroke-width:1px
    classDef apps fill:#f0f0f0,stroke:#333,stroke-width:1px
    classDef infra fill:#fff3cd,stroke:#333,stroke-width:1px
```
