From 762450bb5335d8c79cc29a6111874d89bd3b5c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 25 Mar 2021 20:12:51 +0200 Subject: [PATCH] check: Add Harness::pull_until_eos() --- gstreamer-check/src/harness.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index 021cedce5..e7d36d1e3 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -242,6 +242,20 @@ impl Harness { } } + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + pub fn pull_until_eos(&mut self) -> Result, glib::BoolError> { + unsafe { + let mut buffer = ptr::null_mut(); + let res = ffi::gst_harness_pull_until_eos(self.0.as_ptr(), &mut buffer); + if from_glib(res) { + Ok(from_glib_full(buffer)) + } else { + Err(glib::bool_error!("Failed to pull buffer or EOS")) + } + } + } + pub fn pull_event(&mut self) -> Result { unsafe { Option::<_>::from_glib_full(ffi::gst_harness_pull_event(self.0.as_ptr()))