GhostPad Failed to set target
when trying to use GhostPad::with_target error is thrown that it can't set target
// Initialize GStreamer
gst::init()?;
// Build the pipeline
let pipeline = gst::parse_launch(
"playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm")?;
// let pipeline = gst::Pipeline::new(None);
// let playbin =
// gst::ElementFactory::make("playbin", None).map_err(|_| MissingElement("playbin"))?;
// Create elements that go inside the sink bin
let videoconvert = gst::ElementFactory::make("videoconvert", None)
.map_err(|_| MissingElement("videoconvert"))?;
let scale =
gst::ElementFactory::make("videoscale", None).map_err(|_| MissingElement("videoscale"))?;
let appsink =
gst::ElementFactory::make("appsink", None).map_err(|_| MissingElement("appsink"))?;
println!("create elements");
// Create the sink bin, add the elements and link them
let bin = gst::Bin::new(Some("video-bin"));
bin.add_many(&[&videoconvert, &scale, &appsink])?;
gst::Element::link_many(&[&videoconvert, &scale, &appsink])?;
let pad = appsink
.static_pad("sink")
.expect("Failed to get a static pad from appsink");
println!("create pad");
let ghostpad = gst::GhostPad::with_target(Some("sink"), &pad).unwrap();
println!("create ghostpad");
thread 'main' panicked at 'called
Result::unwrap()on an
Err value: BoolError { message: "Failed to set target", filename: "...\gstreamer\\src\\auto\\ghost_pad.rs", function: "gstreamer::auto::ghost_pad", line: 48 }'