Pygst -GlimageSink 콜백
문제
파이썬과 함께 'GlimageSink'요소를 사용하려고합니다. 요소 (내부에있는 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
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)
해결책
이것은 당신이 가지고있는 문제가 아니지만 (내가 알 수있는 한) 최근 에이 API가 변경되었음을 주목하는 것이 중요합니다. 이제 hands를 user_data (또는 핸들에 전달할 수있는 공간 포인터를 기대합니다. NULL) 콜백을 연결할 때.
gboolean drawCallback (GLuint texture, GLuint width, GLuint height, gpointer data)
제휴하지 않습니다 StackOverflow