ffmpeg_rs/software/
mod.rs

1#[cfg(feature = "software-scaling")]
2pub mod scaling;
3
4#[cfg(feature = "software-scaling")]
5#[inline]
6pub fn scaler(
7    format: ::format::Pixel,
8    flags: scaling::Flags,
9    (in_width, in_height): (u32, u32),
10    (out_width, out_height): (u32, u32),
11) -> Result<scaling::Context, ::Error> {
12    scaling::Context::get(
13        format, in_width, in_height, format, out_width, out_height, flags,
14    )
15}
16
17#[cfg(feature = "software-scaling")]
18#[inline]
19pub fn converter(
20    (width, height): (u32, u32),
21    input: ::format::Pixel,
22    output: ::format::Pixel,
23) -> Result<scaling::Context, ::Error> {
24    scaling::Context::get(
25        input,
26        width,
27        height,
28        output,
29        width,
30        height,
31        scaling::flag::Flags::FAST_BILINEAR,
32    )
33}
34
35#[cfg(feature = "software-resampling")]
36pub mod resampling;
37
38#[cfg(feature = "software-resampling")]
39#[inline]
40pub fn resampler(
41    (in_format, in_layout, in_rate): (::format::Sample, ::ChannelLayout, u32),
42    (out_format, out_layout, out_rate): (::format::Sample, ::ChannelLayout, u32),
43) -> Result<resampling::Context, ::Error> {
44    resampling::Context::get(
45        in_format, in_layout, in_rate, out_format, out_layout, out_rate,
46    )
47}