pub struct GStreamerBackend {
pub(crate) capture_mocking: AtomicBool,
pub(crate) instances: Arc<Mutex<HashMap<ClientContextId, Vec<(usize, Weak<Mutex<dyn MediaInstance>>)>>>>,
pub(crate) next_instance_id: AtomicUsize,
pub(crate) backend_chan: Arc<Mutex<Sender<BackendMsg>>>,
}
Fields§
§capture_mocking: AtomicBool
§instances: Arc<Mutex<HashMap<ClientContextId, Vec<(usize, Weak<Mutex<dyn MediaInstance>>)>>>>
§next_instance_id: AtomicUsize
§backend_chan: Arc<Mutex<Sender<BackendMsg>>>
Channel to communicate media instances with its owner Backend.
Implementations§
source§impl GStreamerBackend
impl GStreamerBackend
pub fn init_with_plugins( plugin_dir: PathBuf, plugins: &[&'static str], ) -> Result<Box<dyn Backend>, ErrorLoadingPlugins>
pub(crate) fn media_instance_action( &self, id: &ClientContextId, cb: &dyn Fn(&dyn MediaInstance) -> Result<(), ()>, )
Trait Implementations§
source§impl AudioBackend for GStreamerBackend
impl AudioBackend for GStreamerBackend
type Sink = GStreamerAudioSink
fn make_decoder() -> Box<dyn AudioDecoder>
fn make_sink() -> Result<Self::Sink, AudioSinkError>
fn make_streamreader( id: MediaStreamId, sample_rate: f32, ) -> Box<dyn AudioStreamReader + Send>
source§impl Backend for GStreamerBackend
impl Backend for GStreamerBackend
fn create_player( &self, context_id: &ClientContextId, stream_type: StreamType, sender: IpcSender<PlayerEvent>, renderer: Option<Arc<Mutex<dyn VideoFrameRenderer>>>, audio_renderer: Option<Arc<Mutex<dyn AudioRenderer>>>, gl_context: Box<dyn PlayerGLContext>, ) -> Arc<Mutex<dyn Player>>
fn create_audio_context( &self, client_context_id: &ClientContextId, options: AudioContextOptions, ) -> Result<Arc<Mutex<AudioContext>>, AudioSinkError>
fn create_webrtc(&self, signaller: Box<dyn WebRtcSignaller>) -> WebRtcController
fn create_audiostream(&self) -> MediaStreamId
fn create_videostream(&self) -> MediaStreamId
fn create_stream_output(&self) -> Box<dyn MediaOutput>
fn create_stream_and_socket( &self, ty: MediaStreamType, ) -> (Box<dyn MediaSocket>, MediaStreamId)
fn create_audioinput_stream( &self, set: MediaTrackConstraintSet, ) -> Option<MediaStreamId>
fn create_videoinput_stream( &self, set: MediaTrackConstraintSet, ) -> Option<MediaStreamId>
fn can_play_type(&self, media_type: &str) -> SupportsMediaType
fn set_capture_mocking(&self, mock: bool)
source§fn mute(&self, id: &ClientContextId, val: bool)
fn mute(&self, id: &ClientContextId, val: bool)
Allow muting/unmuting the media instances associated with the given client context identifier.
Backend implementations are responsible for keeping a match between client contexts
and the media instances created for these contexts.
The client context identifier is currently an abstraction of Servo’s PipelineId.
source§fn suspend(&self, id: &ClientContextId)
fn suspend(&self, id: &ClientContextId)
Allow suspending the activity of all media instances associated with the given client
context identifier.
Note that suspending does not involve releasing any resources, so media playback can
be restarted.
Backend implementations are responsible for keeping a match between client contexts
and the media instances created for these contexts.
The client context identifier is currently an abstraction of Servo’s PipelineId.
source§fn resume(&self, id: &ClientContextId)
fn resume(&self, id: &ClientContextId)
Allow resuming the activity of all the media instances associated with the given client
context identifier.
Backend implementations are responsible for keeping a match between client contexts
and the media instances created for these contexts.
The client context identifier is currently an abstraction of Servo’s PipelineId.
fn get_device_monitor(&self) -> Box<dyn MediaDeviceMonitor>
source§impl BackendInit for GStreamerBackend
impl BackendInit for GStreamerBackend
source§impl WebRtcBackend for GStreamerBackend
impl WebRtcBackend for GStreamerBackend
type Controller = GStreamerWebRtcController
fn construct_webrtc_controller( signaller: Box<dyn WebRtcSignaller>, thread: WebRtcController, ) -> Self::Controller
Auto Trait Implementations§
impl !Freeze for GStreamerBackend
impl RefUnwindSafe for GStreamerBackend
impl Send for GStreamerBackend
impl Sync for GStreamerBackend
impl Unpin for GStreamerBackend
impl UnwindSafe for GStreamerBackend
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more