mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 10:30:40 +00:00
Add BaseTransform::transform_ip_passthrough()
This is called with an immutable BufferRef if we're running in passthrough mode and the element was configured to pass passthrough buffers to transform_ip. Previously we would've gotten a mutable reference, that then would fail all mutable operations.
This commit is contained in:
parent
e7cd12bf8a
commit
3f8adff757
1 changed files with 14 additions and 1 deletions
|
@ -101,6 +101,10 @@ pub trait BaseTransformImpl<T: BaseTransformBase>
|
|||
fn transform_ip(&self, _element: &T, _buf: &mut gst::BufferRef) -> gst::FlowReturn {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
fn transform_ip_passthrough(&self, _element: &T, _buf: &gst::BufferRef) -> gst::FlowReturn {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
|
||||
any_impl!(BaseTransformBase, BaseTransformImpl);
|
||||
|
@ -389,6 +393,11 @@ macro_rules! box_base_transform_impl(
|
|||
let imp: &$name<T> = self.as_ref();
|
||||
imp.transform_ip(element, buf)
|
||||
}
|
||||
|
||||
fn transform_ip_passthrough(&self, element: &T, buf: &gst::BufferRef) -> gst::FlowReturn {
|
||||
let imp: &$name<T> = self.as_ref();
|
||||
imp.transform_ip_passthrough(element, buf)
|
||||
}
|
||||
}
|
||||
};
|
||||
);
|
||||
|
@ -699,6 +708,10 @@ where
|
|||
let buf = buf as *mut gst_ffi::GstBuffer;
|
||||
|
||||
panic_to_error!(&wrap, &element.panicked, gst::FlowReturn::Error, {
|
||||
imp.transform_ip(&wrap, gst::BufferRef::from_mut_ptr(buf))
|
||||
if from_glib(gst_base_ffi::gst_base_transform_is_passthrough(ptr)) {
|
||||
imp.transform_ip_passthrough(&wrap, gst::BufferRef::from_ptr(buf))
|
||||
} else {
|
||||
imp.transform_ip(&wrap, gst::BufferRef::from_mut_ptr(buf))
|
||||
}
|
||||
}).to_glib()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue