ff-common
Common types and traits for the ff-* crate family.
Overview
ff-common provides shared abstractions used across all ff-* crates, particularly for memory management and buffer pooling. It has no external dependencies and serves as the pure-Rust foundation of the ff-* ecosystem.
Features
- Frame buffer pooling: Reusable buffer allocation via
FramePooltrait - Zero-copy design:
PooledBufferreturns memory to the pool automatically on drop - Thread-safe:
FramePoolrequiresSend + Sync - No external dependencies: Pure Rust, no FFmpeg linkage required
Minimum Supported Rust Version
Rust 1.93.0 or later (edition 2024).
Usage
Implementing a Custom Pool
use ;
use ;
Using PooledBuffer Standalone
use PooledBuffer;
// Allocate a standalone buffer (not pooled)
let mut buf = standalone;
buf.data_mut.fill;
assert_eq!;
Module Structure
ff-common/src/
├── lib.rs # Crate root, re-exports
└── pool.rs # FramePool trait, PooledBuffer struct
Related Crates
This crate is part of the ff-* crate family:
- ff-format - Type-safe pixel/sample formats, timestamps, stream info
- ff-probe - Media metadata extraction
- ff-decode - Video/audio decoding
- ff-encode - Video/audio encoding
- ff-sys - Low-level FFmpeg FFI bindings
License
MIT OR Apache-2.0