Split GStreamer backend into separate package
This commit is contained in:
14
Cargo.lock
generated
14
Cargo.lock
generated
@@ -291,9 +291,6 @@ dependencies = [
|
|||||||
"env_logger",
|
"env_logger",
|
||||||
"fluent-templates",
|
"fluent-templates",
|
||||||
"grass",
|
"grass",
|
||||||
"gst-plugin-gtk4",
|
|
||||||
"gstreamer",
|
|
||||||
"gstreamer-play",
|
|
||||||
"jellyfin_api",
|
"jellyfin_api",
|
||||||
"libadwaita",
|
"libadwaita",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -309,6 +306,7 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
"unic-langid",
|
"unic-langid",
|
||||||
"uuid",
|
"uuid",
|
||||||
|
"video_player_gst",
|
||||||
"video_player_mpv",
|
"video_player_mpv",
|
||||||
"whoami",
|
"whoami",
|
||||||
]
|
]
|
||||||
@@ -2769,6 +2767,16 @@ version = "0.9.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "video_player_gst"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"gst-plugin-gtk4",
|
||||||
|
"gstreamer",
|
||||||
|
"gstreamer-play",
|
||||||
|
"relm4",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "video_player_mpv"
|
name = "video_player_mpv"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = ["delfin", "video_player_mpv/sys", "video_player_mpv"]
|
members = [
|
||||||
|
"delfin",
|
||||||
|
"video_player_mpv/sys",
|
||||||
|
"video_player_mpv",
|
||||||
|
"video_player_gst",
|
||||||
|
]
|
||||||
exclude = ["video_player_mpv/sys/gir"]
|
exclude = ["video_player_mpv/sys/gir"]
|
||||||
default-members = ["delfin"]
|
default-members = ["delfin"]
|
||||||
|
[workspace.dependencies]
|
||||||
|
relm4 = { version = "0.7.0-beta.1", features = ["gnome_44", "libadwaita"] }
|
||||||
|
@@ -15,32 +15,29 @@ dirs = "5.0.1"
|
|||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
fluent-templates = "0.8.0"
|
fluent-templates = "0.8.0"
|
||||||
grass = { version = "0.13.1", default-features = false }
|
grass = { version = "0.13.1", default-features = false }
|
||||||
gst = { package = "gstreamer", version = "0.21.0" }
|
|
||||||
gstgtk4 = { package = "gst-plugin-gtk4", version = "0.11.0" }
|
|
||||||
gstplay = { package = "gstreamer-play", version = "0.21.0" }
|
|
||||||
jellyfin_api = "10.8.10-2"
|
jellyfin_api = "10.8.10-2"
|
||||||
regex = "1.9.5"
|
regex = "1.9.5"
|
||||||
relm4 = { version = "0.7.0-beta.1", features = ["gnome_44", "libadwaita"] }
|
relm4 = { workspace = true }
|
||||||
relm4-icons = { version = "0.7.0-alpha.2", features = [
|
relm4-icons = { version = "0.7.0-alpha.2", features = [
|
||||||
"check-round-outline",
|
"check-round-outline",
|
||||||
"video-clip-multiple-filled",
|
"video-clip-multiple-filled",
|
||||||
"play-multiple-filled",
|
"play-multiple-filled",
|
||||||
"tag-multiple-filled",
|
"tag-multiple-filled",
|
||||||
"home-filled",
|
"home-filled",
|
||||||
"closed-captioning",
|
"closed-captioning",
|
||||||
"music-note-single",
|
"music-note-single",
|
||||||
"star-large",
|
"star-large",
|
||||||
"play-filled",
|
"play-filled",
|
||||||
"pause-filled",
|
"pause-filled",
|
||||||
"fast-forward-filled",
|
"fast-forward-filled",
|
||||||
"rewind-filled",
|
"rewind-filled",
|
||||||
"skip-forward-10",
|
"skip-forward-10",
|
||||||
"skip-forward-30",
|
"skip-forward-30",
|
||||||
"skip-backwards-10",
|
"skip-backwards-10",
|
||||||
"skip-backwards-30",
|
"skip-backwards-30",
|
||||||
"left",
|
"left",
|
||||||
"right",
|
"right",
|
||||||
"refresh",
|
"refresh",
|
||||||
] }
|
] }
|
||||||
reqwest = { version = "0.11.20", features = ["json"] }
|
reqwest = { version = "0.11.20", features = ["json"] }
|
||||||
serde = { version = "1.0.188", features = ["derive"] }
|
serde = { version = "1.0.188", features = ["derive"] }
|
||||||
@@ -52,6 +49,7 @@ toml = "0.8.0"
|
|||||||
tracing = { version = "0.1.37", features = ["log"] }
|
tracing = { version = "0.1.37", features = ["log"] }
|
||||||
unic-langid = { version = "0.9.1", features = ["macros", "serde"] }
|
unic-langid = { version = "0.9.1", features = ["macros", "serde"] }
|
||||||
uuid = { version = "1.4.1", features = ["v4"] }
|
uuid = { version = "1.4.1", features = ["v4"] }
|
||||||
|
video_player_gst = { version = "0.1.0", path = "../video_player_gst" }
|
||||||
video_player_mpv = { version = "0.1.0", path = "../video_player_mpv" }
|
video_player_mpv = { version = "0.1.0", path = "../video_player_mpv" }
|
||||||
whoami = { version = "1.4.1", default-features = false }
|
whoami = { version = "1.4.1", default-features = false }
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
use delfin::app::{App, APP_BROKER};
|
use delfin::app::{App, APP_BROKER};
|
||||||
use relm4::RelmApp;
|
use relm4::RelmApp;
|
||||||
|
use video_player_gst::init_gst;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
gst::init().expect("Error initializing GStreamer");
|
init_gst();
|
||||||
gstgtk4::plugin_register_static().expect("Error registering GST GTK4 plugin");
|
|
||||||
|
|
||||||
let app = if cfg!(debug_assertions) {
|
let app = if cfg!(debug_assertions) {
|
||||||
RelmApp::new("cafe.avery.Delfin.Devel")
|
RelmApp::new("cafe.avery.Delfin.Devel")
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
use gst::prelude::Cast;
|
use gtk::prelude::{Cast, ListModelExt};
|
||||||
use gtk::prelude::ListModelExt;
|
|
||||||
use relm4::{adw, gtk};
|
use relm4::{adw, gtk};
|
||||||
|
|
||||||
pub const MAIN_APP_WINDOW_NAME: &str = "main_app_window";
|
pub const MAIN_APP_WINDOW_NAME: &str = "main_app_window";
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
use gst::{glib::SignalHandlerId, prelude::Cast};
|
use gst::{glib::SignalHandlerId, prelude::Cast};
|
||||||
use gstplay::{traits::PlayStreamInfoExt, PlayAudioInfo, PlaySubtitleInfo};
|
use gstplay::{traits::PlayStreamInfoExt, PlayAudioInfo, PlaySubtitleInfo};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
use video_player_gst::{gst, gstplay, GstVideoPlayer};
|
||||||
|
|
||||||
use crate::{tr, video_player::gst_play_widget::GstVideoPlayer};
|
use crate::tr;
|
||||||
|
|
||||||
use super::{AudioTrack, PlayerStateChangedCallback, SubtitleTrack, VideoPlayerBackend};
|
use super::{AudioTrack, PlayerStateChangedCallback, SubtitleTrack, VideoPlayerBackend};
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
pub mod backends;
|
pub mod backends;
|
||||||
mod controls;
|
mod controls;
|
||||||
mod gst_play_widget;
|
|
||||||
mod next_up;
|
mod next_up;
|
||||||
mod session;
|
mod session;
|
||||||
mod skip_intro;
|
mod skip_intro;
|
||||||
|
12
video_player_gst/Cargo.toml
Normal file
12
video_player_gst/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[package]
|
||||||
|
name = "video_player_gst"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
relm4 = { workspace = true }
|
||||||
|
gst = { package = "gstreamer", version = "0.21.0" }
|
||||||
|
gstgtk4 = { package = "gst-plugin-gtk4", version = "0.11.0" }
|
||||||
|
gstplay = { package = "gstreamer-play", version = "0.21.0" }
|
@@ -10,6 +10,14 @@ use gtk::glib;
|
|||||||
use gtk::subclass::prelude::*;
|
use gtk::subclass::prelude::*;
|
||||||
use relm4::gtk;
|
use relm4::gtk;
|
||||||
|
|
||||||
|
pub use gst;
|
||||||
|
pub use gstplay;
|
||||||
|
|
||||||
|
pub fn init_gst() {
|
||||||
|
gst::init().expect("Error initializing GStreamer");
|
||||||
|
gstgtk4::plugin_register_static().expect("Error registering GST GTK4 plugin");
|
||||||
|
}
|
||||||
|
|
||||||
glib::wrapper! {
|
glib::wrapper! {
|
||||||
pub struct GstVideoPlayer(ObjectSubclass<imp::GstVideoPlayer>)
|
pub struct GstVideoPlayer(ObjectSubclass<imp::GstVideoPlayer>)
|
||||||
@extends gtk::Widget,
|
@extends gtk::Widget,
|
Reference in New Issue
Block a user