Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support libpeas based plugin system #501

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

WIP: Support libpeas based plugin system #501

wants to merge 4 commits into from

Conversation

Rafostar
Copy link
Owner

@Rafostar Rafostar commented Oct 30, 2024

Add a libpeas based plugin system. In order to not be confused with GStreamer plugins, I will be using term enhancers as these are meant to be callable from already present functionalities in Clapper library, enhancing them (possibly using other non-C libraries). These are meant mostly for either not actual playback and/or out of GStreamer scope functionalities.

Currently implemented is CLAPPER_EXTRACTABLE, an interface for creating enhancers that extract data from different sources before letting it be played via GStreamer. Note that absolutely no actual extraction code is shipped as part of the app. For this reason loadable enhancers system was invented.

For now, this is meant to replace gtuber with something (hopefully) easier to maintain by using extractors from different libraries (that others will maintain instead of myself 😆).


WIP: Opening as Draft to track progress.

Issues:

Needs CLAPPER_USE_PLAYBIN3=1 to play smoothly in HQ - not fixable here, we should change to playbin3 by default for next Clapper release anyway while other apps can already enforce it with env, so not a problem

  • Tags/Toc are not passed correctly through Pipeline (no title in current video, but works for queued items)

TODO:

  • Element for playing direct URIs (needed for e.g. for Peertube mp4) was not moved here from gtuber yet

Testing:
Both local build and Flatpak package from this PR CI (checks tab) work fine. Windows is currently untested.

@Rafostar
Copy link
Owner Author

Currently, applications can quickly check an enhancer availability with:

gboolean
clapper_enhancer_check (
  GType iface_type,
  const gchar* scheme,
  const gchar* host,
  const gchar** name
)

AND check whether Clapper was even compiled with ability to load enhancers (requires libpeas) by using CLAPPER_WITH_ENHANCERS_LOADER or alternatively get this from pkgconfig.

Example:

gboolean supported = clapper_enhancer_check (CLAPPER_TYPE_EXTRACTABLE, "https", "example.com", NULL);

As requested in: GeopJr/Tuba#1171

ping @GeopJr

@GeopJr
Copy link

GeopJr commented Oct 31, 2024

Sounds good to me, thanks! And I'm interested in maintaining a few extractors probably :)

@Rafostar
Copy link
Owner Author

Rafostar commented Oct 31, 2024

Created a separate repo for enhancer type of plugins here. Also added there an yt-dlp enhancer implementing ClapperExtractable interface from this PR.

I will later update this PR to fix CI with missing dependencies and replace gtuber with this new stuff, so it will be easier to test.

@Rafostar Rafostar force-pushed the libpeas branch 2 times, most recently from 6a9afa9 to 2856179 Compare November 1, 2024 13:18
@Rafostar
Copy link
Owner Author

Rafostar commented Nov 1, 2024

Sounds good to me, thanks! And I'm interested in maintaining a few extractors probably :)

Thanks. Hopefully now most of the hard stuff will be handled by Clapper Enhancer yt-dlp and yt-dlp guys will maintain actual web extraction for us 😄.

Nonetheless, you are (and everyone else) always welcome to contribute (maybe even with new extractors). Now they can be written in C, Vala, Python, GJS and maybe even Rust. I will be moving the ones that are preferred to be custom written over yt-dlp from gtuber repo.

@Rafostar
Copy link
Owner Author

Rafostar commented Nov 1, 2024

The CI now passed, Flatpak was built and... it works! 🎉
I will be updating this PR first comment description with any issues/concerns/todo's I find while testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants