feat: Add keybinds to minimal example
This commit is contained in:
@@ -60,6 +60,15 @@ impl Pipeline {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn stop(&self) -> Result<()> {
|
||||
self.inner
|
||||
.set_state(gstreamer::State::Null)
|
||||
.change_context(Error)
|
||||
.attach("Failed to set pipeline to Null state")?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn set_state(&self, state: gstreamer::State) -> Result<gstreamer::StateChangeSuccess> {
|
||||
let result = self
|
||||
@@ -165,6 +174,12 @@ pub trait PipelineExt: ChildOf<Pipeline> + Sync {
|
||||
fn ready(&self) -> Result<()> {
|
||||
self.upcast_ref().ready()
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn stop(&self) -> Result<()> {
|
||||
self.upcast_ref().stop()
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn set_state(&self, state: gstreamer::State) -> Result<gstreamer::StateChangeSuccess> {
|
||||
self.upcast_ref().set_state(state)
|
||||
|
||||
Reference in New Issue
Block a user