Subject: Re: bug#58299: [patch] add gst-plugins-base-gl (gst-plugins with opengl support)

From: Maxime Devos <[email-masked]>
Date: Thu, 6 Oct 2022 10:05:10 +0200

On 05-10-2022 10:25, Dr. Arne Babenhauserheide wrote:
> Hi,
> 
> the following patch adds a base gstreamer plugins package with opengl support:

Not sure how I received this, as I unsubscribed from guix-patches, but a 
note:

IIUC, you are enabling extra plugins -- so gst-plugins-base-gl also 
contains the non-gl plugins.

Take some non-gl plugin 'foo', of which there is a copy in both 
gst-plugins-base-gl and gst-plugins-base.

This can potentially lead to a situation where an application loads two 
copies of foo into the same process (of gst-plugins-base and 
gst-plugins-base-gl).  This can lead to bugs, see e.g. 
<https://issues.guix.gnu.org/47115#22>.

I don't know if gst stuff cares (and maybe gst refuses to load plugins 
it already has loaded), but it is potentially risky.

To avoid this, I propose to let gst-plugins-base-gl _only_ contain 
plugins that use gl.

 > +     `(("mesa" ,mesa) ;; required for libgstgl

Maybe my local Guix is out-of-date, but mesa is already in 
gst-plugin-base's inputs.  If it's actually unused by gst-plugin-base, I 
suppose it could be removed on core-updates, to avoid the large mesa.

> +    (inputs
> +     (modify-inputs (package-inputs gst-plugins-base)
> +       (append mesa))) ;; required for libgstgl

I recommend 'prepend' instead of 'append' for being a tiny bit faster 
(prepend doesn't need to iterate through the old input list).

Also, a modified description and synopsis, to help users deciding 
between gst-plugins-base, gst-plugins-base-gl or both.

Greetings,
Maxime.