Skip to content

Conversation

@tomberek
Copy link

Not sure about this API. It may require some additional changes to make it easier to use, but it seems to work and does simplify some things. I updated the dynamicpipeline demo here: https://github.com/tomberek/gst-go-demo

Fixes #5

Tom Bereknyei added 2 commits March 28, 2020 23:50
This relies on specific structure of interface{} being composed of two
gpointer's. The code expects something along the lines of:

```
/*
void cb_proxy(void* v, void* v2);
*/
import "C"

//export cb_proxy
func cb_proxy(v unsafe.Pointer, v2 unsafe.Pointer) {
    println("in cb_proxy")
    el := (*C.GstElement)(v)
    cb := (*gst.Element)(v2)
    mycall(el, cb)
}
func mycall(webrtc *C.GstElement, user_data *gst.Element) {
}
...
func main{
    ...
    source.SetCallback("on-negotiation-needed", C.cb_proxy)
    ...
}
```
@tomberek tomberek changed the title Arbitrary callbacks WIP: Arbitrary callbacks Mar 29, 2020
@tomberek
Copy link
Author

tomberek commented Mar 29, 2020

TODO:

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

Successfully merging this pull request may close these issues.

Additional Callbacks

1 participant