[libcamera-devel] [PATCH 04/23] utils: ipc: add generator script

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Sep 16 02:16:14 CEST 2020


Hi Paul,

Thank you for the patch.

On Tue, Sep 15, 2020 at 11:20:19PM +0900, Paul Elder wrote:
> We want to avoid changing our copy of mojo to make updates easier. Some
> parameters in the mojo generator script needs to be changed though; add
> a wrapper script that sets these parameters.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
>  utils/ipc/generate.py | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>  create mode 100755 utils/ipc/generate.py
> 
> diff --git a/utils/ipc/generate.py b/utils/ipc/generate.py
> new file mode 100755
> index 00000000..39160aa2
> --- /dev/null
> +++ b/utils/ipc/generate.py
> @@ -0,0 +1,17 @@
> +#!/usr/bin/env python3
> +
> +import argparse

This doesn't seem needed.

> +import os
> +import sys
> +import mojo.public.tools.bindings.mojom_bindings_generator as generator
> +
> +def _GetModulePath(path, output_dir):
> +  return os.path.join(output_dir, path.relative_path())
> +

Comments to explain what's going on with the next three lines would be useful.

> +generator._BUILTIN_GENERATORS = {'libcamera': 'mojom_libcamera_generator'}
> +generator._GetModulePath = _GetModulePath
> +sys.path.append(os.path.join(os.path.dirname(__file__), 'utils/ipc'))
> +
> +generator.main()
> +
> +#./bindings/mojom_bindings_generator.py generate -g libcamera --bytecode_path . ./raspberrypi.mojom

Is this line a leftover ?

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list