mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-18 08:06:31 +00:00
webrtcsink: Configure custom host/port on the signaller when running signalling server internally
Otherwise it just tries connecting to the default URL, which doesn't work if either the host or the port are changed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1994>
This commit is contained in:
parent
73663d7352
commit
248b7ac059
1 changed files with 25 additions and 0 deletions
|
@ -5450,6 +5450,31 @@ impl WebRTCSink {
|
||||||
let settings = self.settings.lock().unwrap().clone();
|
let settings = self.settings.lock().unwrap().clone();
|
||||||
|
|
||||||
if settings.run_signalling_server {
|
if settings.run_signalling_server {
|
||||||
|
// Configure our own signalling server as URI on the signaller
|
||||||
|
{
|
||||||
|
let signaller = self
|
||||||
|
.obj()
|
||||||
|
.upcast_ref::<super::BaseWebRTCSink>()
|
||||||
|
.imp()
|
||||||
|
.settings
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.signaller
|
||||||
|
.clone();
|
||||||
|
|
||||||
|
// Map UNSPECIFIED addresses to localhost
|
||||||
|
let host = match settings.signalling_server_host.as_str() {
|
||||||
|
"0.0.0.0" => "127.0.0.1".to_string(),
|
||||||
|
"::" | "[::]" => "[::1]".to_string(),
|
||||||
|
host => host.to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
|
signaller.set_property(
|
||||||
|
"uri",
|
||||||
|
format!("ws://{}:{}", host, settings.signalling_server_port),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(err) = LazyLock::force(&SIGNALLING_LOGGING) {
|
if let Err(err) = LazyLock::force(&SIGNALLING_LOGGING) {
|
||||||
Err(anyhow!(
|
Err(anyhow!(
|
||||||
"failed signalling server logging initialization: {}",
|
"failed signalling server logging initialization: {}",
|
||||||
|
|
Loading…
Reference in a new issue