shiboken-AVbin / README

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'.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.