media-pp 0.2.0

A small, GStreamer-flavored media pipeline library built on FFmpeg. Capture, composite and encode without leaving the GPU, on D3D11 and CUDA.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.88"
name = "media-pp"
version = "0.2.0"
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A small, GStreamer-flavored media pipeline library built on FFmpeg. Capture, composite and encode without leaving the GPU, on D3D11 and CUDA."
documentation = "https://docs.rs/media-pp"
readme = "README.md"
keywords = [
    "ffmpeg",
    "gstreamer",
    "video",
    "audio",
    "screen-capture",
]
categories = [
    "multimedia::video",
    "multimedia::audio",
    "multimedia::encoding",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/hash1018/media-pp"

[package.metadata.docs.rs]
default-target = "x86_64-unknown-linux-gnu"
targets = []
features = [
    "ort",
    "webrtc",
]
rustdoc-args = [
    "--cfg",
    "docsrs",
    "-D",
    "warnings",
]

[features]
cuda = ["dep:ab_glyph"]
d3d11 = [
    "dep:windows",
    "dep:ab_glyph",
    "windows/Win32_Foundation",
    "windows/Win32_Graphics_Direct3D",
    "windows/Win32_Graphics_Direct3D_Fxc",
    "windows/Win32_Graphics_Direct3D11",
    "windows/Win32_Graphics_Dxgi_Common",
]
d3d12 = [
    "dep:windows",
    "windows/Win32_Foundation",
    "windows/Win32_Graphics_Direct3D12",
    "windows/Win32_Graphics_Dxgi_Common",
    "windows/Win32_Media_MediaFoundation",
    "windows/Win32_Security",
    "windows/Win32_System_Threading",
]
dxgi-capture = [
    "d3d11",
    "windows/Win32_Graphics_Dxgi",
    "windows/Win32_Graphics_Gdi",
]
mf-capture = [
    "dep:windows",
    "windows/Win32_Foundation",
    "windows/Win32_Media_MediaFoundation",
    "windows/Win32_System_Com",
    "windows/Win32_System_Com_StructuredStorage",
]
ort = [
    "dep:ort",
    "dep:ndarray",
]
pipewire-audio-capture = ["dep:pipewire"]
pipewire-audio-renderer = ["dep:pipewire"]
pipewire-screen-capture = [
    "dep:ashpd",
    "dep:async-io",
    "dep:enumflags2",
    "dep:futures-util",
    "dep:pipewire",
    "dep:pollster",
]
v4l2-capture = ["dep:libc"]
wasapi-capture = [
    "dep:windows",
    "windows/Win32_Foundation",
    "windows/Win32_Devices_FunctionDiscovery",
    "windows/Win32_Media_Audio",
    "windows/Win32_Media_KernelStreaming",
    "windows/Win32_Media_Multimedia",
    "windows/Win32_System_Com",
    "windows/Win32_System_Com_StructuredStorage",
    "windows/Win32_System_Variant",
    "windows/Win32_UI_Shell_PropertiesSystem",
]
wasapi-renderer = [
    "dep:windows",
    "windows/Win32_Foundation",
    "windows/Win32_Devices_FunctionDiscovery",
    "windows/Win32_Media_Audio",
    "windows/Win32_Media_KernelStreaming",
    "windows/Win32_Media_Multimedia",
    "windows/Win32_System_Com",
    "windows/Win32_System_Com_StructuredStorage",
    "windows/Win32_System_Variant",
    "windows/Win32_UI_Shell_PropertiesSystem",
]
webrtc = ["dep:str0m"]
wgc-capture = [
    "d3d11",
    "windows/Graphics_Capture",
    "windows/Graphics_DirectX_Direct3D11",
    "windows/Win32_Graphics_Dxgi",
    "windows/Win32_System_Com",
    "windows/Win32_System_Threading",
    "windows/Win32_System_WinRT_Direct3D11",
    "windows/Win32_System_WinRT_Graphics_Capture",
    "windows/Win32_UI_Accessibility",
    "windows/Win32_UI_WindowsAndMessaging",
]

[lib]
name = "media_pp"
path = "src/lib.rs"

[[test]]
name = "d3d11_shared_device"
path = "tests/d3d11_shared_device.rs"

[[test]]
name = "flow_log"
path = "tests/flow_log.rs"

[[test]]
name = "pp_log"
path = "tests/pp_log.rs"

[[test]]
name = "private_log"
path = "tests/private_log.rs"

[[test]]
name = "soak"
path = "tests/soak.rs"

[[test]]
name = "tee_recording"
path = "tests/tee_recording.rs"

[dependencies.ab_glyph]
version = "0.2"
optional = true

[dependencies.arc-swap]
version = "1"

[dependencies.crossbeam-channel]
version = "0.5"

[dependencies.crossbeam-queue]
version = "0.3"

[dependencies.ffmpeg-next]
version = "8"

[dependencies.ffmpeg-sys-next]
version = "8.1"
default-features = false

[dependencies.ndarray]
version = "0.17"
optional = true

[dependencies.ort]
version = "2.0.0-rc.13"
optional = true

[dependencies.str0m]
version = "0.21"
features = ["rust-crypto"]
optional = true
default-features = false

[dependencies.thiserror]
version = "2"

[dependencies.time]
version = "0.3"
features = ["local-offset"]

[dependencies.tracing-appender]
version = "0.2"

[dev-dependencies.log]
version = "0.4"

[target.'cfg(target_os = "linux")'.dependencies.ashpd]
version = "0.13"
features = [
    "screencast",
    "async-io",
]
optional = true
default-features = false

[target.'cfg(target_os = "linux")'.dependencies.async-io]
version = "2"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.enumflags2]
version = "0.7"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.futures-util]
version = "0.3"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.libc]
version = "0.2"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.pipewire]
version = "0.10.1"
features = ["v0_3_50"]
optional = true

[target.'cfg(target_os = "linux")'.dependencies.pollster]
version = "1"
optional = true

[target."cfg(windows)".dependencies.windows]
version = "0.62"
optional = true

[target."cfg(windows)".dev-dependencies.windows]
version = "0.62"
features = [
    "Win32_Foundation",
    "Win32_Graphics_Direct3D",
    "Win32_Graphics_Direct3D11",
    "Win32_Graphics_Dxgi",
    "Win32_Graphics_Dxgi_Common",
    "Win32_System_ProcessStatus",
    "Win32_System_Threading",
]

[lints.clippy]
undocumented_unsafe_blocks = "deny"