feat: Get iced-video working
This commit is contained in:
@@ -13,6 +13,9 @@ pub use bin::*;
|
||||
pub use bus::*;
|
||||
pub use caps::*;
|
||||
pub use element::*;
|
||||
pub use gstreamer;
|
||||
#[doc(inline)]
|
||||
pub use gstreamer::{Message, MessageType, MessageView, State};
|
||||
pub use pad::*;
|
||||
pub use pipeline::*;
|
||||
pub use plugins::*;
|
||||
@@ -21,6 +24,7 @@ pub(crate) mod priv_prelude {
|
||||
pub use crate::errors::*;
|
||||
pub use crate::wrapper::*;
|
||||
pub use crate::*;
|
||||
pub use gstreamer::prelude::ElementExt as _;
|
||||
pub use gstreamer::prelude::*;
|
||||
#[track_caller]
|
||||
pub fn duration_to_clocktime(
|
||||
@@ -33,15 +37,12 @@ pub(crate) mod priv_prelude {
|
||||
.attach("Failed to convert duration to ClockTime")?;
|
||||
Ok(Some(clocktime))
|
||||
}
|
||||
None => Ok(None),
|
||||
None => Ok(gstreamer::ClockTime::NONE),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use errors::*;
|
||||
use gstreamer::prelude::*;
|
||||
use std::sync::Arc;
|
||||
|
||||
static GST: std::sync::LazyLock<std::sync::Arc<Gst>> = std::sync::LazyLock::new(|| {
|
||||
gstreamer::init().expect("Failed to initialize GStreamer");
|
||||
std::sync::Arc::new(Gst {
|
||||
@@ -49,7 +50,6 @@ static GST: std::sync::LazyLock<std::sync::Arc<Gst>> = std::sync::LazyLock::new(
|
||||
})
|
||||
});
|
||||
|
||||
/// This should be a global singleton
|
||||
pub struct Gst {
|
||||
__private: core::marker::PhantomData<()>,
|
||||
}
|
||||
@@ -58,14 +58,4 @@ impl Gst {
|
||||
pub fn new() -> Arc<Self> {
|
||||
Arc::clone(&GST)
|
||||
}
|
||||
|
||||
// pub fn pipeline_from_str(&self, s: &str) -> Result<Pipeline> {
|
||||
// let pipeline = gstreamer::parse::launch(s).change_context(Error)?;
|
||||
// let pipeline = pipeline.downcast::<gstreamer::Pipeline>();
|
||||
// let pipeline = match pipeline {
|
||||
// Err(_e) => return Err(Error).attach("Failed to downcast to Pipeline"),
|
||||
// Ok(p) => p,
|
||||
// };
|
||||
// Ok(Pipeline { inner: pipeline })
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user