C to Python code to draw using cairooverlay plugin
<p>I want to turn a C function into Python in order to manage a "signal" in a script which uses cairooverlay to draw onto a video playing. </p>

<p>What I'd need: </p>

<pre><code>prepare_overlay (GstElement * overlay, GstCaps * caps, gpointer user_data)
{
  CairoOverlayState *state = (CairoOverlayState *) user_data;

  gst_video_format_parse_caps (caps, NULL, &amp;state-&gt;width, &amp;state-&gt;height);
  state-&gt;valid = TRUE;
}
</code></pre>

<p>the original script is taken from: <a href="http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/cairo/cairo_overlay.c" rel="nofollow">http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/cairo/cairo_overlay.c</a></p>

<p>Thanks in advance, 
Francesco</p>
