1pub mod graph;
2pub mod registry;
3
4use bitflags::bitflags;
5
6use wedeo_core::error::Result;
7use wedeo_core::media_type::MediaType;
8
9bitflags! {
10 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
12 pub struct FilterFlags: u32 {
13 const DYNAMIC_INPUTS = 1 << 0;
14 const DYNAMIC_OUTPUTS = 1 << 1;
15 const SLICE_THREADS = 1 << 2;
16 const METADATA_ONLY = 1 << 3;
17 const SUPPORT_TIMELINE_GENERIC = 1 << 16;
18 const SUPPORT_TIMELINE_INTERNAL = 1 << 17;
19 }
20}
21
22#[derive(Debug, Clone, Copy, PartialEq, Eq)]
24pub enum FilterPadDirection {
25 Input,
26 Output,
27}
28
29#[derive(Debug, Clone)]
31pub struct FilterPadDescriptor {
32 pub name: &'static str,
33 pub media_type: MediaType,
34 pub direction: FilterPadDirection,
35}
36
37#[derive(Debug, Clone)]
39pub struct FilterDescriptor {
40 pub name: &'static str,
41 pub description: &'static str,
42 pub inputs: &'static [FilterPadDescriptor],
43 pub outputs: &'static [FilterPadDescriptor],
44 pub flags: FilterFlags,
45}
46
47pub trait Filter: Send {
49 fn descriptor(&self) -> &FilterDescriptor;
50 fn activate(&mut self) -> Result<()>;
51}