[libcamera-devel] [PATCH] utils: ipu3: Use variables for 'yavta' and 'media-ctl'

Jacopo Mondi jacopo at jmondi.org
Fri Jan 11 14:08:57 CET 2019


Use variables defined at the beginning of ipu3 helper scripts to call
yavta and media-ctl. This makes easier override them if a locally
compiled version should be used in place of the system-wide installed
ones.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 utils/ipu3/ipu3-capture.sh | 9 ++++++---
 utils/ipu3/ipu3-process.sh | 8 +++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/utils/ipu3/ipu3-capture.sh b/utils/ipu3/ipu3-capture.sh
index ba6147b..9d83cd4 100755
--- a/utils/ipu3/ipu3-capture.sh
+++ b/utils/ipu3/ipu3-capture.sh
@@ -13,6 +13,9 @@
 # - raw2pnm (from nvt https://github.com/intel/nvt.git)
 # - yavta (from git://git.ideasonboard.org/yavta.git)

+MEDIACTL=$(which media-ctl)
+YAVTA=$(which yavta)
+
 # Locate the sensor entity
 find_sensor() {
 	local bus
@@ -113,8 +116,8 @@ capture_frames() {
 		file_op="--file=/tmp/frame-#.bin"
 	fi

-	yavta -c$frame_count -n5 -I -f $ipu3_format -s $sensor_size $file_op \
-		$($mediactl -e "$ipu3_capture")
+	${YAVTA} -c$frame_count -n5 -I -f $ipu3_format -s $sensor_size $file_op \
+		   $($mediactl -e "$ipu3_capture")
 }

 # Convert captured files to ppm
@@ -173,7 +176,7 @@ sensor_name=$1

 sensor=$(find_sensor $sensor_name) || exit
 mdev=$(find_media_device) || exit
-mediactl="media-ctl -d $mdev"
+mediactl="${MEDIACTL} -d $mdev"

 parse_pipeline $sensor
 configure_pipeline
diff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh
index bb4abbe..ccdeb27 100755
--- a/utils/ipu3/ipu3-process.sh
+++ b/utils/ipu3/ipu3-process.sh
@@ -13,6 +13,8 @@
 # - raw2pnm (from nvt https://github.com/intel/nvt.git)
 # - yavta (from git://git.ideasonboard.org/yavta.git)

+MEDIACTL=$(which media-ctl)
+YAVTA=$(which yavta)
 imgu_entity="ipu3-imgu 0"

 # Locate the media device
@@ -20,7 +22,7 @@ find_media_device() {
 	local mdev

 	for mdev in /dev/media* ; do
-		media-ctl -d $mdev -p | grep -q "^driver[ \t]*ipu3-imgu$" && break
+		$MEDIACTL -d $mdev -p | grep -q "^driver[ \t]*ipu3-imgu$" && break
 		mdev=
 	done

@@ -62,7 +64,7 @@ configure_pipeline() {
 process_frames() {
 	configure_pipeline

-	local yavta="yavta -n $nbufs -c$frame_count"
+	local yavta="${YAVTA} -n $nbufs -c$frame_count"

 	# Save the main and viewfinder outputs to disk, capture and drop 3A
 	# statistics. Sleep 500ms between each execution of yavta to keep the
@@ -189,7 +191,7 @@ out_size=${out_size:-$in_size}
 vf_size=${vf_size:-$in_size}

 mdev=$(find_media_device) || exit
-mediactl="media-ctl -d $mdev"
+mediactl="${MEDIACTL} -d $mdev"
 echo "Using device $mdev"

 output_dir="/tmp"
--
2.20.1



More information about the libcamera-devel mailing list