Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to access data in a C anonymous union... #123

Open
danjenkins opened this issue Jun 23, 2022 · 0 comments
Open

need to access data in a C anonymous union... #123

danjenkins opened this issue Jun 23, 2022 · 0 comments

Comments

@danjenkins
Copy link

I need to access the data from a field in a C anonymous union within a struct (https://github.com/broadcastervc/ndigo/blob/master/include/Processing.NDI.structs.h#L235-L242) but I'm struggling to understand how I can make c for go output something I can use....

I tried putting my types.go file through go tool cgo -godefs types.go and replacing the types.go file with that as I'd read that I needed -godefs to make cgo understand those unions.... but I then realised I can't do that because code in cgo_helpers expects the types to be that of the C type defintion, not the full definition that the cgo tool then exports is...

Am I missing something?

The function I'm calling is this one: https://github.com/broadcastervc/ndigo/blob/master/ndigo.go#L129-L142

Theres also a separate issue where I pass in a referenced variable pVideoData which then gets made into a new Ref'd var for C cpVideoData - cpVideoData has new data from the C function.... but that never gets passed back into pVideoData.... cpVideoData/pVideoData is where I would expect to see LineStrideInBytes from the anonymous union....

Sorry, fairly new to Go and I've reached the end of my googling skills around cgo/c for go etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant