wpesrc is leaking file descriptors
Here is a simple Rust app:
// src/main.rs
use gstreamer::init;
use gstreamer::prelude::*;
use gstreamer::Caps;
use gstreamer::Element;
use gstreamer::ElementFactory;
use gstreamer::MessageView;
use gstreamer::Pipeline;
use gstreamer::State;
use gstreamer::CLOCK_TIME_NONE;
fn main() {
init().unwrap();
loop {
println!("Creating pipeline");
let pipeline = Pipeline::new(None);
let wpesrc = ElementFactory::make("wpesrc", None).unwrap();
wpesrc.set_property("do-timestamp", &true).unwrap();
wpesrc.set_property("num-buffers", &100i32).unwrap();
wpesrc.set_property("draw-background", &false).unwrap();
wpesrc
.set_property("location", &"https://gstreamer.freedesktop.org")
.unwrap();
let capsfilter = ElementFactory::make("capsfilter", None).unwrap();
let fakesink = ElementFactory::make("fakesink", None).unwrap();
{
let caps = Caps::new_simple("video/x-raw", &[("format", &"BGRA")]);
capsfilter.set_property("caps", &caps).unwrap();
}
pipeline
.add_many(&[&wpesrc, &capsfilter, &fakesink])
.unwrap();
Element::link_many(&[&wpesrc, &capsfilter, &fakesink]).unwrap();
pipeline.set_state(State::Playing).unwrap();
let bus = pipeline.get_bus().unwrap();
for msg in bus.iter_timed(CLOCK_TIME_NONE) {
match msg.view() {
MessageView::Eos(..) => break,
MessageView::Error(err) => {
println!(
"Error from {:?}: {} ({:?})",
err.get_src().map(|s| s.get_path_string()),
err.get_error(),
err.get_debug()
);
break;
}
_ => (),
}
}
pipeline.set_state(State::Null).unwrap();
println!("Destroying pipeline");
std::thread::sleep(std::time::Duration::from_secs(3));
}
}
# Cargo.toml
[package]
authors = ["Nazar Mokrynskyi <nazar@mokrynskyi.com>"]
edition = "2018"
name = "test"
version = "0.0.0"
[dependencies.gstreamer]
features = ["v1_18"]
version = "0.16.3"
It creates and destroys pipeline with wpesrc with 3 seconds interval. After each iteration exactly 1 file descriptor is leaked.
File descriptors leaked are anon_inode:[eventpoll]
, not sure it is wpesrc-specific though, this is just an example that definitely leaks.