You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
@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.
panic: reflect: reflect.Value.Set using value obtained using unexported field goroutine 17 [running, locked to thread]: reflect.flag.mustBeAssignableSlow(0xc314f2) /usr/local/go/src/reflect/value.go:259 +0xc5 reflect.flag.mustBeAssignable(...) /usr/local/go/src/reflect/value.go:249 reflect.Value.Set({0xcb4c80, 0xc000412840, 0x6}, {0xcb4c80, 0x157f428, 0xcb4c80}) /usr/local/go/src/reflect/value.go:1899 +0x6a github.com/tinyzimmer/go-gst/gst.(*Structure).UnmarshalInto(0xe3980e, {0xc92660, 0xc000412840}) /home/bkim/git/mpod/vendor/github.com/tinyzimmer/go-gst/gst/gst_structure.go:89 +0x3c6
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..
The text was updated successfully, but these errors were encountered: