"Signal not found" on emitting create-data-channel
I'm using the webrtcbin to stream RGB video from gstreamer. I have succeeded in getting the video through and would like to add a data channel to the connection as well. I have taken inspiration from this example in C, which yielded the following code:
let data_channel = webrtc.emit("create-data-channel", &[&"channel"]).unwrap();
match data_channel {
Some(channel) => {
let g_channel = channel.get::<gst::Object>().unwrap();
connect_data_channel_signals(&g_channel.clone()).unwrap_err();
}
_ => {
println!("Data channel creation failed :(")
}
}
webrtc.connect("on-data-channel", false, move |values| {
let channel = values[1].get::<gst::Object>().unwrap();
connect_data_channel_signals(&channel.clone()).unwrap_err();
None
})?;
The webrtc
variable has been created with gst::ElementFactory::make("webrtcbin", "webrtc")
and connect_data_channel_signals
sets up the signals associated with the data channel, that is "on-error", "on-open", "on-close" and "on-message-string".
Problem is that the webrtc.emit
function results in a panic with the description "Signal not found". Similarly, if I comment out the first part, the call to webrtc.connect
will result in the same error. Am I doing something wrong or is it because data channels are simply not supported in Rust yet?