diff options
author | François Laignel <fengalin@free.fr> | 2022-08-05 15:44:50 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2022-08-09 20:48:06 +0300 |
commit | fb7929dda68bcf091811750eebe26a8ff1c10c0d (patch) | |
tree | 9e2e47afd9dc6fe9aa7beda0c10263fcfc31ac2b /generic/threadshare/src/appsrc/imp.rs | |
parent | d4061774a46f52523c42f718a0ebcf7b85910d29 (diff) |
ts: update elements for new TransitionStatus
See previous commit
Diffstat (limited to 'generic/threadshare/src/appsrc/imp.rs')
-rw-r--r-- | generic/threadshare/src/appsrc/imp.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 120ed55ff..0fa4c2826 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -94,8 +94,8 @@ impl PadSrcHandler for AppSrcPadHandler { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); let ret = match event.view() { - EventView::FlushStart(..) => appsrc.task.flush_start().is_ok(), - EventView::FlushStop(..) => appsrc.task.flush_stop().is_ok(), + EventView::FlushStart(..) => appsrc.task.flush_start().await_maybe_on_context().is_ok(), + EventView::FlushStop(..) => appsrc.task.flush_stop().await_maybe_on_context().is_ok(), EventView::Reconfigure(..) => true, EventView::Latency(..) => true, _ => false, @@ -396,12 +396,7 @@ impl AppSrc { self.task .prepare(AppSrcTask::new(element.clone(), receiver), context) - .map_err(|err| { - gst::error_msg!( - gst::ResourceError::OpenRead, - ["Error preparing Task: {:?}", err] - ) - })?; + .block_on()?; gst::debug!(CAT, obj: element, "Prepared"); @@ -412,28 +407,28 @@ impl AppSrc { gst::debug!(CAT, obj: element, "Unpreparing"); *self.sender.lock().unwrap() = None; - self.task.unprepare().unwrap(); + self.task.unprepare().block_on().unwrap(); gst::debug!(CAT, obj: element, "Unprepared"); } fn stop(&self, element: &super::AppSrc) -> Result<(), gst::ErrorMessage> { gst::debug!(CAT, obj: element, "Stopping"); - self.task.stop()?; + self.task.stop().block_on()?; gst::debug!(CAT, obj: element, "Stopped"); Ok(()) } fn start(&self, element: &super::AppSrc) -> Result<(), gst::ErrorMessage> { gst::debug!(CAT, obj: element, "Starting"); - self.task.start()?; + self.task.start().block_on()?; gst::debug!(CAT, obj: element, "Started"); Ok(()) } fn pause(&self, element: &super::AppSrc) -> Result<(), gst::ErrorMessage> { gst::debug!(CAT, obj: element, "Pausing"); - self.task.pause()?; + let _ = self.task.pause().check()?; gst::debug!(CAT, obj: element, "Paused"); Ok(()) } |