Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre Courbot Gnurou

View GitHub Profile
@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 / 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
@Gnurou
Gnurou / captest.c
Last active Mar 19, 2021
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
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
@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
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:121666303a811436a412
Created Jan 15, 2016
Script that rebases a bunch of branches and merges them into one.
View gist:121666303a811436a412
# 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 Jan 4, 2016
Script to convert KML files to GPX
View gist:9b3e9e78077b76d6930a
#/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 Nov 10, 2015
Apply a Nouveau patch to the Linux kernel
View gist:349a0fa6b4088d65a4a5
git am --directory drivers/gpu/ foo.patch