Skip to content

Commit 8e0e20c

Browse files
committed
small doc updates
1 parent ce3ccc2 commit 8e0e20c

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
Self contained FFmpeg (sys) bindings.
2-
3-
Does not require or link against any FFmpeg system dependencies,
4-
and does not require a network connection for building.
1+
Direct, unobscured and self contained FFmpeg (sys) bindings.
2+
3+
```rust
4+
let ifmt_ctx: AVFormatContext = *ifmt_ctx;
5+
6+
// Extract video/audio/etc. streams from an e.g. MP4 file
7+
let streams: &[AVStream] = std::slice::from_raw_parts(
8+
*ifmt_ctx.streams,
9+
ifmt_ctx.nb_streams as usize
10+
);
11+
12+
// C bindings require zero for` loops 😌 - instead turn C dynamic arrays into Rust array refs
13+
for stream in std::slice::from_raw_parts(*ifmt_ctx.streams, ifmt_ctx.nb_streams as usize) {
14+
/// ... stream is of type '&AVStream'
15+
}
16+
```
17+
18+
By self contained I mean:
19+
* Does not require or link against any FFmpeg system dependencies.
20+
* Does not require a network connection for building.
521

622
**The FFmpeg bindings now include doc comments, including struct fields!** See [here](https://docs.rs/ffmpeg-dev/0.2.2/ffmpeg_dev/sys/avcodec/struct.AVCodec.html).
723

src/api.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
//! Notes:
1414
//! * **Be advised, exported API yet not stable. Prefer directly using symbols from the `ffmpeg_dev::sys` module over this one.**
1515
//! * Also note that this will be be incomplete.
16+
//!
17+
//! UPDATE:
1618
//! * Things have improved a bit since removing autogenerated layout tests from `ffmpeg_dev::sys`.
19+
//! * **Consider this module deprecated for now.**
1720
1821
// pub mod avcodec;
1922
// pub mod avdevice;

0 commit comments

Comments
 (0)