From d373fcac84131697c04ea4160d040189bfcab8e0 Mon Sep 17 00:00:00 2001 From: jerry73204 Date: Sat, 26 Oct 2019 17:32:02 +0800 Subject: [PATCH] appsink: Use FnMut instead of Fn for callbacks They can only be called from a single thread at once. --- gstreamer-app/src/app_sink.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gstreamer-app/src/app_sink.rs b/gstreamer-app/src/app_sink.rs index a75ddc861..d566466c1 100644 --- a/gstreamer-app/src/app_sink.rs +++ b/gstreamer-app/src/app_sink.rs @@ -67,7 +67,7 @@ pub struct AppSinkCallbacksBuilder { } impl AppSinkCallbacksBuilder { - pub fn eos(self, eos: F) -> Self { + pub fn eos(self, eos: F) -> Self { Self { eos: Some(RefCell::new(Box::new(eos))), ..self @@ -75,7 +75,7 @@ impl AppSinkCallbacksBuilder { } pub fn new_preroll< - F: Fn(&AppSink) -> Result + Send + 'static, + F: FnMut(&AppSink) -> Result + Send + 'static, >( self, new_preroll: F, @@ -87,7 +87,7 @@ impl AppSinkCallbacksBuilder { } pub fn new_sample< - F: Fn(&AppSink) -> Result + Send + 'static, + F: FnMut(&AppSink) -> Result + Send + 'static, >( self, new_sample: F,