# openipc/pixelpilot_rk architecture

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

- Interactive diagram: https://gitdiagram.com/openipc/pixelpilot_rk
- Repository: https://github.com/openipc/pixelpilot_rk

## Overview

PixelPilot_rk is a Rockchip-based WFB-ng video receiver and ground-station display. Its main workflow receives a wireless video stream, decodes frames with MPP, and presents video with an on-screen display; optional DVR re-encodes video with OSD, while GSMenu exposes live link and air-unit controls. The README documents GPU color correction and frame pacing as additional video-processing capabilities. Source excerpts show the application coordinating decoding and DVR startup, but do not establish all component-level wiring, so uncertain links are omitted.

Main entry points: [`src/main.cpp`](https://github.com/openipc/pixelpilot_rk/blob/master/src/main.cpp) (Application coordinator), [`src/gsmenu/colmenu.c`](https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/colmenu.c) (GSMenu UI), [`src/gstrtpreceiver.cpp`](https://github.com/openipc/pixelpilot_rk/blob/master/src/gstrtpreceiver.cpp) (Stream receiver), [`src/osd.cpp`](https://github.com/openipc/pixelpilot_rk/blob/master/src/osd.cpp) (OSD renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_video["Video receive"]
  node_receiver["Stream receiver<br/>[gstrtpreceiver.cpp]"]
  node_wfbcli["WFB client<br/>[wfbcli.cpp]"]
  node_decoder["MPP decoder<br/>[main.cpp]"]
end

subgraph group_display["Display and OSD"]
  node_display["DRM display<br/>[drm.c]"]
  node_osd["OSD renderer<br/>[osd.cpp]"]
  node_osdgl["GPU OSD<br/>[osd_gl.cpp]"]
end

subgraph group_record["DVR processing"]
  node_frameproc["Frame processing"]
  node_color["Color correction"]
  node_dvr["DVR recorder<br/>[dvr.cpp]"]
  node_encoder["MPP encoder<br/>[mpp_encoder.cpp]"]
end

subgraph group_control["Ground controls"]
  node_menu["GSMenu UI<br/>[colmenu.c]"]
  node_pages["Menu pages<br/>[colmenu_pages.c]"]
  node_executor["Command executor<br/>[executor.c]"]
  node_airprofiles["Air profiles<br/>[air_txprofiles.c]"]
  node_input["Input handling<br/>[input.cpp]"]
end

subgraph group_runtime["Runtime services"]
  node_main["Application coordinator<br/>[main.cpp]"]
  node_mavlink["MAVLink protocol<br/>[mavlink.c]"]
  node_osmon["System monitoring<br/>[os_mon.cpp]"]
  node_wifi["WiFi monitoring<br/>[WiFiMonitor.cpp]"]
end

node_operator(("Operator"))
node_wfb(("WFB-ng link"))
node_gstreamer(("GStreamer"))
node_rockchip(("Rockchip MPP"))

node_wfb -->|"sends stream"| node_wfbcli
node_main -->|"starts receiving"| node_receiver
node_receiver -->|"uses pipeline"| node_gstreamer
node_main -->|"feeds packets"| node_decoder
node_rockchip -->|"decodes frames"| node_decoder
node_main -->|"presents frames"| node_display
node_main -->|"renders overlay"| node_osd
node_osd -.->|"uses GPU rendering"| node_osdgl
node_main -->|"sets up re-encoding"| node_frameproc
node_frameproc -.->|"applies transform"| node_color
node_main -->|"configures recording"| node_dvr
node_main -->|"starts encoder"| node_encoder
node_encoder -->|"encodes frames"| node_rockchip
node_operator -->|"provides input"| node_input
node_input -->|"drives controls"| node_menu
node_menu -->|"builds pages"| node_pages
node_menu -->|"runs commands"| node_executor
node_menu -->|"accesses profiles"| node_airprofiles
node_main -->|"initializes protocol"| node_mavlink
node_main -->|"runs monitoring"| node_osmon
node_main -->|"runs link monitoring"| node_wifi

click node_main "https://github.com/openipc/pixelpilot_rk/blob/master/src/main.cpp"
click node_receiver "https://github.com/openipc/pixelpilot_rk/blob/master/src/gstrtpreceiver.cpp"
click node_wfbcli "https://github.com/openipc/pixelpilot_rk/blob/master/src/wfbcli.cpp"
click node_decoder "https://github.com/openipc/pixelpilot_rk/blob/master/src/main.cpp"
click node_frameproc "https://github.com/openipc/pixelpilot_rk/blob/master/src/frame_processor.cpp"
click node_color "https://github.com/openipc/pixelpilot_rk/blob/master/src/frame_colorcorrect.cpp"
click node_display "https://github.com/openipc/pixelpilot_rk/blob/master/src/drm.c"
click node_osd "https://github.com/openipc/pixelpilot_rk/blob/master/src/osd.cpp"
click node_osdgl "https://github.com/openipc/pixelpilot_rk/blob/master/src/osd_gl.cpp"
click node_dvr "https://github.com/openipc/pixelpilot_rk/blob/master/src/dvr.cpp"
click node_encoder "https://github.com/openipc/pixelpilot_rk/blob/master/src/mpp_encoder.cpp"
click node_menu "https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/colmenu.c"
click node_pages "https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/colmenu_pages.c"
click node_executor "https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/executor.c"
click node_airprofiles "https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/air_txprofiles.c"
click node_input "https://github.com/openipc/pixelpilot_rk/blob/master/src/input.cpp"
click node_mavlink "https://github.com/openipc/pixelpilot_rk/blob/master/src/mavlink.c"
click node_osmon "https://github.com/openipc/pixelpilot_rk/blob/master/src/os_mon.cpp"
click node_wifi "https://github.com/openipc/pixelpilot_rk/blob/master/src/WiFiMonitor.cpp"

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_receiver,node_wfbcli,node_decoder toneBlue
class node_display,node_osd,node_osdgl toneAmber
class node_frameproc,node_color,node_dvr,node_encoder toneMint
class node_menu,node_pages,node_executor,node_airprofiles,node_input toneRose
class node_main,node_mavlink,node_osmon,node_wifi,node_operator,node_wfb,node_gstreamer,node_rockchip toneIndigo
```

## Components

### Video receive

- [Stream receiver](https://github.com/openipc/pixelpilot_rk/blob/master/src/gstrtpreceiver.cpp): `src/gstrtpreceiver.cpp`
- [WFB client](https://github.com/openipc/pixelpilot_rk/blob/master/src/wfbcli.cpp): `src/wfbcli.cpp`
- [MPP decoder](https://github.com/openipc/pixelpilot_rk/blob/master/src/main.cpp): `src/main.cpp`

### Display and OSD

- [DRM display](https://github.com/openipc/pixelpilot_rk/blob/master/src/drm.c): `src/drm.c`
- [OSD renderer](https://github.com/openipc/pixelpilot_rk/blob/master/src/osd.cpp): `src/osd.cpp`
- [GPU OSD](https://github.com/openipc/pixelpilot_rk/blob/master/src/osd_gl.cpp): `src/osd_gl.cpp`

### DVR processing

- [Frame processing](https://github.com/openipc/pixelpilot_rk/blob/master/src/frame_processor.cpp): `src/frame_processor.cpp`
- [Color correction](https://github.com/openipc/pixelpilot_rk/blob/master/src/frame_colorcorrect.cpp): `src/frame_colorcorrect.cpp`
- [DVR recorder](https://github.com/openipc/pixelpilot_rk/blob/master/src/dvr.cpp): `src/dvr.cpp`
- [MPP encoder](https://github.com/openipc/pixelpilot_rk/blob/master/src/mpp_encoder.cpp): `src/mpp_encoder.cpp`

### Ground controls

- [GSMenu UI](https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/colmenu.c): `src/gsmenu/colmenu.c`
- [Menu pages](https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/colmenu_pages.c): `src/gsmenu/colmenu_pages.c`
- [Command executor](https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/executor.c): `src/gsmenu/executor.c`
- [Air profiles](https://github.com/openipc/pixelpilot_rk/blob/master/src/gsmenu/air_txprofiles.c): `src/gsmenu/air_txprofiles.c`
- [Input handling](https://github.com/openipc/pixelpilot_rk/blob/master/src/input.cpp): `src/input.cpp`

### Runtime services

- [Application coordinator](https://github.com/openipc/pixelpilot_rk/blob/master/src/main.cpp): `src/main.cpp`
- [MAVLink protocol](https://github.com/openipc/pixelpilot_rk/blob/master/src/mavlink.c): `src/mavlink.c`
- [System monitoring](https://github.com/openipc/pixelpilot_rk/blob/master/src/os_mon.cpp): `src/os_mon.cpp`
- [WiFi monitoring](https://github.com/openipc/pixelpilot_rk/blob/master/src/WiFiMonitor.cpp): `src/WiFiMonitor.cpp`

### Other components

- **Operator**
- **WFB-ng link**
- **GStreamer**
- **Rockchip MPP**

## Connections

- WFB-ng link → WFB client: sends stream
- Application coordinator → Stream receiver: starts receiving
- Stream receiver → GStreamer: uses pipeline
- Application coordinator → MPP decoder: feeds packets
- Rockchip MPP → MPP decoder: decodes frames
- Application coordinator → DRM display: presents frames
- Application coordinator → OSD renderer: renders overlay
- OSD renderer → GPU OSD: uses GPU rendering
- Application coordinator → Frame processing: sets up re-encoding
- Frame processing → Color correction: applies transform
- Application coordinator → DVR recorder: configures recording
- Application coordinator → MPP encoder: starts encoder
- MPP encoder → Rockchip MPP: encodes frames
- Operator → Input handling: provides input
- Input handling → GSMenu UI: drives controls
- GSMenu UI → Menu pages: builds pages
- GSMenu UI → Command executor: runs commands
- GSMenu UI → Air profiles: accesses profiles
- Application coordinator → MAVLink protocol: initializes protocol
- Application coordinator → System monitoring: runs monitoring
- Application coordinator → WiFi monitoring: runs link monitoring
