Integrating Some Rust in VLC Media Player
summary
Claim: replace security‑critical VLC C parsers with Rust code. Implementation uses Rust plus nom parser combinators, hand‑written C bindings and isolated unsafe wrappers. Built an FLV parser module compiled as a dynamic library, loaded into VLC and successfully plays sample video. Surprises: parser itself takes hours to write but integration and build‑system glue (autotools, object shim hacks) takes days. Tooling notes: cargo, cargo vendor, and careful wrapper design make incremental replacement feasible though nontrivial.
AI-written summary · about
chapters (28)
- 0:00Intro
- 1:35VLC media player vulnerabilities
- 1:52Format vulnerabilities
- 3:06We need a practical solution
- 3:44Yay! Rust!
- 5:40what is nom?
- 6:23Basic types
- 7:02MACROS!!!
- 8:20Actual generated code
- 10:26How VLC works
- 11:40Code architecture
- 12:45Lifetime of a VLC module
- 14:01The plan
- 14:35Reproducing structures
- 15:19C structure to Rust
- 15:56Importing functions
- 16:33Writing safer wrappers
- 16:57preparing a VLC module in C
- 18:00Writing the module registration
- 19:27Write a FLV parser
- 20:05Parse the header
- 22:12FLV packets
- 23:04Check the header (audio case)
- 26:14Now, the build system
- 27:13First, check for cargo and Rust
- 27:31Declaring and building a Rust module
- 28:49Summing up
- 31:21Greetings
related talks
30mIntegrating some Rust in VLC media player
26mMoving to modern languages in long-living projects
30mGStreamer & Rust – A perfect match
41mWe can have nice things
30mIntegrating Rust into Tor: Successes and Challenges
25mFearless Multimedia Programming
21mRust in V4L2: a status report
27mParsing Rust code considered harmful
