diff --git a/README.md b/README.md index 30f27a4e..b84ed129 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,42 @@ A GNOME media player built using [GJS](https://gitlab.gnome.org/GNOME/gjs) and powered by [GStreamer](https://gstreamer.freedesktop.org) with [OpenGL](https://www.opengl.org) rendering. Can also be used as a pre-made widget for [GTK](https://www.gtk.org) apps. ### WORK IN PROGRESS -This is still early WIP. Many features are not implemented yet and quite a few are still unstable. Right now Clapper can only be launched from terminal, so if you want to test it, start it like this: -```shell -com.github.rafostar.Clapper "video.mp4" -``` +This is still early WIP. Many features are not implemented yet and quite a few are still unstable. -### Playlists -Clapper can also open playlist files. Playlist file is a standard text file with a `.claps` file extension. It should contain a single filepath per line. The filepath can be either absolute or relative. Playlist can even contain HTTP links instead of filepaths. Here is an example how to easily create a playlist file inside your music directory: +### Features: +
+ Playlists + +Clapper can open playlist files. Playlist file is a standard text file with a `.claps` file extension. +It should contain a single filepath per line. The filepath can be either absolute or relative. +Playlist can even contain HTTP links instead of filepaths. + +Here is an example how to easily create a playlist file inside your music directory: ```shell ls *.mp3 > music.claps ``` -Once you have a playlist, open it with Clapper like any other file: -```shell -com.github.rafostar.Clapper "music.claps" +Once you have a playlist, open it with Clapper like any other file. +Since the playlist is a normal text file with filepaths only, you can always edit it later in any text editor or `echo` more media to it. Easy, right? +
+ +
+ Hardware acceleration + +Using hardware acceleration is highly recommended. As stated in `GStreamer` wiki: ``` -And since the playlist is a normal text file with filepaths only, you can always edit it later in any text editor. Easy, right? +In the case of OpenGL based elements, the buffers have the GstVideoGLTextureUploadMeta meta, which +efficiently copies the content of the VA-API surface into a GL texture. +``` +Clapper uses `OpenGL` based sinks, so when `VA-API` is available, both CPU and RAM usage is much lower. + +To use `VA-API` make sure you have `gstreamer1-vaapi` installed. Verify with: +```shell +gst-inspect-1.0 vaapi +``` +On some older GPUs you might need to export `GST_VAAPI_ALL_DRIVERS=1` environment variable. + +Other acceleration methods (supported by `GStreamer`) should also work, but I have not tested them due to lack of hardware. +
## Requirements Clapper uses `GStreamer` bindings from `GI` repository, so if your distro ships them as separate package, they must be installed first. @@ -88,7 +109,7 @@ Pre-built packages are available here:
Arch Linux - + You can get clapper from the AUR: [clapper-git](https://aur.archlinux.org/packages/clapper-git), or ```shell cd pkgs/arch @@ -96,21 +117,5 @@ makepkg -si ```
-## Hardware acceleration -Using hardware acceleration is highly recommended. As stated in `GStreamer` wiki: -``` -In the case of OpenGL based elements, the buffers have the GstVideoGLTextureUploadMeta meta, which -efficiently copies the content of the VA-API surface into a GL texture. -``` -Clapper uses `OpenGL` based sinks, so when `VA-API` is available, both CPU and RAM usage is much lower. - -To use `VA-API` make sure you have `gstreamer1-vaapi` installed. Verify with: -```shell -gst-inspect-1.0 vaapi -``` -On some older GPUs you might need to export `GST_VAAPI_ALL_DRIVERS=1` environment variable. - -Other acceleration methods (supported by `GStreamer`) should also work, but I have not tested them due to lack of hardware. - ## Special Thanks Many thanks to [sp1ritCS](https://github.com/sp1ritCS) for creating and maintaining package build files. diff --git a/build-aux/meson/postinstall.py b/build-aux/meson/postinstall.py index cd3924d8..21f2a925 100755 --- a/build-aux/meson/postinstall.py +++ b/build-aux/meson/postinstall.py @@ -4,19 +4,20 @@ from os import environ, path from subprocess import call prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') -datadir = path.join(prefix, 'share') +sharedir = path.join(prefix, 'share') destdir = environ.get('DESTDIR', '') # Package managers set this so we don't need to run -#if not destdir: - # NO CLAPPER ICON YET - #print('Updating icon cache...') - #call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')]) +if not destdir: + print('Updating icon cache...') + call(['gtk-update-icon-cache', '-qtf', path.join(sharedir, 'icons', 'hicolor')]) - # NO CLAPPER DESKTOP FILES YET - #print('Updating desktop database...') - #call(['update-desktop-database', '-q', path.join(datadir, 'applications')]) + print('Updating mime database...') + call(['update-mime-database', path.join(sharedir, 'mime')]) + + print('Updating desktop database...') + call(['update-desktop-database', '-q', path.join(sharedir, 'applications')]) # NO CLAPPER SCHEMAS YET #print('Compiling GSettings schemas...') - #call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')]) + #call(['glib-compile-schemas', path.join(sharedir, 'glib-2.0', 'schemas')]) diff --git a/data/com.github.rafostar.Clapper.desktop b/data/com.github.rafostar.Clapper.desktop new file mode 100644 index 00000000..56b7f14c --- /dev/null +++ b/data/com.github.rafostar.Clapper.desktop @@ -0,0 +1,17 @@ +[Desktop Entry] +Name=Clapper +GenericName=Multimedia Player +Comment=Play videos and music +Categories=GTK;GNOME;AudioVideo;Player;Video;TV; +MimeType=application/claps;application/mpeg4-iod;application/mpeg4-muxcodetable;application/mxf;application/ogg;application/ram;application/sdp;application/streamingmedia;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-ogg;application/x-streamingmedia;audio/3gpp;audio/3gpp2;audio/aac;audio/ac3;audio/amr;audio/amr-wb;audio/basic;audio/dv;audio/eac3;audio/flac;audio/m4a;audio/midi;audio/mp1;audio/mp2;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/mpg;audio/ogg;audio/opus;audio/scpls;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/vnd.dolby.mlp;audio/vnd.dts;audio/vnd.dts.hd;audio/vnd.rn-realaudio;audio/wav;audio/webm;audio/x-aac;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-mpg;audio/x-ms-asf;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-realaudio;audio/x-pn-wav;audio/x-real-audio;audio/x-realaudio;audio/x-s3m;audio/x-scpls;audio/x-shorten;audio/x-speex;audio/x-tta;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-wav;audio/x-wavpack;audio/x-xm;video/3gp;video/3gpp;video/3gpp2;video/divx;video/dv;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/mpeg-system;video/msvideo;video/ogg;video/quicktime;video/vnd.mpegurl;video/vnd.rn-realvideo;video/webm;video/x-avi;video/x-flc;video/x-fli;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-mpeg-system;video/x-mpeg2;video/x-ms-asf;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-msvideo;video/x-nsv;video/x-ogm+ogg;video/x-theora;video/x-theora+ogg;x-content/audio-cdda;x-content/audio-player;x-content/video-dvd;x-scheme-handler/mms;x-scheme-handler/mmsh;x-scheme-handler/rtmp;x-scheme-handler/rtp;x-scheme-handler/rtsp; +Exec=com.github.rafostar.Clapper %U +Icon=com.github.rafostar.Clapper +Terminal=false +Type=Application +# Translators: Search terms to find this application. Do NOT translate the semicolons! +Keywords=Video;Movie;Film;Clip;Series;Player;Playlist;DVD;TV;Disc;Album;Music;GNOME;Clapper; +Actions=new-window; + +[Desktop Action new-window] +Name=New Window +Exec=com.github.rafostar.Clapper --new-window diff --git a/data/com.github.rafostar.Clapper.svg b/data/com.github.rafostar.Clapper.svg new file mode 100644 index 00000000..aaeec71b --- /dev/null +++ b/data/com.github.rafostar.Clapper.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/com.github.rafostar.Clapper.xml b/data/com.github.rafostar.Clapper.xml new file mode 100644 index 00000000..121ece0f --- /dev/null +++ b/data/com.github.rafostar.Clapper.xml @@ -0,0 +1,8 @@ + + + + Clapper Playlist + + + + diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 00000000..6b684621 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,12 @@ +sharedir = join_paths(get_option('prefix'), 'share') +iconsdir = join_paths(sharedir, 'icons', 'hicolor') + +install_data('com.github.rafostar.Clapper.svg', + install_dir: join_paths(iconsdir, 'scalable', 'apps') +) +install_data('com.github.rafostar.Clapper.xml', + install_dir: join_paths(sharedir, 'mime', 'packages') +) +install_data('com.github.rafostar.Clapper.desktop', + install_dir: join_paths(sharedir, 'applications') +) diff --git a/meson.build b/meson.build index fe50298b..0d9aed0b 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,7 @@ conf.set('bindir', join_paths(get_option('prefix'), 'bin')) subdir('bin') subdir('gjs-1.0') +subdir('data') installdir = join_paths(get_option('prefix'), 'share', meson.project_name()) install_subdir('clapper_src', install_dir : installdir)