我试图使用“glimagesink”元素与Python。 元件(其是GObject的内部)已经client-draw-callback属性应(在C ++中至少)包含一个函数(bool func(uint t, uint w, uint h))指针。 我试过element.set_property('client-draw-callback', myfunc),并创建具有ctypes的函数指针,但每次它说,TypeError: could not convert argument to correct param type

我能找到关于使用glimagesink或glfilterapp在python)的任何文档:

工作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)
有帮助吗?

解决方案

这是不是你有(据我可以告诉)的问题,但要注意,这一点很重要 这个API最近发生了变化,现在它预计数据的空指针,它允许你在一个句柄传递给USER_DATA(或NULL)当您连接您的回调。

gboolean drawCallback (GLuint texture, GLuint width, GLuint height, gpointer data)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top