mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-09 20:02:41 +00:00
WIP
This commit is contained in:
parent
53cb35f991
commit
c7c2676e67
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue