pygst - glimagesink callback
I'm trying to use 'glimagesink' element with python.
The element (which is GObject inside) ha开发者_如何学编程s client-draw-callback
property which should (in C++ at least) contain a function (bool func(uint t, uint w, uint h)
) pointer.
I've tried element.set_property('client-draw-callback', myfunc)
, and creating function pointer with ctypes, but every time it says, TypeError: could not convert argument to correct param type
I could find any docs on using glimagesink or glfilterapp in python ):
The working c++ code:
gboolean drawCallback (GLuint texture, GLuint width, GLuint height)
{ ... }
GstElement* glimagesink = gst_element_factory_make ("glimagesink", "glimagesink0");
g_object_set(G_OBJECT(glimagesink), "client-draw-callback", drawCallback, NULL)
This isn't the problem you're having (as far as I can tell) but it's important to note that this API has changed recently, now it expects a void pointer of data which allows you to pass in a handle to user_data (or NULL) when you connect your callback.
gboolean drawCallback (GLuint texture, GLuint width, GLuint height, gpointer data)
精彩评论