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

WIP: Arbitrary callbacks #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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