ff-sys 0.18.1

Low-level FFmpeg FFI bindings and owned RAII safe wrappers for the ff-* crate family
Documentation
//! # ff-sys
//!
//! Low-level FFmpeg FFI bindings for Rust.
//!
//! This crate provides raw FFI bindings to FFmpeg libraries, generated by
//! [bindgen](https://github.com/rust-lang/rust-bindgen). It is intended as a
//! building block for higher-level safe wrappers.
//!
//! ## Safety
//!
//! All functions in this crate are unsafe. Higher-level safe wrappers are provided
//! by other ff-* crates:
//! - `ff-probe` - Media metadata extraction
//! - `ff-decode` - Decoding and seeking
//! - `ff-encode` - Encoding and export
//! - `ff-filter` - Filters and effects

// The hand-written wrapper modules below are held to the normal lint set plus
// `unsafe_op_in_unsafe_fn`; only the auto-generated bindings opt out of it, inside
// `mod raw`.
#![deny(unsafe_op_in_unsafe_fn)]

// Auto-generated bindgen output is isolated behind this module so its blanket
// lint allow does not silence the hand-written wrapper modules. On docs.rs
// (DOCS_RS=1) the build script emits an empty bindings.rs and sets cfg(docsrs);
// we include the hand-written stubs instead so dependent crates compile unchanged.
// `pub use raw::*` keeps every bindgen symbol available at the crate root, so
// downstream `ff_sys::<name>` references are unaffected.
mod raw {
    #![allow(warnings)]
    #![allow(unsafe_op_in_unsafe_fn)]

    #[cfg(not(docsrs))]
    include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

    #[cfg(docsrs)]
    include!("docsrs_stubs.rs");
}
pub use raw::*;

// Wrapper modules (real bindings only)
#[cfg(not(docsrs))]
pub mod avcodec;
#[cfg(not(docsrs))]
pub mod avformat;
#[cfg(not(docsrs))]
mod io_context;
#[cfg(not(docsrs))]
pub mod swresample;
#[cfg(not(docsrs))]
pub mod swscale;

// Sub-modules
#[cfg(not(docsrs))]
mod bsf;
#[cfg(not(docsrs))]
mod buffersink;
#[cfg(not(docsrs))]
mod codec;
#[cfg(not(docsrs))]
mod codec_context;
mod constants;
mod error;
pub mod error_codes;
// Ungated: pure `Read`/`Write` + `Seek` bounds with no FFmpeg dependency, so the
// docs.rs stubs can name them too.
#[cfg(not(docsrs))]
mod format_context;
#[cfg(not(docsrs))]
mod frame;
#[cfg(not(docsrs))]
mod hwdevice;
mod io_traits;
mod log_bridge;
#[cfg(not(docsrs))]
mod packet;
#[cfg(not(docsrs))]
mod resample_context;
#[cfg(not(docsrs))]
mod scale_context;
mod utils;

// Re-exports
#[cfg(not(docsrs))]
pub use bsf::BsfContext;
#[cfg(not(docsrs))]
pub use buffersink::{BufferSinkOutcome, buffersink_get_frame};
#[cfg(not(docsrs))]
pub use codec::Codec;
#[cfg(not(docsrs))]
pub use codec_context::{CodecContext, ReceiveOutcome};
pub use constants::{
    AV_NOPTS_VALUE, AVFMT_FLAG_CUSTOM_IO, AVFMT_NOFILE, AVFMT_TS_DISCONT, BUFFERSRC_FLAG_KEEP_REF,
};
pub use error::AvError;
#[cfg(not(docsrs))]
pub use format_context::{
    ChapterRef, ChapterSpec, CodecParameters, InputFormatContext, OutputFormatContext, StreamRef,
};
#[cfg(not(docsrs))]
pub use frame::Frame;
#[cfg(not(docsrs))]
pub use hwdevice::HwDeviceContext;
pub use io_traits::{IoSink, IoSource};
pub use log_bridge::{install_log_bridge, log_level, set_log_level};
#[cfg(not(docsrs))]
pub use packet::Packet;
#[cfg(not(docsrs))]
pub use resample_context::ResampleContext;
#[cfg(not(docsrs))]
pub use scale_context::ScaleContext;
pub use utils::{av_error_string, ensure_initialized};
// check_av_error! is re-exported at the crate root automatically via #[macro_export]