cdgdec: fix test with gst master

Test was relying on 'blocksize' property on the source which can
only be used in push mode.

This change in baseparse broke it:
e906197c62
so ensure we are actually in push mode by using pushfilesrc.
This commit is contained in:
Guillaume Desmottes 2020-05-01 10:28:31 +02:00
parent 896bda12f9
commit 6c6917077d

View file

@ -37,17 +37,21 @@ fn test_cdgdec() {
r r
}; };
let filesrc = gst::ElementFactory::make("filesrc", None).unwrap(); // Ensure we are in push mode so 'blocksize' prop is used
let filesrc = gst::ElementFactory::make("pushfilesrc", None).unwrap();
filesrc filesrc
.set_property("location", &input_path.to_str().unwrap()) .set_property("location", &input_path.to_str().unwrap())
.expect("failed to set 'location' property"); .expect("failed to set 'location' property");
filesrc {
.set_property("num-buffers", &1) let child_proxy = filesrc.dynamic_cast_ref::<gst::ChildProxy>().unwrap();
.expect("failed to set 'num-buffers' property"); child_proxy
let blocksize: u32 = 24; // One CDG instruction .set_child_property("real-filesrc::num-buffers", &1)
filesrc .expect("failed to set 'num-buffers' property");
.set_property("blocksize", &blocksize) let blocksize: u32 = 24; // One CDG instruction
.expect("failed to set 'blocksize' property"); child_proxy
.set_child_property("real-filesrc::blocksize", &blocksize)
.expect("failed to set 'blocksize' property");
}
let parse = gst::ElementFactory::make("cdgparse", None).unwrap(); let parse = gst::ElementFactory::make("cdgparse", None).unwrap();
let dec = gst::ElementFactory::make("cdgdec", None).unwrap(); let dec = gst::ElementFactory::make("cdgdec", None).unwrap();