gstreamer Python and cairooverlay

Łukasz Góralczyk lukasz.goralczyk at gmail.com
Mon Jun 18 10:38:36 PDT 2012


Hello,

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: http://pastebin.com/y38Dnr3x):
---
[...]
# create cairooverlay and attach a function
self.cairooverlay = gst.element_factory_make("cairooverlay")
self.cairooverlay.connect("draw", self.OnDraw)
self.pipeline.add(self.cairooverlay)
[...]
# Callback function to do the drawing (inside class, also tried outside)
def OnDraw(this, overlay, cr, timestamp, duration):
  cr.show_text('Hello World')
  cr.stroke() # commit to surface
[...]
---

Error I get:
---
Traceback (most recent call last):
  File "/some/dir/gst-cairo-test.py", line 71, in OnDraw
    cr.show_text('Hello World')
AttributeError: 'gobject.GBoxed' object has no attribute 'show_text'
---

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.

How to extract cairo context from this GBoxed object? Or, more general, how
to make everything work?

Lukasz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120618/89245f63/attachment.html>


More information about the gstreamer-devel mailing list