# mialbro/bluetooth-video-streaming architecture

> Architecture diagram of the GitHub repository mialbro/bluetooth-video-streaming, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mialbro/bluetooth-video-streaming
- Repository: https://github.com/mialbro/bluetooth-video-streaming

## Overview

The repository is a small Raspberry Pi video-over-Bluetooth prototype. Its intended workflow is camera capture on the client, frame transmission over L2CAP, and reception on the server. The server currently reads and prints only one 1024-byte chunk; it does not decode or display video. The excerpts also show a client call/signature mismatch for sendImageStream and a reference to undefined sock at shutdown, so the intended streaming path may not run as written.

Main entry points: [`l2capClient.py`](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py) (Client entry), [`l2capServer.py`](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py) (Server entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Client capture"]
  node_client_main["Client entry<br/>[l2capClient.py]"]
  node_camera_setup["Camera setup<br/>[l2capClient.py]"]
  node_frame_sender["Frame sender<br/>[l2capClient.py]"]
end

subgraph group_transport["Bluetooth transport"]
  node_client_connect["Client connect<br/>[l2capClient.py]"]
  node_l2cap["Bluetooth L2CAP"]
end

subgraph group_server["Server reception"]
  node_server_entry["Server entry<br/>[l2capServer.py]"]
  node_server_socket["Server socket<br/>[l2capServer.py]"]
  node_receive_print["Receive and print<br/>[l2capServer.py]"]
end

node_camera["Pi camera"]

node_client_main -->|"connects via"| node_client_connect
node_client_main -->|"initializes"| node_camera_setup
node_client_main -->|"invokes"| node_frame_sender
node_camera_setup -->|"configures"| node_camera
node_frame_sender -->|"captures frames"| node_camera
node_client_connect -->|"opens connection"| node_l2cap
node_frame_sender -->|"sends frames"| node_l2cap
node_server_entry -->|"opens socket"| node_server_socket
node_server_entry -->|"binds and listens"| node_l2cap
node_server_entry -->|"receives data"| node_receive_print
node_l2cap -.->|"delivers data"| node_receive_print

click node_client_main "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py"
click node_camera_setup "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py"
click node_frame_sender "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py"
click node_client_connect "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py"
click node_server_entry "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py"
click node_server_socket "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py"
click node_receive_print "https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py"

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_client_main,node_camera_setup,node_frame_sender toneBlue
class node_client_connect,node_l2cap toneAmber
class node_server_entry,node_server_socket,node_receive_print toneMint
class node_camera toneIndigo
```

## Components

### Client capture

- [Client entry](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py): `l2capClient.py`
- [Camera setup](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py): `l2capClient.py`
- [Frame sender](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py): `l2capClient.py`

### Bluetooth transport

- [Client connect](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capClient.py): `l2capClient.py`
- **Bluetooth L2CAP**

### Server reception

- [Server entry](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py): `l2capServer.py`
- [Server socket](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py): `l2capServer.py`
- [Receive and print](https://github.com/mialbro/bluetooth-video-streaming/blob/master/l2capServer.py): `l2capServer.py`

### Other components

- **Pi camera**

## Connections

- Client entry → Client connect: connects via (evidence: `l2capClient.py`)
- Client entry → Camera setup: initializes (evidence: `l2capClient.py`)
- Client entry → Frame sender: invokes (evidence: `l2capClient.py`)
- Camera setup → Pi camera: configures (evidence: `l2capClient.py`)
- Frame sender → Pi camera: captures frames (evidence: `l2capClient.py`)
- Client connect → Bluetooth L2CAP: opens connection (evidence: `l2capClient.py`)
- Frame sender → Bluetooth L2CAP: sends frames (evidence: `l2capClient.py`)
- Server entry → Server socket: opens socket (evidence: `l2capServer.py`)
- Server entry → Bluetooth L2CAP: binds and listens (evidence: `l2capServer.py`)
- Server entry → Receive and print: receives data (evidence: `l2capServer.py`)
- Bluetooth L2CAP → Receive and print: delivers data (evidence: `README.md`)
