我正在尝试在python中使用'glimagesink‘元素。该元素(内部为GObject )具有client-draw-callback属性,该属性应(至少在C++中)包含一个函数(bool func(uint t, uint w, uint h))指针。我尝试过element.set_property('client-draw-callback', myfunc),并使用ctype创建函数指针,但每次都显示为TypeError: could not convert argument to correct param type
我可以找到任何关于在python中使用glimagesink或glfilterapp的文档):
工作的c++代码:
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)发布于 2010-02-16 00:28:28
这不是你遇到的问题(据我所知),但重要的是要注意,这个接口最近发生了变化,现在它需要一个空的数据指针,允许你在连接回调时将一个句柄传递给user_data (或NULL)。
gboolean drawCallback (GLuint texture, GLuint width, GLuint height, gpointer data)https://stackoverflow.com/questions/1834990
复制相似问题