servo_media_streams/
lib.rs1pub mod capture;
6pub mod device_monitor;
7pub mod registry;
8
9use std::any::Any;
10
11use malloc_size_of_derive::MallocSizeOf;
12pub use registry::*;
13
14pub trait MediaStream: Any + Send {
15 fn as_any(&self) -> &dyn Any;
16 fn as_mut_any(&mut self) -> &mut dyn Any;
17 fn set_id(&mut self, id: registry::MediaStreamId);
18 fn ty(&self) -> MediaStreamType;
19}
20
21pub trait MediaSocket: Any + Send {
24 fn as_any(&self) -> &dyn Any;
25}
26
27pub trait MediaOutput: Send {
30 fn add_stream(&mut self, stream: ®istry::MediaStreamId);
31}
32
33#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq)]
34pub enum MediaStreamType {
35 Video,
36 Audio,
37}