Skip to content

Commit

Permalink
fixup! Refactor JPEG handling in agent
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Jan 22, 2024
1 parent 71b7993 commit 0c8e0c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agent/src/ffmpeg/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Streamer {
metrics::counter!(crate::METRIC_FFMPEG_INVOCATIONS, 1);

let stdout = ffmpeg_process.stdout.take().unwrap();
let mut stdout_frame = FramedRead::new(stdout, JpegFrameDecoder::default());
let mut stdout_frame = FramedRead::new(stdout, JpegFrameDecoder);

let stderr = ffmpeg_process.stderr.take().unwrap();
let mut stderr_reader = BufReader::new(stderr).lines();
Expand Down
6 changes: 3 additions & 3 deletions agent/src/jpeg_frame_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod test {

#[test]
fn decoder_none() {
let mut decoder = JpegFrameDecoder::default();
let mut decoder = JpegFrameDecoder;

let data = [0xFF, 0xD8, 1, 1, 1];
let mut data = BytesMut::from(&data[..]);
Expand All @@ -45,7 +45,7 @@ mod test {

#[test]
fn decoder_one() {
let mut decoder = JpegFrameDecoder::default();
let mut decoder = JpegFrameDecoder;

let data = [0xFF, 0xD8, 1, 1, 1, 0xFF, 0xD9];
let mut data = BytesMut::from(&data[..]);
Expand All @@ -57,7 +57,7 @@ mod test {

#[test]
fn decoder_multiple() {
let mut decoder = JpegFrameDecoder::default();
let mut decoder = JpegFrameDecoder;

let data = [
0xFF, 0xD8, 1, 1, 1, 0xFF, 0xD9, 0xFF, 0xD8, 2, 2, 2, 0xFF, 0xD9,
Expand Down

0 comments on commit 0c8e0c7

Please sign in to comment.