rtp: tests: add run_test_pipeline_full() that checks output caps too

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1571>
This commit is contained in:
Tim-Philipp Müller 2024-05-16 19:18:52 +01:00 committed by GStreamer Marge Bot
parent 10e0294d5a
commit 72006215cb

View file

@ -188,6 +188,17 @@ pub fn run_test_pipeline(
depay: &str,
expected_pay: Vec<Vec<ExpectedPacket>>,
expected_depay: Vec<Vec<ExpectedBuffer>>,
) {
run_test_pipeline_full(src, pay, depay, expected_pay, expected_depay, None);
}
pub fn run_test_pipeline_full(
src: Source,
pay: &str,
depay: &str,
expected_pay: Vec<Vec<ExpectedPacket>>,
expected_depay: Vec<Vec<ExpectedBuffer>>,
expected_depay_caps: Option<gst::Caps>,
) {
let pipeline = Pipeline(gst::Pipeline::new());
@ -448,6 +459,12 @@ pub fn run_test_pipeline(
depay_samples.len()
);
if let Some(expected_depay_caps) = expected_depay_caps {
if let Some(first_depay_sample) = depay_samples.first() {
assert_eq!(expected_depay_caps, *first_depay_sample.caps().unwrap());
}
}
for (i, (expected_list, sample)) in
Iterator::zip(expected_depay.into_iter(), depay_samples.into_iter()).enumerate()
{