Skip to content

Commit 316fc32

Browse files
claudeAlexanderWagnerDev
authored andcommitted
docs: correct README implementation status against actual code
The status tables and state-machine notes had drifted from the code and understated what's wired into the live session path: pause/seek/receiveAudio/ receiveVideo/closeStream, deleteStream teardown, onMetaData relay, User Control messages, exvideo/exaudio parsing, fourCcList echo, E-RTMP v2 caps negotiation (CAPS_NEGOTIATED is actually entered), and multitrack/ModEx are all implemented in session/conn.rs and server/mod.rs, not just library code. Also fixed the repo structure listing (amf/ and chunk/ are directories, not files; media/ and net.rs were missing).
1 parent e68391e commit 316fc32

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A modern, open-source **Rust library** for Legacy RTMP and Enhanced RTMP v1/v2.
2323

2424
**What it is not:**
2525
- Not a complete Adobe RTMP 1.0 implementation (no VOD commands, shared objects, encrypted handshake, etc.)
26-
- Not a full E-RTMP v2 session stack (`capsEx` negotiation, reconnect, multitrack, ModEx are library code only today)
26+
- Not a full E-RTMP v2 session stack (`capsEx` negotiation, multitrack, and ModEx are wired into the session; reconnect is library code only today)
2727
- Not an HTTP server, media policy layer, or FFmpeg wrapper
2828

2929
See [Implementation status](#implementation-status) for the code-accurate breakdown.
@@ -54,14 +54,19 @@ The live path is implemented in `session/conn.rs` and `server/mod.rs`. Parser mo
5454
TCP_ACCEPTED
5555
→ HANDSHAKE
5656
→ CONNECTED
57-
→ APP_CONNECTED ← connect today skips CAPS_NEGOTIATED
57+
→ [CAPS_NEGOTIATED] ← entered when connect advertises E-RTMP v2 caps
58+
→ APP_CONNECTED
5859
→ STREAM_CREATED
5960
→ PUBLISHING | PLAYING
6061
→ CLOSING
6162
→ CLOSED
6263
```
6364

64-
`CAPS_NEGOTIATED` exists in `ConnState` for a future E-RTMP v2 capability exchange but is not entered by the current session code.
65+
`CAPS_NEGOTIATED` is entered when the client's `connect` command advertises
66+
`fourCcList` / `capsEx` / `videoFourCcInfoMap` / `reconnect`; `negotiate_caps()`
67+
computes the response and the negotiated caps are echoed back in the `connect`
68+
`_result` (`session/conn.rs`). Clients that don't advertise v2 caps skip
69+
straight to `APP_CONNECTED` as before.
6570

6671
---
6772

@@ -210,15 +215,17 @@ librtmp2/
210215
├── src/
211216
│ ├── lib.rs Rust API + extern "C" FFI layer
212217
│ ├── alloc.rs Custom allocator hook
213-
│ ├── amf.rs AMF0 + AMF3 encoding/decoding
218+
│ ├── amf/ AMF0 + AMF3 encoding/decoding
214219
│ ├── buffer.rs Growable byte buffers
215220
│ ├── bytes.rs Big-endian byte helpers
216-
│ ├── chunk.rs Chunk reader/writer/state (per-csid)
221+
│ ├── chunk/ Chunk reader/writer/state (per-csid)
217222
│ ├── client/ Outbound client: connect → publish/play
218223
│ ├── ertmp/ E-RTMP v1/v2 parsers (see Implementation status)
219224
│ ├── flv/ FLV tag parsers (library; not used in live relay path)
220225
│ ├── handshake.rs C0/C1/C2 ↔ S0/S1/S2
226+
│ ├── media/ Init-frame cache classification + ModEx helpers shared by session/server
221227
│ ├── message/ Message reassembly, control, commands
228+
│ ├── net.rs Host:port parsing shared by server bind / client connect
222229
│ ├── server/ Listening socket, accept loop, relay
223230
│ ├── session/ Connection state, publish/play handling
224231
│ ├── transport.rs TLS/plaintext transport
@@ -245,42 +252,43 @@ Status reflects what is **wired into the live session path** (`conn.rs`, `server
245252
| Encrypted / Adobe-digest handshake | Not implemented |
246253
| Chunking, control messages, ping | Done |
247254
| Commands `connect`, `createStream`, `publish`, `play` | Done |
248-
| Commands `pause`, `seek`, `receiveAudio`, `receiveVideo`, `closeStream` | Not implemented |
255+
| Commands `pause`, `seek`, `receiveAudio`, `receiveVideo`, `closeStream` | Done — `pause`/`receiveAudio`/`receiveVideo` gate per-frame relay; `closeStream` mirrors `deleteStream` cleanup |
249256
| `FCPublish` / `releaseStream` | Ignored (no-op) |
250-
| `FCUnpublish` / `deleteStream` | Partial (publish route cleanup only) |
257+
| `FCUnpublish` / `deleteStream` | Done — clears publish route, play state (`is_playing`/`paused`), and sends `StreamEOF` |
251258
| Audio / video ingest and relay | Done |
252259
| Aggregate messages | Done (unpack → relay) |
253-
| Publisher `onMetaData` parsing (stats) | Done — not relayed to players |
260+
| Publisher `onMetaData` parsing (stats) | Done — relayed live to players and cached for late joiners |
254261
| AMF3 shared objects | Not implemented |
255-
| User Control `StreamBegin` / `StreamEOF` / `SetBufferLength` | Encode/decode helpers only — not sent or handled in session |
262+
| User Control `StreamBegin` / `StreamEOF` / `SetBufferLength` | Done — `StreamBegin`/`SetBufferLength` sent on `play`, `StreamEOF` sent on `deleteStream`/`closeStream`, inbound `SetBufferLength` read and stored |
256263
| One stream per connection (`current_stream`) | By design today |
257-
| Init-frame cache for late joiners | Legacy H.264 (`0x17`) + AAC only |
264+
| Init-frame cache for late joiners | Legacy H.264 (`0x17`) + AAC, plus enhanced (ex-header) and multitrack sequence starts per track |
258265

259266
### E-RTMP v1
260267

261268
| Area | Status |
262269
|------|--------|
263270
| Enhanced A/V passthrough (HEVC/AV1/Opus from FFmpeg/OBS) | Done (opaque byte relay) |
264-
| `exvideo_parse` / `exaudio_parse` in session hot path | Not wired — codec detection uses lightweight heuristics |
265-
| `fourCcList` in `connect` | Skipped on read; not sent on connect |
271+
| `exvideo_parse` / `exaudio_parse` in session hot path | Done — called for codec detection and init-cache classification |
272+
| `fourCcList` in `connect` | Done — parsed on read; echoed back in the `_result` when v2 caps negotiation triggers |
266273
| HDR / `colorInfo` (`metadata.rs`) | Parser only |
267-
| Enhanced sequence-start cache for players | Not implemented (see init-frame cache above) |
274+
| Enhanced sequence-start cache for players | Done (see init-frame cache above) |
268275
| `exvideo_write` / `exaudio_write` helpers | Not present — send raw enhanced payloads via `send_frame` |
269276

270277
### E-RTMP v2
271278

272279
| Area | Status |
273280
|------|--------|
274-
| `capsEx`, `videoFourCcInfoMap`, `reconnect`, `multitrack`, `modex` parse/write | Library code + unit tests |
275-
| v2 capability negotiation in session | Not implemented |
276-
| Reconnect / multitrack / ModEx in session | Not implemented |
281+
| `capsEx`, `videoFourCcInfoMap`, `reconnect`, `multitrack`, `modex` parse/write | Library code + unit tests, also wired into the session (see below) |
282+
| v2 capability negotiation in session | Done — `negotiate_caps()` runs on `connect` when the client advertises v2 caps; state transitions to `CAPS_NEGOTIATED` and the response echoes negotiated caps |
283+
| Multitrack / ModEx in session | Done — ModEx normalized on every ingested frame; multitrack containers demuxed per track for codec authorization and per-track init-cache headers |
284+
| Reconnect in session | Not implemented — capability flag is echoed back but no reconnect-redirect protocol logic exists |
277285

278286
### Client, TLS, tests
279287

280288
| Area | Status |
281289
|------|--------|
282290
| Minimal publish client | Done |
283-
| Minimal play client (A/V receive callback) | Done — no metadata/aggregate on play |
291+
| Minimal play client (A/V receive callback) | Done — also delivers metadata (AMF0/AMF3 data) and handles Aggregate messages |
284292
| RTMPS | Done |
285293
| Loopback + FFmpeg interop tests | Present (`tests/`, `tests/interop/`) |
286294

0 commit comments

Comments
 (0)