From 99cec352c925cdb2adf6d5257814c4b78ebf4419 Mon Sep 17 00:00:00 2001 From: Daniel Hoffman Date: Thu, 11 Feb 2021 18:03:51 -0600 Subject: [PATCH 1/3] update iced from 0.1 to 0.2, move periodic subscription over to the new format --- Cargo.toml | 2 +- src/lib.rs | 31 +------------------------------ 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f450031..3944baf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["jazzfool"] edition = "2018" [dependencies] -iced = { version = "0.1", features = ["image", "tokio"] } +iced = { version = "0.2", features = ["image", "tokio"] } iced_native = "0.2" gstreamer = "0.16" gstreamer-app = "0.16" # appsink diff --git a/src/lib.rs b/src/lib.rs index 22070fb..9547954 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -353,36 +353,7 @@ impl VideoPlayer { // until iced 0.2 is released, which has this built-in mod time { - use iced::futures; - pub fn every(duration: std::time::Duration) -> iced::Subscription { - iced::Subscription::from_recipe(Every(duration)) - } - - struct Every(std::time::Duration); - - impl iced_native::subscription::Recipe for Every - where - H: std::hash::Hasher, - { - type Output = std::time::Instant; - - fn hash(&self, state: &mut H) { - use std::hash::Hash; - - std::any::TypeId::of::().hash(state); - self.0.hash(state); - } - - fn stream( - self: Box, - _input: futures::stream::BoxStream<'static, I>, - ) -> futures::stream::BoxStream<'static, Self::Output> { - use futures::stream::StreamExt; - - tokio::time::interval(self.0) - .map(|_| std::time::Instant::now()) - .boxed() - } + iced::time::every(duration) } } From 67056d441663bc3d8984fa00c9e3c974e0d8c1f3 Mon Sep 17 00:00:00 2001 From: Daniel Hoffman Date: Thu, 11 Feb 2021 18:08:42 -0600 Subject: [PATCH 2/3] update semver-incompatible dependencies --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3944baf..18df05b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,11 @@ edition = "2018" [dependencies] iced = { version = "0.2", features = ["image", "tokio"] } -iced_native = "0.2" +iced_native = "0.3.0" gstreamer = "0.16" gstreamer-app = "0.16" # appsink glib = "0.10" # gobject traits and error type -tokio = { version = "0.2", features = ["time", "stream"] }# time subscription (every frame) +tokio = { version = "1.2.0", features = ["time"] } thiserror = "1" url = "2" # media uri num-rational = "0.3" # framerates come in rationals From 2b7b516a466cca73361bb05608043ab0a8ddbf53 Mon Sep 17 00:00:00 2001 From: Daniel Hoffman Date: Thu, 11 Feb 2021 18:15:41 -0600 Subject: [PATCH 3/3] use the version on the git because a dependency semver is incompatible otherwise --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 18df05b..8c4a5c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["jazzfool"] edition = "2018" [dependencies] -iced = { version = "0.2", features = ["image", "tokio"] } +iced = { git = "https://github.com/hecrj/iced.git", features = ["image", "tokio"] } iced_native = "0.3.0" gstreamer = "0.16" gstreamer-app = "0.16" # appsink