gstreamer: Use new pad probe take_*() API in tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1537>
This commit is contained in:
Arun Raghavan 2024-09-11 14:11:31 -04:00 committed by Backport Bot
parent e34323cf2a
commit a369f9e345

View file

@ -2451,7 +2451,7 @@ mod tests {
{ {
let events = events.clone(); let events = events.clone();
pad.add_probe(crate::PadProbeType::EVENT_UPSTREAM, move |_, info| { pad.add_probe(crate::PadProbeType::EVENT_UPSTREAM, move |_, info| {
if let Some(PadProbeData::Event(event)) = info.data.take() { if let Some(event) = info.take_event() {
let mut events = events.lock().unwrap(); let mut events = events.lock().unwrap();
events.push(event); events.push(event);
} else { } else {
@ -2464,7 +2464,7 @@ mod tests {
{ {
let buffers = buffers.clone(); let buffers = buffers.clone();
pad.add_probe(crate::PadProbeType::BUFFER, move |_, info| { pad.add_probe(crate::PadProbeType::BUFFER, move |_, info| {
if let Some(PadProbeData::Buffer(buffer)) = info.data.take() { if let Some(buffer) = info.take_buffer() {
let mut buffers = buffers.lock().unwrap(); let mut buffers = buffers.lock().unwrap();
info.flow_res = if buffers.is_empty() { info.flow_res = if buffers.is_empty() {
Ok(FlowSuccess::Ok) Ok(FlowSuccess::Ok)