mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-25 11:30:29 +00:00
Add trait functions for getting back the controller
This commit is contained in:
parent
82c29d369d
commit
df50617c87
5 changed files with 16 additions and 0 deletions
|
@ -62,6 +62,10 @@ impl FileSink {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Sink for FileSink {
|
impl Sink for FileSink {
|
||||||
|
fn get_controller(&self) -> &SinkController {
|
||||||
|
&self.controller
|
||||||
|
}
|
||||||
|
|
||||||
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)> {
|
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)> {
|
||||||
let location = &mut self.settings.lock().unwrap().location;
|
let location = &mut self.settings.lock().unwrap().location;
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,10 @@ impl FileSrc {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Source for FileSrc {
|
impl Source for FileSrc {
|
||||||
|
fn get_controller(&self) -> &SourceController {
|
||||||
|
&self.controller
|
||||||
|
}
|
||||||
|
|
||||||
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)> {
|
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)> {
|
||||||
let location = &mut self.settings.lock().unwrap().location;
|
let location = &mut self.settings.lock().unwrap().location;
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,10 @@ impl HttpSrc {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Source for HttpSrc {
|
impl Source for HttpSrc {
|
||||||
|
fn get_controller(&self) -> &SourceController {
|
||||||
|
&self.controller
|
||||||
|
}
|
||||||
|
|
||||||
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)> {
|
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)> {
|
||||||
let url = &mut self.settings.lock().unwrap().url;
|
let url = &mut self.settings.lock().unwrap().url;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ impl SinkController {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Sink: Sync + Send {
|
pub trait Sink: Sync + Send {
|
||||||
|
fn get_controller(&self) -> &SinkController;
|
||||||
|
|
||||||
// Called from any thread at any time
|
// Called from any thread at any time
|
||||||
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)>;
|
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)>;
|
||||||
fn get_uri(&self) -> Option<Url>;
|
fn get_uri(&self) -> Option<Url>;
|
||||||
|
|
|
@ -37,6 +37,8 @@ impl SourceController {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Source: Sync + Send {
|
pub trait Source: Sync + Send {
|
||||||
|
fn get_controller(&self) -> &SourceController;
|
||||||
|
|
||||||
// Called from any thread at any time
|
// Called from any thread at any time
|
||||||
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)>;
|
fn set_uri(&self, uri: Option<Url>) -> Result<(), (UriError, String)>;
|
||||||
fn get_uri(&self) -> Option<Url>;
|
fn get_uri(&self) -> Option<Url>;
|
||||||
|
|
Loading…
Reference in a new issue