Skip to content

Commit 11ac535

Browse files
Auto merge of #421 - lennart/CLOUD-91, r=TroyKomodo
feat(amf0): serde rewrite - Rewrite scuffle-amf0 with serde support - Adheres to these [conventions](https://serde.rs/conventions.html) CLOUD-91 Requested-by: lennartkloock <[email protected]> Reviewed-by: TroyKomodo <[email protected]>
2 parents 956bffc + 0d4caf6 commit 11ac535

File tree

50 files changed

+5505
-1903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5505
-1903
lines changed

Cargo.lock

Lines changed: 16 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changes.d/pr-421.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[[scuffle-amf0]]
2+
category = "feat"
3+
description = "rewrite with serde support"
4+
breaking = true
5+
authors = ["@lennartkloock", "@TroyKomodo"]
6+
7+
[[scuffle-bytes-util]]
8+
category = "feat"
9+
description = "add new cow types"
10+
authors = ["@TroyKomodo", "@lennartkloock"]
11+
12+
[[scuffle-bytes-util]]
13+
category = "feat"
14+
description = "add new zero-copy reader types"
15+
authors = ["@TroyKomodo", "@lennartkloock"]
16+
17+
[[scuffle-flv]]
18+
category = "chore"
19+
description = "update to use new version of scuffle-amf0"
20+
breaking = true
21+
authors = ["@lennartkloock", "@TroyKomodo"]
22+
23+
[[scuffle-rtmp]]
24+
category = "chore"
25+
description = "update to use new version of scuffle-amf0"
26+
breaking = true
27+
authors = ["@lennartkloock"]
28+
29+
[[scuffle-transmuxer]]
30+
category = "chore"
31+
description = "update to use new version of scuffle-rtmp"
32+
authors = ["@lennartkloock"]

crates/amf0/Cargo.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ keywords = ["amf0", "rtmp", "flash", "video", "flv"]
1111
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
1212

1313
[dependencies]
14-
bytes = "1.5"
14+
serde = { version = "1.0.219", optional = true }
15+
bytes = "1.10.1"
1516
byteorder = "1.5"
1617
num-traits = "0.2"
1718
num-derive = "0.4"
18-
scuffle-bytes-util.workspace = true
1919
thiserror = "2.0"
20+
bytestring = "1.4.0"
21+
scuffle-bytes-util = { workspace = true }
2022
scuffle-workspace-hack.workspace = true
23+
24+
[dev-dependencies]
25+
serde = { version = "1.0.219", features = ["derive"] }
26+
27+
[features]
28+
serde = ["dep:serde", "scuffle-bytes-util/serde"]
29+
30+
[package.metadata.docs.rs]
31+
all-features = true
32+
rustdoc-args = ["--cfg", "docsrs"]

crates/amf0/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,37 @@
99

1010
A pure-rust implementation of AMF0 encoder and decoder.
1111

12+
This crate provides serde support for serialization and deserialization of AMF0 data.
13+
14+
## Specification
15+
16+
| Name | Version | Link | Comments |
17+
| --- | --- | --- | --- |
18+
| Action Message Format -- AMF 0 | - | <https://rtmp.veriskope.com/pdf/amf0-file-format-specification.pdf> | Refered to as 'AMF0 spec' in this documentation |
19+
20+
## Limitations
21+
22+
- Does not support AMF0 references.
23+
- Does not support the AVM+ Type Marker. (see AMF 0 spec, 3.1)
24+
25+
## Example
26+
27+
```rust
28+
// Decode a string value from bytes
29+
let value: String = scuffle_amf0::from_bytes(bytes)?;
30+
31+
// .. do something with the value
32+
33+
// Encode a value into a writer
34+
scuffle_amf0::to_writer(&mut writer, &value)?;
35+
```
36+
37+
## Status
38+
39+
This crate is currently under development and is not yet stable.
40+
41+
Unit tests are not yet fully implemented. Use at your own risk.
42+
1243
## License
1344

1445
This project is licensed under the [MIT](./LICENSE.MIT) or [Apache-2.0](./LICENSE.Apache-2.0) license.

0 commit comments

Comments
 (0)