# xilinx/video-sdk architecture

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

- Interactive diagram: https://gitdiagram.com/xilinx/video-sdk
- Repository: https://github.com/xilinx/video-sdk

## Overview

##### Main Components

A. Application Layer
- FFmpeg Integration (from app-ffmpeg4-xma)
- GStreamer Integration (from video-sdk-gstreamer)
- Custom Applications (represented by various app-* directories)

B. Resource Management Layer
- XRM (Xilinx Resource Manager) component
- Job Slot Reservation System

C. Plugin Layer
- Decoder plugins (codec-decoder-xrm-plg-u30)
- Encoder plugins (codec-encoder-xrm-plg-u30)
- Scaler plugins (filter-scaler-xrm-plg-u30)
- Multiscaler plugins (filter-multiscaler-xma-plg-u30)
- Lookahead plugins (codec-lookahead-xma-plg)

D. Hardware Abstraction Layer
- XRT (Xilinx Runtime)
- XVBM (Xilinx Video Buffer Management)
- Container Runtime

E. Hardware Layer
- Alveo U30 Card
- Amazon EC2 VT1 instances

**[Applications] (Top Layer)**
- ↓
**[Resource Management]**
- ↓
**[Plugins]**
- ↓
**[Hardware Abstraction]**
- ↓
**[Hardware] (Bottom Layer)**

##### Key Relationships to Highlight

a. Data Flow:
- Video stream flow from input through decode→scale→encode
- Buffer management paths through XVBM
- Resource allocation requests through XRM

b. Control Flow:
- Application to XRM resource requests
- XRM to plugin initialization
- Plugin to XRT hardware access

##### Additional Elements

- Version information (SDK v3.0)
- Supported hardware platforms
- API boundaries

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef application fill:#b3d1ff,stroke:#333,stroke-width:2px
    classDef resource fill:#98fb98,stroke:#333,stroke-width:2px
    classDef plugin fill:#fff68f,stroke:#333,stroke-width:2px
    classDef hardware fill:#ffa07a,stroke:#333,stroke-width:2px
    classDef hardware_layer fill:#d3d3d3,stroke:#333,stroke-width:2px

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        FFmpeg["FFmpeg Integration"]:::application
        GStreamer["GStreamer Integration"]:::application
        CustomApps["Custom Applications"]:::application
        FFmpegLauncher["FFmpeg Launcher"]:::application
        Transcoder["Custom Transcoder"]:::application
        Examples["Example Applications"]:::application
    end

    %% Resource Management Layer
    subgraph ResourceLayer["Resource Management Layer"]
        XRM["XRM Resource Manager"]:::resource
        JobSlot["Job Slot Reservation"]:::resource
    end

    %% Plugin Layer
    subgraph PluginLayer["Plugin Layer"]
        Decoder["Decoder Plugin"]:::plugin
        Encoder["Encoder Plugin"]:::plugin
        Scaler["Scaler Plugin"]:::plugin
        MultiScaler["Multiscaler Plugin"]:::plugin
        Lookahead["Lookahead Plugin"]:::plugin
    end

    %% Hardware Abstraction Layer
    subgraph HWAbsLayer["Hardware Abstraction Layer"]
        XRT["XRT Runtime"]:::hardware
        XVBM["XVBM Buffer Management"]:::hardware
        Container["Container Runtime"]:::hardware
    end

    %% Hardware Layer
    subgraph HWLayer["Hardware Layer"]
        U30["Alveo U30 Card"]:::hardware_layer
        VT1["Amazon EC2 VT1"]:::hardware_layer
    end

    %% Relationships
    FFmpeg --> XRM
    GStreamer --> XRM
    CustomApps --> XRM
    FFmpegLauncher --> XRM
    Transcoder --> XRM
    Examples --> XRM

    XRM --> Decoder
    XRM --> Encoder
    XRM --> Scaler
    XRM --> MultiScaler
    XRM --> Lookahead
    JobSlot --> XRM

    Decoder --> XRT
    Encoder --> XRT
    Scaler --> XRT
    MultiScaler --> XRT
    Lookahead --> XRT

    Decoder --> XVBM
    Encoder --> XVBM
    Scaler --> XVBM
    MultiScaler --> XVBM

    XRT --> U30
    XRT --> VT1
    Container --> U30
    Container --> VT1

    %% Click Events
    click FFmpeg "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/app-ffmpeg4-xma"
    click GStreamer "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/video-sdk-gstreamer"
    click XRM "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/xrm"
    click JobSlot "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/app-jobslot-reservation-xrm"
    click Decoder "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/codec-decoder-xrm-plg-u30"
    click Encoder "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/codec-encoder-xrm-plg-u30"
    click Scaler "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/filter-scaler-xrm-plg-u30"
    click MultiScaler "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/filter-multiscaler-xma-plg-u30"
    click Lookahead "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/codec-lookahead-xma-plg"
    click XRT "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/xrt"
    click XVBM "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/lib-xvbm-xrt"
    click Container "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/Xilinx_Container_Runtime"
    click Examples "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/video-sdk-u30-examples"
    click FFmpegLauncher "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/app-XRM-launcher-ffmpeg"
    click Transcoder "https://github.com/Xilinx/video-sdk/tree/v3.0/sources/app-xcdr"
```
