media_pp\elements\filter/
mod.rs1mod audio_resampler;
2mod audio_volume;
3pub(crate) mod decoder;
4mod download;
5mod encoder;
6mod pacer;
7mod scaler;
8mod tee;
9mod upload;
10mod video_synchronizer;
11
12pub use audio_resampler::{AudioFormat, AudioResampler, AudioResamplerError};
13pub use audio_volume::{AudioVolume, AudioVolumeError, AudioVolumeHandle, AudioVolumeOptions};
14#[cfg(all(target_os = "windows", feature = "d3d11"))]
15pub use decoder::{D3d11Decoder, D3d11vaDecoderError};
16#[cfg(all(target_os = "windows", feature = "d3d12"))]
17pub use decoder::{D3d12vaDecoder, D3d12vaDecoderError};
18pub use decoder::{SwDecoder, SwDecoderError};
19#[cfg(all(target_os = "windows", feature = "d3d11"))]
20pub use download::{D3d11Download, D3d11DownloadError};
21pub use encoder::{
22 AudioCodec, SwAudioEncoder, SwAudioEncoderError, SwAudioEncoderOptions, SwEncoder,
23 SwEncoderError, SwEncoderOptions, VideoCodec,
24};
25#[cfg(all(target_os = "windows", feature = "d3d11"))]
26pub use encoder::{
27 D3d11NvencCodec, D3d11NvencEncoder, D3d11NvencEncoderError, D3d11NvencEncoderOptions,
28 D3d11NvencInputFormat,
29};
30pub use pacer::{Pacer, PacerError};
31pub use scaler::{Scaler, ScalerError};
32pub use tee::{Tee, TeeBuilder, TeeHandle};
33#[cfg(all(target_os = "windows", feature = "d3d11"))]
34pub use upload::{D3d11Upload, D3d11UploadError};
35#[cfg(all(target_os = "windows", feature = "d3d12"))]
36pub use upload::{D3d12Upload, D3d12UploadError};
37pub use video_synchronizer::{VideoSynchronizer, VideoSynchronizerError};
38
39fn is_codec_drain_boundary(error: &ffmpeg_next::Error) -> bool {
43 match error {
44 ffmpeg_next::Error::Eof => true,
45 ffmpeg_next::Error::Other { errno } => *errno == ffmpeg_next::error::EAGAIN,
46 _ => false,
47 }
48}
49
50#[cfg(test)]
51mod codec_error_tests {
52 use super::*;
53
54 #[test]
55 fn only_eagain_and_eof_are_codec_drain_boundaries() {
56 assert!(is_codec_drain_boundary(&ffmpeg_next::Error::Eof));
57 assert!(is_codec_drain_boundary(&ffmpeg_next::Error::Other {
58 errno: ffmpeg_next::error::EAGAIN,
59 }));
60 assert!(!is_codec_drain_boundary(&ffmpeg_next::Error::InvalidData));
61 }
62}