Minor cleanup
Some checks failed
Check / linting (push) Failing after 6s
Check / formatting (push) Failing after 6s
Check / build (push) Failing after 3m37s

This commit is contained in:
Mark 2025-01-26 10:33:13 -08:00
parent 17ef2a1abd
commit cef1cd7495
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
2 changed files with 3 additions and 18 deletions

View File

@ -95,18 +95,17 @@ set -e # stop if an error occurs
# shellcheck disable=SC2089
restream_rs="PATH=\"\$PATH:/opt/bin/:.\" restream"
listen_port=16789
ssh_cmd "$restream_rs --listen $listen_port" &
ssh_cmd "$restream_rs --port $listen_port --format mono" &
sleep 1 # give some time to restream.rs to start listening
receive_cmd="nc $remarkable $listen_port"
# TODO: return this from stdout
width=1872
height=1404
pixel_format="gray8"
pixel_format="monob"
# shellcheck disable=SC2086,SC2090
$receive_cmd |
pv |
(
"$output_cmd" \
-vcodec rawvideo \

View File

@ -8,7 +8,7 @@ use std::{
io::{BufRead, BufReader, Read, Write},
net::{TcpListener, TcpStream},
process::Command,
time::{Duration, Instant},
time::Duration,
};
mod reduce;
@ -53,10 +53,8 @@ impl Format {
Self::Gray16be => {
let mut buf = [0u8; IN_SIZE];
loop {
let now = Instant::now();
src.read_exact(&mut buf)?;
tgt.write_all(&buf[0..IN_SIZE])?;
println!("{:?}", now.elapsed().as_millis());
}
}
@ -64,12 +62,9 @@ impl Format {
const OUT: usize = reduce::gray8::out_size(IN_SIZE);
let mut buf = [0u8; IN_SIZE];
loop {
let now = Instant::now();
src.read_exact(&mut buf)?;
reduce::gray8::run(&mut buf);
tgt.write_all(&buf[0..OUT])?;
println!("{:?}", now.elapsed().as_millis());
}
}
@ -77,12 +72,9 @@ impl Format {
const OUT: usize = reduce::gray8_simd::out_size(IN_SIZE);
let mut buf = [0u8; IN_SIZE];
loop {
let now = Instant::now();
src.read_exact(&mut buf)?;
reduce::gray8_simd::run(&mut buf);
tgt.write_all(&buf[0..OUT])?;
println!("{:?}", now.elapsed().as_millis());
}
}
@ -90,12 +82,9 @@ impl Format {
const OUT: usize = reduce::mono::out_size(IN_SIZE);
let mut buf = [0u8; IN_SIZE];
loop {
let now = Instant::now();
src.read_exact(&mut buf)?;
reduce::mono::run(&mut buf);
tgt.write_all(&buf[0..OUT])?;
println!("{:?}", now.elapsed().as_millis());
}
}
@ -103,12 +92,9 @@ impl Format {
const OUT: usize = reduce::mono_simd::out_size(IN_SIZE);
let mut buf = [0u8; IN_SIZE];
loop {
let now = Instant::now();
src.read_exact(&mut buf)?;
reduce::mono_simd::run(&mut buf);
tgt.write_all(&buf[0..OUT])?;
println!("{:?}", now.elapsed().as_millis());
}
}
}