Skip to content

gstreamer/element: Add call_async_future() that returns a future

Sebastian Dröge requested to merge slomo/gstreamer-rs:call-async-future into master

The future would resolve into the return value of the closure that is called asynchronously on the thread pool, and allows asynchronous awaiting for it to finish.

  let res = element.call_async(|element| {
      element.set_state(gst::State::Playing)
  }).await;

  assert_eq!(res, Ok(gst::StateChangeSuccess::Success))
Edited by Sebastian Dröge

Merge request reports

Loading