# avnu/libavtp architecture

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

- Interactive diagram: https://gitdiagram.com/avnu/libavtp
- Repository: https://github.com/avnu/libavtp

## Overview

libavtp is a C implementation of IEEE 1722-2016 AVTP packet formats. A caller uses the common or stream PDU APIs and format-specific getters, setters, and initializers to construct or inspect PDUs. The supported format branches are AAF (PCM), CRF, CVF (H.264), IEC 61883/IIDC, RVF, and VSF. The graph includes public API declarations and the shared stream-field layer; it omits examples and build/test machinery. Some format implementations were not sampled, so their internal calls are not inferred.

Main entry points: [`src/avtp_stream.c`](https://github.com/avnu/libavtp/blob/master/src/avtp_stream.c) (Stream PDU fields), [`src/avtp_ieciidc.c`](https://github.com/avnu/libavtp/blob/master/src/avtp_ieciidc.c) (IEC 61883/IIDC), [`src/avtp_rvf.c`](https://github.com/avnu/libavtp/blob/master/src/avtp_rvf.c) (RVF), [`include/avtp.h`](https://github.com/avnu/libavtp/blob/master/include/avtp.h) (Common PDU API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public APIs"]
  node_common_api["Common PDU API<br/>[avtp.h]"]
  node_stream_api["Stream PDU API<br/>[avtp_stream.h]"]
  node_aaf_api["AAF API<br/>[avtp_aaf.h]"]
  node_crf_api["CRF API<br/>[avtp_crf.h]"]
  node_cvf_api["CVF API<br/>[avtp_cvf.h]"]
  node_iidc_api["IEC IIDC API<br/>[avtp_ieciidc.h]"]
  node_rvf_api["RVF API<br/>[avtp_rvf.h]"]
  node_vsf_api["VSF API<br/>[avtp_vsf_stream.h]"]
end

subgraph group_formats["AVTP Formats"]
  node_aaf_impl["AAF PCM<br/>[avtp_aaf.c]"]
  node_crf_impl["CRF<br/>[avtp_crf.c]"]
  node_cvf_impl["CVF H.264<br/>[avtp_cvf.c]"]
  node_iidc_impl["IEC 61883/IIDC<br/>[avtp_ieciidc.c]"]
  node_rvf_impl["RVF<br/>[avtp_rvf.c]"]
  node_vsf_impl["VSF stream<br/>[avtp_vsf_stream.c]"]
end

subgraph group_shared["Shared PDU Layer"]
  node_common_impl["Common PDU fields<br/>[avtp.c]"]
  node_stream_impl["Stream PDU fields<br/>[avtp_stream.c]"]
end

node_caller(("Library caller"))

node_caller -->|"uses"| node_common_api
node_caller -->|"uses"| node_aaf_api
node_caller -->|"uses"| node_crf_api
node_caller -->|"uses"| node_cvf_api
node_caller -->|"uses"| node_iidc_api
node_caller -->|"uses"| node_rvf_api
node_caller -->|"uses"| node_vsf_api
node_common_impl -->|"implements"| node_common_api
node_stream_impl -->|"implements"| node_stream_api
node_aaf_impl -->|"implements"| node_aaf_api
node_crf_impl -->|"implements"| node_crf_api
node_cvf_impl -->|"implements"| node_cvf_api
node_iidc_impl -->|"implements"| node_iidc_api
node_rvf_impl -->|"implements"| node_rvf_api
node_vsf_impl -->|"implements"| node_vsf_api
node_rvf_impl -->|"delegates fields"| node_stream_impl
node_iidc_impl -.->|"delegates fields"| node_stream_impl

click node_common_api "https://github.com/avnu/libavtp/blob/master/include/avtp.h"
click node_common_impl "https://github.com/avnu/libavtp/blob/master/src/avtp.c"
click node_stream_api "https://github.com/avnu/libavtp/blob/master/src/avtp_stream.h"
click node_stream_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_stream.c"
click node_aaf_api "https://github.com/avnu/libavtp/blob/master/include/avtp_aaf.h"
click node_aaf_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_aaf.c"
click node_crf_api "https://github.com/avnu/libavtp/blob/master/include/avtp_crf.h"
click node_crf_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_crf.c"
click node_cvf_api "https://github.com/avnu/libavtp/blob/master/include/avtp_cvf.h"
click node_cvf_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_cvf.c"
click node_iidc_api "https://github.com/avnu/libavtp/blob/master/include/avtp_ieciidc.h"
click node_iidc_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_ieciidc.c"
click node_rvf_api "https://github.com/avnu/libavtp/blob/master/include/avtp_rvf.h"
click node_rvf_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_rvf.c"
click node_vsf_api "https://github.com/avnu/libavtp/blob/master/include/avtp_vsf_stream.h"
click node_vsf_impl "https://github.com/avnu/libavtp/blob/master/src/avtp_vsf_stream.c"

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_common_api,node_stream_api,node_aaf_api,node_crf_api,node_cvf_api,node_iidc_api,node_rvf_api,node_vsf_api toneBlue
class node_aaf_impl,node_crf_impl,node_cvf_impl,node_iidc_impl,node_rvf_impl,node_vsf_impl toneAmber
class node_common_impl,node_stream_impl toneMint
class node_caller toneIndigo
```

## Components

### Public APIs

- [Common PDU API](https://github.com/avnu/libavtp/blob/master/include/avtp.h): `include/avtp.h`
- [Stream PDU API](https://github.com/avnu/libavtp/blob/master/src/avtp_stream.h): `src/avtp_stream.h`
- [AAF API](https://github.com/avnu/libavtp/blob/master/include/avtp_aaf.h): `include/avtp_aaf.h`
- [CRF API](https://github.com/avnu/libavtp/blob/master/include/avtp_crf.h): `include/avtp_crf.h`
- [CVF API](https://github.com/avnu/libavtp/blob/master/include/avtp_cvf.h): `include/avtp_cvf.h`
- [IEC IIDC API](https://github.com/avnu/libavtp/blob/master/include/avtp_ieciidc.h): `include/avtp_ieciidc.h`
- [RVF API](https://github.com/avnu/libavtp/blob/master/include/avtp_rvf.h): `include/avtp_rvf.h`
- [VSF API](https://github.com/avnu/libavtp/blob/master/include/avtp_vsf_stream.h): `include/avtp_vsf_stream.h`

### AVTP Formats

- [AAF PCM](https://github.com/avnu/libavtp/blob/master/src/avtp_aaf.c): `src/avtp_aaf.c`
- [CRF](https://github.com/avnu/libavtp/blob/master/src/avtp_crf.c): `src/avtp_crf.c`
- [CVF H.264](https://github.com/avnu/libavtp/blob/master/src/avtp_cvf.c): `src/avtp_cvf.c`
- [IEC 61883/IIDC](https://github.com/avnu/libavtp/blob/master/src/avtp_ieciidc.c): `src/avtp_ieciidc.c`
- [RVF](https://github.com/avnu/libavtp/blob/master/src/avtp_rvf.c): `src/avtp_rvf.c`
- [VSF stream](https://github.com/avnu/libavtp/blob/master/src/avtp_vsf_stream.c): `src/avtp_vsf_stream.c`

### Shared PDU Layer

- [Common PDU fields](https://github.com/avnu/libavtp/blob/master/src/avtp.c): `src/avtp.c`
- [Stream PDU fields](https://github.com/avnu/libavtp/blob/master/src/avtp_stream.c): `src/avtp_stream.c`

### Other components

- **Library caller**

## Connections

- Library caller → Common PDU API: uses (evidence: `README.md`)
- Library caller → AAF API: uses (evidence: `README.md`)
- Library caller → CRF API: uses (evidence: `README.md`)
- Library caller → CVF API: uses (evidence: `README.md`)
- Library caller → IEC IIDC API: uses (evidence: `README.md`)
- Library caller → RVF API: uses (evidence: `README.md`)
- Library caller → VSF API: uses (evidence: `README.md`)
- Common PDU fields → Common PDU API: implements (evidence: `src/avtp.c`)
- Stream PDU fields → Stream PDU API: implements (evidence: `src/avtp_stream.c`)
- AAF PCM → AAF API: implements (evidence: `src/avtp_aaf.c`)
- CRF → CRF API: implements (evidence: `src/avtp_crf.c`)
- CVF H.264 → CVF API: implements (evidence: `src/avtp_cvf.c`)
- IEC 61883/IIDC → IEC IIDC API: implements (evidence: `src/avtp_ieciidc.c`)
- RVF → RVF API: implements (evidence: `src/avtp_rvf.c`)
- VSF stream → VSF API: implements (evidence: `src/avtp_vsf_stream.c`)
- RVF → Stream PDU fields: delegates fields (evidence: `src/avtp_rvf.c`)
- IEC 61883/IIDC → Stream PDU fields: delegates fields
