pub trait MediaStreamImpl: MediaStreamImplExt + ObjectImpl {
// Provided methods
fn pause(&self) { ... }
fn play(&self) -> bool { ... }
fn realize(&self, surface: Surface) { ... }
fn seek(&self, timestamp: i64) { ... }
fn unrealize(&self, surface: Surface) { ... }
fn update_audio(&self, muted: bool, volume: f64) { ... }
}
Provided Methods§
fn play(&self) -> bool
Sourcefn realize(&self, surface: Surface)
fn realize(&self, surface: Surface)
Called by users to attach the media stream to a gdk::Surface
they manage.
The stream can then access the resources of @surface for its
rendering purposes. In particular, media streams might want to
create a gdk::GLContext
or sync to the gdk::FrameClock
.
Whoever calls this function is responsible for calling
MediaStreamExt::unrealize()
before either the stream
or @surface get destroyed.
Multiple calls to this function may happen from different
users of the video, even with the same @surface. Each of these
calls must be followed by its own call to
MediaStreamExt::unrealize()
.
It is not required to call this function to make a media stream work.
§surface
Sourcefn seek(&self, timestamp: i64)
fn seek(&self, timestamp: i64)
Start a seek operation on @self to @timestamp.
If @timestamp is out of range, it will be clamped.
Seek operations may not finish instantly. While a
seek operation is in process, the seeking
property will be set.
When calling gtk_media_stream_seek() during an ongoing seek operation, the new seek will override any pending seek.
§timestamp
timestamp to seek to.
Sourcefn unrealize(&self, surface: Surface)
fn unrealize(&self, surface: Surface)
Undoes a previous call to gtk_media_stream_realize().
This causes the stream to release all resources it had allocated from @surface.
§surface
the gdk::Surface
the stream was realized with
fn update_audio(&self, muted: bool, volume: f64)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.