feat: Modify gst crate to add lot of more granularity
This commit is contained in:
26
gst/src/bus.rs
Normal file
26
gst/src/bus.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
#[derive(Debug, Clone)]
|
||||
#[repr(transparent)]
|
||||
pub struct Bus {
|
||||
pub(crate) bus: gstreamer::Bus,
|
||||
}
|
||||
|
||||
impl Bus {
|
||||
pub fn iter_timed(
|
||||
&self,
|
||||
timeout: impl Into<Option<core::time::Duration>>,
|
||||
) -> gstreamer::bus::Iter<'_> {
|
||||
let clocktime = match timeout.into() {
|
||||
Some(dur) => gstreamer::ClockTime::try_from(dur).ok(),
|
||||
None => gstreamer::ClockTime::NONE,
|
||||
};
|
||||
self.bus.iter_timed(clocktime)
|
||||
}
|
||||
|
||||
pub fn stream(&self) -> gstreamer::bus::BusStream {
|
||||
self.bus.stream()
|
||||
}
|
||||
|
||||
pub fn into_inner(self) -> gstreamer::Bus {
|
||||
self.bus
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user