Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>2022-12-19 19:13:01 +0300
committerSebastian Dröge <sebastian@centricular.com>2023-06-06 22:45:28 +0300
commit52b30a37ed7ea44681a71d4f55452c237403e28c (patch)
treedb3a214eedf696db21d049af04f7a30e74fdef06
parent7e9cb37892fbd954b73650fbe48e95813884195e (diff)
uriplaylistbin: example: display iterations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1233>
-rw-r--r--utils/uriplaylistbin/examples/playlist.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/uriplaylistbin/examples/playlist.rs b/utils/uriplaylistbin/examples/playlist.rs
index 3c624ba17..707e0d92b 100644
--- a/utils/uriplaylistbin/examples/playlist.rs
+++ b/utils/uriplaylistbin/examples/playlist.rs
@@ -78,6 +78,22 @@ fn create_pipeline(uris: Vec<String>, iterations: u32) -> anyhow::Result<gst::Pi
let _ = sink.set_state(gst::State::Null);
});
+ fn display_current(uriplaylistbin: &gst::Element) {
+ let uris = uriplaylistbin.property::<Vec<String>>("uris");
+ let uri_index = uriplaylistbin.property::<u64>("current-uri-index");
+ let iteration = uriplaylistbin.property::<u32>("current-iteration");
+
+ println!("-> {} (iteration {})", uris[uri_index as usize], iteration);
+ }
+
+ playlist.connect_notify(Some("current-iteration"), |uriplaylistbin, _param_spec| {
+ display_current(uriplaylistbin);
+ });
+
+ playlist.connect_notify(Some("current-uri-index"), |uriplaylistbin, _param_spec| {
+ display_current(uriplaylistbin);
+ });
+
Ok(pipeline)
}