Month: June 2009

WoW! My ICQ still alive

I can’t believe it: my ICQ still working!

I got my ICQ# 190580 (yes, it is my birthday) more than 10 years ago and I stopped to use it about 6 years ago.

Everything dies, but ICQ will be remembered forever…

Use ack to search pattern

Normally I use find, xargs and grep to search pattern on source code (besides cscope):

find . -type f | xargs grep pattern

But it is not efficient mainly because it will search on all binary file and it will search on .cvs, .svn, .git directory.

A good alternative it the “ack” program:
http://betterthangrep.com/

On Ubuntu you can just install ack-grep package:
sudo apt-get install ack-grep

Example:

$ ack-grep mxc-mmc
drivers/mmc/host/mxcmmc.c
45:#define DRIVER_NAME "mxc-mmc"

arch/arm/mach-mx3/clock.c
546:    _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
547:    _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)

arch/arm/mach-mx3/devices.c
274:    .name = "mxc-mmc",
281:    .name = "mxc-mmc",

arch/arm/mach-mx2/devices.c
369:       .name           = "mxc-mmc",
400:       .name           = "mxc-mmc",

arch/arm/mach-mx2/clock_imx27.c
638:    _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
639:    _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)
640:    _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk)

Listing video formats supported by your webcam

Currently I am developing an application to encode webcam video stream directly to Ogg Theora. During my search I found some interesting projects and documentation.

The first one is the linpvr (Linux personal video recorder), this is an interesting project, but it is unfinished, then don’t wait to get it working, but it can be used as example to know how to convert RBG to YUV and to convert YUV to Theora:
http://code.google.com/p/linpvr/source/checkout

Other useful project is Etheora, this is a set of API developed to simplify Theora usage, it have many conversion routines (RGBxyz -> YUV420, etc):
http://wiki.xiph.org/index.php/Etheora

I am planing to use a webcam which supports natively YUV420 since this is the input format used on Theora encoding routines. Using VIDIOC_ENUM_FMT we can list what format the webcam and its kernel driver supports.

There is a program developed to test cameras supported natively by Adobe Flash, you can use this sample code to list your webcam capabilities:
http://blogs.adobe.com/penguin.swf/2008/07/paparazzi_v2_1.html

In that post’s comments we can find a great listing of webcams and their supported formats.

uCFLTK

Today I found something I was looking for long time ago: someone porting FLTK from C++ to C.

It is called uCFLTK mainly focused to microcontrollers (uC) because normally uC doesn’t have C++ compiler available:

http://www.kiwacan.co.nz/fltk/

Currently it is just on initial stage, but I think it is promising idea!