[libcamera-devel] [PATCH] gstreamer: Add meson devenv support

Nicolas Dufresne nicolas.dufresne at collabora.com
Tue Dec 5 15:00:10 CET 2023


Hi,

Le lundi 04 décembre 2023 à 16:27 -0500, Nicolas Dufresne via libcamera-devel a
écrit :
> From: Nicolas Dufresne <nicolas.dufresne at collabora.com>
> 
> This change to the build system will prepend the plugin build directory
> to GST_PLUGIN_PATH environment. This makes the built plugin visible to
> GStreamer inside meson devenv enabling uninstalled testing.

In case of positive feedback, I'd like to make a V2 that updates the
documentation. Instead of:

  export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer

I'd document:

  meson devenv -C build/

Devenv is nicer since it prepends to the path, it will also blend well if
libcamera is made a subproject of another project using devenv (notably mesa
and/or GStreamer). In cross-compilation, the env can be generated on the build
computer, and used as a script on the target with help of the --dump option.

Nicolas

> ---
>  src/gstreamer/meson.build | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build
> index 20784b71..3810a15b 100644
> --- a/src/gstreamer/meson.build
> +++ b/src/gstreamer/meson.build
> @@ -46,3 +46,10 @@ libcamera_gst = shared_library('gstlibcamera',
>      install : true,
>      install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),
>  )
> +
> +# Makes the plugin visble to GStreamer inside meson devenv
> +fs = import('fs')
> +plugin_path = fs.parent(libcamera_gst.full_path())
> +env = environment()
> +env.prepend('GST_PLUGIN_PATH', fs.parent(plugin_path))
> +meson.add_devenv(env)



More information about the libcamera-devel mailing list