servo_media_gstreamer::player

Struct GStreamerPlayer

source
pub struct GStreamerPlayer {
    id: usize,
    context_id: ClientContextId,
    backend_chan: Arc<Mutex<Sender<BackendMsg>>>,
    inner: RefCell<Option<Arc<Mutex<PlayerInner>>>>,
    observer: Arc<Mutex<IpcSender<PlayerEvent>>>,
    audio_renderer: Option<Arc<Mutex<dyn AudioRenderer>>>,
    video_renderer: Option<Arc<Mutex<dyn VideoFrameRenderer>>>,
    is_ready: Arc<Once>,
    stream_type: StreamType,
    render: Arc<Mutex<GStreamerRender>>,
}

Fields§

§id: usize

The player unique ID.

§context_id: ClientContextId

The ID of the client context this player belongs to.

§backend_chan: Arc<Mutex<Sender<BackendMsg>>>

Channel to communicate with the owner GStreamerBackend instance.

§inner: RefCell<Option<Arc<Mutex<PlayerInner>>>>§observer: Arc<Mutex<IpcSender<PlayerEvent>>>§audio_renderer: Option<Arc<Mutex<dyn AudioRenderer>>>§video_renderer: Option<Arc<Mutex<dyn VideoFrameRenderer>>>§is_ready: Arc<Once>

Indicates whether the setup was succesfully performed and we are ready to consume a/v data.

§stream_type: StreamType

Indicates whether the type of media stream to be played is a live stream.

§render: Arc<Mutex<GStreamerRender>>

Decorator used to setup the video sink and process the produced frames.

Implementations§

source§

impl GStreamerPlayer

source

pub fn new( id: usize, context_id: &ClientContextId, backend_chan: Arc<Mutex<Sender<BackendMsg>>>, stream_type: StreamType, observer: IpcSender<PlayerEvent>, video_renderer: Option<Arc<Mutex<dyn VideoFrameRenderer>>>, audio_renderer: Option<Arc<Mutex<dyn AudioRenderer>>>, gl_context: Box<dyn PlayerGLContext>, ) -> GStreamerPlayer

source

fn setup(&self) -> Result<(), PlayerError>

Trait Implementations§

source§

impl Drop for GStreamerPlayer

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl MediaInstance for GStreamerPlayer

source§

fn get_id(&self) -> usize

source§

fn mute(&self, val: bool) -> Result<(), ()>

source§

fn suspend(&self) -> Result<(), ()>

source§

fn resume(&self) -> Result<(), ()>

source§

impl Player for GStreamerPlayer

source§

fn play(&self) -> Result<(), PlayerError>

source§

fn pause(&self) -> Result<(), PlayerError>

source§

fn stop(&self) -> Result<(), PlayerError>

source§

fn end_of_stream(&self) -> Result<(), PlayerError>

source§

fn set_input_size(&self, size: u64) -> Result<(), PlayerError>

source§

fn set_mute(&self, val: bool) -> Result<(), PlayerError>

source§

fn set_rate(&self, rate: f64) -> Result<(), PlayerError>

source§

fn push_data(&self, data: Vec<u8>) -> Result<(), PlayerError>

source§

fn seek(&self, time: f64) -> Result<(), PlayerError>

source§

fn set_volume(&self, value: f64) -> Result<(), PlayerError>

source§

fn buffered(&self) -> Result<Vec<Range<f64>>, PlayerError>

Get the list of time ranges in seconds that have been buffered.
source§

fn render_use_gl(&self) -> bool

If player’s rendering draws using GL textures
source§

fn set_stream( &self, stream: &MediaStreamId, only_stream: bool, ) -> Result<(), PlayerError>

Set the stream to be played by the player. Only a single stream of the same type (audio or video) can be set. Subsequent calls with a stream of the same type will override the previously set stream. This method requires the player to be constructed with StreamType::Stream. It is important to give the correct value of only_stream indicating that the audio or video stream being set is the only one expected. Subsequent calls to set_stream after the only_stream flag has been set to true will fail.
source§

fn set_audio_track( &self, stream_index: i32, enabled: bool, ) -> Result<(), PlayerError>

source§

fn set_video_track( &self, stream_index: i32, enabled: bool, ) -> Result<(), PlayerError>

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