From patchwork Fri Jan 11 13:08:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 204 Return-Path: Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 33D46600CC for ; Fri, 11 Jan 2019 14:08:57 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A13122000D; Fri, 11 Jan 2019 13:08:56 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 11 Jan 2019 14:08:57 +0100 Message-Id: <20190111130857.17946-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] utils: ipu3: Use variables for 'yavta' and 'media-ctl' X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2019 13:08:57 -0000 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 --- utils/ipu3/ipu3-capture.sh | 9 ++++++--- utils/ipu3/ipu3-process.sh | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) -- 2.20.1 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"