feat: Modify gst crate to add lot of more granularity

This commit is contained in:
uttarayan21
2025-12-22 13:27:30 +05:30
parent d42ef3b550
commit 043d1e99f0
23 changed files with 947 additions and 392 deletions

26
gst/src/bus.rs Normal file
View 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
}
}