Commit c7c2676e authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

WIP

parent 53cb35f9
......@@ -53,7 +53,7 @@ impl FileSink {
}
impl Sink for FileSink {
fn set_uri(&mut self, uri: Option<Url>) -> bool {
fn set_uri(&self, uri: Option<Url>) -> 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) => {
......
......@@ -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<Url>) -> bool;
fn set_uri(&self, uri: Option<Url>) -> bool;
fn get_uri(&self) -> Option<Url>;
// 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]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment