From ade0aad6b0ba8e71fe5c852fab8dca3f8621500a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 2 Oct 2022 10:36:05 +0300 Subject: [PATCH] tracer: Make buffer in pull-range-post function optional Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/410 --- gstreamer/src/subclass/tracer.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gstreamer/src/subclass/tracer.rs b/gstreamer/src/subclass/tracer.rs index 1bd661079..16ed9a49d 100644 --- a/gstreamer/src/subclass/tracer.rs +++ b/gstreamer/src/subclass/tracer.rs @@ -46,7 +46,8 @@ pub trait TracerImpl: TracerImplExt + GstObjectImpl + Send + Sync { fn object_unreffed(&self, ts: u64, object: &Object, new_refcount: i32) {} fn pad_link_post(&self, ts: u64, src: &Pad, sink: &Pad, result: PadLinkReturn) {} fn pad_link_pre(&self, ts: u64, src: &Pad, sink: &Pad) {} - fn pad_pull_range_post(&self, ts: u64, pad: &Pad, buffer: &Buffer, result: FlowReturn) {} + fn pad_pull_range_post(&self, ts: u64, pad: &Pad, buffer: Option<&Buffer>, result: FlowReturn) { + } fn pad_pull_range_pre(&self, ts: u64, pad: &Pad, offset: u64, size: u32) {} fn pad_push_event_post(&self, ts: u64, pad: &Pad, success: bool) {} fn pad_push_event_pre(&self, ts: u64, pad: &Pad, event: &Event) {} @@ -229,8 +230,8 @@ define_tracer_hooks! { }; PadPullRangePost("pad-pull-range-post") = |this, ts, p: *mut ffi::GstPad, b: *mut ffi::GstBuffer, r: ffi::GstFlowReturn| { let p = Pad::from_glib_borrow(p); - let b = Buffer::from_glib_borrow(b); - this.pad_pull_range_post(ts, &p, &b, FlowReturn::from_glib(r)) + let b = Option::::from_glib_borrow(b); + this.pad_pull_range_post(ts, &p, b.as_ref().as_ref(), FlowReturn::from_glib(r)) }; PadPullRangePre("pad-pull-range-pre") = |this, ts, p: *mut ffi::GstPad, o: u64, s: libc::c_uint| { let p = Pad::from_glib_borrow(p);