gtk4/media_stream.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{prelude::*, MediaStream};
6
7pub trait MediaStreamExtManual: IsA<MediaStream> + 'static {
8 /// Sets @self into an error state.
9 ///
10 /// This will pause the stream (you can check for an error
11 /// via [`MediaStreamExt::error()`][crate::prelude::MediaStreamExt::error()] in your
12 /// GtkMediaStream.pause() implementation), abort pending
13 /// seeks and mark the stream as prepared.
14 ///
15 /// if the stream is already in an error state, this call
16 /// will be ignored and the existing error will be retained.
17 ///
18 /// To unset an error, the stream must be reset via a call to
19 /// [`MediaStreamExt::unprepared()`][crate::prelude::MediaStreamExt::unprepared()].
20 /// ## `error`
21 /// the `GError` to set
22 #[doc(alias = "gtk_media_stream_gerror")]
23 #[doc(alias = "gtk_media_stream_error")]
24 #[doc(alias = "gerror")]
25 fn set_error(&self, error: glib::Error) {
26 unsafe {
27 crate::ffi::gtk_media_stream_gerror(
28 self.as_ref().to_glib_none().0,
29 mut_override(error.into_glib_ptr()),
30 );
31 }
32 }
33}
34
35impl<O: IsA<MediaStream>> MediaStreamExtManual for O {}