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
7mod sealed {
8    pub trait Sealed {}
9    impl<T: super::IsA<super::MediaStream>> Sealed for T {}
10}
11
12pub trait MediaStreamExtManual: sealed::Sealed + IsA<MediaStream> + 'static {
13    /// Sets @self into an error state.
14    ///
15    /// This will pause the stream (you can check for an error
16    /// via [`MediaStreamExt::error()`][crate::prelude::MediaStreamExt::error()] in your
17    /// GtkMediaStream.pause() implementation), abort pending
18    /// seeks and mark the stream as prepared.
19    ///
20    /// if the stream is already in an error state, this call
21    /// will be ignored and the existing error will be retained.
22    ///
23    /// To unset an error, the stream must be reset via a call to
24    /// [`MediaStreamExt::unprepared()`][crate::prelude::MediaStreamExt::unprepared()].
25    /// ## `error`
26    /// the `GError` to set
27    #[doc(alias = "gtk_media_stream_gerror")]
28    #[doc(alias = "gtk_media_stream_error")]
29    #[doc(alias = "gerror")]
30    fn set_error(&self, error: glib::Error) {
31        unsafe {
32            crate::ffi::gtk_media_stream_gerror(
33                self.as_ref().to_glib_none().0,
34                mut_override(error.into_glib_ptr()),
35            );
36        }
37    }
38}
39
40impl<O: IsA<MediaStream>> MediaStreamExtManual for O {}