clapper_enhancer_check is deprecated
Hi, just friendly ping here.
https://rafostar.github.io/clapper/doc/clapper/func.enhancer_check.html
There's lots of undergoing changes to how Clapper enhancer plugin system works currently. So I am opening this as a heads up before Clapper 0.10 (still lots of work left to do).
Anyway, just deprecated, so it should still work as before and I implemented all things that this was doing underneath as part of the API, so if Tuba still desires such "enhancer_check" it should be able to replicate its logic here relatively easy.
Note that these new APIs are only in git (development) without release yet, so they still might change slightly.
Reasons of deprecation:
- Enhancers are now accessible through
ClapperEnhancerProxyobjects allowing implementations to browse them, check their types, capabilities and settings, so this became just a convenience function. - Due to the above, this can be implemented now as part of the app with higher customizability.
- There will be different types of enhancers soon (TM), so this function would not apply to all types of them.
- Its not really GStreamer-ish way of doing things where expected behavior is to try to play something and listen for errors/missing-plugin events. This being part of Clapper API seems like it is recommended way of doing things, while it isn't but I understand why Tuba needs this.
Sounds good to me, I'll do it with a version check soon-ish so I can provide feedback, thanks!
No rush. I just wanted to let you know and parts of these APIs might still change before next stable release.
The Proxy API is pretty nice! I like that it's more transparent than Clapper.enhancer_check. My only note is that if X-Schemes and X-Hosts are required for all plugins, maybe they should be properties (get { return proxy.get_extra_data ("X-Schemes"); } ?) on Proxies because other clapper-gtk consumers might not know they exist.
Also I'm getting a critical when attempting to play a video, I can forward it to Clapper's repo, but just in case I might have missed something while compiling the main branches of clapper and enhancers:
(dev.geopjr.Tuba:204584): GStreamer-CRITICAL **: 08:06:55.642: gst_structure_foreach_id_str: assertion 'structure != NULL' failed
(gdb) bt
#0 0x00007ffff7ead1da in g_logv () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1 0x00007ffff7ead443 in g_log () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff6158b6a in gst_structure_foreach_id_str () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#3 0x00007ffff6158bc0 in gst_structure_foreach () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#4 0x00007ffff64db273 in clapper_enhancer_proxy_apply_config_to_enhancer (self=self@entry=0x55555c143580, config=config@entry=0x0, enhancer=enhancer@entry=0x7fff24a976c0)
at ../src/lib/clapper/clapper-enhancer-proxy.c:600
#5 0x00007ffff64efd57 in clapper_enhancer_director_extract_in_thread (data=0x7fff6000a090) at ../src/lib/clapper/gst/clapper-enhancer-director.c:98
#6 0x00007ffff64f1270 in _invoke_func (invoke=0x7fff817f93b0) at ../src/lib/shared/clapper-shared-utils.c:37
#7 0x00007ffff7ea2345 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff7ea4577 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007ffff7ea4fdf in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff64eb7ef in clapper_threaded_object_main (self=0x7fff60007680) at ../src/lib/clapper/clapper-threaded-object.c:105
#11 0x00007ffff7ed5783 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff089cb7b in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:448
#13 0x00007ffff091a7b8 in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
The Proxy API is pretty nice!
😍
My only note is that if X-Schemes and X-Hosts are required for all plugins, maybe they should be properties
In Clapper 0.10 there will be a new type of enhancer plugins for doing something else than web extraction. It won't require these fields. Another reason for deprecation.
Please use either proxy.get_extra_data or proxy.extra_data_lists_value depending whether you prefer to get the whole string and inspect it yourself or convenience functions that checks if value (scheme or host) is listed.
because other clapper-gtk consumers might not know they exist
Normally, I imagine apps shouldn't really care about those extra fields. Tuba is a special case here that does this, but it should know (and knows) whats it doing 😉 .
This also allows to introduce other fields in other types of enhancers if needed without API changes (adding a getter each time). Or allows writing custom enhancer plugin (with additional extra data) to be both shipped and used as part of some application instead of having it in upstream repo.
Also I'm getting a critical when attempting to play a video
Thanks for testing this on a clean system 😄. Fixed: https://github.com/Rafostar/clapper/commit/c557c11e86f4d3bdca12bf284e58fd8c67c655d8