servo_media_gstreamer

Struct GStreamerBackend

source
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

source

pub fn init_with_plugins( plugin_dir: PathBuf, plugins: &[&'static str], ) -> Result<Box<dyn Backend>, ErrorLoadingPlugins>

source

pub(crate) fn media_instance_action( &self, id: &ClientContextId, cb: &dyn Fn(&dyn MediaInstance) -> Result<(), ()>, )

Trait Implementations§

source§

impl AudioBackend for GStreamerBackend

source§

impl Backend for GStreamerBackend

source§

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>>

source§

fn create_audio_context( &self, client_context_id: &ClientContextId, options: AudioContextOptions, ) -> Result<Arc<Mutex<AudioContext>>, AudioSinkError>

source§

fn create_webrtc(&self, signaller: Box<dyn WebRtcSignaller>) -> WebRtcController

source§

fn create_audiostream(&self) -> MediaStreamId

source§

fn create_videostream(&self) -> MediaStreamId

source§

fn create_stream_output(&self) -> Box<dyn MediaOutput>

source§

fn create_stream_and_socket( &self, ty: MediaStreamType, ) -> (Box<dyn MediaSocket>, MediaStreamId)

source§

fn create_audioinput_stream( &self, set: MediaTrackConstraintSet, ) -> Option<MediaStreamId>

source§

fn create_videoinput_stream( &self, set: MediaTrackConstraintSet, ) -> Option<MediaStreamId>

source§

fn can_play_type(&self, media_type: &str) -> SupportsMediaType

source§

fn set_capture_mocking(&self, mock: bool)

source§

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)

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)

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.
source§

fn get_device_monitor(&self) -> Box<dyn MediaDeviceMonitor>

source§

impl BackendInit for GStreamerBackend

source§

fn init() -> Box<dyn Backend>

source§

impl WebRtcBackend for GStreamerBackend

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T