From d573ffc2e89336ea04fda42d0e56b59a65953d51 Mon Sep 17 00:00:00 2001 From: David Holroyd Date: Mon, 19 Feb 2024 00:12:53 +0000 Subject: [PATCH] Move test asset to git lfs --- .gitattributes | 1 + .github/workflows/benchmark.yml | 2 -- benches/bench.rs | 4 ++-- benches/ci_bench.rs | 3 ++- testsrc.ts | 3 +++ 5 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .gitattributes create mode 100644 testsrc.ts diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ebc58b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +testsrc.ts filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2a39553..80ba6a2 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,8 +17,6 @@ jobs: - uses: bencherdev/bencher@main - - name: Download test mpegts asset - run: wget --quiet -c "http://www.badgers-in-foil.co.uk/4d0660bd-5755-4917-9592-2e3d85736592.ts" - run: sudo apt-get install valgrind - run: cargo install --version 0.10.2 iai-callgrind-runner - run: | diff --git a/benches/bench.rs b/benches/bench.rs index 3e4eea2..d93917f 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -82,8 +82,8 @@ fn mpeg2ts_reader(c: &mut Criterion) { // code to consume vec![0; 188] } else { - let mut f = File::open("resources/testsrc.ts") - .expect("Test file missing. To create, run: mkdir -p resources && ffmpeg -f lavfi -i testsrc=duration=20:size=640x360:rate=30,noise=alls=20:allf=t+u -f lavfi -i sine=duration=20:frequency=1:beep_factor=480:sample_rate=48000 -c:v libx264 -b:v 20M -map 0:v -c:a aac -b:a 128k -map 1:a -vf format=yuv420p -f mpegts resources/testsrc.ts"); + let mut f = File::open("testsrc.ts") + .expect("Test file missing. To create, run: mkdir -p resources && ffmpeg -f lavfi -i testsrc=duration=20:size=640x360:rate=30,noise=alls=20:allf=t+u -f lavfi -i sine=duration=20:frequency=1:beep_factor=480:sample_rate=48000 -c:v libx264 -b:v 20M -map 0:v -c:a aac -b:a 128k -map 1:a -vf format=yuv420p -f mpegts testsrc.ts"); let l = f.metadata().unwrap().len() as usize; let size = l.min(188 * 200_000); let mut buf = vec![0; size]; diff --git a/benches/ci_bench.rs b/benches/ci_bench.rs index 41ab6b4..f5ffc6e 100644 --- a/benches/ci_bench.rs +++ b/benches/ci_bench.rs @@ -72,7 +72,8 @@ impl pes::ElementaryStreamConsumer for NullElementaryStreamConsumer { #[library_benchmark] fn reader() { - let mut f = File::open("4d0660bd-5755-4917-9592-2e3d85736592.ts").expect("Test file missing"); + let mut f = File::open("testsrc.ts") + .expect("Test file missing. To create, run: mkdir -p resources && ffmpeg -f lavfi -i testsrc=duration=20:size=640x360:rate=30,noise=alls=20:allf=t+u -f lavfi -i sine=duration=20:frequency=1:beep_factor=480:sample_rate=48000 -c:v libx264 -b:v 20M -map 0:v -c:a aac -b:a 128k -map 1:a -vf format=yuv420p -f mpegts testsrc.ts"); let l = f.metadata().unwrap().len() as usize; let size = l.min(188 * 200_000); let mut buf = vec![0; size]; diff --git a/testsrc.ts b/testsrc.ts new file mode 100644 index 0000000..72fa791 --- /dev/null +++ b/testsrc.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6823b6c4491f3205b6e9d4e313e1f5127c257dc228128005c9294bd023eeaeb +size 51776140