I'm trying to build
https://github.com/pion/webrtc with gomobile but I'm running into this error. To reproduce, clone and then run
gomobile bind .
gobind/go_webrtcmain.go:86:19: cannot use (*proxywebrtc_TrackLocal)(_param_track_ref) (value of type *proxywebrtc_TrackLocal) as webrtc.TrackLocal value in assignment: *proxywebrtc_TrackLocal does not implement webrtc.TrackLocal (missing method Bind)
func proxywebrtc_API_NewRTPSender(refnum C.int32_t, param_track C.int32_t, param_transport C.int32_t) (C.int32_t, C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*webrtc.API)
var _param_track webrtc.TrackLocal
_param_track_ref := _seq.FromRefNum(int32(param_track))
if _param_track_ref != nil {
if param_track < 0 { // go object
_param_track = _param_track_ref.Get().(webrtc.TrackLocal)
} else { // foreign object
_param_track = (*proxywebrtc_TrackLocal)(_param_track_ref)
}
}
A little bit up, it seems that it's indeed creating a proxy TrackLocal type but doesn't implement the interface completely
type proxywebrtc_TrackLocal _seq.Ref
func (p *proxywebrtc_TrackLocal) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
// skipped method TrackLocal.Bind with unsupported parameter or result types
So I'm not surprised this can't be assigned. I guess the consequence is that this API can't be bound?
Is it possible to have gobind skip the non-working functions with a comment or something? I'm not sure why gobind doesn't reject the API and instead crashes.