mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-11 12:46:29 +00:00
Compare IP addresses in lowercase
Only really relevant for IPv6.
This commit is contained in:
parent
98c290602c
commit
bbdfae8cdd
1 changed files with 8 additions and 11 deletions
|
@ -570,6 +570,8 @@ where
|
||||||
{
|
{
|
||||||
gst_debug!(cat, obj: element, "Starting NDI connection...");
|
gst_debug!(cat, obj: element, "Starting NDI connection...");
|
||||||
|
|
||||||
|
let ip_address = ip_address.map(str::to_lowercase);
|
||||||
|
|
||||||
let mut receivers = HASHMAP_RECEIVERS.lock().unwrap();
|
let mut receivers = HASHMAP_RECEIVERS.lock().unwrap();
|
||||||
|
|
||||||
// Check if we already have a receiver for this very stream
|
// Check if we already have a receiver for this very stream
|
||||||
|
@ -584,7 +586,7 @@ where
|
||||||
} => (
|
} => (
|
||||||
audio,
|
audio,
|
||||||
video,
|
video,
|
||||||
ip_address.as_ref().map(String::as_ref),
|
ip_address.as_ref(),
|
||||||
ndi_name.as_ref().map(String::as_ref),
|
ndi_name.as_ref().map(String::as_ref),
|
||||||
),
|
),
|
||||||
ReceiverInfo::Connected {
|
ReceiverInfo::Connected {
|
||||||
|
@ -593,15 +595,10 @@ where
|
||||||
ref ip_address,
|
ref ip_address,
|
||||||
ref ndi_name,
|
ref ndi_name,
|
||||||
..
|
..
|
||||||
} => (
|
} => (audio, video, Some(ip_address), Some(ndi_name.as_str())),
|
||||||
audio,
|
|
||||||
video,
|
|
||||||
Some(ip_address.as_str()),
|
|
||||||
Some(ndi_name.as_str()),
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if val_ip_address == ip_address || val_ndi_name == ndi_name {
|
if val_ip_address == ip_address.as_ref() || val_ndi_name == ndi_name {
|
||||||
if (val_video.is_some() || !T::IS_VIDEO) && (val_audio.is_some() || T::IS_VIDEO) {
|
if (val_video.is_some() || !T::IS_VIDEO) && (val_audio.is_some() || T::IS_VIDEO) {
|
||||||
gst_element_error!(
|
gst_element_error!(
|
||||||
element,
|
element,
|
||||||
|
@ -626,7 +623,7 @@ where
|
||||||
let mut info = ReceiverInfo::Connecting {
|
let mut info = ReceiverInfo::Connecting {
|
||||||
id: id_receiver,
|
id: id_receiver,
|
||||||
ndi_name: ndi_name.map(String::from),
|
ndi_name: ndi_name.map(String::from),
|
||||||
ip_address: ip_address.map(String::from),
|
ip_address,
|
||||||
video: None,
|
video: None,
|
||||||
audio: None,
|
audio: None,
|
||||||
observations: Observations::new(),
|
observations: Observations::new(),
|
||||||
|
@ -775,7 +772,7 @@ fn connect_ndi_async(
|
||||||
|
|
||||||
let source = sources.iter().find(|s| {
|
let source = sources.iter().find(|s| {
|
||||||
Some(s.ndi_name()) == ndi_name.as_ref().map(String::as_str)
|
Some(s.ndi_name()) == ndi_name.as_ref().map(String::as_str)
|
||||||
|| Some(s.ip_address()) == ip_address.as_ref().map(String::as_str)
|
|| Some(&s.ip_address().to_lowercase()) == ip_address.as_ref()
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Some(source) = source {
|
if let Some(source) = source {
|
||||||
|
@ -842,7 +839,7 @@ fn connect_ndi_async(
|
||||||
*info = ReceiverInfo::Connected {
|
*info = ReceiverInfo::Connected {
|
||||||
id: id_receiver,
|
id: id_receiver,
|
||||||
ndi_name: source.ndi_name().to_owned(),
|
ndi_name: source.ndi_name().to_owned(),
|
||||||
ip_address: source.ip_address().to_owned(),
|
ip_address: source.ip_address().to_lowercase(),
|
||||||
recv: recv.clone(),
|
recv: recv.clone(),
|
||||||
video: video.clone(),
|
video: video.clone(),
|
||||||
audio: audio.clone(),
|
audio: audio.clone(),
|
||||||
|
|
Loading…
Reference in a new issue