Commit e5dacb49 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Drop the video welcome page

It is no longer used and if we ever re-add it, we can think of another way to do that.
parent a7be4366
...@@ -115,12 +115,6 @@ dependencies = [ ...@@ -115,12 +115,6 @@ dependencies = [
] ]
[[package]] [[package]]
name = "fragile"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8da1b8f89c5b5a5b7e59405cfcf0bb9588e5ed19f0b57a4cd542bbba3f164a6d"
[[package]]
name = "futures-channel" name = "futures-channel"
version = "0.3.19" version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -330,8 +324,6 @@ name = "gnome-tour" ...@@ -330,8 +324,6 @@ name = "gnome-tour"
version = "40.0.0" version = "40.0.0"
dependencies = [ dependencies = [
"gettext-rs", "gettext-rs",
"gstreamer",
"gstreamer-player",
"gtk4", "gtk4",
"libadwaita", "libadwaita",
"log", "log",
...@@ -405,131 +397,6 @@ dependencies = [ ...@@ -405,131 +397,6 @@ dependencies = [
] ]
[[package]] [[package]]
name = "gstreamer"
version = "0.18.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bc8364f9129c73e214ac1128fcff0e9a25cbc69f06d3ede9f7b07c8b6338680"
dependencies = [
"bitflags",
"cfg-if",
"fragile",
"futures-channel",
"futures-core",
"futures-util",
"glib",
"gstreamer-sys",
"libc",
"muldiv",
"num-integer",
"num-rational",
"once_cell",
"option-operations",
"paste",
"pretty-hex",
"thiserror",
]
[[package]]
name = "gstreamer-base"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224f35f36582407caf58ded74854526beeecc23d0cf64b8d1c3e00584ed6863f"
dependencies = [
"bitflags",
"cfg-if",
"glib",
"gstreamer",
"gstreamer-base-sys",
"libc",
]
[[package]]
name = "gstreamer-base-sys"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a083493c3c340e71fa7c66eebda016e9fafc03eb1b4804cf9b2bad61994b078e"
dependencies = [
"glib-sys",
"gobject-sys",
"gstreamer-sys",
"libc",
"system-deps",
]
[[package]]
name = "gstreamer-player"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f14ee02352ba73cadebe640bfb33f12fe8d03cbcad816a102d55a0251fb99bb"
dependencies = [
"bitflags",
"glib",
"gstreamer",
"gstreamer-player-sys",
"gstreamer-video",
"libc",
"once_cell",
]
[[package]]
name = "gstreamer-player-sys"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f9b674b39a4d0e18710f6e3d2b109f1793d8028ee4e39da3909b55b4529d399"
dependencies = [
"glib-sys",
"gobject-sys",
"gstreamer-sys",
"gstreamer-video-sys",
"libc",
"system-deps",
]
[[package]]
name = "gstreamer-sys"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3517a65d3c2e6f8905b456eba5d53bda158d664863aef960b44f651cb7d33e2"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "gstreamer-video"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "410c72d885a67aeb7dbfa49c347e6c85d60f54e1cdaf6aadf8b5364892451261"
dependencies = [
"bitflags",
"cfg-if",
"fragile",
"futures-channel",
"glib",
"gstreamer",
"gstreamer-base",
"gstreamer-video-sys",
"libc",
"once_cell",
]
[[package]]
name = "gstreamer-video-sys"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "255c487bf6dd145e23558eaf1c92ef0946ee1999d22bdadc1e492b463609c4b6"
dependencies = [
"glib-sys",
"gobject-sys",
"gstreamer-base-sys",
"gstreamer-sys",
"libc",
"system-deps",
]
[[package]]
name = "gtk4" name = "gtk4"
version = "0.4.5" version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -709,42 +576,6 @@ dependencies = [ ...@@ -709,42 +576,6 @@ dependencies = [
] ]
[[package]] [[package]]
name = "muldiv"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5136edda114182728ccdedb9f5eda882781f35fa6e80cc360af12a8932507f3"
[[package]]
name = "num-integer"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [
"autocfg",
"num-traits",
]
[[package]]
name = "num-rational"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [
"autocfg",
]
[[package]]
name = "objc" name = "objc"
version = "0.2.7" version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -780,15 +611,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -780,15 +611,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
[[package]] [[package]]
name = "option-operations"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95d6113415f41b268f1195907427519769e40ee6f28cbb053795098a2c16f447"
dependencies = [
"paste",
]
[[package]]
name = "pango" name = "pango"
version = "0.15.2" version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -814,12 +636,6 @@ dependencies = [ ...@@ -814,12 +636,6 @@ dependencies = [
] ]
[[package]] [[package]]
name = "paste"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5"
[[package]]
name = "pest" name = "pest"
version = "2.1.3" version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
...@@ -847,12 +663,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -847,12 +663,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
[[package]] [[package]]
name = "pretty-hex"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc5c99d529f0d30937f6f4b8a86d988047327bb88d04d2c4afc356de74722131"
[[package]]
name = "pretty_env_logger" name = "pretty_env_logger"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
......
...@@ -4,8 +4,6 @@ version = "40.0.0" ...@@ -4,8 +4,6 @@ version = "40.0.0"
authors = ["Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>"] authors = ["Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>"]
edition = "2021" edition = "2021"
[features]
video = ["gst_player", "gst"]
[dependencies] [dependencies]
gtk = { package = "gtk4", version = "0.4", features= ["v4_2"]} gtk = { package = "gtk4", version = "0.4", features= ["v4_2"]}
...@@ -14,13 +12,3 @@ gettext-rs = { version = "0.7", features = ["gettext-system"] } ...@@ -14,13 +12,3 @@ gettext-rs = { version = "0.7", features = ["gettext-system"] }
adw = {package = "libadwaita", version = "0.1"} adw = {package = "libadwaita", version = "0.1"}
pretty_env_logger = "0.4" pretty_env_logger = "0.4"
[dependencies.gst_player]
version = "0.18"
package = "gstreamer-player"
optional = true
[dependencies.gst]
version = "0.18"
package = "gstreamer"
optional = true
...@@ -9,24 +9,3 @@ ...@@ -9,24 +9,3 @@
![screenshot](data/resources/screenshots/screenshot1.png) ![screenshot](data/resources/screenshots/screenshot1.png)
</div> </div>
### Video Feature
Tour uses by default the logo of the distribution based on the info from `/etc/os-release`. The application comes with a feature to replace the logo with a welcome video shipped by the distribution.
To enable the feature, you need to build the application with
```bash
meson _builddir -Dvideo_path=/absolute/path/to/the/video.mp4
```
If you're testing the application using Builder, make sure to change the `config-opts` accordingly & give the application filesystem access so it can play the video file.
Example:
This needs to be added to the `gnome-tour` module
```json
"config-opts" : [
"-Dvideo_path=/home/username/to/the/video.mp4"
]
```
along with `--filesystem=home` in `finish-args`
...@@ -15,12 +15,6 @@ dependency('gdk-pixbuf-2.0') ...@@ -15,12 +15,6 @@ dependency('gdk-pixbuf-2.0')
dependency('gtk4', version: '>= 4.4') dependency('gtk4', version: '>= 4.4')
dependency('libadwaita-1', version: '>= 1') dependency('libadwaita-1', version: '>= 1')
if get_option('video_path') != ''
dependency('gstreamer-1.0', version: '>= 1.12')
dependency('gstreamer-video-1.0', version: '>= 1.12')
dependency('gstreamer-player-1.0', version: '>= 1.12')
endif
glib_compile_resources = find_program('glib-compile-resources', required: true) glib_compile_resources = find_program('glib-compile-resources', required: true)
desktop_file_validate = find_program('desktop-file-validate', required: false) desktop_file_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: false) appstream_util = find_program('appstream-util', required: false)
......
...@@ -9,9 +9,3 @@ option ( ...@@ -9,9 +9,3 @@ option (
description: 'The build profile for GNOME Tour. One of "default" or "development".' description: 'The build profile for GNOME Tour. One of "default" or "development".'
) )
option(
'video_path',
type : 'string',
value: '',
description : 'Sets the absolute path of a welcome video'
)
...@@ -5,5 +5,3 @@ pub static VERSION: &str = @VERSION@; ...@@ -5,5 +5,3 @@ pub static VERSION: &str = @VERSION@;
pub static GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@; pub static GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@;
pub static LOCALEDIR: &str = @LOCALEDIR@; pub static LOCALEDIR: &str = @LOCALEDIR@;
pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource"); pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource");
#[cfg(feature = "video")]
pub static VIDEO_PATH: &str = @VIDEO_PATH@;
...@@ -5,7 +5,6 @@ global_conf.set_quoted('PROFILE', profile) ...@@ -5,7 +5,6 @@ global_conf.set_quoted('PROFILE', profile)
global_conf.set_quoted('VERSION', version + version_suffix) global_conf.set_quoted('VERSION', version + version_suffix)
global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package) global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
global_conf.set_quoted('LOCALEDIR', localedir) global_conf.set_quoted('LOCALEDIR', localedir)
global_conf.set_quoted('VIDEO_PATH', get_option('video_path'))
config = configure_file( config = configure_file(
input: 'config.rs.in', input: 'config.rs.in',
output: 'config.rs', output: 'config.rs',
......
#[cfg(feature = "video")]
use crate::config;
use crate::utils::i18n_f; use crate::utils::i18n_f;
use gettextrs::gettext; use gettextrs::gettext;
#[cfg(feature = "video")]
use gio::FileExt;
use gtk::glib; use gtk::glib;
#[cfg(feature = "video")]
use gtk::glib::clone;
#[cfg(feature = "video")]
use gtk::glib::{Receiver, Sender};
use gtk::prelude::*; use gtk::prelude::*;
use gtk::subclass::prelude::*; use gtk::subclass::prelude::*;
#[cfg(feature = "video")]
use std::cell::RefCell;
#[derive(PartialEq)]
#[cfg(feature = "video")]
pub enum Action {
VideoReady,
VideoUp,
}
mod imp { mod imp {
use super::*; use super::*;
#[derive(Debug)] #[derive(Default, Debug)]
pub struct WelcomePageWidget { pub struct WelcomePageWidget {}
#[cfg(feature = "video")]
player: gst_player::Player,
#[cfg(feature = "video")]
receiver: RefCell<Option<Receiver<Action>>>,
#[cfg(feature = "video")]
sender: Sender<Action>,
}
#[allow(clippy::derivable_impls)]
impl Default for WelcomePageWidget {
fn default() -> Self {
#[cfg(feature = "video")]
let player = {
let dispatcher = gst_player::PlayerGMainContextSignalDispatcher::new(None);
let sink = gst::ElementFactory::make("gtksink", None)
.expect("Missing dependency: element gtksink is needed (usually, in gstreamer-plugins-good or in gst-plugin-gtk).");
let renderer =
gst_player::PlayerVideoOverlayVideoRenderer::with_sink(&sink).upcast();
gst_player::Player::new(
Some(&renderer),
Some(&dispatcher.upcast::<gst_player::PlayerSignalDispatcher>()),
)
};
#[cfg(feature = "video")]
let (sender, r) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
#[cfg(feature = "video")]
let receiver = RefCell::new(Some(r));
Self {
#[cfg(feature = "video")]
player,
#[cfg(feature = "video")]
sender,
#[cfg(feature = "video")]
receiver,
}
}
}
#[glib::object_subclass] #[glib::object_subclass]
impl ObjectSubclass for WelcomePageWidget { impl ObjectSubclass for WelcomePageWidget {
...@@ -96,71 +41,12 @@ mod imp { ...@@ -96,71 +41,12 @@ mod imp {
let clamp = adw::Clamp::new(); let clamp = adw::Clamp::new();
clamp.set_child(Some(&container)); clamp.set_child(Some(&container));
#[cfg(not(feature = "video"))]
let header = {
let logo = gtk::Picture::builder() let logo = gtk::Picture::builder()
.can_shrink(false) .can_shrink(false)
.keep_aspect_ratio(true) .keep_aspect_ratio(true)
.build(); .build();
logo.set_resource(Some("/org/gnome/Tour/welcome.svg")); logo.set_resource(Some("/org/gnome/Tour/welcome.svg"));
container.append(&logo);
logo.upcast::<gtk::Widget>()
};
#[cfg(feature = "video")]
let header = {
let video_widget = self
.player
.pipeline()
.property::<gst::Element>("video-sink")
.property::<gtk::Widget>("widget");
video_widget.set_size_request(-1, 360);
video_widget.set_property("ignore-alpha", &false).unwrap();
video_widget.add_css_class("video");
video_widget
};
container.append(&header);
#[cfg(feature = "video")]
{
let receiver = self.receiver.borrow_mut().take().unwrap();
receiver.attach(
None,
clone!(@strong self.player as player => move |action| {
match action {
Action::VideoReady => player.play(),
Action::VideoUp => header.add_css_class("playing"),
};
glib::Continue(true)
}),
);
self.player.connect_state_changed(
clone!(@strong self.sender as sender => move |_p,state| {
if state == gst_player::PlayerState::Playing {
sender.send(Action::VideoUp).unwrap();
}
}),
);
self.player.connect_uri_loaded(
clone!(@strong self.sender as sender => move |_p, _uri| {
sender.send(Action::VideoReady).unwrap();
}),
);
self.player.connect_end_of_stream(move |p| p.stop());
let video_file = gio::File::new_for_path(config::VIDEO_PATH);
gtk::timeout_add(
500,
clone!(@strong self.player as player => move || {
player.set_uri(&video_file.get_uri());
glib::Continue(false)
}),
);
};
let title = gtk::Label::new(Some(&gettext("Start the Tour"))); let title = gtk::Label::new(Some(&gettext("Start the Tour")));
title.set_margin_top(36); title.set_margin_top(36);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment