Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix libcamera resolution and controls logging #260

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading