mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
appsink: Use FnMut instead of Fn for callbacks
They can only be called from a single thread at once.
This commit is contained in:
parent
38e7a4f8d4
commit
d373fcac84
1 changed files with 3 additions and 3 deletions
|
@ -67,7 +67,7 @@ pub struct AppSinkCallbacksBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AppSinkCallbacksBuilder {
|
impl AppSinkCallbacksBuilder {
|
||||||
pub fn eos<F: Fn(&AppSink) + Send + 'static>(self, eos: F) -> Self {
|
pub fn eos<F: FnMut(&AppSink) + Send + 'static>(self, eos: F) -> Self {
|
||||||
Self {
|
Self {
|
||||||
eos: Some(RefCell::new(Box::new(eos))),
|
eos: Some(RefCell::new(Box::new(eos))),
|
||||||
..self
|
..self
|
||||||
|
@ -75,7 +75,7 @@ impl AppSinkCallbacksBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_preroll<
|
pub fn new_preroll<
|
||||||
F: Fn(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
F: FnMut(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
||||||
>(
|
>(
|
||||||
self,
|
self,
|
||||||
new_preroll: F,
|
new_preroll: F,
|
||||||
|
@ -87,7 +87,7 @@ impl AppSinkCallbacksBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_sample<
|
pub fn new_sample<
|
||||||
F: Fn(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
F: FnMut(&AppSink) -> Result<gst::FlowSuccess, gst::FlowError> + Send + 'static,
|
||||||
>(
|
>(
|
||||||
self,
|
self,
|
||||||
new_sample: F,
|
new_sample: F,
|
||||||
|
|
Loading…
Reference in a new issue