video_toolbox_sys/lib.rs
1//! FFI bindings and helpers for Apple VideoToolbox framework.
2//!
3//! VideoToolbox is a low-level framework that provides direct access to hardware
4//! encoders and decoders. It provides services for video compression and decompression,
5//! and for conversion between raster image formats stored in CoreVideo pixel buffers.
6//!
7//! # Features
8//!
9//! - `helpers` - Enable high-level helper utilities (requires additional dependencies)
10//!
11//! # Example
12//!
13//! ```no_run
14//! use video_toolbox_sys::codecs;
15//! use video_toolbox_sys::compression::*;
16//!
17//! // Use H.264 codec
18//! let codec = codecs::video::H264;
19//! let pixel_format = codecs::pixel::BGRA32;
20//! ```
21//!
22//! # With helpers feature
23//!
24//! ```ignore
25//! use video_toolbox_sys::helpers::CompressionSessionBuilder;
26//! use video_toolbox_sys::codecs;
27//!
28//! let session = CompressionSessionBuilder::new(1920, 1080, codecs::video::H264)
29//! .hardware_accelerated(true)
30//! .bitrate(8_000_000)
31//! .frame_rate(30.0)
32//! .build_with_context(None, std::ptr::null_mut())
33//! .expect("Failed to create compression session");
34//! ```
35
36#![allow(
37 non_snake_case,
38 non_camel_case_types,
39 non_upper_case_globals,
40 improper_ctypes
41)]
42#![cfg(any(target_os = "macos", target_os = "ios"))]
43
44// Document: https://developer.apple.com/documentation/videotoolbox?language=objc
45
46pub mod base;
47pub mod compression;
48pub mod cv_types;
49pub mod decompression;
50pub mod errors;
51pub mod frame_silo;
52pub mod multi_pass_storage;
53pub mod pixel_transfer;
54pub mod session;
55pub mod utilities;
56
57// New modules
58pub mod codecs;
59
60#[cfg(feature = "helpers")]
61pub mod helpers;