Commit Graph

1457 Commits

Author SHA1 Message Date
Rafał Dzięgiel
54efc98166 clapper: Fix media items leak when parsing URI list
Unlike other array containers, GListStore append function
refs object internally, so unref afterwards is needed.
2025-11-25 20:24:18 +01:00
Rafał Dzięgiel
48d7f48212 clapper: Media item construction code cleanup
Slight cleanup related to media item construction.
Also fixes an issue where item ID was not being set when
created with g_object_new (what bindings usually use).
2025-11-25 20:20:49 +01:00
Rafał Dzięgiel
f0d27b01ef clapper: Modify URI of media item from GFile in-place
When creating item from GFile, modify URI in-place if needed (avoid a copy)
2025-11-25 19:13:57 +01:00
Rafał Dzięgiel
4cae6d4aed clapper: Use atomic operations for item ID generation 2025-11-25 19:02:24 +01:00
Rafał Dzięgiel
3c00dc61d6 Merge pull request #594 from Rafostar/devel
Playlists handling changes and bugfixes
2025-11-23 19:28:14 +01:00
Rafał Dzięgiel
50d7ae4b2a clapper: Add readable "redirect-uri" property to media item
Allow applications to inspect permanent redirect URIs of media items
in a similar manner as done for "cache-location" property
2025-11-23 18:46:51 +01:00
Rafał Dzięgiel
9e1622976a clapper: Make media item "cache-location" a readable property 2025-11-23 18:46:41 +01:00
Rafał Dzięgiel
872c049af8 clapper: Skip default cache location set at item construction
It is already NULL for newly created media item and otherwise
debug printing for this property being changed to NULL for each
media item is confusing
2025-11-23 14:45:13 +01:00
Rafał Dzięgiel
27fd2e0225 clapper: Ensure redirects for an item are from single source
In cases where there are multiple objects resolving a playlist at once
(e.g. player starts playing playlist item that Media Scanner also works on),
just ignore parsing results from the other parser. We keep/use parsing
results from whichever parser parsed the playlist first.
2025-11-23 14:45:11 +01:00
Rafał Dzięgiel
05b7314b73 clapper: Reworked infinite nested playlists detection
Instead of doing this inside player, logic was reworked and moved into playlist demuxer
itself. It uses GstQueries to communicate with upstream elements. This way we can post
an error from running pipeline which helps keep this logic in single place and have it
shared with other pipelines (like the one used in Media Scanner Enhancer).

As part of the rework, nested playlist limit was added and set to 10 redirects.
Seems like a safe/optimal number and this simplifies stuff a lot. Instead of
keeping a list of strings with previous redirected URIs, we can just store the
one most recent in media item.
2025-11-23 14:45:02 +01:00
Rafał Dzięgiel
4acb3e38b3 clapper: Post playlist message before setting next URI
Fixes a problem where error message from unplayable URI content
(e.g. non-existing file) arrives on pipeline bus before resolved
playlist which contains that URI.

With this change, a playlist can be resolved into individual items
which are put into queue even if first item of it is unplayable.
2025-11-21 18:52:06 +01:00
Rafał Dzięgiel
9e955f4e5f clapper: Prevent concurrent cache cleanups
We do not want to create situations where multiple threads are running
cache cleanup at once (since they all think last one was run long ago).
This can be prevented with a combination of global mutex and a "trylock",
so we can simply avoid both mutex locking and starting another cleanup.
2025-11-21 18:52:04 +01:00
Rafał Dzięgiel
10bb4365a0 clapper: Use correct types for enums/flags in playbin bus
We send read them as simple integers, thus we should send them as such instead of using GObject Flag or Enum types.
2025-11-21 18:52:00 +01:00
Rafał Dzięgiel
a9cdbf8626 clapper: Mark item title as always parsed
This should be used internally for whether title is still used from parsing, not if parsing was successful.

Fixes an issue where in such cases correct title is not updated later on.
2025-11-21 18:51:58 +01:00
Rafał Dzięgiel
e85be687d6 clapper: Add messaging between app, reactables and player
In some cases, simple properties in reactable enhancers are not enough.
This allows enhancers to do something on a signal from user (e.g. button/shortcut press).

It can also be used to communicate with the player for things that were
already done externally (like playlist parsing in Media Scanner enhancer).
2025-11-21 18:51:54 +01:00
Rafał Dzięgiel
1ae7d8dead clapper: Deprecate Discoverer feature
It was ported to Clapper Enhancers repo as a plugin and applications
using old one should slowy move towards using new implementation instead.
2025-11-21 18:34:00 +01:00
Rafał Dzięgiel
84edc142ab clapper: Prefer media scanner enhancer over legacy discoverer feature 2025-11-21 18:33:16 +01:00
Rafał Dzięgiel
39e225d70d Merge pull request #591 from Rafostar/proxy-jobs
clapper: Add simple enhancer proxy jobs management
2025-11-10 18:37:24 +01:00
Rafał Dzięgiel
acf99586ab clapper: Add simple enhancer proxy jobs management
Allows to mark a job with a given ID as started, then when another thread/instance
wants to process the same ID we can detect it and await previous job finish.
This is especially useful for not extracting the same URI concurrently while
still allowing to process multiple different URIs at once without blocking.
2025-11-06 18:44:40 +01:00
Rafał Dzięgiel
b41949fb87 Merge pull request #585 from Rafostar/enhancers-keyfile
Store enhancers settings in separate config file
2025-08-11 18:26:28 +02:00
Rafał Dzięgiel
38752a3832 doc: clapper: Document how to share enhancers config between Flatpaks 2025-08-11 17:32:52 +02:00
Rafał Dzięgiel
659de80741 clapper: Store enhancers settings in separate config file
By enforcing keyfile GSettings backend with a custom file path,
we can store all enhancers settings within known location.
It makes it much easier to share them in between apps in Flatpak.
2025-08-11 17:32:38 +02:00
Rafał Dzięgiel
d2ceb962f1 Merge pull request #584 from Rafostar/additional-docs
doc: Additional migration docs
2025-08-08 19:12:52 +02:00
Rafał Dzięgiel
ff3df7a8bf doc: clapper: Fix typo 2025-08-08 17:52:50 +02:00
Rafał Dzięgiel
31c230dde6 doc: clapper-gtk: Add migrating to 0.10 guide 2025-08-08 10:14:47 +02:00
Rafał Dzięgiel
91b7a0f1a5 Merge pull request #583 from Rafostar/additional-docs
doc: clapper: Additional documentation about enhancers
2025-08-07 22:50:50 +02:00
Rafał Dzięgiel
8d002397df doc: clapper: Additional documentation about enhancers 2025-08-07 22:35:38 +02:00
Rafał Dzięgiel
b9e98e2fdb Merge pull request #581 from Rafostar/flatpak-enhancers
flatpak: Reverse enhancers extension preference order
2025-08-04 20:31:52 +02:00
Rafał Dzięgiel
555b93451e flatpak: Reverse enhancers extension preference order
It seems that Flatpak selects first available branch from the end, not start
2025-08-04 20:13:42 +02:00
Rafał Dzięgiel
cdfac76d66 Merge pull request #580 from Rafostar/versioning
lib: Add runtime version information
2025-08-03 20:11:59 +02:00
Rafał Dzięgiel
ed13d53db9 clapper-gtk: Add runtime version information
Allows apps to check the library version app
is run against, contrary to compiled against
2025-08-03 15:18:44 +02:00
Rafał Dzięgiel
acf2b75f27 clapper: Add runtime version information
Allows apps to check the library version app
is run against, contrary to compiled against
2025-08-03 15:12:28 +02:00
Rafał Dzięgiel
d9c8534bb7 Merge pull request #579 from Rafostar/audio
clapper-gtk: Add audio widget
2025-08-03 14:23:20 +02:00
Rafał Dzięgiel
292b339e8a clapper-app: Use actions from AV widget
Replace all usage of "video" actions with "av" as the former one is deprecated
2025-08-03 13:36:34 +02:00
Rafał Dzięgiel
ddfedddce5 clapper-app: Use player from AV widget
Replace all usage of "clapper_gtk_video_get_player" with
"clapper_gtk_av_get_player" as the former one is deprecated
2025-08-02 20:57:03 +02:00
Rafał Dzięgiel
743097060e gst: sink: Remove unused posting of navigation messages
We only need to post events in the pipeline for navigation to work.
This was never used for anything and it generates a lot of noise
in the pipeline bus when cursor is moving over video.
2025-08-02 20:50:26 +02:00
Rafał Dzięgiel
b0b15cec5c clapper: Add "message" signal to the player
A detailed signal that allows for applications to receive element
messages posted on the pipeline bus. Useful if app cares about
some custom message that player normally does not handle.

For example audio player might want to read "level" messages in
order to show current audio level or implement visualizations.
2025-08-02 20:50:24 +02:00
Rafał Dzięgiel
b9a8b28a1f examples: Add audio player python example
A simple audio player made using "ClapperGtkAudio"
widget with python3 GI bindings
2025-08-02 20:50:22 +02:00
Rafał Dzięgiel
4c8c76c8f7 clapper-gtk: Introduce "ClapperGtkAudio" widget
A widget similar to video but for audio playback only. Widgets from
ClapperGtk library like buttons, seek bar, etc. can be used in it
for building an audio player with ease.
2025-08-02 20:50:20 +02:00
Rafał Dzięgiel
a5db6f701d clapper-gtk: Use AV widget actions directly
Actions of video widget are being deprecated in favour of
the same actions in the recently added AV base class
2025-08-02 20:50:18 +02:00
Rafał Dzięgiel
4301a9a9fa clapper-gtk: video: Split code into subclass
Create a base class called "ClapperGtkAv" and subclass it into "ClapperGtkVideo".
This allows to have player and session inhibit logic in base class and share it
with other subclassed widgets.
2025-08-02 20:50:10 +02:00
Rafał Dzięgiel
c21e1c1c6a Merge pull request #578 from City-busz/window-group
Put each main window into its own group
2025-08-01 16:09:41 +02:00
Balló György
92e0e22e8b Put each main window into its own group
This fixes the problem that a main window cannot be used if a modal dialog
is opened in another main window.
2025-07-31 19:15:29 +02:00
Rafał Dzięgiel
4d5519b42d Merge pull request #575 from Rafostar/playlistable
Expandable playlists support
2025-07-26 18:10:29 +02:00
Rafał Dzięgiel
4a34fb3484 clapper: discoverer: Skip items that already have tags
When tags are populated elsewhere, do not run discovery on them again.
It is possible they were discovered in more efficient maner
(e.g. from playlist data itself).

This avoid us downloading each media item separately after all
playlist items are queued.
2025-07-26 15:37:33 +02:00
Rafał Dzięgiel
d8ea220aad clapper-app: Remove claps handling code
It is now handled inside playlist demuxer, with the other playlist formats
2025-07-26 15:37:31 +02:00
Rafał Dzięgiel
dc56cb201a clapper: Support demuxing uri-list and claps files 2025-07-26 15:37:28 +02:00
Rafał Dzięgiel
07f944fb31 clapper: Update harvest common formats description 2025-07-26 15:37:26 +02:00
Rafał Dzięgiel
b2e6533c30 clapper: Store full caps in harvest
Make it possible to know which enhancer harvested this cached data
2025-07-26 15:37:24 +02:00
Rafał Dzięgiel
7a56fbfff8 clapper: Rename "uri-list-demux" element
Move as harvest URI demuxer since it is supposed to work only with
harvest data from extractable src. Also change caps media type
to "text/x-uri" which is non-standard, but we have to differentiate
single URI from harvest and URI list (one or more URIs).
2025-07-26 15:37:22 +02:00