mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-25 03:20:30 +00:00
Add comments about which Source/Sink methods are called from which threads
Source::get_size() / ::is_seekable() implementations need to be made thread-safe still.
This commit is contained in:
parent
8514d46092
commit
5cc890cc04
2 changed files with 9 additions and 1 deletions
|
@ -24,8 +24,11 @@ use std::ptr;
|
|||
use utils::*;
|
||||
|
||||
pub trait Sink: Sync + Send {
|
||||
// Called from any thread at any time
|
||||
fn set_uri(&mut self, uri_str: Option<&str>) -> bool;
|
||||
fn get_uri(&self) -> Option<String>;
|
||||
|
||||
// Called from the streaming thread only
|
||||
fn start(&mut self) -> bool;
|
||||
fn stop(&mut self) -> bool;
|
||||
fn render(&mut self, data: &[u8]) -> GstFlowReturn;
|
||||
|
|
|
@ -23,14 +23,19 @@ use std::ptr;
|
|||
use utils::*;
|
||||
|
||||
pub trait Source: Sync + Send {
|
||||
// Called from any thread at any time
|
||||
fn set_uri(&mut self, uri_str: Option<&str>) -> bool;
|
||||
fn get_uri(&self) -> Option<String>;
|
||||
|
||||
// Called from any thread between start/stop
|
||||
fn is_seekable(&self) -> bool;
|
||||
fn get_size(&self) -> u64;
|
||||
|
||||
// Called from the streaming thread only
|
||||
fn start(&mut self) -> bool;
|
||||
fn stop(&mut self) -> bool;
|
||||
fn fill(&mut self, offset: u64, data: &mut [u8]) -> Result<usize, GstFlowReturn>;
|
||||
fn do_seek(&mut self, start: u64, stop: u64) -> bool;
|
||||
fn get_size(&self) -> u64;
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
Loading…
Reference in a new issue