[gnome-tour/bilelmoussaoui/fixes] Drop the video welcome page



commit e5dacb493a88a0d71d2ac70714003b792caa9932
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Wed Jan 26 18:57:05 2022 +0100

    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.

 Cargo.lock                   | 190 -------------------------------------------
 Cargo.toml                   |  12 ---
 README.md                    |  21 -----
 meson.build                  |   6 --
 meson_options.txt            |   6 --
 src/config.rs.in             |   2 -
 src/meson.build              |   1 -
 src/widgets/pages/welcome.rs | 130 ++---------------------------
 8 files changed, 8 insertions(+), 360 deletions(-)
---
diff --git a/Cargo.lock b/Cargo.lock
index ef8e4a1..47b24c2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -114,12 +114,6 @@ dependencies = [
  "rustc_version",
 ]
 
-[[package]]
-name = "fragile"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8da1b8f89c5b5a5b7e59405cfcf0bb9588e5ed19f0b57a4cd542bbba3f164a6d"
-
 [[package]]
 name = "futures-channel"
 version = "0.3.19"
@@ -330,8 +324,6 @@ name = "gnome-tour"
 version = "40.0.0"
 dependencies = [
  "gettext-rs",
- "gstreamer",
- "gstreamer-player",
  "gtk4",
  "libadwaita",
  "log",
@@ -404,131 +396,6 @@ dependencies = [
  "system-deps",
 ]
 
-[[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"
 version = "0.4.5"
@@ -708,42 +575,6 @@ dependencies = [
  "autocfg",
 ]
 
-[[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"
 version = "0.2.7"
@@ -779,15 +610,6 @@ version = "1.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
 
-[[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"
 version = "0.15.2"
@@ -813,12 +635,6 @@ dependencies = [
  "system-deps",
 ]
 
-[[package]]
-name = "paste"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5"
-
 [[package]]
 name = "pest"
 version = "2.1.3"
@@ -846,12 +662,6 @@ version = "0.3.24"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
 
-[[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"
 version = "0.4.0"
diff --git a/Cargo.toml b/Cargo.toml
index 9be3e81..b81201b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,8 +4,6 @@ version = "40.0.0"
 authors = ["Bilal Elmoussaoui <bil elmoussaoui gmail com>"]
 edition = "2021"
 
-[features]
-video = ["gst_player", "gst"]
 
 [dependencies]
 gtk = { package = "gtk4", version = "0.4", features= ["v4_2"]}
@@ -14,13 +12,3 @@ gettext-rs = { version = "0.7", features = ["gettext-system"] }
 adw = {package = "libadwaita", version = "0.1"}
 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
-
diff --git a/README.md b/README.md
index 4606047..1459b42 100644
--- a/README.md
+++ b/README.md
@@ -9,24 +9,3 @@
 ![screenshot](data/resources/screenshots/screenshot1.png)
 </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`
diff --git a/meson.build b/meson.build
index ca93bec..8bda926 100644
--- a/meson.build
+++ b/meson.build
@@ -15,12 +15,6 @@ dependency('gdk-pixbuf-2.0')
 dependency('gtk4', version: '>= 4.4')
 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)
 desktop_file_validate = find_program('desktop-file-validate', required: false)
 appstream_util = find_program('appstream-util', required: false)
diff --git a/meson_options.txt b/meson_options.txt
index c6a5d3e..9163edb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -9,9 +9,3 @@ option (
   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'
-)
diff --git a/src/config.rs.in b/src/config.rs.in
index 85f7309..b5ffa84 100644
--- a/src/config.rs.in
+++ b/src/config.rs.in
@@ -5,5 +5,3 @@ pub static VERSION: &str = @VERSION@;
 pub static GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@;
 pub static LOCALEDIR: &str = @LOCALEDIR@;
 pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource");
-#[cfg(feature = "video")]
-pub static VIDEO_PATH: &str = @VIDEO_PATH@;
diff --git a/src/meson.build b/src/meson.build
index 2899e81..ef03e99 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -5,7 +5,6 @@ global_conf.set_quoted('PROFILE', profile)
 global_conf.set_quoted('VERSION', version + version_suffix)
 global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
 global_conf.set_quoted('LOCALEDIR', localedir)
-global_conf.set_quoted('VIDEO_PATH', get_option('video_path'))
 config = configure_file(
   input: 'config.rs.in',
   output: 'config.rs',
diff --git a/src/widgets/pages/welcome.rs b/src/widgets/pages/welcome.rs
index 7d2d6c2..1cd6ae4 100644
--- a/src/widgets/pages/welcome.rs
+++ b/src/widgets/pages/welcome.rs
@@ -1,69 +1,14 @@
-#[cfg(feature = "video")]
-use crate::config;
 use crate::utils::i18n_f;
 use gettextrs::gettext;
-#[cfg(feature = "video")]
-use gio::FileExt;
 use gtk::glib;
-#[cfg(feature = "video")]
-use gtk::glib::clone;
-#[cfg(feature = "video")]
-use gtk::glib::{Receiver, Sender};
 use gtk::prelude::*;
 use gtk::subclass::prelude::*;
-#[cfg(feature = "video")]
-use std::cell::RefCell;
-
-#[derive(PartialEq)]
-#[cfg(feature = "video")]
-pub enum Action {
-    VideoReady,
-    VideoUp,
-}
 
 mod imp {
     use super::*;
 
-    #[derive(Debug)]
-    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,
-            }
-        }
-    }
+    #[derive(Default, Debug)]
+    pub struct WelcomePageWidget {}
 
     #[glib::object_subclass]
     impl ObjectSubclass for WelcomePageWidget {
@@ -96,71 +41,12 @@ mod imp {
             let clamp = adw::Clamp::new();
             clamp.set_child(Some(&container));
 
-            #[cfg(not(feature = "video"))]
-            let header = {
-                let logo = gtk::Picture::builder()
-                    .can_shrink(false)
-                    .keep_aspect_ratio(true)
-                    .build();
-                logo.set_resource(Some("/org/gnome/Tour/welcome.svg"));
-
-                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 logo = gtk::Picture::builder()
+                .can_shrink(false)
+                .keep_aspect_ratio(true)
+                .build();
+            logo.set_resource(Some("/org/gnome/Tour/welcome.svg"));
+            container.append(&logo);
 
             let title = gtk::Label::new(Some(&gettext("Start the Tour")));
             title.set_margin_top(36);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]