feat: Added stuff
Some checks failed
build / checks-matrix (push) Has been cancelled
build / checks-build (push) Has been cancelled
build / codecov (push) Has been cancelled
docs / docs (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-11-22 04:39:42 +05:30
parent b1cfc19b96
commit 61a2ea1733
8 changed files with 398 additions and 117 deletions

View File

@@ -11,12 +11,14 @@ authors = ["jazzfool"]
edition = "2021"
resolver = "2"
license = "MIT OR Apache-2.0"
exclude = [
".media/test.mp4"
]
exclude = [".media/test.mp4"]
[dependencies]
iced = { git = "https://github.com/iced-rs/iced", features = ["image", "advanced", "wgpu"] }
iced = { git = "https://github.com/iced-rs/iced", features = [
"image",
"advanced",
"wgpu",
] }
iced_wgpu = { git = "https://github.com/iced-rs/iced" }
gstreamer = "0.23"
gstreamer-app = "0.23" # appsink
@@ -31,15 +33,29 @@ systems = ["x86_64-linux"]
app = true
build = true
runtimeLibs = [
"vulkan-loader",
"wayland",
"wayland-protocols",
"libxkbcommon",
"xorg.libX11",
"xorg.libXrandr",
"xorg.libXi", "gst_all_1.gstreamer", "gst_all_1.gstreamermm", "gst_all_1.gst-plugins-bad", "gst_all_1.gst-plugins-ugly", "gst_all_1.gst-plugins-good", "gst_all_1.gst-plugins-base",
"vulkan-loader",
"wayland",
"wayland-protocols",
"libxkbcommon",
"xorg.libX11",
"xorg.libXrandr",
"xorg.libXi",
"gst_all_1.gstreamer",
"gst_all_1.gstreamermm",
"gst_all_1.gst-plugins-bad",
"gst_all_1.gst-plugins-ugly",
"gst_all_1.gst-plugins-good",
"gst_all_1.gst-plugins-base",
]
buildInputs = [
"libxkbcommon",
"gst_all_1.gstreamer",
"gst_all_1.gstreamermm",
"gst_all_1.gst-plugins-bad",
"gst_all_1.gst-plugins-ugly",
"gst_all_1.gst-plugins-good",
"gst_all_1.gst-plugins-base",
]
buildInputs = ["libxkbcommon", "gst_all_1.gstreamer", "gst_all_1.gstreamermm", "gst_all_1.gst-plugins-bad", "gst_all_1.gst-plugins-ugly", "gst_all_1.gst-plugins-good", "gst_all_1.gst-plugins-base"]
[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]

View File

@@ -6,7 +6,7 @@ use iced_video_player::{Video, VideoPlayer};
use std::time::Duration;
fn main() -> iced::Result {
iced::run("Iced Video Player", App::update, App::view)
iced::run(App::update, App::view)
}
#[derive(Clone, Debug)]
@@ -29,17 +29,10 @@ impl Default for App {
fn default() -> Self {
App {
video: Video::new(
&url::Url::from_file_path(
std::path::PathBuf::from(file!())
.parent()
.unwrap()
.join("../.media/test.mp4")
.canonicalize()
.unwrap(),
)
.unwrap(),
&url::Url::parse("https://jellyfin.tsuba.darksailor.dev/Videos/1d7e2012-e17d-edbb-25c3-2dbcc803d6b6/stream?static=true")
.expect("Failed to parse URL"),
)
.unwrap(),
.expect("Failed to create video"),
position: 0.0,
dragging: false,
}

View File

@@ -273,6 +273,8 @@ impl Video {
let pad = video_sink.pads().first().cloned().unwrap();
dbg!(&pad);
dbg!(&pipeline);
cleanup!(pipeline.set_state(gst::State::Playing))?;
// wait for up to 5 seconds until the decoder gets the source capabilities