Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre Courbot Gnurou

View GitHub Profile
@Gnurou
Gnurou / captest.c
Last active Jun 16, 2022
Test program demonstrating the V4L2 request API on a capture device (vivid)
View captest.c
/*
* This program illustrates how the V4L2 request API can be used on a capture
* device, using the vivid driver. It must be invoked with the path to the vivid
* capture device as parameter, e.g.
*
* $ ./captest /dev/videoX
*
* NB_CAPTURES of decreasing brightness are then scheduled on the capture device,
* then saved to disk as captureX.rgb. The request API is used to confirm that
* the captures have been performed using the expected brightness, and the
@Gnurou
Gnurou / Kexec for ARM
Created Oct 28, 2013
Cross-compiling Kexec for ARM, how-to.
View Kexec for ARM
./bootstrap
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi --without-zlib --without-lzma
make
-> static binary in build/sbin/kexec
@Gnurou
Gnurou / kdev_kernel.py
Last active Jan 24, 2019
Convert Linux kernel config into Kdevelop macro defines
View kdev_kernel.py
#!/usr/bin/env python3
import sys
import os
import re
r = re.compile('\#define (\w+) (.+)')
f = open(os.path.join(sys.argv[1], 'include/generated/autoconf.h'))
@Gnurou
Gnurou / SHIELD loopback initramfs script
Last active Oct 31, 2018
A minimal /init script for a Busybox initramfs that mounts a loopback device file from SHIELD's data partition as root and continue booting from it. It allows to have a non-intrusive Linux installation along with Android on SHIELD.
View SHIELD loopback initramfs script
#!/bin/sh
mkdir /proc
mkdir /sys
mkdir /d
/bin/mount /proc
/bin/mount /sys
echo /sbin/mdev >/proc/sys/kernel/hotplug
mdev -s
mkdir /roothost
mkdir /newroot
@Gnurou
Gnurou / m2mtest.c
Last active Apr 17, 2018
Test program demonstrating the V4L2 request API on a codec device (vim2m)
View m2mtest.c
/*
* This program is a very simple demonstration of the proposed V4L2 request API.
* It must be invoked with the path to the vim2m device as parameter, e.g.
*
* $ ./m2mtest /dev/videoX /dev/mediaX
*
* It performs the following:
* * open the vim2m and media devices, allocate buffers and requests
* * submit a first request with a processing time of 600 ms
* * submit a second request with a processing time of 2000 ms
@Gnurou
Gnurou / gist:dbc3776ed97ea7d4ce6041ea15eb0438
Last active Jan 31, 2018
Request API simple test program
View gist:dbc3776ed97ea7d4ce6041ea15eb0438
/*
* This program is a very simple demonstration of the proposed V4L2 request API.
* It must be invoked with the path to the vim2m device as parameter, e.g.
*
* $ ./m2mtest /dev/videoX
*
* It performs the following:
* * open the vim2m and /dev/media0 devices, allocate buffers and requests
* * submit a first request with a processing time of 600 ms
* * submit a second request with a processing time of 2000 ms
View gist:866f1d77f63a1a002a17d2aa7630ec65
https://trac.ffmpeg.org/wiki/Debug/MacroblocksAndMotionVectors
Show motion vectors in real time:
ffplay -flags2 +export_mvs -vf codecview=mv=pf+bf+bb video.avi
Show only keyframes:
ffplay -vf select="eq(pict_type\,PICT_TYPE_I)" video.avi
View keybase.md

Keybase proof

I hereby claim:

  • I am Gnurou on github.
  • I am gnurou (https://keybase.io/gnurou) on keybase.
  • I have a public key whose fingerprint is 3A5A 6608 87D9 EC34 D662 FB27 04B0 8C8F 1524 FAF8

To claim this, I am signing this object:

@Gnurou
Gnurou / gist:a21e1ec65ce01aa89d390879e9763bf8
Created Oct 28, 2016
Pixel C override keyboard mappings
View gist:a21e1ec65ce01aa89d390879e9763bf8
Everything needed is explained here:
https://source.android.com/devices/input/key-character-map-files.html
https://source.android.com/devices/input/key-layout-files.html
Put the files in /data/system/devices/.../DEVICE_NAME so they survive system updates.
@Gnurou
Gnurou / gist:749930267e2ca4bc290b
Last active Sep 9, 2016
How to compile glmark2 under Linux/ARM with a special prefix
View gist:749930267e2ca4bc290b
./waf configure --with-flavors=drm-gl,drm-glesv2,wayland-gl,wayland-glesv2,x11-gl,x11-glesv2 --prefix=/opt/nouveau
./waf
./waf install
Compile issues? http://lists.freedesktop.org/archives/wayland-devel/2013-April/008497.html