mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-06 00:09:22 +00:00
205b6040fb
This should start making navigating the tree a little easier to start with, and we can then move to allowing building specific groups of plugins as well. The plugins are moved into the following hierarchy: audio / gst-plugin-audiofx / gst-plugin-claxon / gst-plugin-csound / gst-plugin-lewton generic / gst-plugin-file / gst-plugin-sodium / gst-plugin-threadshare net / gst-plugin-reqwest / gst-plugin-rusoto utils / gst-plugin-fallbackswitch / gst-plugin-togglerecord video / gst-plugin-cdg / gst-plugin-closedcaption / gst-plugin-dav1d / gst-plugin-flv / gst-plugin-gif / gst-plugin-rav1e gst-plugin-tutorial gst-plugin-version-helper
38 lines
1.4 KiB
Rust
38 lines
1.4 KiB
Rust
// Copyright (C) 2020 François Laignel <fengalin@free.fr>
|
|
//
|
|
// This library is free software; you can redistribute it and/or
|
|
// modify it under the terms of the GNU Library General Public
|
|
// License as published by the Free Software Foundation; either
|
|
// version 2 of the License, or (at your option) any later version.
|
|
//
|
|
// This library is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
// Library General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Library General Public
|
|
// License along with this library; if not, write to the
|
|
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
|
|
// Boston, MA 02110-1335, USA.
|
|
|
|
//! Wrappers for the underlying runtime specific time related Futures.
|
|
|
|
use futures::prelude::*;
|
|
use futures::stream::StreamExt;
|
|
|
|
use std::time::Duration;
|
|
|
|
/// Wait until the given `delay` has elapsed.
|
|
///
|
|
/// This must be called from within the target runtime environment.
|
|
pub async fn delay_for(delay: Duration) {
|
|
tokio::time::delay_for(delay).map(drop).await;
|
|
}
|
|
|
|
/// Builds a `Stream` that yields at `interval.
|
|
///
|
|
/// This must be called from within the target runtime environment.
|
|
pub fn interval(interval: Duration) -> impl Stream<Item = ()> {
|
|
tokio::time::interval(interval).map(drop)
|
|
}
|