Commit Graph

573 Commits

Author SHA1 Message Date
Rafał Dzięgiel
cbbd93bf04 clapper-gtk: av: Fix checks when inhibiting session 2025-12-08 20:00:42 +01:00
Rafał Dzięgiel
065b8698dc clapper-gtk: video: Fix sink property type checks
Sometimes property might return a subclass type when object is subclassed.
This especially happens with custom GdkPaintable implementations.
For this reason instead of comparing object type, check if it inherits what we want.
2025-12-08 19:55:38 +01:00
Rafał Dzięgiel
c1fd82f8d9 clapper-gtk: seek-bar: Honour accurate seek method on markers
When seeking to a marker position, logic always used NORMAL seek method since
FAST would be too inaccurate. This is fine, but when user sets preferred seek
method to ACCURATE we should use it always (including seeks to marker positions).
2025-12-08 19:52:04 +01:00
Rafał Dzięgiel
38cad126ff clapper: playlistable: Annotation fixes
Both cancellable and error cannot be NULL
2025-12-08 18:50:39 +01:00
Rafał Dzięgiel
c270920886 clapper: extractable: Annotation fixes
Both "cancellable" and "error" cannot be NULL.
Also add missing "harvest" annotation.
2025-12-08 18:49:36 +01:00
Rafał Dzięgiel
d331641e88 clapper: playlist-demux: Support searching for exclusions
Sometimes data is similar and can be determined to be a playlist
by NOT including some specific syntax (e.g. HLS). For this reason
add ability to define an exclusion requirement for playlist parsers.
2025-12-06 18:32:32 +01:00
Rafał Dzięgiel
c3533ddec2 clapper: reactable: Add timeline insert/remove functions
Similar to queue alternation functions present in reactable, also
add ones for timeline alternations as these are a must for non-newly
created items.

For consistency, remove auto thread switching logic from insert/remove
functions in ClapperTimeline object. Such behavior is unexpected and
I feel it could lead to potential issues such as deadlocks.
2025-12-06 16:35:00 +01:00
Rafał Dzięgiel
e1d635e6dd clapper: Function to insert into queue after other item position 2025-12-06 16:24:21 +01:00
Rafał Dzięgiel
8f33737903 clapper: Deprecate Server feature
It was ported to Clapper Enhancers repo as a plugin called "Control Hub"
for better clarity what it does. Applications using old one should slowy
move towards using new implementation instead.
2025-12-02 18:20:52 +01:00
Rafał Dzięgiel
1bc1fbf54e clapper-app: Add Control Hub Enhancer support
When installed configure and use it instead of ClapperServer feature.
Also hide all server feature options in preferences when not being used.
2025-12-02 18:19:12 +01:00
Rafał Dzięgiel
f58e403c55 clapper: reactable: Add missing "message_received" docs note 2025-12-02 18:15:33 +01:00
Rafał Dzięgiel
c39c72c3ed clapper: media-item: Add missing version annotation 2025-12-02 18:13:27 +01:00
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
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
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
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
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
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
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
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
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
Rafał Dzięgiel
7457ffda13 clapper: Handle parsed playlists
Handle "ClapperPlaylistParsed" messages on playbin bus by updating current media
item (playlist) to redirect to the first item in that playlist (with changed tags)
and appending remaining items to the queue after that playlist position.

This basically means that playlist gets resolved into simply adding more
items to the queue. This should also work with nested playlists within playlist.
2025-07-26 15:37:18 +02:00
Rafał Dzięgiel
bee2e08fb1 clapper: Add playlist demuxer element
Uses "Playlistable" enhancers to parse playlist and demux first URI in it
2025-07-26 15:32:32 +02:00
Rafał Dzięgiel
0c1d291006 clapper: Split URI list demux code into subclass 2025-07-19 15:43:36 +02:00
Rafał Dzięgiel
4002a63e3a clapper: Add "Playlistable" interface
An interface for creating enhancers that parse data
into individual media items
2025-07-19 15:43:30 +02:00