Skip to content

Instantly share code, notes, and snippets.

View kbingham's full-sized avatar

Kieran Bingham kbingham

View GitHub Profile
@kbingham
kbingham / check-v4l2-sensor-compatibility.awk
Created April 20, 2023 14:28
Check for keywords in a V4L2 Subdevice driver
#!/usr/bin/awk -f
function initialiseControls(ids, keys, controls)
{
split(ids, keys)
for (i in keys) {
controls[keys[i]] = "--------"
# Track the maximum key length
len = length(keys[i])
From 3507214a30a9b615faf7d0998defdde69864f386 Mon Sep 17 00:00:00 2001
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Date: Sun, 30 Oct 2022 22:12:38 +0000
Subject: [PATCH] gstreamer: provider: Support builds with
GST_DISABLE_GST_DEBUG
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When the host system packages gstreamer with GST_DISABLE_GST_DEBUG defined, the
@kbingham
kbingham / lcdebug
Created September 26, 2022 15:27
lcdebug - helper to debug libcamera
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Support debugging libcamera commands and applications.
# We default to enabling the most debug
# (that's why we're being used right)
FILTER="*"
LEVEL="0"
FROM debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
ENV LANG='C.UTF-8' LC_ALL='C.UTF-8'
# Support multiarch builds to perform cross compilation
# https://wiki.debian.org/Multiarch/HOWTO
RUN dpkg --add-architecture arm64
# Expected system requirements
@kbingham
kbingham / check-v4l2-sensor-compatibility.awk
Created February 25, 2022 11:02
Quick tool to help reviewing Camera Sensor drivers in linux-media to support libcamera requirements
#!/usr/bin/awk -f
function initialiseControls(ids, keys, controls)
{
split(ids, keys)
for (i in keys) controls[keys[i]] = "--------"
}
BEGIN {
print "Processing " ARGV[1]
[bindings]
G = call hooks.getmail(ui)
@kbingham
kbingham / git-banner-commit
Created September 27, 2021 09:28
Create 'banner' commits in a branch to separate topics
#!/bin/sh
## Often used with interactive rebases to split patch groups
## git rebase -i
## add lines such as:
## x git banner-commit "Submitted"
## dot-files are created so that the commits are not empty, and persist.
columns=52
line="$*"
@kbingham
kbingham / bootstrap-deps.sh
Created September 10, 2021 16:12
Support installation of libcamera dependencies on multiple platforms
#!/bin/bash
app=`basename $0`
# Todo: Autodetect system
system=ubuntu
toolchains=(gcc clang)
modules=(android cam qcam raspberrypi tracing gstreamer hotplug documentation tracing developer)
for m in /sys/bus/media/devices/media*;
do
mn=`basename $m`
model=`cat $m/model`
echo $mn: $model
done | sort -V;
@kbingham
kbingham / sd-card-writer
Created December 15, 2020 16:10
SD Card writer (can also write USB sticks)
#!/bin/bash
## Usage sd-card-writer image <target>
IMAGE=$1
TARGET=${2:-/dev/mmcblk0}
if [ ! -b $TARGET ] ; then
echo "$TARGET is not a block device"
exit