开发者

pygst - glimagesink callback

开发者 https://www.devze.com 2022-12-13 14:05 出处:网络
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

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号