Commit Graph

1037 Commits

Author SHA1 Message Date
Rafał Dzięgiel
c395c6b9be Merge pull request #262 from Rafostar/reloaded
plugin: Make modules management separate per instance
2022-05-20 11:28:27 +02:00
Rafał Dzięgiel
8301cded2f plugin: Make modules management separate per instance
There were various problems with importer loader code. One defect was that
it kept managing a single global list of available importers and marking
which one is currently used on it. This made it not work correctly for
multiple sink instances in single process and was not thread safe.

This commit changes importer loader code into a GstObject subclass, which
keeps its own list of importers per instance and unlike before makes it
possible to free this data from memory when destroyed.

Now only open modules are kept always in memory until process finishes
since we cannot unload them once loaded anyway.
2022-05-20 10:13:14 +02:00
Rafał Dzięgiel
34386bc96c plugin: Use different lock for importer within paintable
This way we can avoid an additional importer ref + unref for every frame draw
2022-05-18 19:25:00 +02:00
Rafał Dzięgiel
2b85afc03e plugin: Do not use weak ref on importer
There is no good reason to keep using weak ref on importer within paintable object. Change that to a gst_object_ref which is faster.
2022-05-18 18:28:20 +02:00
Rafał Dzięgiel
bb56efa705 Merge pull request #261 from Rafostar/adw-fixes
libadwaita CSS fixes
2022-05-18 12:26:52 +02:00
Rafał Dzięgiel
82922e51f9 flatpak: Update GTK4 to 4.6.4
With latest GTK 4.6.4 the issues with opening popovers are finally fixed. Stop patching older version and just build the latest one.
2022-05-18 11:39:07 +02:00
Rafał Dzięgiel
ca64d9d2ee flatpak: Build recent libadwaita version
With updated CSS we use some variables intoduced in stable versions of libadwaita. To make it work properly, stop using alpha.2 and build recent stable version.
2022-05-18 11:39:04 +02:00
Rafostar
2a18c6a374 css: Misc fixes for recent Adwaita theme
Fixes for recent libadwaita provided theme, mainly needed to workaround:
https://gitlab.gnome.org/GNOME/libadwaita/-/issues/454

Devs rejected my idea of fixing it upstream. They said to override it
in my own app. So here it is.
2022-05-18 11:38:56 +02:00
Rafał Dzięgiel
af6cf01c98 player: Remove hardcoded ring buffer value
We should aim to have this as a configurable option.
Until then lets use the default value.
2022-05-17 22:07:21 +02:00
Rafał Dzięgiel
85bdbb1132 plugin: Prefer GL over GLES on macOS
Apple decoder uses rectangle texture-target, which GLES does not support
2022-05-16 19:16:36 +02:00
Rafał Dzięgiel
8e89b0d8ca gschema: Make resume video option disabled by default
A resume video question dialog that keeps poping confuses new Clapper users.
Looks like some spam. Change default option value to be disabled, so people
that are interested in this feature can enable it in preferences.
2022-05-16 09:45:36 +02:00
Rafostar
4e3cc3e23f plugin: Set initial display resolution to 1x1
We do not support zero width/height (described in our caps). Set initial video
dimensions to 1x1. They are going to be updated on first buffer after video info is set.

This avoids running into https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1139
and makes sure we do not do any divisions by zero here either.
2022-05-15 20:02:01 +02:00
Rafostar
c6c43346fa lib: Replace usage of "g_str_equal" with "g_strcmp0"
The first one is meant for hash tables comparisons and does not guard against NULL values (#259).
2022-05-15 14:45:49 +02:00
Rafał Dzięgiel
be58af2256 Merge pull request #256 from Rafostar/gl-win
plugin: Add GL support for Windows OS
2022-05-13 16:34:26 +02:00
Rafał Dzięgiel
343eef5894 plugin: Add GL support for Windows OS
Add support for both WGL and EGL on Win32
2022-05-13 15:17:53 +02:00
Rafał Dzięgiel
04657017f9 Merge pull request #257 from Rafostar/gl-macos
plugin: Add GL support for macOS
2022-05-13 14:12:09 +02:00
Rafał Dzięgiel
1cdaa36559 plugin: Add GL support for macOS 2022-05-13 13:53:35 +02:00
Rafał Dzięgiel
f351982067 plugin: Handle premultiplied alpha in RAW frames
Add support for premultiplied alpha flag detection when creating GdkMemoryTextures.
Also check if overlays have premultiplied alpha and if they do set this flag for
their video info, so it will be detected when creating a GdkMemoryTexture out of them.

Fixes performance issues with karaoke subtitles, as now GTK does not have to perform
unnecessary multiplication.
2022-05-12 18:08:53 +02:00
Rafał Dzięgiel
ae531db2b7 plugin: Have a separate mutex lock in GL base class
Make GL base importer class and all its subclasses that access parent props,
use a different mutex lock then the main importer class.

This way main importer class can continue processing buffers without waiting for
GL-based subclasses, as most GL operations (e.g. upload) are time consuming.
2022-05-11 22:00:49 +02:00
Rafał Dzięgiel
66fb8d4a1f Merge pull request #255 from Rafostar/fixes
Misc fixes
2022-05-11 21:21:33 +02:00
Rafał Dzięgiel
8f0ad12795 meson: Make sink compile on Windows OS
We cannot compile app as a whole on MS Windows yet, but with those changes it is now possible to compile and run our new video sink alone on Windows OS
2022-05-11 18:55:06 +02:00
Rafał Dzięgiel
908a388f68 meson: Give up on building GL base without GL windowing
We do not want to build GL-based importers when GTK GL windowing support is missing,
which might happen because of missing deps or on unsupported platform
2022-05-11 18:55:03 +02:00
Rafał Dzięgiel
7f33db4159 plugin: Fix possible buffer and v_info mismatch 2022-05-11 18:54:48 +02:00
Rafał Dzięgiel
288b829139 Further alter default plugin feature ranks on startup
Too many problems with VAAPI decodebin, meanwhile VA works fine and there is already
a pending MR on GStreamer to enable it by default, so we do that a little early.

We also do promise working HW accel out of box, so enable all common NVDEC elements too.
They can always be disabled back in player preferences window if any problems do happen.

We can now remove the alternations of v4l2codecs as those are PRIMARY+1 by default and we
now require GStreamer 1.20+ so no need for version checking there too.

Fixes #236
2022-05-11 11:50:15 +02:00
Rafał Dzięgiel
aa6d21973c gschema: Disable download buffering by default
We had this option enabled to workaround problems with old YT code.
Adaptive streaming now seems to work correctly, so restoring the
default play flags value.
2022-05-10 13:57:11 +02:00
Rafał Dzięgiel
e506063409 gschema: Remove leftover web app settings 2022-05-10 12:09:30 +02:00
Rafał Dzięgiel
e679430d3e meson: Set plugin option to be auto by default
This should allow to still compile and use the player with the legacy sink, without changing meson default options
2022-05-09 12:39:41 +02:00
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
00650a596f obs: Use "trigger_services" step
Instead "rebuild_package" use "trigger_services" for OBS integration, otherwise the same old package is rebuild again and again.
2022-05-06 18:57:12 +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
01b3feb213 New Crowdin updates (#247)
* New translations com.github.rafostar.Clapper.pot (Chinese Simplified)

* New translations com.github.rafostar.Clapper.pot (Portuguese)
2022-05-06 17:36:53 +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
b37ab432d7 player: Use new "clappersink" element
Use brand new clapper video sink for video output. Also add "CLAPPER_USE_LEGACY_SINK" env
to still allow the usage of old video sink if any problems arise.
2022-05-05 11:17:28 +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
b83d500352 Merge pull request #245 from Rafostar/crowdin_sync
New Crowdin updates
2022-04-11 21:02:50 +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
f8fe49a809 obs: Add "workflows.yml" file 2022-04-11 18:08:52 +02:00
Rafał Dzięgiel
264f0abb64 New translations com.github.rafostar.Clapper.pot (Dutch) 2022-04-08 18:14:27 +02:00
Rafał Dzięgiel
b330aa1ccd workflow: Increase default timeout time
AArch64 build is taking a lot of time...
2022-04-08 17:27:38 +02:00
Rafał Dzięgiel
de8ecb8f82 flatpak: Do not build pango anymore
GNOME 42 runtime includes version that is new enough
2022-04-08 17:08:32 +02:00
Rafał Dzięgiel
a2bb927502 Update LINGUAS file 2022-04-08 10:08:05 +02:00
Rafał Dzięgiel
df728f383b Merge pull request #237 from Rafostar/crowdin_sync
New Crowdin updates
2022-04-08 10:01:39 +02:00
Rafał Dzięgiel
c80d2e9fd6 New translations com.github.rafostar.Clapper.pot (Turkish) 2022-04-02 03:43:30 +02:00
Rafał Dzięgiel
5a00301935 New translations com.github.rafostar.Clapper.pot (Turkish) 2022-04-02 02:44:03 +02:00