mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-10 10:02:31 +00:00
webrtcsink: emit consumer-added with webrtcbin in the Ready state
In order for applications to potentially create data channels at the correct moment
This commit is contained in:
parent
9e7406cec0
commit
3a5e05f2ab
1 changed files with 9 additions and 5 deletions
|
@ -1728,6 +1728,15 @@ impl WebRTCSink {
|
||||||
state.navigation_handler = Some(NavigationEventHandler::new(&element, &webrtcbin));
|
state.navigation_handler = Some(NavigationEventHandler::new(&element, &webrtcbin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.consumers.insert(peer_id.to_string(), consumer);
|
||||||
|
|
||||||
|
drop(state);
|
||||||
|
|
||||||
|
// This is intentionally emitted with the pipeline in the Ready state,
|
||||||
|
// so that application code can create data channels at the correct
|
||||||
|
// moment.
|
||||||
|
element.emit_by_name::<()>("consumer-added", &[&peer_id, &webrtcbin]);
|
||||||
|
|
||||||
pipeline.set_state(gst::State::Playing).map_err(|err| {
|
pipeline.set_state(gst::State::Playing).map_err(|err| {
|
||||||
WebRTCSinkError::ConsumerPipelineError {
|
WebRTCSinkError::ConsumerPipelineError {
|
||||||
peer_id: peer_id.to_string(),
|
peer_id: peer_id.to_string(),
|
||||||
|
@ -1735,11 +1744,6 @@ impl WebRTCSink {
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
state.consumers.insert(peer_id.to_string(), consumer);
|
|
||||||
|
|
||||||
drop(state);
|
|
||||||
element.emit_by_name::<()>("consumer-added", &[&peer_id, &webrtcbin]);
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue