mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 23:11:01 +00:00
ts-udpsrc: Fix build on Windows
By disabling socket sharing there. This is blocked by PRs to mio/tokio currently.
This commit is contained in:
parent
6286e496ba
commit
a2582afed3
2 changed files with 21 additions and 2 deletions
|
@ -696,7 +696,9 @@ impl UdpSrc {
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
unsafe {
|
unsafe {
|
||||||
let fd = dup_socket(socket.as_raw_socket() as _) as _;
|
// FIXME: Needs https://github.com/tokio-rs/tokio/pull/806
|
||||||
|
// and https://github.com/carllerche/mio/pull/859
|
||||||
|
let fd = unreachable!(); //dup_socket(socket.as_raw_socket() as _) as _;
|
||||||
|
|
||||||
// This is unsafe because it allows us to share the fd between the socket and the
|
// This is unsafe because it allows us to share the fd between the socket and the
|
||||||
// GIO socket below, but safety of this is the job of the application
|
// GIO socket below, but safety of this is the job of the application
|
||||||
|
@ -876,8 +878,24 @@ impl ObjectSubclass for UdpSrc {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
klass.add_pad_template(src_pad_template);
|
klass.add_pad_template(src_pad_template);
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
{
|
||||||
klass.install_properties(&PROPERTIES);
|
klass.install_properties(&PROPERTIES);
|
||||||
}
|
}
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
|
let properties = PROPERTIES
|
||||||
|
.iter()
|
||||||
|
.filter(|p| match *p {
|
||||||
|
subclass::Property("socket", ..) | subclass::Property("used-socket", ..) => {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
_ => true,
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
klass.install_properties(properties.as_slice());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn new_with_class(klass: &subclass::simple::ClassStruct<Self>) -> Self {
|
fn new_with_class(klass: &subclass::simple::ClassStruct<Self>) -> Self {
|
||||||
let templ = klass.get_pad_template("src").unwrap();
|
let templ = klass.get_pad_template("src").unwrap();
|
||||||
|
|
|
@ -103,6 +103,7 @@ fn test_push() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(not(windows))]
|
||||||
fn test_socket_reuse() {
|
fn test_socket_reuse() {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue