# rgaufman/live555 architecture

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

- Interactive diagram: https://gitdiagram.com/rgaufman/live555
- Repository: https://github.com/rgaufman/live555

## Overview

##### Project type and purpose
- This is an open-source C++ streaming-media toolkit (live555) plus a set of sample applications.
- Its purpose is to provide a layered library for RTSP/RTP/RTCP streaming (liveMedia), built atop a socket abstraction (groupsock) and a scheduling/utility layer (UsageEnvironment and BasicUsageEnvironment).
- On top of the libraries are three main server apps (mediaServer, proxyServer, hlsProxy) and a suite of test programs (testProgs) and one Windows audio-input helper.

##### File structure
- Top-level library modules:
- BasicUsageEnvironment/ – primitive task scheduler, hash table, delay queue
- UsageEnvironment/ – higher-level task‐scheduling API, string utilities
- groupsock/ – UDP/TCP socket wrappers, I/O handlers, multicast support
- liveMedia/ – RTSP server/client, RTP/RTCP sinks & sources, file/stream parsers, HLS segmenter
- Application modules:
- mediaServer/ – an RTSP media server executable (live555MediaServer)
- proxyServer/ – an RTSP proxy server executable (live555ProxyServer)
- hlsProxy/ – an HTTP-to-HLS segmenting proxy
- testProgs/ – example clients and streamers demonstrating how to use the library
- WindowsAudioInputDevice/ – Windows-specific audio capture support
- Build infrastructure:
- genMakefiles, configure, config.* files for cross-platform Makefile generation
- Makefile.head/tail files in each module
- Licensing files (COPYING, COPYING.LESSER).

##### README for additional insights
- Build is driven by “./genMakefiles PLATFORM” + “make”.
- Produces several executables under top-level, mediaServer/, proxyServer/, testProgs/.
- Notes on buffer sizes, port reuse, and TCP-error handling tweaks.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Systems
    subgraph "External Systems"
        RTSPClients["RTSP Clients"]:::external
        IPCameras["IP Cameras"]:::external
        WebBrowsers["Web Browsers (HLS)"]:::external
    end

    %% Applications
    subgraph "Applications"
        mediaServer["mediaServer"]:::app
        proxyServer["proxyServer"]:::app
        hlsProxy["hlsProxy"]:::app
        testProgs["testProgs"]:::app
        WindowsAudioInputDevice["WindowsAudioInputDevice"]:::app
    end

    %% Library Layers
    subgraph "Library Layers"
        Basic["BasicUsageEnvironment"]:::library
        Usage["UsageEnvironment"]:::library
        groupsock["groupsock"]:::library
        liveMedia["liveMedia"]:::library
    end

    %% Build Infrastructure
    subgraph "Build Infrastructure"
        genMakefiles["genMakefiles"]:::build
        genWindowsMakefiles["genWindowsMakefiles"]:::build
        genWindowsMakefilesCmd["genWindowsMakefiles.cmd"]:::build
        configure["configure"]:::build
        configFiles["config.*"]:::build
        MakefileHead["Makefile.head"]:::build
        MakefileTail["Makefile.tail"]:::build
    end

    %% Licensing
    subgraph "Licensing"
        COPYING["COPYING"]:::build
        COPYING_LESSER["COPYING.LESSER"]:::build
    end

    %% Dependencies and Flows
    Basic -->|"provides event loop & utilities"| Usage
    Usage -->|"scheduler & string utils"| groupsock
    groupsock -->|"socket abstraction"| liveMedia
    liveMedia -->|"protocol APIs"| mediaServer
    liveMedia -->|"protocol APIs"| proxyServer
    liveMedia -->|"segmenter API"| hlsProxy
    liveMedia -->|"test interfaces"| testProgs
    liveMedia -->|"audio capture API"| WindowsAudioInputDevice

    mediaServer -->|"RTSP streams"| RTSPClients
    mediaServer <-->|"forwards streams"| IPCameras
    proxyServer -->|"RTSP proxy"| RTSPClients
    proxyServer <-->|"connects to"| IPCameras
    hlsProxy -->|"serves HLS segments"| WebBrowsers

    %% Build flow (dashed)
    genMakefiles -.->|"generates"| MakefileHead
    genMakefiles -.-> MakefileTail
    genWindowsMakefiles -.-> genWindowsMakefilesCmd
    configure -.-> configFiles
    genMakefiles -.->|"configures"| Basic
    genMakefiles -.-> Usage
    genMakefiles -.-> groupsock
    genMakefiles -.-> liveMedia
    genMakefiles -.-> mediaServer
    genMakefiles -.-> proxyServer
    genMakefiles -.-> hlsProxy
    genMakefiles -.-> testProgs
    genMakefiles -.-> WindowsAudioInputDevice

    %% Click Events
    click Basic "https://github.com/rgaufman/live555/tree/master/BasicUsageEnvironment/"
    click Usage "https://github.com/rgaufman/live555/tree/master/UsageEnvironment/"
    click groupsock "https://github.com/rgaufman/live555/tree/master/groupsock/"
    click liveMedia "https://github.com/rgaufman/live555/tree/master/liveMedia/"
    click mediaServer "https://github.com/rgaufman/live555/tree/master/mediaServer/"
    click proxyServer "https://github.com/rgaufman/live555/tree/master/proxyServer/"
    click hlsProxy "https://github.com/rgaufman/live555/tree/master/hlsProxy/"
    click testProgs "https://github.com/rgaufman/live555/tree/master/testProgs/"
    click WindowsAudioInputDevice "https://github.com/rgaufman/live555/tree/master/WindowsAudioInputDevice/"
    click genMakefiles "https://github.com/rgaufman/live555/tree/master/genMakefiles"
    click genWindowsMakefiles "https://github.com/rgaufman/live555/tree/master/genWindowsMakefiles"
    click genWindowsMakefilesCmd "https://github.com/rgaufman/live555/blob/master/genWindowsMakefiles.cmd"
    click configure "https://github.com/rgaufman/live555/tree/master/configure"
    click configFiles "https://github.com/rgaufman/live555/blob/master/config.*"
    click MakefileHead "https://github.com/rgaufman/live555/blob/master/Makefile.head"
    click MakefileTail "https://github.com/rgaufman/live555/blob/master/Makefile.tail"
    click COPYING "https://github.com/rgaufman/live555/tree/master/COPYING"
    click COPYING_LESSER "https://github.com/rgaufman/live555/blob/master/COPYING.LESSER"

    %% Styles
    classDef library fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef app fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef build fill:#D3D3D3,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
```
