revelo-reader
Input/reader registration layer for revelo — a fast, safe, pure-Rust port of MediaInfoLib for extracting technical and tag metadata from media files.
Part of the revelo project — see the project README for the full picture.
What it does
Before a media file reaches the format parsers, MediaInfoLib registers the
source type through which the bytes arrive — filesystem path, directory, HTTP
stream, or MMS URL. revelo-reader ports that reader-registration step: each
function receives a mutable FileAnalyze context,
ensures a General stream exists, and writes the Reader field that downstream
parsers can inspect to adapt their behaviour.
Public API
| Function | Reader value |
Source type |
|---|---|---|
parse_file_reader |
"File" |
Ordinary filesystem path |
parse_directory_reader |
"Directory" |
Directory source |
parse_http_reader |
"HTTP" |
HTTP or HTTPS URL |
parse_mms_reader |
"MMS" |
Microsoft Media Server URL |
Every function returns bool (true on success), matching the reader-dispatch
contract used by revelo-core.
Usage
Add the dependency:
[]
= "0.4"
= "0.4"
Register a reader before handing the context to the format parsers:
use FileAnalyze;
use parse_file_reader;
let mut fa = new;
parse_file_reader;
// fa's General stream now has Reader = "File".
// Pass `fa` to the appropriate format parser next.
For network sources, swap in the matching function:
use FileAnalyze;
use ;
let mut fa = new;
parse_http_reader; // Reader = "HTTP"
let mut fa2 = new;
parse_mms_reader; // Reader = "MMS"
License
BSD-2-Clause — see LICENSE.