mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-31 20:48:56 +00:00
sendrecv/Rust: Only set pipeline to Playing after connecting to the signals
Might miss some signal emissions otherwise, especially the on-negotiation-needed signal. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-examples/-/merge_requests/21>
This commit is contained in:
parent
3492c81fcf
commit
6378337a0e
1 changed files with 7 additions and 7 deletions
|
@ -142,13 +142,6 @@ impl App {
|
|||
// Channel for outgoing WebSocket messages from other threads
|
||||
let (send_ws_msg_tx, send_ws_msg_rx) = mpsc::unbounded::<WsMessage>();
|
||||
|
||||
// Asynchronously set the pipeline to Playing
|
||||
pipeline.call_async(|pipeline| {
|
||||
pipeline
|
||||
.set_state(gst::State::Playing)
|
||||
.expect("Couldn't set pipeline to Playing");
|
||||
});
|
||||
|
||||
let app = App(Arc::new(AppInner {
|
||||
args,
|
||||
pipeline,
|
||||
|
@ -228,6 +221,13 @@ impl App {
|
|||
}
|
||||
});
|
||||
|
||||
// Asynchronously set the pipeline to Playing
|
||||
app.pipeline.call_async(|pipeline| {
|
||||
pipeline
|
||||
.set_state(gst::State::Playing)
|
||||
.expect("Couldn't set pipeline to Playing");
|
||||
});
|
||||
|
||||
Ok((app, send_gst_msg_rx, send_ws_msg_rx))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue