Skip to content

Instantly share code, notes, and snippets.

View Gnurou's full-sized avatar

Alexandre Courbot Gnurou

View GitHub Profile
@Gnurou
Gnurou / kdev_kernel.py
Last active January 24, 2019 14:06
Convert Linux kernel config into Kdevelop macro defines
#!/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 / gist:dbc3776ed97ea7d4ce6041ea15eb0438
Last active January 31, 2018 10:20
Request API simple test program
/*
* 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
@Gnurou
Gnurou / captest.c
Last active June 16, 2022 09:47
Test program demonstrating the V4L2 request API on a capture device (vivid)
/*
* 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
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
@Gnurou
Gnurou / m2mtest.c
Last active April 17, 2018 04:17
Test program demonstrating the V4L2 request API on a codec device (vim2m)
/*
* 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

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 October 28, 2016 03:39
Pixel C override keyboard mappings
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:121666303a811436a412
Created January 15, 2016 06:48
Script that rebases a bunch of branches and merges them into one.
# Usage: reb.sh branch_base new_base
set -e
git checkout --detach
oldbase=`git show-ref --heads -s "$1/base"`
branches=`git branch --list "$1/*"`
git checkout "$1/base"
@Gnurou
Gnurou / gist:9b3e9e78077b76d6930a
Created January 4, 2016 01:57
Script to convert KML files to GPX
#/bin/bash
for f in $*
do
unzip "$f" doc.kml
gpsbabel -i kml -f doc.kml -o gpx -F "${f%.kmz}.gpx"
rm doc.kml
done
@Gnurou
Gnurou / gist:349a0fa6b4088d65a4a5
Created November 10, 2015 05:10
Apply a Nouveau patch to the Linux kernel
git am --directory drivers/gpu/ foo.patch