device: allow to use dummy as a way to test streamer

This adds loopback tests via `tests/`
This commit is contained in:
Kamil Trzcinski
2023-02-21 22:13:42 +01:00
parent 2e9718fea7
commit c9600d1253
15 changed files with 182 additions and 13 deletions

13
tests/capture.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"
set -xeo pipefail
[[ -e capture.jpeg ]] || libcamera-jpeg --timeout 1000 --output capture.jpeg --width 1920 --height 1080 --encoding jpg
[[ -e capture.yuv420 ]] || libcamera-jpeg --timeout 1000 --output capture.yuv420 --width 1920 --height 1080 --encoding yuv420
[[ -e capture.h264 ]] || libcamera-vid --frames 1 --output capture.h264 --width 1920 --height 1080 --codec h264 --profile main --level 4.2
# This is not ideal as `libcamera-raw` does not respect `--frames`
[[ -e capture.bg10p ]] || libcamera-raw --frames 1 --timeout 300 --verbose 2 --flush --output capture.bg10p --width 2304 --height 1296