title: Python SWIG bindings with SomeType ** as function argument
body: <p>I couldn't find any working Python bindings for ffmpeg, so I decided to generate one with SWIG. Generation was quick and easy (no customization, just default SWIG interface), but these a problem using some functions like <code>int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);</code> from <a href="http://svn.perian.org/ffmpeg/libavformat/avformat.h" rel="nofollow">libavformat/avformat.h</a>. Using C this can be run simply by:
  </p>
  
  <pre><code>AVFormatContext *pFormatCtx = NULL;
  int status;
  status = avformat_open_input(&amp;pFormatCtx, '/path/to/my/file.ext', NULL, NULL);
  </code></pre>
  
  <p>In Python I try following:
  </p>
  
  <pre><code>&gt;&gt;&gt; from ppmpeg import *
  &gt;&gt;&gt; av_register_all()
  &gt;&gt;&gt; FormatCtx = AVFormatContext()
  &gt;&gt;&gt; FormatCtx
  &lt;ppmpeg.AVFormatContext; proxy of &lt;Swig Object of type 'struct AVFormatContext *' at 0x173eed0&gt; &gt;
  &gt;&gt;&gt; avformat_open_input(FormatCtx, '/path/to/my/file.ext', None, None)
  Traceback (most recent call last):
     File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: in method 'avformat_open_input', argument 1 of type 'AVFormatContext **'
  </code></pre>
  
  <p>Problem is that Python do not have &amp; equivalent. I tried to use <code>cpointer.i</code> and its <code>pointer_class</code> (<code>%pointer_class(AVFormatContext, new_ctx)</code>), but <code>new_ctx()</code> returns pointer and this is not I want definitely. <code>%pointer_class(AVFormatContext *, new_ctx)</code> is illegal and gives syntax error. I would be grateful for any help. Thanks.</p>
  
  <p>EDIT:
  I forgot to mention I tried to use typemaps, but don't know how to write custom typemap for struct and documentation has only examples for basic types like int or float...</p>