Skip to content

Commit

Permalink
fix: fix libcamera resolution and controls logging (#260)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Gehrsitz <mryel00.github@gmail.com>
  • Loading branch information
mryel00 committed Apr 26, 2024
1 parent 809e54a commit 5fa8d1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/hwhandler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ list_picam_resolution() {
local prefix
prefix="$(date +'[%D %T]') crowsnest:"
log_msg "'libcamera' device(s) resolution(s) :"
while read -r i; do
while IFS= read -r i; do
printf "%s\t\t%s\n" "${prefix}" "${i}" >> "${CROWSNEST_LOG_PATH}"
done < <(libcamera-hello --list-cameras | sed '1,2d;s/Modes:/Colorspace:/')
}
Expand All @@ -101,8 +101,8 @@ get_libcamera_controls() {
sed 's/device//g;/^SNAPSHOT/q' | sed '/^SNAPSHOT/d' | \
sed '/^CAMERA/d;/- property/d' | sed '/camera-streamer Version:/d' | \
sed 's/- available option: //g' | sed '/^$/d;' | \
sed 's/([0-9]*[a-z,0-9]\,//g' | sed '/type=7/d;/type=4/d' | \
sed 's/type=1/ (bool/g;s/type=3/ (int/g;s/type=5/ (float/g' | \
sed 's/([0-9]*[a-z,0-9]\, /(/g' | sed '/type=7/d;/type=4/d;/type=Rectangle/d' | \
sed 's/type=1/bool/g;s/type=3/int/g;s/type=5/float/g' | sed 's/type=//g;' | \
sed 's/\[/min=/g;s/\.\./ max=/g;s/\]$//g'
else
log_msg "WARN: 'libcamera' device option can not be displayed, because"
Expand All @@ -114,7 +114,7 @@ list_picam_controls() {
local prefix
prefix="$(date +'[%D %T]') crowsnest:"
log_msg "'libcamera' device controls :"
while read -r i; do
while IFS= read -r i; do
if [[ ! "${i}" =~ "INFO" ]]; then
printf "%s\t\t%s\n" "${prefix}" "${i}" >>"${CROWSNEST_LOG_PATH}"
fi
Expand Down

0 comments on commit 5fa8d1e

Please sign in to comment.