BlueGit

ict rusty-teams

Files

rusty-teams / crates / calling / examples / capture_probe.rs

capture_probe.rs

chore: cargo fmt the workspace
metis Daniel Däschle · pushed by metis · 2 weeks ago
a6592765 History
capture_probe.rs 926 B Download Raw
1use calling::camera::list_cameras;
2use calling::screen::{ShareKind, list_share_sources};
3
4fn main() {
5 let cameras = list_cameras();
6 println!("cameras: {}", cameras.len());
7 for (index, camera) in cameras.iter().enumerate() {
8 println!(
9 " camera {index}: key {:?}, name {} chars",
10 camera.key,
11 camera.name.chars().count()
12 );
13 }
14 let sources = list_share_sources();
15 for kind in [ShareKind::Screen, ShareKind::Window] {
16 let of_kind: Vec<_> = sources
17 .iter()
18 .filter(|source| source.kind == kind)
19 .collect();
20 println!("{kind:?} sources: {}", of_kind.len());
21 for (index, source) in of_kind.iter().enumerate() {
22 println!(
23 " {kind:?} {index}: id {}, title {} chars",
24 source.id,
25 source.title.chars().count()
26 );
27 }
28 }
29}