Python Forum
How to use python to receive Gobject.pointer - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to use python to receive Gobject.pointer (/thread-5957.html)



How to use python to receive Gobject.pointer - stephenwei - Oct-30-2017

Hi,
I write a gstreamer plugin and g_signal_emit had send a struct.

when I try to use python to receive callback function. I don't know how to
receive a array?
example :

int a[2];
a[0]=1;
g_signal_emit(filter, gst_test_signals[SIGNAL_DETECTED], 0, &a);

def cb_test_monitor(object, test, data):

print(test) #<gpointer at 0x7f439aa508a0>
print(test[0]) #TypeError: 'gobject.GPointer' object is not subscriptable

Thanks,
Stephen