Hello,<div><br></div><div>I'm trying to do some video overlay using gstreamer and cairooverlay, everything written in Python and I'm having some problemss. Here's a snippet from my code (everything: <a href="http://pastebin.com/y38Dnr3x" target="_blank">http://pastebin.com/y38Dnr3x</a>):</div>
<div>---</div><div>[...]</div><div># create cairooverlay and attach a function</div>
<div><div>self.cairooverlay = gst.element_factory_make("cairooverlay")</div><div>self.cairooverlay.connect("draw", self.OnDraw)</div><div>self.pipeline.add(self.cairooverlay)</div></div><div>[...]</div>
<div># Callback function to do the drawing (inside class, also tried outside)</div>
<div><div>def OnDraw(this, overlay, cr, timestamp, duration):</div><div> cr.show_text('Hello World')</div><div> cr.stroke() # commit to surface</div></div><div>[...]</div><div>---</div><div><br></div><div>Error I get:</div>
<div>---</div><div><div>Traceback (most recent call last):</div><div> File "/some/dir/gst-cairo-test.py", line 71, in OnDraw</div><div> cr.show_text('Hello World')</div>
<div>AttributeError: 'gobject.GBoxed' object has no attribute 'show_text'</div></div><div>---</div><div><br></div><div>The problem is that "cr" variable is passed as GBoxed object not a cairo context. I suspect that GBoxed it might hold cairo context object but I don't know how to extract it.</div>
<div><br></div><div>How to extract cairo context from this GBoxed object? Or, more general, how to make everything work?</div><div><br></div><div>Lukasz.</div><div><br></div>