From c7c2676e67700934240a409dcd52386bf248f518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 22 Aug 2016 21:08:26 +0300 Subject: [PATCH] WIP --- src/rsfilesink.rs | 8 ++++---- src/rssink.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rsfilesink.rs b/src/rsfilesink.rs index 161c74cf..5d55f647 100644 --- a/src/rsfilesink.rs +++ b/src/rsfilesink.rs @@ -53,7 +53,7 @@ impl FileSink { } impl Sink for FileSink { - fn set_uri(&mut self, uri: Option) -> bool { + fn set_uri(&self, uri: Option) -> bool { match uri { None => { let mut location = self.location.lock().unwrap(); @@ -86,7 +86,7 @@ impl Sink for FileSink { .and_then(|i| i) // join() } - fn start(&mut self) -> bool { + fn start(&self) -> bool { self.file = None; self.position = 0; @@ -110,14 +110,14 @@ impl Sink for FileSink { } } - fn stop(&mut self) -> bool { + fn stop(&self) -> bool { self.file = None; self.position = 0; true } - fn render(&mut self, data: &[u8]) -> GstFlowReturn { + fn render(&self, data: &[u8]) -> GstFlowReturn { match self.file { None => return GstFlowReturn::Error, Some(ref mut f) => { diff --git a/src/rssink.rs b/src/rssink.rs index 3cb401a9..7826c247 100644 --- a/src/rssink.rs +++ b/src/rssink.rs @@ -40,13 +40,13 @@ impl SinkController { pub trait Sink: Sync + Send { // Called from any thread at any time - fn set_uri(&mut self, uri: Option) -> bool; + fn set_uri(&self, uri: Option) -> bool; fn get_uri(&self) -> Option; // Called from the streaming thread only - fn start(&mut self) -> bool; - fn stop(&mut self) -> bool; - fn render(&mut self, data: &[u8]) -> GstFlowReturn; + fn start(&self) -> bool; + fn stop(&self) -> bool; + fn render(&self, data: &[u8]) -> GstFlowReturn; } #[no_mangle]