MCPcopy Create free account
hub / github.com/Recordscript/recordscript / main

Function main

libs/scrap/examples/benchmark.rs:49–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49fn main() {
50 init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
51 let args: Args = Docopt::new(USAGE)
52 .and_then(|d| d.deserialize())
53 .unwrap_or_else(|e| e.exit());
54 let quality = args.flag_quality;
55 let yuv_count = args.flag_count;
56 let mut index = 0;
57 let mut displays = Display::all().unwrap();
58 for i in 0..displays.len() {
59 if displays[i].is_primary() {
60 index = i;
61 break;
62 }
63 }
64 let d = displays.remove(index);
65 let mut c = Capturer::new(d).unwrap();
66 let width = c.width();
67 let height = c.height();
68
69 println!(
70 "benchmark {}x{} quality:{:?}, i444:{:?}",
71 width, height, quality, args.flag_i444
72 );
73 let quality = match quality {
74 Quality::Best => Q::Best,
75 Quality::Balanced => Q::Balanced,
76 Quality::Low => Q::Low,
77 };
78 [VP8, VP9].map(|codec| {
79 test_vpx(
80 &mut c,
81 codec,
82 width,
83 height,
84 quality,
85 yuv_count,
86 if codec == VP8 { false } else { args.flag_i444 },
87 )
88 });
89 test_av1(&mut c, width, height, quality, yuv_count, args.flag_i444);
90 #[cfg(feature = "hwcodec")]
91 {
92 hw::test(&mut c, width, height, quality, yuv_count);
93 }
94}
95
96fn test_vpx(
97 c: &mut Capturer,

Callers

nothing calls this directly

Calls 7

test_vpxFunction · 0.85
test_av1Function · 0.85
removeMethod · 0.80
testFunction · 0.70
is_primaryMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected