Add desktop file, icon and "application/claps" mime type

This commit is contained in:
Rafostar
2020-09-17 18:57:40 +02:00
parent 2225aa2343
commit 932849af92
7 changed files with 109 additions and 36 deletions

View File

@@ -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. 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 ### 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: This is still early WIP. Many features are not implemented yet and quite a few are still unstable.
```shell
com.github.rafostar.Clapper "video.mp4"
```
### Playlists ### Features:
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: <details>
<summary><b>Playlists</b></summary>
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 ```shell
ls *.mp3 > music.claps ls *.mp3 > music.claps
``` ```
Once you have a playlist, open it with Clapper like any other file: Once you have a playlist, open it with Clapper like any other file.
```shell 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?
com.github.rafostar.Clapper "music.claps" </details>
<details>
<summary><b>Hardware acceleration</b></summary>
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.
</details>
## Requirements ## Requirements
Clapper uses `GStreamer` bindings from `GI` repository, so if your distro ships them as separate package, they must be installed first. Clapper uses `GStreamer` bindings from `GI` repository, so if your distro ships them as separate package, they must be installed first.
@@ -96,21 +117,5 @@ makepkg -si
``` ```
</details> </details>
## 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 ## Special Thanks
Many thanks to [sp1ritCS](https://github.com/sp1ritCS) for creating and maintaining package build files. Many thanks to [sp1ritCS](https://github.com/sp1ritCS) for creating and maintaining package build files.

View File

@@ -4,19 +4,20 @@ from os import environ, path
from subprocess import call from subprocess import call
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local') prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share') sharedir = path.join(prefix, 'share')
destdir = environ.get('DESTDIR', '') destdir = environ.get('DESTDIR', '')
# Package managers set this so we don't need to run # Package managers set this so we don't need to run
#if not destdir: if not destdir:
# NO CLAPPER ICON YET print('Updating icon cache...')
#print('Updating icon cache...') call(['gtk-update-icon-cache', '-qtf', path.join(sharedir, 'icons', 'hicolor')])
#call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
# NO CLAPPER DESKTOP FILES YET print('Updating mime database...')
#print('Updating desktop database...') call(['update-mime-database', path.join(sharedir, 'mime')])
#call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
print('Updating desktop database...')
call(['update-desktop-database', '-q', path.join(sharedir, 'applications')])
# NO CLAPPER SCHEMAS YET # NO CLAPPER SCHEMAS YET
#print('Compiling GSettings schemas...') #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')])

View File

@@ -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

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 256 256" width="256" height="256">
<defs>
<path d="M27.2 243.52C27.2 236.16 27.2 199.83 27.2 134.22C47.64 134.22 211.12 134.22 231.56 134.22C231.56 199.83 231.56 236.16 231.56 243.52C231.56 250.4 225.96 256 218.92 256C183.07 256 57.77 256 39.84 256C32.8 256 27.2 250.4 27.2 243.52Z" id="b1nGq5BrLC"></path>
<path d="M24.32 103.65C24.32 106.22 24.32 127.02 24.32 129.58C24.32 132.78 26.72 135.18 29.92 135.18C50.41 135.18 215.08 135.18 235.72 135.18C238.76 135.18 241.32 132.78 241.32 129.58C241.32 127.02 241.32 106.22 241.32 103.65C241.32 100.45 238.76 98.05 235.72 98.05C194.59 98.05 50.41 98.05 29.92 98.05C26.72 98.05 24.32 100.45 24.32 103.65Z" id="a3jkaoNn4k"></path>
<path d="M174.59 135.18L211.87 98.05L171.07 98.05L133.78 135.18L174.59 135.18Z" id="atpVQ8mnd"></path>
<path d="M76.81 135.18L114.1 98.05L73.13 98.05L35.84 135.18L76.81 135.18Z" id="bMtYoNHu0"></path>
<path d="M19.04 69.41C19.84 71.97 25.92 91.97 26.72 94.37C27.68 97.41 30.72 99.01 33.76 98.05C54.09 91.81 216.68 42.04 237 35.8C240.04 35 241.64 31.8 240.84 28.92C240.04 26.36 233.96 6.36 233.16 3.96C232.2 0.92 229.16 -0.68 226.12 0.28C185.47 12.6 43.21 56.29 22.88 62.53C19.84 63.33 18.24 66.53 19.04 69.41Z" id="b5oP0Glp4"></path>
<path d="M176.51 54.37L129.94 29.4L169.15 17.56L215.72 42.52L176.51 54.37Z" id="lwBgev6DR"></path>
<path d="M81.61 83.49L35.04 58.69L74.25 46.69L120.82 71.49L81.61 83.49Z" id="cUsjEMRUu"></path>
<path d="M14.72 66.69C14.72 72.93 14.72 123.02 14.72 129.26C14.72 132.62 17.44 135.18 20.64 135.18C26.56 135.18 74.09 135.18 80.01 135.18C84.33 135.18 87.21 130.86 85.61 127.02C82.89 120.78 61.45 70.53 58.73 64.29C57.77 62.05 55.69 60.77 53.29 60.77C46.73 60.77 24 60.77 20.64 60.77C17.44 60.77 14.72 63.33 14.72 66.69Z" id="c1bcHZGXe"></path>
<path d="M32.64 60.61C31.52 60.61 21.92 60.61 20.64 60.61C17.44 60.61 14.72 63.33 14.72 66.53C14.72 72.77 14.72 123.02 14.72 129.26C14.72 132.46 17.44 135.18 20.64 135.18C21.92 135.18 31.52 135.18 32.64 135.18C29.44 135.18 26.72 132.46 26.72 129.26C26.72 116.62 26.72 72.77 26.72 66.53C26.72 63.33 29.44 60.61 32.64 60.61Z" id="f2PtH0V1vC"></path>
<path d="M231.56 135.18C231.56 143.82 231.56 148.46 231.56 149.42C231.56 149.42 231.56 149.42 231.56 149.42C108.98 149.42 40.8 149.42 27.2 149.42C27.2 149.42 27.2 149.42 27.2 149.42C27.2 140.94 27.2 136.14 27.2 135.18C27.2 135.18 27.2 135.18 27.2 135.18C149.78 135.18 217.96 135.18 231.56 135.18C231.56 135.18 231.56 135.18 231.56 135.18Z" id="a1SvrrkqVm"></path>
<path d="M165.79 199.83L101.78 160.62L101.78 238.88L165.79 199.83Z" id="agXcvKqh8"></path>
</defs>
<g>
<g><use xlink:href="#b1nGq5BrLC" fill="#4747d1"></use></g>
<g><use xlink:href="#a3jkaoNn4k" fill="#4747d1"></use></g>
<g><use xlink:href="#atpVQ8mnd" fill="#f1f1f1"></use></g>
<g><use xlink:href="#bMtYoNHu0" fill="#f1f1f1"></use></g>
<g><use xlink:href="#b5oP0Glp4" fill="#4747d1"></use></g>
<g><use xlink:href="#lwBgev6DR" fill="#f1f1f1"></use></g>
<g><use xlink:href="#cUsjEMRUu" fill="#f1f1f1"></use></g>
<g><use xlink:href="#c1bcHZGXe" fill="#a9a9a9"></use></g>
<g><use xlink:href="#f2PtH0V1vC" opacity="0.2" fill="#000000"></use></g>
<g><use xlink:href="#a1SvrrkqVm" opacity="0.2" fill="#000000"></use></g>
<g><use xlink:href="#agXcvKqh8" fill="#f1f1f1"></use></g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/claps">
<comment>Clapper Playlist</comment>
<glob pattern="*.claps"/>
<icon name="com.github.rafostar.Clapper"/>
</mime-type>
</mime-info>

12
data/meson.build Normal file
View File

@@ -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')
)

View File

@@ -17,6 +17,7 @@ conf.set('bindir', join_paths(get_option('prefix'), 'bin'))
subdir('bin') subdir('bin')
subdir('gjs-1.0') subdir('gjs-1.0')
subdir('data')
installdir = join_paths(get_option('prefix'), 'share', meson.project_name()) installdir = join_paths(get_option('prefix'), 'share', meson.project_name())
install_subdir('clapper_src', install_dir : installdir) install_subdir('clapper_src', install_dir : installdir)