Overview

The Goal: Create Pythonic binding for audio/video API of AVbin library
          documented at http://avbin.github.com/docs/



01: Get AVbin and compile it

lib/AVbin - will contain AVbin source

$ mkdir lib
$ cd lib
$ git clone git://github.com/AVbin/AVbin.git

$ cd AVbin
$ ./build.sh linux-x86-32
# refer to README if your platform is different



02. Locate AVbin headers with API description and libraries with binary code

From README and filesystem inspection, the location is the following:

lib/AVbin/dist/linux-x86-32/libavbin.so.9  - compiled binary library
lib/AVbin/include/avbin.h   - header with API that we need to port to Python



03. Setup shiboken

You can install `shiboken` package on Ubuntu from PySide PPA.  There is always
the latest and greatest version.  For other systems it's probably easier to
compile it from source using https://github.com/PySide/BuildScripts

(sorry, can't say anything for Windows/Mac OS user right now)

$ shiboken --version
shiboken v1.0.10
Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)



04. Inspect what shiboken need to generate the bindings

$ shiboken --help
Usage:
  generator [options] header-file typesystem-file

Seems like `shiboken` thinks that it is named a `generator`. Anyway, it
requires header-file and typesystem-file to generate the bindings.



05. Create API mapping (mysteriously called 'typesystem')

Basically, you need an XML file that defines how your C++ functions calls and
types are converted to Python. This file is called 'typesystem file'.

$ cat typesystem.xml
<?xml version="1.0"?>

<!-- the name of the module as it will be imported from Python-->
<typesystem package='AVbin'>
</typesystem>

$ shiboken lib/AVbin/include/avbin.h typesystem.xml 
Resolving typedefs...                        [OK]
Detecting inconsistencies in typesystem...   [OK]

	Cyclic dependency found! Graph can be found at /tmp/qt_temp.T13977
	No C++ classes found!
	

Done, 2 warnings (0 known issues)


It is not clear if C++ classes are not found in avbin.h or just don't defined,
so let's dig further.