Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable gstreamer #1650

Open
sl1pkn07 opened this issue Feb 21, 2025 · 3 comments
Open

Disable gstreamer #1650

sl1pkn07 opened this issue Feb 21, 2025 · 3 comments
Labels

Comments

@sl1pkn07
Copy link

Operating System

archlinux

XDG Desktop Portal version

Git

XDG Desktop Portal version (Other)

No response

Desktop Environment

Plasma

Desktop Environment (Other)

No response

Expected Behavior

its not possible disable gstreamer

please add a option for disable it (or in case, use only plain ffmpeg)

greetings

Current Behavior

meson fails in gst free environment because gst support is hardcoded (not spected)

Steps to Reproduce

1.try to build from git wout gstreamer. is not posible because not have an option for disable it
2. meson config got error because not found gst in a gst system free environment (elementally, my dear watson)
3.
...

Anything else we should know?

gst support sould be optional, or swicth to plain ffmpeg

@sl1pkn07 sl1pkn07 added the bug label Feb 21, 2025
@sl1pkn07
Copy link
Author

i see in the src/meson.build, gst is used in xdp_validate_sound, but is hardoded linked in meson.build without xdp_validate_sound option umbrella

@sl1pkn07
Copy link
Author

bad implemented. completely sure. if anyone with better meson.build kwedge, please fix it

diff --git a/meson.build b/meson.build
index fa6b7ff6..e0897bfd 100644
--- a/meson.build
+++ b/meson.build
@@ -112,7 +112,7 @@ gio_unix_dep = dependency('gio-unix-2.0')
 json_glib_dep = dependency('json-glib-1.0')
 fuse3_dep = dependency('fuse3', version: '>= 3.10.0')
 gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0')
-gst_pbutils_dep = dependency('gstreamer-pbutils-1.0')
+gst_pbutils_dep = dependency('gstreamer-pbutils-1.0', required: get_option('sandboxed-sound-validation'))
 geoclue_dep = dependency(
   'libgeoclue-2.0',
   version: '>= 2.5.2',
@@ -122,8 +122,8 @@ pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.2.90')
 libsystemd_dep = dependency('libsystemd', required: get_option('systemd'))
 gudev_dep = dependency('gudev-1.0', required: get_option('gudev'))
 umockdev_dep = dependency('umockdev-1.0', required: get_option('tests'))
-
-gst_inspect = find_program('gst-inspect-1.0', required: false)
+gst_inspect = find_program('gst-inspect-1.0', required: get_option('sandboxed-sound-validation'))
+have_gst_inspect = gst_inspect.found()
 if gst_inspect.found()
   have_wav_parse = run_command(
     gst_inspect, 'wavparse', '--exists',
@@ -132,6 +132,7 @@ if gst_inspect.found()
 else
   have_wav_parse = false
 endif
+
 if have_wav_parse
   config_h.set('HAVE_WAV_PARSE', 1)
 endif
@@ -224,7 +225,7 @@ enable_tests = get_option('tests') \
   .require(python.found() and python.language_version().version_compare('>=3.9'),
            error_message: 'Python version >=3.9 is required') \
   .require(umockdev_dep.found()) \
-  .require(have_wav_parse,
+  .require(not have_wav_parse and not get_option('sandboxed-sound-validation').allowed(),
            error_message: 'gst-inspect and the wavparse plugins are required') \
   .allowed()
 
diff --git a/src/meson.build b/src/meson.build
index f5f53e55..f1e5a592 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -206,14 +206,16 @@ if bwrap.found()
   validate_sound_c_args += '-DHELPER="@0@"'.format(bwrap.full_path())
 endif
 
-xdp_validate_sound = executable(
-  'xdg-desktop-portal-validate-sound',
-  'validate-sound.c',
-  dependencies: [gst_pbutils_dep],
-  c_args: validate_sound_c_args,
-  install: true,
-  install_dir: libexecdir,
-)
+if gst_inspect.found()
+  xdp_validate_sound = executable(
+    'xdg-desktop-portal-validate-sound',
+    'validate-sound.c',
+    dependencies: [gst_pbutils_dep],
+    c_args: validate_sound_c_args,
+    install: true,
+    install_dir: libexecdir,
+  )
+endif
 
 configure_file(
   input: 'xdg-desktop-portal-rewrite-launchers.service.in',
diff --git a/tests/meson.build b/tests/meson.build
index 87b2e390..290b27ac 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -94,7 +94,6 @@ pytest_files = [
   'test_inhibit.py',
   'test_inputcapture.py',
   'test_location.py',
-  'test_notification.py',
   'test_openuri.py',
   'test_permission_store.py',
   'test_print.py',
@@ -122,7 +121,6 @@ template_files = [
   'templates/__init__.py',
   'templates/inputcapture.py',
   'templates/lockdown.py',
-  'templates/notification.py',
   'templates/print.py',
   'templates/remotedesktop.py',
   'templates/screenshot.py',
@@ -131,6 +129,11 @@ template_files = [
   'templates/wallpaper.py',
 ]
 
+if have_gst_inspect
+  template_files += ['templates/notification.py',]
+  pytest_files += [  'test_notification.py',]
+endif
+
 foreach pytest_file : pytest_files
   testname = pytest_file.replace('.py', '').replace('test_', '')
   test(

greetings

@swick
Copy link
Collaborator

swick commented Feb 24, 2025

We require gst to validate audio. The only way around this is to drop audio support in notifications. That would require more changes and would be up to you to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants