Open brucekim opened 2 years ago
@brucekim I have some ideas involving reflection tags to fix this issue. If you still need this, move the issue please and continue the discussion at https://github.com/go-gst/go-gst (where future development of the bindings will take place)
It encounters panic when accessing unexported fields of struct at reflect used by
GetStructure().UnmarshallInto()
.In my case, I need to get GstRTPPacketLost event. So I need to define type struct in go area in order to extract GstStructure values from gst into go area.
However it could not get value of each field from GstStructure of GstRTPPacketLost because the field of GstRTPPacketLost is in lowercase whereas the type struct what I defined in go area is starting with upper case for exporting out of struct. I mean, it has not found any matching field in GstRTPPacketLost GstStructure from the type struct I defined above.
https://github.com/GStreamer/gst-plugins-good/blob/20bbeb5e37666c53c254c7b08470ad8a00d97630/gst/rtpmanager/gstrtpjitterbuffer.c#L2433-L2438
So I redefined the type struct in go area having filed in lower case only, which results in panic since reflect doesn't allow to set on unexported fields, this causes panic.
I figured out an workaround by lowering
fieldName
then set onUnmarshalInto
. However this is limited to cover only lower case of field name.I am now figuring out better way for this..