Commit Graph

122 Commits

Author SHA1 Message Date
Rafał Dzięgiel
4b93d4d132 meson: Cleanup plugin build script 2022-05-08 18:47:13 +02:00
Rafał Dzięgiel
b7b99c20cf meson: Do not go down in lib versioning
Install plugin lib stuff into a dir named "clapper-1.0" instead of "clapper-0.0". Even through our API is still very unstable, we cannot go down with versioning. The sink importers being installed there are not part of public API anyway.
2022-05-08 13:54:55 +02:00
Rafał Dzięgiel
5775738f67 plugin: Fix possible dir enumerator NULL unref
On an unlikely chance that sink was compiled without any importers, iterated dir does not exists thus we try to unref a NULL. Avoid doing that.
2022-05-07 13:43:51 +02:00
Rafał Dzięgiel
7159459160 meson: Cleanup of plugin build script 2022-05-06 21:08:03 +02:00
Rafał Dzięgiel
6a995e2143 Merge pull request #253 from Rafostar/clappersink2
Move away from GtkGLArea
2022-05-06 17:52:56 +02:00
Rafał Dzięgiel
5b9e7eacba meson: Do not auto build rawimporter when building gluploader
No need to auto build rawimporter if we are building gluploader as it
will be always loaded on startup, but never used.

Skip the build of it when its meson option is set to "auto".
2022-05-06 11:42:47 +02:00
Rafostar
0410c6e9b5 plugin: Add GL uploader
Add "clappergluploader" module which uses "glupload" and "glcolorconvert" internally,
allowing either uploading RAW system memory into GPU with GL colorspace conversion or
importing DMABufs into GL memory and making a GdkTexture out of them at one go.
2022-05-05 11:17:17 +02:00
Rafostar
3e0a0e0555 plugin: Add GL memory importer
Add "clapperglimporter" and a base class for creating GL importers. This module allows importing GL memory into GdkTexture.
2022-05-05 11:17:04 +02:00
Rafostar
5b7b7085e4 plugin: Add RAW system memory importer
Add "clapperrawimporter" module which allows importing RAW system memory mapped frames
2022-05-05 11:16:44 +02:00
Rafostar
044710f97e plugin: Add clapper GStreamer plugin
Add new GStreamer plugin with custom video sink for Clapper video player.

The main difference is that unlike the old one, this does not operate using `GtkGLArea`
anymore, but processes and displays `GdkTextures` directly through `GtkPicture` widget.
Also this one is installed like any other GStreamer plugin, thus can be used via
`gst-launch-1.0` binary or even by other GTK4 apps if they wish to integrate it.

In order to not depend on GL stuff at build time, this plugin uses seperate GModules
called "importers" in order to import different kind of memories into GdkTexture. This
allows expanding its capabilities further then we were able to do before.
2022-05-05 11:16:34 +02:00
Rafał Dzięgiel
3fadf13125 api: Also check "USE_PLAYBIN3" env
Some mobile distros seem to be under assumption that playbin3 is required to
get HW accel and setting this env by default is good idea. Both are wrong.

Check this env presence to avoid problems as factory will always return
playbin3 if set (even if playbin2 was requested).
2022-04-11 19:44:05 +02:00
Rafał Dzięgiel
0db2a4a045 gstclapper: Fix plugin feature leak 2022-01-14 09:28:26 +01:00
Rafostar
469c06d22b gstclapper: Go into NULL state directly when stopped
Instead of waiting another 60 seconds for user, go into NULL state ASAP to free all resources and open devices.
2022-01-09 13:31:37 +01:00
Rafostar
3feaf225b5 gstclapper: Make tags writable before insert
Someone might be holding a copied media info in which case tag
list ref count is not 1. Use gst_tag_list_make_writable to
assure that ref count is 1, so we can insert more tags into the list.
2022-01-09 13:31:29 +01:00
Rafał Dzięgiel
50aac8cdd8 gstclapper: Merge global tags instead replacing them
There is no guarantee that received later tags also contain values from
earlier ones, as they might come from different element.
Combine them instead while replacing old values with newer ones.
2021-12-02 08:52:35 +01:00
Rafał Dzięgiel
b853685dd4 gstclapper: Fix decoder stream ID string leak 2021-10-22 13:11:42 +02:00
Rafał Dzięgiel
15461dd38a gstclapper: Fix video/audio decoder change detection
The video/audio decoder changed signal was not working correctly in case of
multiple streams with multiple decoders in single file.

We need to listen to the current-(video/audio) signal, when it changes find
corresponding "input-selector", get stream ID from its active pad and then
find the decoder in the pipeline that handles this stream ID. Similarly for
playbin3, but use stream ID from the "streams-selected" signal.
2021-10-22 11:05:08 +02:00
Rafał Dzięgiel
1c1989bc32 gstclapper: Fix GST_PLUGIN_FEATURE_RANK env usage
We change few default plugin ranks during init to whitelist them, but we do not update
their values from GST_PLUGIN_FEATURE_RANK env afterwards, so do that.
The ENV should be preferred over default config.
2021-10-21 11:21:07 +02:00
Rafał Dzięgiel
9fc1d9b8c4 sink: Do not leak pool when set config fails 2021-09-15 16:28:23 +02:00
Rafał Dzięgiel
2500a42286 Fix missing gio-unix-2.0 dep
Our autogenerated MPRIS code needs it. On some packaging systems this might be included outside of glib, so depend on it explicitly.
2021-09-14 17:54:03 +02:00
Rafał Dzięgiel
6cddb1a16d meson: Cleanup build files
Remove some twice declared variables and keep code style
2021-09-08 20:44:12 +02:00
Rafał Dzięgiel
98d2b80103 Add PiP and play icons as gresource
Add missing PiP icons from web devel kit. Also add play/pause
icons at the right size and remove all workarounds/scaling
implemented or these two.

Playback icons are always two bars for pause and triangle for play,
so hopefully this will not be problematic, as this guaranties the
right size for them that Adwaita unfortunately cannot provide.
2021-09-07 19:34:59 +02:00
Rafał Dzięgiel
99acd36cc0 api: Always start unmuted 2021-09-06 13:18:57 +02:00
Rafał Dzięgiel
d49df86397 api: Replace mute-changed signal with mute notify
Notify is enough, we do not need a separate signal for mute property. This also allows binding this property to some other GObject props.
2021-09-06 12:18:32 +02:00
Rafostar
d0304d4ded mpris: Allow reading properties 2021-09-04 18:57:08 +02:00
Rafał Dzięgiel
cd479f3bb4 api: Set fakesink to be sync
Otherwise seeking will not be possible when this sink is used
2021-09-03 20:32:17 +02:00
Rafał Dzięgiel
cccc584961 api: Use fakesink when PipeWire enabled but unavailable
Instead of misleading users that they are using PipeWire after enabling it, use fakesink in order to not output any sound at all
2021-09-03 11:50:40 +02:00
Rafał Dzięgiel
cf6d41b725 api: Add property to control PipeWire enablement 2021-09-03 11:12:48 +02:00
Rafał Dzięgiel
b68c1a62b2 api: Add property to control playbin3 enablement 2021-09-03 10:59:44 +02:00
Rafał Dzięgiel
0323c816ad api: Use GstElementFactoryListType to detect decoders
Using simply GST_IS_VIDEO_DECODER is not enough as some special cases like vaapidecodebin are not using decoder base class
2021-09-01 17:41:31 +02:00
Rafał Dzięgiel
27ffb65d8f api: Remove unused declaration 2021-08-28 10:29:12 +02:00
Rafał Dzięgiel
9328a7af75 meson: Warn about unused variables 2021-08-28 10:27:44 +02:00
Rafał Dzięgiel
9b53a3e387 api: Fix plugin feature unref 2021-08-24 20:52:18 +02:00
Rafał Dzięgiel
5874db45ea api: Introduce custom gstreamer init function
Initializes GStreamer library and tweaks some of its defaults to our liking.
This also allows usage of GstClapper API alone without importing GStreamer on the implementation side.

It changes preferred hardware acceleration order (depending on plugins versions) into:
v4l2sl -> nv -> va -> vaapi -> v4l2
2021-08-24 14:15:29 +02:00
Rafał Dzięgiel
d798539dce Merge pull request #128 from Rafostar/gles
Cleanup GL init and use GLES if GTK is using it
2021-08-01 13:47:24 +02:00
Rafostar
19e159d1bd sink: Cleanup GL context init code 2021-08-01 12:44:35 +02:00
Rafał Dzięgiel
b308ae367f sink: When GTK is using GLES on EGL, use it too
If for some reason GTK ended up with using EGL with GLES instead of OpenGL and user
did not specify anything other, use it by default in gstreamer part of the app too.
2021-07-28 18:00:08 +02:00
Rafostar
90844e49ad API: Add video/audio decoder changed signals 2021-07-28 12:02:52 +02:00
Rafał Dzięgiel
e40f11def5 sink: Small code cleanup 2021-07-16 23:50:26 +02:00
Rafał Dzięgiel
0f1447b14e sink: Check navigation state with a lock held
This happens as callback from GTK thread, so its not thread safe
2021-07-13 19:57:31 +02:00
Rafał Dzięgiel
3bf636d46b sink: Do not send navigation events when not playing
Before playback starts our video display size is zero, no point in sending navigation events in such case.
Latest gstreamer git prints criticals in such case.

Also do not send mouse navigaion when element is paused and skip keypresses when below paused state.
2021-07-08 20:33:12 +02:00
Rafał Dzięgiel
2e776ddf7b sink: Support rendering external-oes textures
This significantly improves performance on mobile devices by
removing the texture copy from an OES texture to 2D texture.
2021-07-05 22:08:51 +02:00
Rafał Dzięgiel
e1845a212f Merge pull request #87 from Rafostar/pipewire
Add PipeWire support
2021-06-20 15:46:03 +02:00
Rafostar
1c414ef36b API: allow using PipeWire for audio output
Instead of using PulseAudio sink and making a round way through pipewire-pulse,
access and use PipeWire directly for audio output when user sets env var
GST_CLAPPER_USE_PIPEWIRE=1
2021-06-20 11:27:43 +02:00
Rafał Dzięgiel
21ccab1cc2 Add option to keep showing last video frame after playback
Previously Clapper showed last frame, now it defaults to black screen, so add an option for users to choose what they like better
2021-06-16 15:34:36 +02:00
Rafał Dzięgiel
bea3b1670d API: Raise ignored duration changes to 250 milliseconds
We do not show milliseconds in GUI, so we should not try to handle stream gaps that short.
2021-06-16 11:07:50 +02:00
Rafał Dzięgiel
0d4d3f1a8c sink: Avoid props code duplication 2021-06-16 09:43:55 +02:00
Rafał Dzięgiel
fc525ffcb1 sink: EGL on X11 from GTK 4.3.1
Recent GTK 4.3.1 release already uses EGL on x11, so lower the version check to that version
2021-06-15 16:52:47 +02:00
Rafał Dzięgiel
6f1a5626bc API: get MPRIS with a lock
Otherwise it is not thread safe
2021-06-15 16:16:29 +02:00
Rafał Dzięgiel
c0b92c190b mpris: Fix wrong object type
Fix a copy-paste bug
2021-06-05 22:24:26 +02:00