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

experiment(mediaviewer): clapper support #931

Merged
merged 11 commits into from
Jun 16, 2024
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.PHONY: all install uninstall build test potfiles
PREFIX ?= /usr

clapper ?=
# Remove the devel headerbar style:
# make release=1
release ?=
Expand All @@ -9,7 +10,7 @@ all: build

build:
meson setup builddir --prefix=$(PREFIX)
meson configure builddir -Ddevel=$(if $(release),false,true)
meson configure builddir -Ddevel=$(if $(release),false,true) -Dclapper=$(if $(clapper),true,false)
meson compile -C builddir

install:
Expand Down
22 changes: 22 additions & 0 deletions build-aux/clapper/clapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "clapper",
"buildsystem": "meson",
"config-opts": [
"-Dclapper=enabled",
"-Dclapper-gtk=enabled",
"-Dclapper-app=disabled",
"-Dintrospection=enabled",
"-Dvapi=enabled"
],
"cleanup": [
"/include",
"/lib/pkgconfig"
],
"sources": [
{
"type": "git",
"url": "https://github.com/Rafostar/clapper.git",
"branch": "master"
}
]
}
73 changes: 73 additions & 0 deletions build-aux/clapper/gstreamer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "gstreamer",
"buildsystem": "meson",
"config-opts": [
"--buildtype=release",
"--wrap-mode=nodownload",

"-Dbase=enabled",
"-Dgood=enabled",
"-Dbad=enabled",
"-Dugly=enabled",
"-Dlibav=enabled",
"-Dvaapi=enabled",
"-Dsharp=disabled",
"-Drs=disabled",
"-Dpython=disabled",
"-Ddevtools=disabled",
"-Dges=disabled",
"-Drtsp_server=disabled",
"-Dgst-examples=disabled",
"-Dqt5=disabled",
"-Dtests=disabled",
"-Dexamples=disabled",
"-Dintrospection=enabled",
"-Ddoc=disabled",
"-Dgtk_doc=disabled",
"-Dgpl=enabled",

"-Dgstreamer:benchmarks=disabled",
"-Dgstreamer:gobject-cast-checks=disabled",
"-Dgstreamer:glib-asserts=disabled",
"-Dgstreamer:glib-checks=disabled",
"-Dgstreamer:extra-checks=disabled",

"-Dgst-plugins-base:gobject-cast-checks=disabled",
"-Dgst-plugins-base:glib-asserts=disabled",
"-Dgst-plugins-base:glib-checks=disabled",
"-Dgst-plugins-base:gl_api=opengl,gles2",
"-Dgst-plugins-base:gl_platform=egl,glx",

"-Dgst-plugins-good:gobject-cast-checks=disabled",
"-Dgst-plugins-good:glib-asserts=disabled",
"-Dgst-plugins-good:glib-checks=disabled",
"-Dgst-plugins-good:gtk3=disabled",

"-Dgst-plugins-bad:gobject-cast-checks=disabled",
"-Dgst-plugins-bad:glib-asserts=disabled",
"-Dgst-plugins-bad:glib-checks=disabled",
"-Dgst-plugins-bad:extra-checks=disabled",
"-Dgst-plugins-bad:vulkan=disabled",
"-Dgst-plugins-bad:webrtc=disabled",
"-Dgst-plugins-bad:wasapi=disabled",
"-Dgst-plugins-bad:wasapi2=disabled",
"-Dgst-plugins-bad:winks=disabled",
"-Dgst-plugins-bad:winscreencap=disabled",
"-Dgst-plugins-bad:nvcodec=enabled",
"-Dgst-plugins-bad:v4l2codecs=enabled",
"-Dgst-plugins-bad:va=enabled",

"-Dgst-plugins-ugly:gobject-cast-checks=disabled",
"-Dgst-plugins-ugly:glib-asserts=disabled",
"-Dgst-plugins-ugly:glib-checks=disabled"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.freedesktop.org/gstreamer/gstreamer.git",
"tag": "1.24.3",
"commit": "da69285863780ce0ebb51482edcf1d54c7c29533",
"disable-submodules": true
}
]
}
74 changes: 74 additions & 0 deletions build-aux/dev.geopjr.Tuba.Clapper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"app-id": "dev.geopjr.Tuba",
"runtime": "org.gnome.Platform",
"runtime-version": "46",
"sdk": "org.gnome.Sdk",
"add-extensions": {
"org.freedesktop.Platform.ffmpeg-full": {
"version": "23.08",
"directory": "lib/ffmpeg",
"add-ld-path": ".",
"no-autodownload": false,
"autodelete": false
}
},
"command": "dev.geopjr.Tuba",
"finish-args": [
"--device=dri",
"--share=ipc",
"--share=network",
"--socket=fallback-x11",
"--socket=wayland",
"--socket=pulseaudio",
"--own-name=org.mpris.MediaPlayer2.Tuba",
"--env=GST_PLUGIN_SYSTEM_PATH=/app/lib/gstreamer-1.0"
],
"cleanup": [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"/share/vala",
"*.la",
"*.a"
],
"modules": [
"clapper/gstreamer.json",
"clapper/clapper.json",
{
"name" : "libspelling",
"buildsystem" : "meson",
"config-opts" : [
"-Ddocs=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libspelling.git",
"branch" : "main"
}
]
},
{
"name": "tuba",
"builddir": true,
"buildsystem": "meson",
"config-opts" : [
"-Ddevel=true",
"-Dclapper=true"
],
"sources": [
{
"type": "dir",
"path": "../"
}
]
}
],
"cleanup-commands": [
"mkdir -p /app/lib/ffmpeg"
]
}
2 changes: 1 addition & 1 deletion build-aux/dev.geopjr.Tuba.Devel.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
]
}
]
}
}
14 changes: 13 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ endif

devel = get_option('devel')
distro = get_option('distro')
clapper_support = get_option('clapper')

# Setup configuration file
config = configuration_data()
Expand Down Expand Up @@ -82,6 +83,8 @@ libadwaita_dep = dependency('libadwaita-1', version: '>=1.5', required: true)
gtksourceview_dep = dependency('gtksourceview-5', required: true, version: '>=5.6.0')
libwebp_dep = dependency('libwebp', required: false)
libspelling = dependency('libspelling-1', required: false)
clapper_dep = dependency('clapper-0.0', required: false)
clapper_gtk_dep = dependency('clapper-gtk-0.0', required: false)

if not libwebp_dep.found ()
warning('WebP support might be missing, please install webp-pixbuf-loader.')
Expand All @@ -99,6 +102,13 @@ if gtksourceview_dep.version().version_compare('>=5.7.1')
add_project_arguments(['--define=GTKSOURCEVIEW_5_7_1'], language: 'vala')
endif

if clapper_support and clapper_dep.found () and clapper_dep.version().version_compare('>=0.6.0') and clapper_gtk_dep.found ()
add_project_arguments(['--define=CLAPPER'], language: 'vala')
if (clapper_dep.get_variable('features').split().contains('mpris'))
add_project_arguments(['--define=CLAPPER_MPRIS'], language: 'vala')
endif
endif

if gtk_dep.version().version_compare('>=4.14')
add_project_arguments(['--define=GTK_4_14'], language: 'vala')
endif
Expand All @@ -118,7 +128,9 @@ final_deps = [
gtksourceview_dep,
gtk_dep,
libadwaita_dep,
meson.get_compiler('c').find_library('m', required: false)
meson.get_compiler('c').find_library('m', required: false),
clapper_dep,
clapper_gtk_dep
]

executable(
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
option('devel', type: 'boolean', value: false)
option('distro', type: 'boolean', value: false)
option('clapper', type: 'boolean', value: false)
4 changes: 4 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ namespace Tuba {
warning (e.message);
}

#if CLAPPER
Clapper.init (ref args);
GLib.Environment.set_variable ("CLAPPER_USE_PLAYBIN3", "1", false);
#endif
cache_path = GLib.Path.build_path (GLib.Path.DIR_SEPARATOR_S, GLib.Environment.get_user_cache_dir (), Build.NAME.down ());

try {
Expand Down
Loading
Loading