This commit is contained in:
Sebastian Dröge 2016-08-22 21:08:26 +03:00
parent 53cb35f991
commit c7c2676e67
2 changed files with 8 additions and 8 deletions

View file

@ -53,7 +53,7 @@ impl FileSink {
} }
impl Sink for FileSink { impl Sink for FileSink {
fn set_uri(&mut self, uri: Option<Url>) -> bool { fn set_uri(&self, uri: Option<Url>) -> bool {
match uri { match uri {
None => { None => {
let mut location = self.location.lock().unwrap(); let mut location = self.location.lock().unwrap();
@ -86,7 +86,7 @@ impl Sink for FileSink {
.and_then(|i| i) // join() .and_then(|i| i) // join()
} }
fn start(&mut self) -> bool { fn start(&self) -> bool {
self.file = None; self.file = None;
self.position = 0; self.position = 0;
@ -110,14 +110,14 @@ impl Sink for FileSink {
} }
} }
fn stop(&mut self) -> bool { fn stop(&self) -> bool {
self.file = None; self.file = None;
self.position = 0; self.position = 0;
true true
} }
fn render(&mut self, data: &[u8]) -> GstFlowReturn { fn render(&self, data: &[u8]) -> GstFlowReturn {
match self.file { match self.file {
None => return GstFlowReturn::Error, None => return GstFlowReturn::Error,
Some(ref mut f) => { Some(ref mut f) => {

View file

@ -40,13 +40,13 @@ impl SinkController {
pub trait Sink: Sync + Send { pub trait Sink: Sync + Send {
// Called from any thread at any time // Called from any thread at any time
fn set_uri(&mut self, uri: Option<Url>) -> bool; fn set_uri(&self, uri: Option<Url>) -> bool;
fn get_uri(&self) -> Option<Url>; fn get_uri(&self) -> Option<Url>;
// Called from the streaming thread only // Called from the streaming thread only
fn start(&mut self) -> bool; fn start(&self) -> bool;
fn stop(&mut self) -> bool; fn stop(&self) -> bool;
fn render(&mut self, data: &[u8]) -> GstFlowReturn; fn render(&self, data: &[u8]) -> GstFlowReturn;
} }
#[no_mangle] #[no_mangle]