Commit Graph

111 Commits

Author SHA1 Message Date
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
Rafał Dzięgiel
8fc64eaf73 sink: Automatically draw black when going to NULL state
Remove all workarounds including ignore_textures prop and draw black functions and handle that automatically in sink when going into NULL state.
2021-06-02 20:56:50 +02:00
Rafał Dzięgiel
0b7f31b7c2 API: Properly return a boolean instead of a number 2021-06-02 20:24:40 +02:00
Rafał Dzięgiel
7062af472b API: Add function to get subtitle track title 2021-06-02 11:08:30 +02:00
Rafał Dzięgiel
1f4698448a Detect used GStreamer plugin names
Allows seeing what plugins are used with GST_DEBUG=Clapper:4. This is also needed for yet to come functionality of setting elements props.
2021-06-01 21:57:14 +02:00
Rafał Dzięgiel
06d9f302c2 Revert "sink: Use g_main_context_invoke_full for drawing"
Not much benefit from using this function and unlike g_idle_add_full it
does not allow to skip a frame when previous one was not finished (slow HW).

This reverts commit f8a7abe195.
2021-05-31 18:07:37 +02:00
Rafostar
1f781716d7 Add env variable to display FPS 2021-05-30 11:14:51 +02:00
Rafał Dzięgiel
0d7ef22c88 Merge pull request #77 from Rafostar/mpris
Add MPRIS
2021-05-26 22:01:49 +02:00
Rafał Dzięgiel
57664f32da sink: Do not send the same cursor coords on each GUI redraw 2021-05-26 21:15:58 +02:00
Rafał Dzięgiel
f8a7abe195 sink: Use g_main_context_invoke_full for drawing
Queue draws to application (and GTK) main context using g_main_context_invoke_full method
2021-05-26 20:59:50 +02:00
Rafostar
5f259b28fe mpris: Add "SupportedUriSchemes" and handle "OpenUri" method 2021-05-26 15:14:28 +02:00
Rafostar
9f776e9ecb mpris: Support changing volume 2021-05-26 15:13:30 +02:00