[{"id":17765,"web_url":"https://patchwork.libcamera.org/comment/17765/","msgid":"<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>","date":"2021-06-25T04:12:57","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Kieran, thank you for the patch.\n\nOn Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Headers which must not be exposed as part of the public libcamera API\n> can include base/private.h.\n>\n> Any interface which includes the private.h header will only be able to\n> build if the libcamera_private dependency is used (or the\n> libcamera_base_private dependency directly)\n>\n\nI couldn't understand well which one of the four dependencies\n(libcamera_private, libcamera_base, libcamera_dep,\nlibcamera_base_private) should be used in a specific target.\nWould you mind describing the rule of using these dependencies?\n\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  include/libcamera/base/event_dispatcher.h     |  2 ++\n>  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n>  include/libcamera/base/event_notifier.h       |  1 +\n>  include/libcamera/base/file.h                 |  1 +\n>  include/libcamera/base/log.h                  |  1 +\n>  include/libcamera/base/meson.build            |  1 +\n>  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n>  include/libcamera/base/semaphore.h            |  1 +\n>  include/libcamera/base/thread.h               |  1 +\n>  include/libcamera/base/timer.h                |  1 +\n>  include/libcamera/base/utils.h                |  2 ++\n>  src/android/meson.build                       |  2 +-\n>  src/ipa/ipu3/meson.build                      |  2 +-\n>  src/ipa/libipa/meson.build                    |  2 +-\n>  src/ipa/raspberrypi/meson.build               |  2 +-\n>  src/ipa/rkisp1/meson.build                    |  2 +-\n>  src/ipa/vimc/meson.build                      |  2 +-\n>  src/libcamera/base/meson.build                |  8 +++++++\n>  src/libcamera/meson.build                     | 10 +++++++--\n>  src/libcamera/proxy/worker/meson.build        |  2 +-\n>  src/v4l2/meson.build                          |  2 +-\n>  test/camera/meson.build                       |  2 +-\n>  test/ipa/meson.build                          |  2 +-\n>  test/ipc/meson.build                          |  2 +-\n>  test/libtest/meson.build                      |  2 +-\n>  test/log/meson.build                          |  2 +-\n>  test/media_device/meson.build                 |  4 ++--\n>  test/meson.build                              |  2 +-\n>  test/pipeline/ipu3/meson.build                |  2 +-\n>  test/pipeline/rkisp1/meson.build              |  2 +-\n>  test/process/meson.build                      |  2 +-\n>  .../generated_serializer/meson.build          |  2 +-\n>  test/serialization/meson.build                |  2 +-\n>  test/v4l2_subdevice/meson.build               |  2 +-\n>  test/v4l2_videodevice/meson.build             |  2 +-\n>  35 files changed, 74 insertions(+), 25 deletions(-)\n>  create mode 100644 include/libcamera/base/private.h\n>\n> diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n> index 045df27fff16..825af7a33919 100644\n> --- a/include/libcamera/base/event_dispatcher.h\n> +++ b/include/libcamera/base/event_dispatcher.h\n> @@ -9,6 +9,8 @@\n>\n>  #include <vector>\n>\n> +#include <libcamera/base/private.h>\n> +\n>  namespace libcamera {\n>\n>  class EventNotifier;\n> diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n> index ae2a3f04e4b9..88835902980c 100644\n> --- a/include/libcamera/base/event_dispatcher_poll.h\n> +++ b/include/libcamera/base/event_dispatcher_poll.h\n> @@ -13,6 +13,8 @@\n>\n>  #include <libcamera/base/event_dispatcher.h>\n>\n> +#include <libcamera/base/private.h>\n> +\n>  struct pollfd;\n>\n>  namespace libcamera {\n> diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n> index 8a6419f23004..6bb4e5143aa6 100644\n> --- a/include/libcamera/base/event_notifier.h\n> +++ b/include/libcamera/base/event_notifier.h\n> @@ -8,6 +8,7 @@\n>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n>\n>  #include <libcamera/base/object.h>\n> +#include <libcamera/base/private.h>\n>  #include <libcamera/base/signal.h>\n>\n>  namespace libcamera {\n> diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n> index e8e4b76e1a4e..cecbb254591f 100644\n> --- a/include/libcamera/base/file.h\n> +++ b/include/libcamera/base/file.h\n> @@ -12,6 +12,7 @@\n>  #include <sys/types.h>\n>\n>  #include <libcamera/base/class.h>\n> +#include <libcamera/base/private.h>\n>\n>  #include <libcamera/span.h>\n>\n> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n> index b93c947ae7db..70582cd47902 100644\n> --- a/include/libcamera/base/log.h\n> +++ b/include/libcamera/base/log.h\n> @@ -11,6 +11,7 @@\n>  #include <sstream>\n>\n>  #include <libcamera/base/class.h>\n> +#include <libcamera/base/private.h>\n>  #include <libcamera/base/utils.h>\n>\n>  namespace libcamera {\n> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n> index 83c664affc88..aaac324d7149 100644\n> --- a/include/libcamera/base/meson.build\n> +++ b/include/libcamera/base/meson.build\n> @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n>      'log.h',\n>      'message.h',\n>      'object.h',\n> +    'private.h',\n>      'semaphore.h',\n>      'signal.h',\n>      'thread.h',\n> diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n> new file mode 100644\n> index 000000000000..b54ad076688e\n> --- /dev/null\n> +++ b/include/libcamera/base/private.h\n> @@ -0,0 +1,22 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021, Google Inc.\n> + *\n> + * private.h - Private Header Validation\n> + *\n> + * A selection of internal libcamera headers are installed as part\n> + * of the libcamera package to allow sharing of a select subset of\n> + * internal functionality with IPA module developers only.\n> + *\n> + * This functionality is not considered part of the public libcamera\n> + * API, and can therefore potentially face ABI instabilities which\n> + * should not be exposed to applications. IPA modules however should be\n> + * versioned and more closely matched to the libcamera installation.\n> + *\n> + * Components which include this file can not be included in any file\n> + * which forms part of the libcamera API.\n> + */\n> +\n> +#ifndef LIBCAMERA_BASE_PRIVATE\n> +#error \"Private headers must not be included in the libcamera API\"\n> +#endif\n> diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n> index c8e62e3ee68b..d8146eb8060b 100644\n> --- a/include/libcamera/base/semaphore.h\n> +++ b/include/libcamera/base/semaphore.h\n> @@ -9,6 +9,7 @@\n>\n>  #include <condition_variable>\n>\n> +#include <libcamera/base/private.h>\n>  #include <libcamera/base/thread.h>\n>\n>  namespace libcamera {\n> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n> index 2ed18d49c978..b30ed12715a2 100644\n> --- a/include/libcamera/base/thread.h\n> +++ b/include/libcamera/base/thread.h\n> @@ -13,6 +13,7 @@\n>  #include <thread>\n>\n>  #include <libcamera/base/message.h>\n> +#include <libcamera/base/private.h>\n>  #include <libcamera/base/signal.h>\n>  #include <libcamera/base/utils.h>\n>\n> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n> index e79e85f1ef0d..f762e8767d97 100644\n> --- a/include/libcamera/base/timer.h\n> +++ b/include/libcamera/base/timer.h\n> @@ -11,6 +11,7 @@\n>  #include <stdint.h>\n>\n>  #include <libcamera/base/object.h>\n> +#include <libcamera/base/private.h>\n>  #include <libcamera/base/signal.h>\n>\n>  namespace libcamera {\n> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n> index d1aaff65211a..07685045aa05 100644\n> --- a/include/libcamera/base/utils.h\n> +++ b/include/libcamera/base/utils.h\n> @@ -19,6 +19,8 @@\n>  #include <utility>\n>  #include <vector>\n>\n> +#include <libcamera/base/private.h>\n> +\n>  #ifndef __DOXYGEN__\n>\n>  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n> diff --git a/src/android/meson.build b/src/android/meson.build\n> index bd58ef964c2a..7d1e7e85f16e 100644\n> --- a/src/android/meson.build\n> +++ b/src/android/meson.build\n> @@ -4,7 +4,7 @@ android_deps = [\n>      dependency('libexif', required : get_option('android')),\n>      dependency('libjpeg', required : get_option('android')),\n>      dependency('yaml-0.1', required : get_option('android')),\n> -    libcamera_dep,\n> +    libcamera_private,\n>  ]\n>\n>  android_enabled = true\n> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n> index 0d843846acde..b63641908710 100644\n> --- a/src/ipa/ipu3/meson.build\n> +++ b/src/ipa/ipu3/meson.build\n> @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n>                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n>                      name_prefix : '',\n>                      include_directories : [ipa_includes, libipa_includes],\n> -                    dependencies : libcamera_dep,\n> +                    dependencies : libcamera_private,\n>                      link_with : libipa,\n>                      install : true,\n>                      install_dir : ipa_install_dir)\n> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> index 038fc49060ef..ca541a5aafd7 100644\n> --- a/src/ipa/libipa/meson.build\n> +++ b/src/ipa/libipa/meson.build\n> @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n>\n>  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n>                          include_directories : ipa_includes,\n> -                        dependencies : libcamera_dep)\n> +                        dependencies : libcamera_private)\n> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n> index 230356d3ce3a..d7203aa042cd 100644\n> --- a/src/ipa/raspberrypi/meson.build\n> +++ b/src/ipa/raspberrypi/meson.build\n> @@ -3,7 +3,7 @@\n>  ipa_name = 'ipa_rpi'\n>\n>  rpi_ipa_deps = [\n> -    libcamera_dep,\n> +    libcamera_private,\n>      dependency('boost'),\n>      libatomic,\n>  ]\n> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n> index 1a1c71591039..f76b37f5af50 100644\n> --- a/src/ipa/rkisp1/meson.build\n> +++ b/src/ipa/rkisp1/meson.build\n> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n>                      name_prefix : '',\n>                      include_directories : [ipa_includes, libipa_includes],\n> -                    dependencies : libcamera_dep,\n> +                    dependencies : libcamera_private,\n>                      link_with : libipa,\n>                      install : true,\n>                      install_dir : ipa_install_dir)\n> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n> index a35825ae25a6..ecbeee136451 100644\n> --- a/src/ipa/vimc/meson.build\n> +++ b/src/ipa/vimc/meson.build\n> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>                      ['vimc.cpp', libcamera_generated_ipa_headers],\n>                      name_prefix : '',\n>                      include_directories : [ipa_includes, libipa_includes],\n> -                    dependencies : libcamera_dep,\n> +                    dependencies : libcamera_private,\n>                      link_with : libipa,\n>                      install : true,\n>                      install_dir : ipa_install_dir)\n> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> index a8b04cfc8a5f..871721571e98 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -21,10 +21,15 @@ libcamera_base_deps = [\n>      dependency('threads'),\n>  ]\n>\n> +# Internal components must use the libcamera_base_private dependency to enable\n> +# the use of headers which must not be exposed to the libcamera public api.\n> +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> +\n>  libcamera_base_lib = shared_library('libcamera-base',\n>                                      [libcamera_base_sources, libcamera_base_headers],\n>                                      name_prefix : '',\n>                                      install : true,\n> +                                    cpp_args : libcamera_base_args,\n>                                      include_directories : libcamera_includes,\n>                                      dependencies : libcamera_base_deps)\n>\n> @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n>                   version : '1.0',\n>                   description : 'Camera support base utility library',\n>                   subdirs : 'libcamera')\n> +\n> +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n> +                                            compile_args : libcamera_base_args)\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 1f163cfe1225..64c7475f1a2e 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -115,7 +115,7 @@ libcamera_deps = [\n>      libgnutls,\n>      liblttng,\n>      libudev,\n> -    libcamera_base,\n> +    libcamera_base_private,\n>  ]\n>\n>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n> @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n>                                         libcamera_generated_ipa_headers,\n>                                     ],\n>                                     include_directories : libcamera_includes,\n> -                                   dependencies: libcamera_base,\n> +                                   dependencies : libcamera_base,\n>                                     link_with : libcamera)\n>\n> +# Internal dependancy for components and plugins which can use Private APIs\n> +libcamera_private = declare_dependency(dependencies : [\n> +                                           libcamera_dep,\n> +                                           libcamera_base_private,\n> +                                       ])\n> +\n>  pkg_mod = import('pkgconfig')\n>  pkg_mod.generate(libcamera,\n>                   libraries : libcamera_base_lib,\n> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n> index 28fe5f1fd6b2..70c8760a3d42 100644\n> --- a/src/libcamera/proxy/worker/meson.build\n> +++ b/src/libcamera/proxy/worker/meson.build\n> @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n>                         [worker, libcamera_generated_ipa_headers],\n>                         install : true,\n>                         install_dir : proxy_install_dir,\n> -                       dependencies : libcamera_dep)\n> +                       dependencies : libcamera_private)\n>  endforeach\n>\n>  config_h.set('IPA_PROXY_DIR',\n> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> index 0accac194be4..f78497b6799b 100644\n> --- a/src/v4l2/meson.build\n> +++ b/src/v4l2/meson.build\n> @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n>                               v4l2_compat_sources,\n>                               name_prefix : '',\n>                               install : true,\n> -                             dependencies : [libcamera_dep, libdl],\n> +                             dependencies : [libcamera_private, libdl],\n>                               cpp_args : v4l2_compat_cpp_args)\n> diff --git a/test/camera/meson.build b/test/camera/meson.build\n> index 9cb95affffab..002a87b594e0 100644\n> --- a/test/camera/meson.build\n> +++ b/test/camera/meson.build\n> @@ -12,7 +12,7 @@ camera_tests = [\n>\n>  foreach t : camera_tests\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>      test(t[0], exe, suite : 'camera', is_parallel : false)\n> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n> index e8a041b5bbd2..7938633e54ab 100644\n> --- a/test/ipa/meson.build\n> +++ b/test/ipa/meson.build\n> @@ -7,7 +7,7 @@ ipa_test = [\n>\n>  foreach t : ipa_test\n>      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : [libipa, test_libraries],\n>                       include_directories : [libipa_includes, test_includes_internal])\n>\n> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n> index ad47b2feb718..2a6cd7fb8433 100644\n> --- a/test/ipc/meson.build\n> +++ b/test/ipc/meson.build\n> @@ -7,7 +7,7 @@ ipc_tests = [\n>\n>  foreach t : ipc_tests\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n> index 542335ea5e7c..351629f3ce73 100644\n> --- a/test/libtest/meson.build\n> +++ b/test/libtest/meson.build\n> @@ -18,7 +18,7 @@ test_includes_internal = [\n>  ]\n>\n>  libtest = static_library('libtest', libtest_sources,\n> -                         dependencies : libcamera_dep,\n> +                         dependencies : libcamera_private,\n>                           include_directories : test_includes_internal)\n>\n>  test_libraries = [libtest]\n> diff --git a/test/log/meson.build b/test/log/meson.build\n> index 8cd664e04a00..ac87841a24e1 100644\n> --- a/test/log/meson.build\n> +++ b/test/log/meson.build\n> @@ -7,7 +7,7 @@ log_test = [\n>\n>  foreach t : log_test\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n> index 1dfcdd8bd744..83dfe8f11d2f 100644\n> --- a/test/media_device/meson.build\n> +++ b/test/media_device/meson.build\n> @@ -11,12 +11,12 @@ media_device_tests = [\n>  ]\n>\n>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n> -                               dependencies : libcamera_dep,\n> +                               dependencies : libcamera_private,\n>                                 include_directories : test_includes_internal)\n>\n>  foreach t : media_device_tests\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : [test_libraries, lib_mdev_test],\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/meson.build b/test/meson.build\n> index 045ad2a2d7c9..b8615e0fd3e6 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -64,7 +64,7 @@ endforeach\n>\n>  foreach t : internal_tests\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n> index d062ecd269f2..16701080ca2b 100644\n> --- a/test/pipeline/ipu3/meson.build\n> +++ b/test/pipeline/ipu3/meson.build\n> @@ -6,7 +6,7 @@ ipu3_test = [\n>\n>  foreach t : ipu3_test\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n> index ece147b054e4..364b5711a0f9 100644\n> --- a/test/pipeline/rkisp1/meson.build\n> +++ b/test/pipeline/rkisp1/meson.build\n> @@ -6,7 +6,7 @@ rkisp1_test = [\n>\n>  foreach t : rkisp1_test\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/process/meson.build b/test/process/meson.build\n> index d2272d509db3..af86b277db63 100644\n> --- a/test/process/meson.build\n> +++ b/test/process/meson.build\n> @@ -6,7 +6,7 @@ process_tests = [\n>\n>  foreach t : process_tests\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n> index 2460e0b114b3..9fb9cd1db968 100644\n> --- a/test/serialization/generated_serializer/meson.build\n> +++ b/test/serialization/generated_serializer/meson.build\n> @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n>                       generated_test_header,\n>                       generated_test_serializer,\n>                   ],\n> -                 dependencies : libcamera_dep,\n> +                 dependencies : libcamera_private,\n>                   link_with : test_libraries,\n>                   include_directories : [\n>                       test_includes_internal,\n> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n> index 60ebf3255b28..5446e4907f33 100644\n> --- a/test/serialization/meson.build\n> +++ b/test/serialization/meson.build\n> @@ -9,7 +9,7 @@ serialization_tests = [\n>\n>  foreach t : serialization_tests\n>      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>      test(t[0], exe, suite : 'serialization', is_parallel : true)\n> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n> index 40d39766af9b..d82be3c60b75 100644\n> --- a/test/v4l2_subdevice/meson.build\n> +++ b/test/v4l2_subdevice/meson.build\n> @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n>\n>  foreach t : v4l2_subdevice_tests\n>      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n> -        dependencies : libcamera_dep,\n> +        dependencies : libcamera_private,\n>          link_with : test_libraries,\n>          include_directories : test_includes_internal)\n>      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n> index e733518c0185..643f82edce5e 100644\n> --- a/test/v4l2_videodevice/meson.build\n> +++ b/test/v4l2_videodevice/meson.build\n> @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n>\n>  foreach t : v4l2_videodevice_tests\n>      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n> -                     dependencies : libcamera_dep,\n> +                     dependencies : libcamera_private,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n> --\n> 2.30.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id ED20AC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jun 2021 04:13:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26859684CE;\n\tFri, 25 Jun 2021 06:13:09 +0200 (CEST)","from mail-ej1-x631.google.com (mail-ej1-x631.google.com\n\t[IPv6:2a00:1450:4864:20::631])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DAE46684C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 06:13:07 +0200 (CEST)","by mail-ej1-x631.google.com with SMTP id he7so12912488ejc.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jun 2021 21:13:07 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"jZ9Oy4hi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=9VS/02lLUm4OVIblVdBwUfAM0ZiIBXvMKgMy3tFubd8=;\n\tb=jZ9Oy4hisl5XoAnoYTCcFzsNIrK37HCjQJmn3cyWHYHp0Scl5ZsilScXThfCszWbEd\n\tmNTPluW4kfNxnPX0vTSPLSKYzM2/lgsUhpICghgl83AVSWuMg7ya/aN/dvqa3x+SbTNQ\n\tSRDtbv7kFeAxDEHVnHerq3YThsy/FAGm2M+bg=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=9VS/02lLUm4OVIblVdBwUfAM0ZiIBXvMKgMy3tFubd8=;\n\tb=dQBpc1X291B9BdgjafA1iMFnL2TCLXuRkb57IDUTqfaXmdesdYCVlqueMa+T/9DRlY\n\tl7ohmFLImiVNYTJtrE4sT7wuxoTdCcqY4pMzS+ISB1oDJ5fS5KfS9vKraw+qdVK/ojHx\n\ttFC3MLg93w7MAmIx+LnIAGExRafsxYWehqKYoTLApiU0r8l1mzqzmOXMc7ZoyOSCgcWV\n\t+Z9ICTWk1DjI2cummFjxWAemKilbH1XDmlpDSohPb48yAehL510K+1UAbfHMadpiHFU1\n\tPZAaQbMOIn6wRfnLYL8KSmhn/HrcE1MExCKngIdsNKAKHKdXXfAYc6XMPfm5FysoIjbw\n\tZYiw==","X-Gm-Message-State":"AOAM531n9zLLpuc4bqlyHTqLnq6EOrkcMrgHvBeVIEno/jecNTlcjnsC\n\ti3YuyPEWWc0GIfwH5L2pSywzqr4EHuTJPemWegIyqg==","X-Google-Smtp-Source":"ABdhPJzvizcZq3SPuAIjkmCAZFn7bTK8BcoxfYr/QavqUQPOiZpzDGsbP6qn5wuVlkqAvo0VjdY8yx4TmrvbMhSJO7Q=","X-Received":"by 2002:a17:906:c10f:: with SMTP id\n\tdo15mr5622556ejc.475.1624594387513; \n\tThu, 24 Jun 2021 21:13:07 -0700 (PDT)","MIME-Version":"1.0","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>","In-Reply-To":"<20210625013539.625803-13-kieran.bingham@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Fri, 25 Jun 2021 13:12:57 +0900","Message-ID":"<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17774,"web_url":"https://patchwork.libcamera.org/comment/17774/","msgid":"<20210625084008.GN2599@pyrite.rasen.tech>","date":"2021-06-25T08:40:08","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Hiro,\n\nOn Fri, Jun 25, 2021 at 01:12:57PM +0900, Hirokazu Honda wrote:\n> Hi Kieran, thank you for the patch.\n> \n> On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham\n> <kieran.bingham@ideasonboard.com> wrote:\n> >\n> > Headers which must not be exposed as part of the public libcamera API\n> > can include base/private.h.\n> >\n> > Any interface which includes the private.h header will only be able to\n> > build if the libcamera_private dependency is used (or the\n> > libcamera_base_private dependency directly)\n> >\n> \n> I couldn't understand well which one of the four dependencies\n> (libcamera_private, libcamera_base, libcamera_dep,\n> libcamera_base_private) should be used in a specific target.\n> Would you mind describing the rule of using these dependencies?\n\nMy understanding is that:\n\n- libcamera_base is everything in base\n- libcamera_base_private is libcamera_base + the macro required for\n  using the private headers\n- libcamera_dep is public + private, for things like IPAs and internal\n  components (but doesn't include the macro for private headers)\n- libcamera_private is libcamera_dep + the macro\n\nKieran, is this correct? (it is a bit hard to keep track of...)\n\n\nPaul\n\n> \n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  include/libcamera/base/event_dispatcher.h     |  2 ++\n> >  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n> >  include/libcamera/base/event_notifier.h       |  1 +\n> >  include/libcamera/base/file.h                 |  1 +\n> >  include/libcamera/base/log.h                  |  1 +\n> >  include/libcamera/base/meson.build            |  1 +\n> >  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n> >  include/libcamera/base/semaphore.h            |  1 +\n> >  include/libcamera/base/thread.h               |  1 +\n> >  include/libcamera/base/timer.h                |  1 +\n> >  include/libcamera/base/utils.h                |  2 ++\n> >  src/android/meson.build                       |  2 +-\n> >  src/ipa/ipu3/meson.build                      |  2 +-\n> >  src/ipa/libipa/meson.build                    |  2 +-\n> >  src/ipa/raspberrypi/meson.build               |  2 +-\n> >  src/ipa/rkisp1/meson.build                    |  2 +-\n> >  src/ipa/vimc/meson.build                      |  2 +-\n> >  src/libcamera/base/meson.build                |  8 +++++++\n> >  src/libcamera/meson.build                     | 10 +++++++--\n> >  src/libcamera/proxy/worker/meson.build        |  2 +-\n> >  src/v4l2/meson.build                          |  2 +-\n> >  test/camera/meson.build                       |  2 +-\n> >  test/ipa/meson.build                          |  2 +-\n> >  test/ipc/meson.build                          |  2 +-\n> >  test/libtest/meson.build                      |  2 +-\n> >  test/log/meson.build                          |  2 +-\n> >  test/media_device/meson.build                 |  4 ++--\n> >  test/meson.build                              |  2 +-\n> >  test/pipeline/ipu3/meson.build                |  2 +-\n> >  test/pipeline/rkisp1/meson.build              |  2 +-\n> >  test/process/meson.build                      |  2 +-\n> >  .../generated_serializer/meson.build          |  2 +-\n> >  test/serialization/meson.build                |  2 +-\n> >  test/v4l2_subdevice/meson.build               |  2 +-\n> >  test/v4l2_videodevice/meson.build             |  2 +-\n> >  35 files changed, 74 insertions(+), 25 deletions(-)\n> >  create mode 100644 include/libcamera/base/private.h\n> >\n> > diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n> > index 045df27fff16..825af7a33919 100644\n> > --- a/include/libcamera/base/event_dispatcher.h\n> > +++ b/include/libcamera/base/event_dispatcher.h\n> > @@ -9,6 +9,8 @@\n> >\n> >  #include <vector>\n> >\n> > +#include <libcamera/base/private.h>\n> > +\n> >  namespace libcamera {\n> >\n> >  class EventNotifier;\n> > diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n> > index ae2a3f04e4b9..88835902980c 100644\n> > --- a/include/libcamera/base/event_dispatcher_poll.h\n> > +++ b/include/libcamera/base/event_dispatcher_poll.h\n> > @@ -13,6 +13,8 @@\n> >\n> >  #include <libcamera/base/event_dispatcher.h>\n> >\n> > +#include <libcamera/base/private.h>\n> > +\n> >  struct pollfd;\n> >\n> >  namespace libcamera {\n> > diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n> > index 8a6419f23004..6bb4e5143aa6 100644\n> > --- a/include/libcamera/base/event_notifier.h\n> > +++ b/include/libcamera/base/event_notifier.h\n> > @@ -8,6 +8,7 @@\n> >  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n> >\n> >  #include <libcamera/base/object.h>\n> > +#include <libcamera/base/private.h>\n> >  #include <libcamera/base/signal.h>\n> >\n> >  namespace libcamera {\n> > diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n> > index e8e4b76e1a4e..cecbb254591f 100644\n> > --- a/include/libcamera/base/file.h\n> > +++ b/include/libcamera/base/file.h\n> > @@ -12,6 +12,7 @@\n> >  #include <sys/types.h>\n> >\n> >  #include <libcamera/base/class.h>\n> > +#include <libcamera/base/private.h>\n> >\n> >  #include <libcamera/span.h>\n> >\n> > diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n> > index b93c947ae7db..70582cd47902 100644\n> > --- a/include/libcamera/base/log.h\n> > +++ b/include/libcamera/base/log.h\n> > @@ -11,6 +11,7 @@\n> >  #include <sstream>\n> >\n> >  #include <libcamera/base/class.h>\n> > +#include <libcamera/base/private.h>\n> >  #include <libcamera/base/utils.h>\n> >\n> >  namespace libcamera {\n> > diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n> > index 83c664affc88..aaac324d7149 100644\n> > --- a/include/libcamera/base/meson.build\n> > +++ b/include/libcamera/base/meson.build\n> > @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n> >      'log.h',\n> >      'message.h',\n> >      'object.h',\n> > +    'private.h',\n> >      'semaphore.h',\n> >      'signal.h',\n> >      'thread.h',\n> > diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n> > new file mode 100644\n> > index 000000000000..b54ad076688e\n> > --- /dev/null\n> > +++ b/include/libcamera/base/private.h\n> > @@ -0,0 +1,22 @@\n> > +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> > +/*\n> > + * Copyright (C) 2021, Google Inc.\n> > + *\n> > + * private.h - Private Header Validation\n> > + *\n> > + * A selection of internal libcamera headers are installed as part\n> > + * of the libcamera package to allow sharing of a select subset of\n> > + * internal functionality with IPA module developers only.\n> > + *\n> > + * This functionality is not considered part of the public libcamera\n> > + * API, and can therefore potentially face ABI instabilities which\n> > + * should not be exposed to applications. IPA modules however should be\n> > + * versioned and more closely matched to the libcamera installation.\n> > + *\n> > + * Components which include this file can not be included in any file\n> > + * which forms part of the libcamera API.\n> > + */\n> > +\n> > +#ifndef LIBCAMERA_BASE_PRIVATE\n> > +#error \"Private headers must not be included in the libcamera API\"\n> > +#endif\n> > diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n> > index c8e62e3ee68b..d8146eb8060b 100644\n> > --- a/include/libcamera/base/semaphore.h\n> > +++ b/include/libcamera/base/semaphore.h\n> > @@ -9,6 +9,7 @@\n> >\n> >  #include <condition_variable>\n> >\n> > +#include <libcamera/base/private.h>\n> >  #include <libcamera/base/thread.h>\n> >\n> >  namespace libcamera {\n> > diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n> > index 2ed18d49c978..b30ed12715a2 100644\n> > --- a/include/libcamera/base/thread.h\n> > +++ b/include/libcamera/base/thread.h\n> > @@ -13,6 +13,7 @@\n> >  #include <thread>\n> >\n> >  #include <libcamera/base/message.h>\n> > +#include <libcamera/base/private.h>\n> >  #include <libcamera/base/signal.h>\n> >  #include <libcamera/base/utils.h>\n> >\n> > diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n> > index e79e85f1ef0d..f762e8767d97 100644\n> > --- a/include/libcamera/base/timer.h\n> > +++ b/include/libcamera/base/timer.h\n> > @@ -11,6 +11,7 @@\n> >  #include <stdint.h>\n> >\n> >  #include <libcamera/base/object.h>\n> > +#include <libcamera/base/private.h>\n> >  #include <libcamera/base/signal.h>\n> >\n> >  namespace libcamera {\n> > diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n> > index d1aaff65211a..07685045aa05 100644\n> > --- a/include/libcamera/base/utils.h\n> > +++ b/include/libcamera/base/utils.h\n> > @@ -19,6 +19,8 @@\n> >  #include <utility>\n> >  #include <vector>\n> >\n> > +#include <libcamera/base/private.h>\n> > +\n> >  #ifndef __DOXYGEN__\n> >\n> >  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n> > diff --git a/src/android/meson.build b/src/android/meson.build\n> > index bd58ef964c2a..7d1e7e85f16e 100644\n> > --- a/src/android/meson.build\n> > +++ b/src/android/meson.build\n> > @@ -4,7 +4,7 @@ android_deps = [\n> >      dependency('libexif', required : get_option('android')),\n> >      dependency('libjpeg', required : get_option('android')),\n> >      dependency('yaml-0.1', required : get_option('android')),\n> > -    libcamera_dep,\n> > +    libcamera_private,\n> >  ]\n> >\n> >  android_enabled = true\n> > diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n> > index 0d843846acde..b63641908710 100644\n> > --- a/src/ipa/ipu3/meson.build\n> > +++ b/src/ipa/ipu3/meson.build\n> > @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n> >                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n> >                      name_prefix : '',\n> >                      include_directories : [ipa_includes, libipa_includes],\n> > -                    dependencies : libcamera_dep,\n> > +                    dependencies : libcamera_private,\n> >                      link_with : libipa,\n> >                      install : true,\n> >                      install_dir : ipa_install_dir)\n> > diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> > index 038fc49060ef..ca541a5aafd7 100644\n> > --- a/src/ipa/libipa/meson.build\n> > +++ b/src/ipa/libipa/meson.build\n> > @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n> >\n> >  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n> >                          include_directories : ipa_includes,\n> > -                        dependencies : libcamera_dep)\n> > +                        dependencies : libcamera_private)\n> > diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n> > index 230356d3ce3a..d7203aa042cd 100644\n> > --- a/src/ipa/raspberrypi/meson.build\n> > +++ b/src/ipa/raspberrypi/meson.build\n> > @@ -3,7 +3,7 @@\n> >  ipa_name = 'ipa_rpi'\n> >\n> >  rpi_ipa_deps = [\n> > -    libcamera_dep,\n> > +    libcamera_private,\n> >      dependency('boost'),\n> >      libatomic,\n> >  ]\n> > diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n> > index 1a1c71591039..f76b37f5af50 100644\n> > --- a/src/ipa/rkisp1/meson.build\n> > +++ b/src/ipa/rkisp1/meson.build\n> > @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n> >                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n> >                      name_prefix : '',\n> >                      include_directories : [ipa_includes, libipa_includes],\n> > -                    dependencies : libcamera_dep,\n> > +                    dependencies : libcamera_private,\n> >                      link_with : libipa,\n> >                      install : true,\n> >                      install_dir : ipa_install_dir)\n> > diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n> > index a35825ae25a6..ecbeee136451 100644\n> > --- a/src/ipa/vimc/meson.build\n> > +++ b/src/ipa/vimc/meson.build\n> > @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n> >                      ['vimc.cpp', libcamera_generated_ipa_headers],\n> >                      name_prefix : '',\n> >                      include_directories : [ipa_includes, libipa_includes],\n> > -                    dependencies : libcamera_dep,\n> > +                    dependencies : libcamera_private,\n> >                      link_with : libipa,\n> >                      install : true,\n> >                      install_dir : ipa_install_dir)\n> > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > index a8b04cfc8a5f..871721571e98 100644\n> > --- a/src/libcamera/base/meson.build\n> > +++ b/src/libcamera/base/meson.build\n> > @@ -21,10 +21,15 @@ libcamera_base_deps = [\n> >      dependency('threads'),\n> >  ]\n> >\n> > +# Internal components must use the libcamera_base_private dependency to enable\n> > +# the use of headers which must not be exposed to the libcamera public api.\n> > +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> > +\n> >  libcamera_base_lib = shared_library('libcamera-base',\n> >                                      [libcamera_base_sources, libcamera_base_headers],\n> >                                      name_prefix : '',\n> >                                      install : true,\n> > +                                    cpp_args : libcamera_base_args,\n> >                                      include_directories : libcamera_includes,\n> >                                      dependencies : libcamera_base_deps)\n> >\n> > @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n> >                   version : '1.0',\n> >                   description : 'Camera support base utility library',\n> >                   subdirs : 'libcamera')\n> > +\n> > +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n> > +                                            compile_args : libcamera_base_args)\n> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > index 1f163cfe1225..64c7475f1a2e 100644\n> > --- a/src/libcamera/meson.build\n> > +++ b/src/libcamera/meson.build\n> > @@ -115,7 +115,7 @@ libcamera_deps = [\n> >      libgnutls,\n> >      liblttng,\n> >      libudev,\n> > -    libcamera_base,\n> > +    libcamera_base_private,\n> >  ]\n> >\n> >  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n> > @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n> >                                         libcamera_generated_ipa_headers,\n> >                                     ],\n> >                                     include_directories : libcamera_includes,\n> > -                                   dependencies: libcamera_base,\n> > +                                   dependencies : libcamera_base,\n> >                                     link_with : libcamera)\n> >\n> > +# Internal dependancy for components and plugins which can use Private APIs\n> > +libcamera_private = declare_dependency(dependencies : [\n> > +                                           libcamera_dep,\n> > +                                           libcamera_base_private,\n> > +                                       ])\n> > +\n> >  pkg_mod = import('pkgconfig')\n> >  pkg_mod.generate(libcamera,\n> >                   libraries : libcamera_base_lib,\n> > diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n> > index 28fe5f1fd6b2..70c8760a3d42 100644\n> > --- a/src/libcamera/proxy/worker/meson.build\n> > +++ b/src/libcamera/proxy/worker/meson.build\n> > @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n> >                         [worker, libcamera_generated_ipa_headers],\n> >                         install : true,\n> >                         install_dir : proxy_install_dir,\n> > -                       dependencies : libcamera_dep)\n> > +                       dependencies : libcamera_private)\n> >  endforeach\n> >\n> >  config_h.set('IPA_PROXY_DIR',\n> > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > index 0accac194be4..f78497b6799b 100644\n> > --- a/src/v4l2/meson.build\n> > +++ b/src/v4l2/meson.build\n> > @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n> >                               v4l2_compat_sources,\n> >                               name_prefix : '',\n> >                               install : true,\n> > -                             dependencies : [libcamera_dep, libdl],\n> > +                             dependencies : [libcamera_private, libdl],\n> >                               cpp_args : v4l2_compat_cpp_args)\n> > diff --git a/test/camera/meson.build b/test/camera/meson.build\n> > index 9cb95affffab..002a87b594e0 100644\n> > --- a/test/camera/meson.build\n> > +++ b/test/camera/meson.build\n> > @@ -12,7 +12,7 @@ camera_tests = [\n> >\n> >  foreach t : camera_tests\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >      test(t[0], exe, suite : 'camera', is_parallel : false)\n> > diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n> > index e8a041b5bbd2..7938633e54ab 100644\n> > --- a/test/ipa/meson.build\n> > +++ b/test/ipa/meson.build\n> > @@ -7,7 +7,7 @@ ipa_test = [\n> >\n> >  foreach t : ipa_test\n> >      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : [libipa, test_libraries],\n> >                       include_directories : [libipa_includes, test_includes_internal])\n> >\n> > diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n> > index ad47b2feb718..2a6cd7fb8433 100644\n> > --- a/test/ipc/meson.build\n> > +++ b/test/ipc/meson.build\n> > @@ -7,7 +7,7 @@ ipc_tests = [\n> >\n> >  foreach t : ipc_tests\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n> > index 542335ea5e7c..351629f3ce73 100644\n> > --- a/test/libtest/meson.build\n> > +++ b/test/libtest/meson.build\n> > @@ -18,7 +18,7 @@ test_includes_internal = [\n> >  ]\n> >\n> >  libtest = static_library('libtest', libtest_sources,\n> > -                         dependencies : libcamera_dep,\n> > +                         dependencies : libcamera_private,\n> >                           include_directories : test_includes_internal)\n> >\n> >  test_libraries = [libtest]\n> > diff --git a/test/log/meson.build b/test/log/meson.build\n> > index 8cd664e04a00..ac87841a24e1 100644\n> > --- a/test/log/meson.build\n> > +++ b/test/log/meson.build\n> > @@ -7,7 +7,7 @@ log_test = [\n> >\n> >  foreach t : log_test\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n> > index 1dfcdd8bd744..83dfe8f11d2f 100644\n> > --- a/test/media_device/meson.build\n> > +++ b/test/media_device/meson.build\n> > @@ -11,12 +11,12 @@ media_device_tests = [\n> >  ]\n> >\n> >  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n> > -                               dependencies : libcamera_dep,\n> > +                               dependencies : libcamera_private,\n> >                                 include_directories : test_includes_internal)\n> >\n> >  foreach t : media_device_tests\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : [test_libraries, lib_mdev_test],\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/meson.build b/test/meson.build\n> > index 045ad2a2d7c9..b8615e0fd3e6 100644\n> > --- a/test/meson.build\n> > +++ b/test/meson.build\n> > @@ -64,7 +64,7 @@ endforeach\n> >\n> >  foreach t : internal_tests\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n> > index d062ecd269f2..16701080ca2b 100644\n> > --- a/test/pipeline/ipu3/meson.build\n> > +++ b/test/pipeline/ipu3/meson.build\n> > @@ -6,7 +6,7 @@ ipu3_test = [\n> >\n> >  foreach t : ipu3_test\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n> > index ece147b054e4..364b5711a0f9 100644\n> > --- a/test/pipeline/rkisp1/meson.build\n> > +++ b/test/pipeline/rkisp1/meson.build\n> > @@ -6,7 +6,7 @@ rkisp1_test = [\n> >\n> >  foreach t : rkisp1_test\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/process/meson.build b/test/process/meson.build\n> > index d2272d509db3..af86b277db63 100644\n> > --- a/test/process/meson.build\n> > +++ b/test/process/meson.build\n> > @@ -6,7 +6,7 @@ process_tests = [\n> >\n> >  foreach t : process_tests\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n> > index 2460e0b114b3..9fb9cd1db968 100644\n> > --- a/test/serialization/generated_serializer/meson.build\n> > +++ b/test/serialization/generated_serializer/meson.build\n> > @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n> >                       generated_test_header,\n> >                       generated_test_serializer,\n> >                   ],\n> > -                 dependencies : libcamera_dep,\n> > +                 dependencies : libcamera_private,\n> >                   link_with : test_libraries,\n> >                   include_directories : [\n> >                       test_includes_internal,\n> > diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n> > index 60ebf3255b28..5446e4907f33 100644\n> > --- a/test/serialization/meson.build\n> > +++ b/test/serialization/meson.build\n> > @@ -9,7 +9,7 @@ serialization_tests = [\n> >\n> >  foreach t : serialization_tests\n> >      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >      test(t[0], exe, suite : 'serialization', is_parallel : true)\n> > diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n> > index 40d39766af9b..d82be3c60b75 100644\n> > --- a/test/v4l2_subdevice/meson.build\n> > +++ b/test/v4l2_subdevice/meson.build\n> > @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n> >\n> >  foreach t : v4l2_subdevice_tests\n> >      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n> > -        dependencies : libcamera_dep,\n> > +        dependencies : libcamera_private,\n> >          link_with : test_libraries,\n> >          include_directories : test_includes_internal)\n> >      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n> > diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n> > index e733518c0185..643f82edce5e 100644\n> > --- a/test/v4l2_videodevice/meson.build\n> > +++ b/test/v4l2_videodevice/meson.build\n> > @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n> >\n> >  foreach t : v4l2_videodevice_tests\n> >      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n> > -                     dependencies : libcamera_dep,\n> > +                     dependencies : libcamera_private,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n> > --\n> > 2.30.2\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 41CDEC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jun 2021 08:40:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9E7B4684CF;\n\tFri, 25 Jun 2021 10:40:18 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BCB2E684CA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 10:40:16 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 063A58B6;\n\tFri, 25 Jun 2021 10:40:14 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NQCd+U4k\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624610416;\n\tbh=FtSj5SfJm6qVi94KwSMu4NFVVd7JJBvnjQI4lMsNr60=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NQCd+U4kh9D+WgYZVk9KzU2OAHXeKlrOLyWPjpNfp5DkWLAhkyeTwoFvjOkcrD2ac\n\tHN7OKORciq78t2K7l6HiS4zIkWvnGAeVAHqF21WWkm3nSxLpoSAXI9c9eDYSkM9onR\n\ttF1faLnYzP9nJQ0J3Q/gfScx42vgIehMqaahi8ts=","Date":"Fri, 25 Jun 2021 17:40:08 +0900","From":"paul.elder@ideasonboard.com","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<20210625084008.GN2599@pyrite.rasen.tech>","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>\n\t<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17785,"web_url":"https://patchwork.libcamera.org/comment/17785/","msgid":"<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>","date":"2021-06-25T09:34:29","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Paul, Hiro,\n\nOn 25/06/2021 09:40, paul.elder@ideasonboard.com wrote:\n> Hi Hiro,\n> \n> On Fri, Jun 25, 2021 at 01:12:57PM +0900, Hirokazu Honda wrote:\n>> Hi Kieran, thank you for the patch.\n>>\n>> On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham\n>> <kieran.bingham@ideasonboard.com> wrote:\n>>>\n>>> Headers which must not be exposed as part of the public libcamera API\n>>> can include base/private.h.\n>>>\n>>> Any interface which includes the private.h header will only be able to\n>>> build if the libcamera_private dependency is used (or the\n>>> libcamera_base_private dependency directly)\n>>>\n>>\n>> I couldn't understand well which one of the four dependencies\n>> (libcamera_private, libcamera_base, libcamera_dep,\n>> libcamera_base_private) should be used in a specific target.\n>> Would you mind describing the rule of using these dependencies?\n> \n> My understanding is that:\n> \n> - libcamera_base is everything in base\n> - libcamera_base_private is libcamera_base + the macro required for\n>   using the private headers\n\nCorrect.\n\n> - libcamera_dep is public + private, for things like IPAs and internal\n>   components (but doesn't include the macro for private headers)\n\n- libcamera_dep is the existing, widely used dependency for linking\nagainst libcamera within the meson project.\n\nIt indeed links against all things public and private currently, and\nanything which references this could use any part of the libcamera library.\n\n(However after this patch, any inclusion of a header without defining\n'LIBCAMERA_BASE_PRIVATE' will hit a compile break)\n\n\n> - libcamera_private is libcamera_dep + the macro\n\nCorrect - this allows a component to link against libcamera, whilst also\ndefining that it is explicitly allowed to access 'private' components,\nwhich should not leak to the public APIs.\n\n> \n> Kieran, is this correct? (it is a bit hard to keep track of...)\n\nI've added\n\n\nBuild targets which are intended to use the private API's will use the\nlibcamera_private to handle the automatic definition of the inclusion\nguard.\n\n\nIt's hard to go into more detail on this in this commit, as it's about\nto get changed in the up coming patches, and I don't want someone to\nread this and say \"Oh I should use the libcamera_dep for my public\ncomponent, as ... it will very soon become libcamera_public\"\n\n\n\n> \n> \n> Paul\n> \n>>\n>>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>> ---\n>>>  include/libcamera/base/event_dispatcher.h     |  2 ++\n>>>  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n>>>  include/libcamera/base/event_notifier.h       |  1 +\n>>>  include/libcamera/base/file.h                 |  1 +\n>>>  include/libcamera/base/log.h                  |  1 +\n>>>  include/libcamera/base/meson.build            |  1 +\n>>>  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n>>>  include/libcamera/base/semaphore.h            |  1 +\n>>>  include/libcamera/base/thread.h               |  1 +\n>>>  include/libcamera/base/timer.h                |  1 +\n>>>  include/libcamera/base/utils.h                |  2 ++\n>>>  src/android/meson.build                       |  2 +-\n>>>  src/ipa/ipu3/meson.build                      |  2 +-\n>>>  src/ipa/libipa/meson.build                    |  2 +-\n>>>  src/ipa/raspberrypi/meson.build               |  2 +-\n>>>  src/ipa/rkisp1/meson.build                    |  2 +-\n>>>  src/ipa/vimc/meson.build                      |  2 +-\n>>>  src/libcamera/base/meson.build                |  8 +++++++\n>>>  src/libcamera/meson.build                     | 10 +++++++--\n>>>  src/libcamera/proxy/worker/meson.build        |  2 +-\n>>>  src/v4l2/meson.build                          |  2 +-\n>>>  test/camera/meson.build                       |  2 +-\n>>>  test/ipa/meson.build                          |  2 +-\n>>>  test/ipc/meson.build                          |  2 +-\n>>>  test/libtest/meson.build                      |  2 +-\n>>>  test/log/meson.build                          |  2 +-\n>>>  test/media_device/meson.build                 |  4 ++--\n>>>  test/meson.build                              |  2 +-\n>>>  test/pipeline/ipu3/meson.build                |  2 +-\n>>>  test/pipeline/rkisp1/meson.build              |  2 +-\n>>>  test/process/meson.build                      |  2 +-\n>>>  .../generated_serializer/meson.build          |  2 +-\n>>>  test/serialization/meson.build                |  2 +-\n>>>  test/v4l2_subdevice/meson.build               |  2 +-\n>>>  test/v4l2_videodevice/meson.build             |  2 +-\n>>>  35 files changed, 74 insertions(+), 25 deletions(-)\n>>>  create mode 100644 include/libcamera/base/private.h\n>>>\n>>> diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n>>> index 045df27fff16..825af7a33919 100644\n>>> --- a/include/libcamera/base/event_dispatcher.h\n>>> +++ b/include/libcamera/base/event_dispatcher.h\n>>> @@ -9,6 +9,8 @@\n>>>\n>>>  #include <vector>\n>>>\n>>> +#include <libcamera/base/private.h>\n>>> +\n>>>  namespace libcamera {\n>>>\n>>>  class EventNotifier;\n>>> diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n>>> index ae2a3f04e4b9..88835902980c 100644\n>>> --- a/include/libcamera/base/event_dispatcher_poll.h\n>>> +++ b/include/libcamera/base/event_dispatcher_poll.h\n>>> @@ -13,6 +13,8 @@\n>>>\n>>>  #include <libcamera/base/event_dispatcher.h>\n>>>\n>>> +#include <libcamera/base/private.h>\n>>> +\n>>>  struct pollfd;\n>>>\n>>>  namespace libcamera {\n>>> diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n>>> index 8a6419f23004..6bb4e5143aa6 100644\n>>> --- a/include/libcamera/base/event_notifier.h\n>>> +++ b/include/libcamera/base/event_notifier.h\n>>> @@ -8,6 +8,7 @@\n>>>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n>>>\n>>>  #include <libcamera/base/object.h>\n>>> +#include <libcamera/base/private.h>\n>>>  #include <libcamera/base/signal.h>\n>>>\n>>>  namespace libcamera {\n>>> diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n>>> index e8e4b76e1a4e..cecbb254591f 100644\n>>> --- a/include/libcamera/base/file.h\n>>> +++ b/include/libcamera/base/file.h\n>>> @@ -12,6 +12,7 @@\n>>>  #include <sys/types.h>\n>>>\n>>>  #include <libcamera/base/class.h>\n>>> +#include <libcamera/base/private.h>\n>>>\n>>>  #include <libcamera/span.h>\n>>>\n>>> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n>>> index b93c947ae7db..70582cd47902 100644\n>>> --- a/include/libcamera/base/log.h\n>>> +++ b/include/libcamera/base/log.h\n>>> @@ -11,6 +11,7 @@\n>>>  #include <sstream>\n>>>\n>>>  #include <libcamera/base/class.h>\n>>> +#include <libcamera/base/private.h>\n>>>  #include <libcamera/base/utils.h>\n>>>\n>>>  namespace libcamera {\n>>> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n>>> index 83c664affc88..aaac324d7149 100644\n>>> --- a/include/libcamera/base/meson.build\n>>> +++ b/include/libcamera/base/meson.build\n>>> @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n>>>      'log.h',\n>>>      'message.h',\n>>>      'object.h',\n>>> +    'private.h',\n>>>      'semaphore.h',\n>>>      'signal.h',\n>>>      'thread.h',\n>>> diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n>>> new file mode 100644\n>>> index 000000000000..b54ad076688e\n>>> --- /dev/null\n>>> +++ b/include/libcamera/base/private.h\n>>> @@ -0,0 +1,22 @@\n>>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>> +/*\n>>> + * Copyright (C) 2021, Google Inc.\n>>> + *\n>>> + * private.h - Private Header Validation\n>>> + *\n>>> + * A selection of internal libcamera headers are installed as part\n>>> + * of the libcamera package to allow sharing of a select subset of\n>>> + * internal functionality with IPA module developers only.\n>>> + *\n>>> + * This functionality is not considered part of the public libcamera\n>>> + * API, and can therefore potentially face ABI instabilities which\n>>> + * should not be exposed to applications. IPA modules however should be\n>>> + * versioned and more closely matched to the libcamera installation.\n>>> + *\n>>> + * Components which include this file can not be included in any file\n>>> + * which forms part of the libcamera API.\n>>> + */\n>>> +\n>>> +#ifndef LIBCAMERA_BASE_PRIVATE\n>>> +#error \"Private headers must not be included in the libcamera API\"\n>>> +#endif\n>>> diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n>>> index c8e62e3ee68b..d8146eb8060b 100644\n>>> --- a/include/libcamera/base/semaphore.h\n>>> +++ b/include/libcamera/base/semaphore.h\n>>> @@ -9,6 +9,7 @@\n>>>\n>>>  #include <condition_variable>\n>>>\n>>> +#include <libcamera/base/private.h>\n>>>  #include <libcamera/base/thread.h>\n>>>\n>>>  namespace libcamera {\n>>> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n>>> index 2ed18d49c978..b30ed12715a2 100644\n>>> --- a/include/libcamera/base/thread.h\n>>> +++ b/include/libcamera/base/thread.h\n>>> @@ -13,6 +13,7 @@\n>>>  #include <thread>\n>>>\n>>>  #include <libcamera/base/message.h>\n>>> +#include <libcamera/base/private.h>\n>>>  #include <libcamera/base/signal.h>\n>>>  #include <libcamera/base/utils.h>\n>>>\n>>> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n>>> index e79e85f1ef0d..f762e8767d97 100644\n>>> --- a/include/libcamera/base/timer.h\n>>> +++ b/include/libcamera/base/timer.h\n>>> @@ -11,6 +11,7 @@\n>>>  #include <stdint.h>\n>>>\n>>>  #include <libcamera/base/object.h>\n>>> +#include <libcamera/base/private.h>\n>>>  #include <libcamera/base/signal.h>\n>>>\n>>>  namespace libcamera {\n>>> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n>>> index d1aaff65211a..07685045aa05 100644\n>>> --- a/include/libcamera/base/utils.h\n>>> +++ b/include/libcamera/base/utils.h\n>>> @@ -19,6 +19,8 @@\n>>>  #include <utility>\n>>>  #include <vector>\n>>>\n>>> +#include <libcamera/base/private.h>\n>>> +\n>>>  #ifndef __DOXYGEN__\n>>>\n>>>  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n>>> diff --git a/src/android/meson.build b/src/android/meson.build\n>>> index bd58ef964c2a..7d1e7e85f16e 100644\n>>> --- a/src/android/meson.build\n>>> +++ b/src/android/meson.build\n>>> @@ -4,7 +4,7 @@ android_deps = [\n>>>      dependency('libexif', required : get_option('android')),\n>>>      dependency('libjpeg', required : get_option('android')),\n>>>      dependency('yaml-0.1', required : get_option('android')),\n>>> -    libcamera_dep,\n>>> +    libcamera_private,\n>>>  ]\n>>>\n>>>  android_enabled = true\n>>> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n>>> index 0d843846acde..b63641908710 100644\n>>> --- a/src/ipa/ipu3/meson.build\n>>> +++ b/src/ipa/ipu3/meson.build\n>>> @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n>>>                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n>>>                      name_prefix : '',\n>>>                      include_directories : [ipa_includes, libipa_includes],\n>>> -                    dependencies : libcamera_dep,\n>>> +                    dependencies : libcamera_private,\n>>>                      link_with : libipa,\n>>>                      install : true,\n>>>                      install_dir : ipa_install_dir)\n>>> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n>>> index 038fc49060ef..ca541a5aafd7 100644\n>>> --- a/src/ipa/libipa/meson.build\n>>> +++ b/src/ipa/libipa/meson.build\n>>> @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n>>>\n>>>  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n>>>                          include_directories : ipa_includes,\n>>> -                        dependencies : libcamera_dep)\n>>> +                        dependencies : libcamera_private)\n>>> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n>>> index 230356d3ce3a..d7203aa042cd 100644\n>>> --- a/src/ipa/raspberrypi/meson.build\n>>> +++ b/src/ipa/raspberrypi/meson.build\n>>> @@ -3,7 +3,7 @@\n>>>  ipa_name = 'ipa_rpi'\n>>>\n>>>  rpi_ipa_deps = [\n>>> -    libcamera_dep,\n>>> +    libcamera_private,\n>>>      dependency('boost'),\n>>>      libatomic,\n>>>  ]\n>>> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n>>> index 1a1c71591039..f76b37f5af50 100644\n>>> --- a/src/ipa/rkisp1/meson.build\n>>> +++ b/src/ipa/rkisp1/meson.build\n>>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>>>                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n>>>                      name_prefix : '',\n>>>                      include_directories : [ipa_includes, libipa_includes],\n>>> -                    dependencies : libcamera_dep,\n>>> +                    dependencies : libcamera_private,\n>>>                      link_with : libipa,\n>>>                      install : true,\n>>>                      install_dir : ipa_install_dir)\n>>> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n>>> index a35825ae25a6..ecbeee136451 100644\n>>> --- a/src/ipa/vimc/meson.build\n>>> +++ b/src/ipa/vimc/meson.build\n>>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>>>                      ['vimc.cpp', libcamera_generated_ipa_headers],\n>>>                      name_prefix : '',\n>>>                      include_directories : [ipa_includes, libipa_includes],\n>>> -                    dependencies : libcamera_dep,\n>>> +                    dependencies : libcamera_private,\n>>>                      link_with : libipa,\n>>>                      install : true,\n>>>                      install_dir : ipa_install_dir)\n>>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n>>> index a8b04cfc8a5f..871721571e98 100644\n>>> --- a/src/libcamera/base/meson.build\n>>> +++ b/src/libcamera/base/meson.build\n>>> @@ -21,10 +21,15 @@ libcamera_base_deps = [\n>>>      dependency('threads'),\n>>>  ]\n>>>\n>>> +# Internal components must use the libcamera_base_private dependency to enable\n>>> +# the use of headers which must not be exposed to the libcamera public api.\n>>> +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n>>> +\n>>>  libcamera_base_lib = shared_library('libcamera-base',\n>>>                                      [libcamera_base_sources, libcamera_base_headers],\n>>>                                      name_prefix : '',\n>>>                                      install : true,\n>>> +                                    cpp_args : libcamera_base_args,\n>>>                                      include_directories : libcamera_includes,\n>>>                                      dependencies : libcamera_base_deps)\n>>>\n>>> @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n>>>                   version : '1.0',\n>>>                   description : 'Camera support base utility library',\n>>>                   subdirs : 'libcamera')\n>>> +\n>>> +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n>>> +                                            compile_args : libcamera_base_args)\n>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>>> index 1f163cfe1225..64c7475f1a2e 100644\n>>> --- a/src/libcamera/meson.build\n>>> +++ b/src/libcamera/meson.build\n>>> @@ -115,7 +115,7 @@ libcamera_deps = [\n>>>      libgnutls,\n>>>      liblttng,\n>>>      libudev,\n>>> -    libcamera_base,\n>>> +    libcamera_base_private,\n>>>  ]\n>>>\n>>>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n>>> @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n>>>                                         libcamera_generated_ipa_headers,\n>>>                                     ],\n>>>                                     include_directories : libcamera_includes,\n>>> -                                   dependencies: libcamera_base,\n>>> +                                   dependencies : libcamera_base,\n>>>                                     link_with : libcamera)\n>>>\n>>> +# Internal dependancy for components and plugins which can use Private APIs\n>>> +libcamera_private = declare_dependency(dependencies : [\n>>> +                                           libcamera_dep,\n>>> +                                           libcamera_base_private,\n>>> +                                       ])\n>>> +\n>>>  pkg_mod = import('pkgconfig')\n>>>  pkg_mod.generate(libcamera,\n>>>                   libraries : libcamera_base_lib,\n>>> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n>>> index 28fe5f1fd6b2..70c8760a3d42 100644\n>>> --- a/src/libcamera/proxy/worker/meson.build\n>>> +++ b/src/libcamera/proxy/worker/meson.build\n>>> @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n>>>                         [worker, libcamera_generated_ipa_headers],\n>>>                         install : true,\n>>>                         install_dir : proxy_install_dir,\n>>> -                       dependencies : libcamera_dep)\n>>> +                       dependencies : libcamera_private)\n>>>  endforeach\n>>>\n>>>  config_h.set('IPA_PROXY_DIR',\n>>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n>>> index 0accac194be4..f78497b6799b 100644\n>>> --- a/src/v4l2/meson.build\n>>> +++ b/src/v4l2/meson.build\n>>> @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n>>>                               v4l2_compat_sources,\n>>>                               name_prefix : '',\n>>>                               install : true,\n>>> -                             dependencies : [libcamera_dep, libdl],\n>>> +                             dependencies : [libcamera_private, libdl],\n>>>                               cpp_args : v4l2_compat_cpp_args)\n>>> diff --git a/test/camera/meson.build b/test/camera/meson.build\n>>> index 9cb95affffab..002a87b594e0 100644\n>>> --- a/test/camera/meson.build\n>>> +++ b/test/camera/meson.build\n>>> @@ -12,7 +12,7 @@ camera_tests = [\n>>>\n>>>  foreach t : camera_tests\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>      test(t[0], exe, suite : 'camera', is_parallel : false)\n>>> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n>>> index e8a041b5bbd2..7938633e54ab 100644\n>>> --- a/test/ipa/meson.build\n>>> +++ b/test/ipa/meson.build\n>>> @@ -7,7 +7,7 @@ ipa_test = [\n>>>\n>>>  foreach t : ipa_test\n>>>      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : [libipa, test_libraries],\n>>>                       include_directories : [libipa_includes, test_includes_internal])\n>>>\n>>> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n>>> index ad47b2feb718..2a6cd7fb8433 100644\n>>> --- a/test/ipc/meson.build\n>>> +++ b/test/ipc/meson.build\n>>> @@ -7,7 +7,7 @@ ipc_tests = [\n>>>\n>>>  foreach t : ipc_tests\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n>>> index 542335ea5e7c..351629f3ce73 100644\n>>> --- a/test/libtest/meson.build\n>>> +++ b/test/libtest/meson.build\n>>> @@ -18,7 +18,7 @@ test_includes_internal = [\n>>>  ]\n>>>\n>>>  libtest = static_library('libtest', libtest_sources,\n>>> -                         dependencies : libcamera_dep,\n>>> +                         dependencies : libcamera_private,\n>>>                           include_directories : test_includes_internal)\n>>>\n>>>  test_libraries = [libtest]\n>>> diff --git a/test/log/meson.build b/test/log/meson.build\n>>> index 8cd664e04a00..ac87841a24e1 100644\n>>> --- a/test/log/meson.build\n>>> +++ b/test/log/meson.build\n>>> @@ -7,7 +7,7 @@ log_test = [\n>>>\n>>>  foreach t : log_test\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n>>> index 1dfcdd8bd744..83dfe8f11d2f 100644\n>>> --- a/test/media_device/meson.build\n>>> +++ b/test/media_device/meson.build\n>>> @@ -11,12 +11,12 @@ media_device_tests = [\n>>>  ]\n>>>\n>>>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n>>> -                               dependencies : libcamera_dep,\n>>> +                               dependencies : libcamera_private,\n>>>                                 include_directories : test_includes_internal)\n>>>\n>>>  foreach t : media_device_tests\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : [test_libraries, lib_mdev_test],\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/meson.build b/test/meson.build\n>>> index 045ad2a2d7c9..b8615e0fd3e6 100644\n>>> --- a/test/meson.build\n>>> +++ b/test/meson.build\n>>> @@ -64,7 +64,7 @@ endforeach\n>>>\n>>>  foreach t : internal_tests\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n>>> index d062ecd269f2..16701080ca2b 100644\n>>> --- a/test/pipeline/ipu3/meson.build\n>>> +++ b/test/pipeline/ipu3/meson.build\n>>> @@ -6,7 +6,7 @@ ipu3_test = [\n>>>\n>>>  foreach t : ipu3_test\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n>>> index ece147b054e4..364b5711a0f9 100644\n>>> --- a/test/pipeline/rkisp1/meson.build\n>>> +++ b/test/pipeline/rkisp1/meson.build\n>>> @@ -6,7 +6,7 @@ rkisp1_test = [\n>>>\n>>>  foreach t : rkisp1_test\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/process/meson.build b/test/process/meson.build\n>>> index d2272d509db3..af86b277db63 100644\n>>> --- a/test/process/meson.build\n>>> +++ b/test/process/meson.build\n>>> @@ -6,7 +6,7 @@ process_tests = [\n>>>\n>>>  foreach t : process_tests\n>>>      exe = executable(t[0], t[1],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>\n>>> diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n>>> index 2460e0b114b3..9fb9cd1db968 100644\n>>> --- a/test/serialization/generated_serializer/meson.build\n>>> +++ b/test/serialization/generated_serializer/meson.build\n>>> @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n>>>                       generated_test_header,\n>>>                       generated_test_serializer,\n>>>                   ],\n>>> -                 dependencies : libcamera_dep,\n>>> +                 dependencies : libcamera_private,\n>>>                   link_with : test_libraries,\n>>>                   include_directories : [\n>>>                       test_includes_internal,\n>>> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n>>> index 60ebf3255b28..5446e4907f33 100644\n>>> --- a/test/serialization/meson.build\n>>> +++ b/test/serialization/meson.build\n>>> @@ -9,7 +9,7 @@ serialization_tests = [\n>>>\n>>>  foreach t : serialization_tests\n>>>      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>      test(t[0], exe, suite : 'serialization', is_parallel : true)\n>>> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n>>> index 40d39766af9b..d82be3c60b75 100644\n>>> --- a/test/v4l2_subdevice/meson.build\n>>> +++ b/test/v4l2_subdevice/meson.build\n>>> @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n>>>\n>>>  foreach t : v4l2_subdevice_tests\n>>>      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n>>> -        dependencies : libcamera_dep,\n>>> +        dependencies : libcamera_private,\n>>>          link_with : test_libraries,\n>>>          include_directories : test_includes_internal)\n>>>      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n>>> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n>>> index e733518c0185..643f82edce5e 100644\n>>> --- a/test/v4l2_videodevice/meson.build\n>>> +++ b/test/v4l2_videodevice/meson.build\n>>> @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n>>>\n>>>  foreach t : v4l2_videodevice_tests\n>>>      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n>>> -                     dependencies : libcamera_dep,\n>>> +                     dependencies : libcamera_private,\n>>>                       link_with : test_libraries,\n>>>                       include_directories : test_includes_internal)\n>>>      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n>>> --\n>>> 2.30.2\n>>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2B62BC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jun 2021 09:34:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8156F684D2;\n\tFri, 25 Jun 2021 11:34:33 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4796F684CB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 11:34:32 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B1E1D501;\n\tFri, 25 Jun 2021 11:34:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"UesqAGAJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624613671;\n\tbh=cHFmMNoCX0BGZ9Efqy0FND+MnAWD2qW27iiySsVisq0=;\n\th=From:To:Cc:References:Subject:Date:In-Reply-To:From;\n\tb=UesqAGAJKZ23SHOHWV74G4c3aeXgjh0PAy8ARKvuAWuu6Z5jATHLF4ajBJXisCBYb\n\t93zMmq6N/BvaxiHPLXKxU6Wk1ffWp9xKmHtkLiKbyhZroZCzDacRVRkgO1kf2MUBUW\n\tjZbnDLKGZVzHifF9Si0ZlhGqr2JQnxSuqVgTEO0g=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"paul.elder@ideasonboard.com, Hirokazu Honda <hiroh@chromium.org>","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>\n\t<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>\n\t<20210625084008.GN2599@pyrite.rasen.tech>","Message-ID":"<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>","Date":"Fri, 25 Jun 2021 10:34:29 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210625084008.GN2599@pyrite.rasen.tech>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17808,"web_url":"https://patchwork.libcamera.org/comment/17808/","msgid":"<YNXRC9eEhre8IB8L@pendragon.ideasonboard.com>","date":"2021-06-25T12:50:19","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Fri, Jun 25, 2021 at 10:34:29AM +0100, Kieran Bingham wrote:\n> On 25/06/2021 09:40, paul.elder@ideasonboard.com wrote:\n> > On Fri, Jun 25, 2021 at 01:12:57PM +0900, Hirokazu Honda wrote:\n> >> On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham wrote:\n> >>>\n> >>> Headers which must not be exposed as part of the public libcamera API\n> >>> can include base/private.h.\n> >>>\n> >>> Any interface which includes the private.h header will only be able to\n> >>> build if the libcamera_private dependency is used (or the\n> >>> libcamera_base_private dependency directly)\n> >>\n> >> I couldn't understand well which one of the four dependencies\n> >> (libcamera_private, libcamera_base, libcamera_dep,\n> >> libcamera_base_private) should be used in a specific target.\n> >> Would you mind describing the rule of using these dependencies?\n> > \n> > My understanding is that:\n> > \n> > - libcamera_base is everything in base\n> > - libcamera_base_private is libcamera_base + the macro required for\n> >   using the private headers\n> \n> Correct.\n> \n> > - libcamera_dep is public + private, for things like IPAs and internal\n> >   components (but doesn't include the macro for private headers)\n> \n> - libcamera_dep is the existing, widely used dependency for linking\n> against libcamera within the meson project.\n> \n> It indeed links against all things public and private currently, and\n> anything which references this could use any part of the libcamera library.\n> \n> (However after this patch, any inclusion of a header without defining\n> 'LIBCAMERA_BASE_PRIVATE' will hit a compile break)\n> \n> > - libcamera_private is libcamera_dep + the macro\n> \n> Correct - this allows a component to link against libcamera, whilst also\n> defining that it is explicitly allowed to access 'private' components,\n> which should not leak to the public APIs.\n> \n> > Kieran, is this correct? (it is a bit hard to keep track of...)\n> \n> I've added\n> \n> \n> Build targets which are intended to use the private API's will use the\n> libcamera_private to handle the automatic definition of the inclusion\n> guard.\n> \n> \n> It's hard to go into more detail on this in this commit, as it's about\n> to get changed in the up coming patches, and I don't want someone to\n> read this and say \"Oh I should use the libcamera_dep for my public\n> component, as ... it will very soon become libcamera_public\"\n\nLet's make sure it's properly documented with the whole series applied,\nit should be enough.\n\n> >>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >>> ---\n> >>>  include/libcamera/base/event_dispatcher.h     |  2 ++\n> >>>  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n> >>>  include/libcamera/base/event_notifier.h       |  1 +\n> >>>  include/libcamera/base/file.h                 |  1 +\n> >>>  include/libcamera/base/log.h                  |  1 +\n> >>>  include/libcamera/base/meson.build            |  1 +\n> >>>  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n> >>>  include/libcamera/base/semaphore.h            |  1 +\n> >>>  include/libcamera/base/thread.h               |  1 +\n> >>>  include/libcamera/base/timer.h                |  1 +\n> >>>  include/libcamera/base/utils.h                |  2 ++\n> >>>  src/android/meson.build                       |  2 +-\n> >>>  src/ipa/ipu3/meson.build                      |  2 +-\n> >>>  src/ipa/libipa/meson.build                    |  2 +-\n> >>>  src/ipa/raspberrypi/meson.build               |  2 +-\n> >>>  src/ipa/rkisp1/meson.build                    |  2 +-\n> >>>  src/ipa/vimc/meson.build                      |  2 +-\n> >>>  src/libcamera/base/meson.build                |  8 +++++++\n> >>>  src/libcamera/meson.build                     | 10 +++++++--\n> >>>  src/libcamera/proxy/worker/meson.build        |  2 +-\n> >>>  src/v4l2/meson.build                          |  2 +-\n> >>>  test/camera/meson.build                       |  2 +-\n> >>>  test/ipa/meson.build                          |  2 +-\n> >>>  test/ipc/meson.build                          |  2 +-\n> >>>  test/libtest/meson.build                      |  2 +-\n> >>>  test/log/meson.build                          |  2 +-\n> >>>  test/media_device/meson.build                 |  4 ++--\n> >>>  test/meson.build                              |  2 +-\n> >>>  test/pipeline/ipu3/meson.build                |  2 +-\n> >>>  test/pipeline/rkisp1/meson.build              |  2 +-\n> >>>  test/process/meson.build                      |  2 +-\n> >>>  .../generated_serializer/meson.build          |  2 +-\n> >>>  test/serialization/meson.build                |  2 +-\n> >>>  test/v4l2_subdevice/meson.build               |  2 +-\n> >>>  test/v4l2_videodevice/meson.build             |  2 +-\n> >>>  35 files changed, 74 insertions(+), 25 deletions(-)\n> >>>  create mode 100644 include/libcamera/base/private.h\n> >>>\n> >>> diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n> >>> index 045df27fff16..825af7a33919 100644\n> >>> --- a/include/libcamera/base/event_dispatcher.h\n> >>> +++ b/include/libcamera/base/event_dispatcher.h\n> >>> @@ -9,6 +9,8 @@\n> >>>\n> >>>  #include <vector>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>> +\n> >>>  namespace libcamera {\n> >>>\n> >>>  class EventNotifier;\n> >>> diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n> >>> index ae2a3f04e4b9..88835902980c 100644\n> >>> --- a/include/libcamera/base/event_dispatcher_poll.h\n> >>> +++ b/include/libcamera/base/event_dispatcher_poll.h\n> >>> @@ -13,6 +13,8 @@\n> >>>\n> >>>  #include <libcamera/base/event_dispatcher.h>\n> >>>\n\nExtra blank line ?\n\nI'd be tempted to move private.h to the very beginning, but it may cause\nissues with clang-format I suppose.\n\n> >>> +#include <libcamera/base/private.h>\n> >>> +\n> >>>  struct pollfd;\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n> >>> index 8a6419f23004..6bb4e5143aa6 100644\n> >>> --- a/include/libcamera/base/event_notifier.h\n> >>> +++ b/include/libcamera/base/event_notifier.h\n> >>> @@ -8,6 +8,7 @@\n> >>>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n> >>>\n> >>>  #include <libcamera/base/object.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/signal.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n> >>> index e8e4b76e1a4e..cecbb254591f 100644\n> >>> --- a/include/libcamera/base/file.h\n> >>> +++ b/include/libcamera/base/file.h\n> >>> @@ -12,6 +12,7 @@\n> >>>  #include <sys/types.h>\n> >>>\n> >>>  #include <libcamera/base/class.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>\n> >>>  #include <libcamera/span.h>\n> >>>\n> >>> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n> >>> index b93c947ae7db..70582cd47902 100644\n> >>> --- a/include/libcamera/base/log.h\n> >>> +++ b/include/libcamera/base/log.h\n> >>> @@ -11,6 +11,7 @@\n> >>>  #include <sstream>\n> >>>\n> >>>  #include <libcamera/base/class.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/utils.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n> >>> index 83c664affc88..aaac324d7149 100644\n> >>> --- a/include/libcamera/base/meson.build\n> >>> +++ b/include/libcamera/base/meson.build\n> >>> @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n> >>>      'log.h',\n> >>>      'message.h',\n> >>>      'object.h',\n> >>> +    'private.h',\n> >>>      'semaphore.h',\n> >>>      'signal.h',\n> >>>      'thread.h',\n> >>> diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n> >>> new file mode 100644\n> >>> index 000000000000..b54ad076688e\n> >>> --- /dev/null\n> >>> +++ b/include/libcamera/base/private.h\n> >>> @@ -0,0 +1,22 @@\n> >>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> >>> +/*\n> >>> + * Copyright (C) 2021, Google Inc.\n> >>> + *\n> >>> + * private.h - Private Header Validation\n> >>> + *\n> >>> + * A selection of internal libcamera headers are installed as part\n> >>> + * of the libcamera package to allow sharing of a select subset of\n> >>> + * internal functionality with IPA module developers only.\n\ns/developers //\n\n> >>> + *\n> >>> + * This functionality is not considered part of the public libcamera\n> >>> + * API, and can therefore potentially face ABI instabilities which\n> >>> + * should not be exposed to applications. IPA modules however should be\n> >>> + * versioned and more closely matched to the libcamera installation.\n> >>> + *\n> >>> + * Components which include this file can not be included in any file\n> >>> + * which forms part of the libcamera API.\n> >>> + */\n> >>> +\n> >>> +#ifndef LIBCAMERA_BASE_PRIVATE\n> >>> +#error \"Private headers must not be included in the libcamera API\"\n> >>> +#endif\n> >>> diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n> >>> index c8e62e3ee68b..d8146eb8060b 100644\n> >>> --- a/include/libcamera/base/semaphore.h\n> >>> +++ b/include/libcamera/base/semaphore.h\n> >>> @@ -9,6 +9,7 @@\n> >>>\n> >>>  #include <condition_variable>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/thread.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n> >>> index 2ed18d49c978..b30ed12715a2 100644\n> >>> --- a/include/libcamera/base/thread.h\n> >>> +++ b/include/libcamera/base/thread.h\n> >>> @@ -13,6 +13,7 @@\n> >>>  #include <thread>\n> >>>\n> >>>  #include <libcamera/base/message.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/signal.h>\n> >>>  #include <libcamera/base/utils.h>\n> >>>\n> >>> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n> >>> index e79e85f1ef0d..f762e8767d97 100644\n> >>> --- a/include/libcamera/base/timer.h\n> >>> +++ b/include/libcamera/base/timer.h\n> >>> @@ -11,6 +11,7 @@\n> >>>  #include <stdint.h>\n> >>>\n> >>>  #include <libcamera/base/object.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/signal.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n> >>> index d1aaff65211a..07685045aa05 100644\n> >>> --- a/include/libcamera/base/utils.h\n> >>> +++ b/include/libcamera/base/utils.h\n> >>> @@ -19,6 +19,8 @@\n> >>>  #include <utility>\n> >>>  #include <vector>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>> +\n> >>>  #ifndef __DOXYGEN__\n> >>>\n> >>>  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n> >>> diff --git a/src/android/meson.build b/src/android/meson.build\n> >>> index bd58ef964c2a..7d1e7e85f16e 100644\n> >>> --- a/src/android/meson.build\n> >>> +++ b/src/android/meson.build\n> >>> @@ -4,7 +4,7 @@ android_deps = [\n> >>>      dependency('libexif', required : get_option('android')),\n> >>>      dependency('libjpeg', required : get_option('android')),\n> >>>      dependency('yaml-0.1', required : get_option('android')),\n> >>> -    libcamera_dep,\n> >>> +    libcamera_private,\n> >>>  ]\n> >>>\n> >>>  android_enabled = true\n> >>> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n> >>> index 0d843846acde..b63641908710 100644\n> >>> --- a/src/ipa/ipu3/meson.build\n> >>> +++ b/src/ipa/ipu3/meson.build\n> >>> @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n> >>>                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n> >>>                      name_prefix : '',\n> >>>                      include_directories : [ipa_includes, libipa_includes],\n> >>> -                    dependencies : libcamera_dep,\n> >>> +                    dependencies : libcamera_private,\n> >>>                      link_with : libipa,\n> >>>                      install : true,\n> >>>                      install_dir : ipa_install_dir)\n> >>> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> >>> index 038fc49060ef..ca541a5aafd7 100644\n> >>> --- a/src/ipa/libipa/meson.build\n> >>> +++ b/src/ipa/libipa/meson.build\n> >>> @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n> >>>\n> >>>  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n> >>>                          include_directories : ipa_includes,\n> >>> -                        dependencies : libcamera_dep)\n> >>> +                        dependencies : libcamera_private)\n> >>> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n> >>> index 230356d3ce3a..d7203aa042cd 100644\n> >>> --- a/src/ipa/raspberrypi/meson.build\n> >>> +++ b/src/ipa/raspberrypi/meson.build\n> >>> @@ -3,7 +3,7 @@\n> >>>  ipa_name = 'ipa_rpi'\n> >>>\n> >>>  rpi_ipa_deps = [\n> >>> -    libcamera_dep,\n> >>> +    libcamera_private,\n> >>>      dependency('boost'),\n> >>>      libatomic,\n> >>>  ]\n> >>> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n> >>> index 1a1c71591039..f76b37f5af50 100644\n> >>> --- a/src/ipa/rkisp1/meson.build\n> >>> +++ b/src/ipa/rkisp1/meson.build\n> >>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n> >>>                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n> >>>                      name_prefix : '',\n> >>>                      include_directories : [ipa_includes, libipa_includes],\n> >>> -                    dependencies : libcamera_dep,\n> >>> +                    dependencies : libcamera_private,\n> >>>                      link_with : libipa,\n> >>>                      install : true,\n> >>>                      install_dir : ipa_install_dir)\n> >>> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n> >>> index a35825ae25a6..ecbeee136451 100644\n> >>> --- a/src/ipa/vimc/meson.build\n> >>> +++ b/src/ipa/vimc/meson.build\n> >>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n> >>>                      ['vimc.cpp', libcamera_generated_ipa_headers],\n> >>>                      name_prefix : '',\n> >>>                      include_directories : [ipa_includes, libipa_includes],\n> >>> -                    dependencies : libcamera_dep,\n> >>> +                    dependencies : libcamera_private,\n> >>>                      link_with : libipa,\n> >>>                      install : true,\n> >>>                      install_dir : ipa_install_dir)\n> >>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> >>> index a8b04cfc8a5f..871721571e98 100644\n> >>> --- a/src/libcamera/base/meson.build\n> >>> +++ b/src/libcamera/base/meson.build\n> >>> @@ -21,10 +21,15 @@ libcamera_base_deps = [\n> >>>      dependency('threads'),\n> >>>  ]\n> >>>\n> >>> +# Internal components must use the libcamera_base_private dependency to enable\n> >>> +# the use of headers which must not be exposed to the libcamera public api.\n> >>> +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> >>> +\n> >>>  libcamera_base_lib = shared_library('libcamera-base',\n> >>>                                      [libcamera_base_sources, libcamera_base_headers],\n> >>>                                      name_prefix : '',\n> >>>                                      install : true,\n> >>> +                                    cpp_args : libcamera_base_args,\n> >>>                                      include_directories : libcamera_includes,\n> >>>                                      dependencies : libcamera_base_deps)\n> >>>\n> >>> @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n> >>>                   version : '1.0',\n> >>>                   description : 'Camera support base utility library',\n> >>>                   subdirs : 'libcamera')\n> >>> +\n> >>> +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n> >>> +                                            compile_args : libcamera_base_args)\n> >>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> >>> index 1f163cfe1225..64c7475f1a2e 100644\n> >>> --- a/src/libcamera/meson.build\n> >>> +++ b/src/libcamera/meson.build\n> >>> @@ -115,7 +115,7 @@ libcamera_deps = [\n> >>>      libgnutls,\n> >>>      liblttng,\n> >>>      libudev,\n> >>> -    libcamera_base,\n> >>> +    libcamera_base_private,\n> >>>  ]\n> >>>\n> >>>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n> >>> @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n> >>>                                         libcamera_generated_ipa_headers,\n> >>>                                     ],\n> >>>                                     include_directories : libcamera_includes,\n> >>> -                                   dependencies: libcamera_base,\n> >>> +                                   dependencies : libcamera_base,\n> >>>                                     link_with : libcamera)\n> >>>\n> >>> +# Internal dependancy for components and plugins which can use Private APIs\n\ns/dependancy/dependency/\ns/Private/private/\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >>> +libcamera_private = declare_dependency(dependencies : [\n> >>> +                                           libcamera_dep,\n> >>> +                                           libcamera_base_private,\n> >>> +                                       ])\n> >>> +\n> >>>  pkg_mod = import('pkgconfig')\n> >>>  pkg_mod.generate(libcamera,\n> >>>                   libraries : libcamera_base_lib,\n> >>> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n> >>> index 28fe5f1fd6b2..70c8760a3d42 100644\n> >>> --- a/src/libcamera/proxy/worker/meson.build\n> >>> +++ b/src/libcamera/proxy/worker/meson.build\n> >>> @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n> >>>                         [worker, libcamera_generated_ipa_headers],\n> >>>                         install : true,\n> >>>                         install_dir : proxy_install_dir,\n> >>> -                       dependencies : libcamera_dep)\n> >>> +                       dependencies : libcamera_private)\n> >>>  endforeach\n> >>>\n> >>>  config_h.set('IPA_PROXY_DIR',\n> >>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> >>> index 0accac194be4..f78497b6799b 100644\n> >>> --- a/src/v4l2/meson.build\n> >>> +++ b/src/v4l2/meson.build\n> >>> @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n> >>>                               v4l2_compat_sources,\n> >>>                               name_prefix : '',\n> >>>                               install : true,\n> >>> -                             dependencies : [libcamera_dep, libdl],\n> >>> +                             dependencies : [libcamera_private, libdl],\n> >>>                               cpp_args : v4l2_compat_cpp_args)\n> >>> diff --git a/test/camera/meson.build b/test/camera/meson.build\n> >>> index 9cb95affffab..002a87b594e0 100644\n> >>> --- a/test/camera/meson.build\n> >>> +++ b/test/camera/meson.build\n> >>> @@ -12,7 +12,7 @@ camera_tests = [\n> >>>\n> >>>  foreach t : camera_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'camera', is_parallel : false)\n> >>> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n> >>> index e8a041b5bbd2..7938633e54ab 100644\n> >>> --- a/test/ipa/meson.build\n> >>> +++ b/test/ipa/meson.build\n> >>> @@ -7,7 +7,7 @@ ipa_test = [\n> >>>\n> >>>  foreach t : ipa_test\n> >>>      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : [libipa, test_libraries],\n> >>>                       include_directories : [libipa_includes, test_includes_internal])\n> >>>\n> >>> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n> >>> index ad47b2feb718..2a6cd7fb8433 100644\n> >>> --- a/test/ipc/meson.build\n> >>> +++ b/test/ipc/meson.build\n> >>> @@ -7,7 +7,7 @@ ipc_tests = [\n> >>>\n> >>>  foreach t : ipc_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n> >>> index 542335ea5e7c..351629f3ce73 100644\n> >>> --- a/test/libtest/meson.build\n> >>> +++ b/test/libtest/meson.build\n> >>> @@ -18,7 +18,7 @@ test_includes_internal = [\n> >>>  ]\n> >>>\n> >>>  libtest = static_library('libtest', libtest_sources,\n> >>> -                         dependencies : libcamera_dep,\n> >>> +                         dependencies : libcamera_private,\n> >>>                           include_directories : test_includes_internal)\n> >>>\n> >>>  test_libraries = [libtest]\n> >>> diff --git a/test/log/meson.build b/test/log/meson.build\n> >>> index 8cd664e04a00..ac87841a24e1 100644\n> >>> --- a/test/log/meson.build\n> >>> +++ b/test/log/meson.build\n> >>> @@ -7,7 +7,7 @@ log_test = [\n> >>>\n> >>>  foreach t : log_test\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n> >>> index 1dfcdd8bd744..83dfe8f11d2f 100644\n> >>> --- a/test/media_device/meson.build\n> >>> +++ b/test/media_device/meson.build\n> >>> @@ -11,12 +11,12 @@ media_device_tests = [\n> >>>  ]\n> >>>\n> >>>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n> >>> -                               dependencies : libcamera_dep,\n> >>> +                               dependencies : libcamera_private,\n> >>>                                 include_directories : test_includes_internal)\n> >>>\n> >>>  foreach t : media_device_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : [test_libraries, lib_mdev_test],\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/meson.build b/test/meson.build\n> >>> index 045ad2a2d7c9..b8615e0fd3e6 100644\n> >>> --- a/test/meson.build\n> >>> +++ b/test/meson.build\n> >>> @@ -64,7 +64,7 @@ endforeach\n> >>>\n> >>>  foreach t : internal_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n> >>> index d062ecd269f2..16701080ca2b 100644\n> >>> --- a/test/pipeline/ipu3/meson.build\n> >>> +++ b/test/pipeline/ipu3/meson.build\n> >>> @@ -6,7 +6,7 @@ ipu3_test = [\n> >>>\n> >>>  foreach t : ipu3_test\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n> >>> index ece147b054e4..364b5711a0f9 100644\n> >>> --- a/test/pipeline/rkisp1/meson.build\n> >>> +++ b/test/pipeline/rkisp1/meson.build\n> >>> @@ -6,7 +6,7 @@ rkisp1_test = [\n> >>>\n> >>>  foreach t : rkisp1_test\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/process/meson.build b/test/process/meson.build\n> >>> index d2272d509db3..af86b277db63 100644\n> >>> --- a/test/process/meson.build\n> >>> +++ b/test/process/meson.build\n> >>> @@ -6,7 +6,7 @@ process_tests = [\n> >>>\n> >>>  foreach t : process_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n> >>> index 2460e0b114b3..9fb9cd1db968 100644\n> >>> --- a/test/serialization/generated_serializer/meson.build\n> >>> +++ b/test/serialization/generated_serializer/meson.build\n> >>> @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n> >>>                       generated_test_header,\n> >>>                       generated_test_serializer,\n> >>>                   ],\n> >>> -                 dependencies : libcamera_dep,\n> >>> +                 dependencies : libcamera_private,\n> >>>                   link_with : test_libraries,\n> >>>                   include_directories : [\n> >>>                       test_includes_internal,\n> >>> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n> >>> index 60ebf3255b28..5446e4907f33 100644\n> >>> --- a/test/serialization/meson.build\n> >>> +++ b/test/serialization/meson.build\n> >>> @@ -9,7 +9,7 @@ serialization_tests = [\n> >>>\n> >>>  foreach t : serialization_tests\n> >>>      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'serialization', is_parallel : true)\n> >>> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n> >>> index 40d39766af9b..d82be3c60b75 100644\n> >>> --- a/test/v4l2_subdevice/meson.build\n> >>> +++ b/test/v4l2_subdevice/meson.build\n> >>> @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n> >>>\n> >>>  foreach t : v4l2_subdevice_tests\n> >>>      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n> >>> -        dependencies : libcamera_dep,\n> >>> +        dependencies : libcamera_private,\n> >>>          link_with : test_libraries,\n> >>>          include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n> >>> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n> >>> index e733518c0185..643f82edce5e 100644\n> >>> --- a/test/v4l2_videodevice/meson.build\n> >>> +++ b/test/v4l2_videodevice/meson.build\n> >>> @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n> >>>\n> >>>  foreach t : v4l2_videodevice_tests\n> >>>      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C316CC321D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jun 2021 12:50:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3240C684CF;\n\tFri, 25 Jun 2021 14:50:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6168B684C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 14:50:50 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A39491853;\n\tFri, 25 Jun 2021 14:50:49 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pLF6nbe2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624625449;\n\tbh=Ig95ELVXA0Q3MZ254HAUrOyIpk9d5Lenrw1VVJKb9tw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pLF6nbe2I3N9r8HpVs3FQaPYzFRvUqVx2nfqIIRjTE/IpFWDEBcawaDzaxhWOS/tl\n\tEpQp/ZQBzthQgI8V6OajzYJyb9HFG876XUUMKU77alisD6L67zYL8ypOMOUVTY+PUR\n\ty3TjHUcu67orMCZkvVL6H3hbMzvN3QUjfPjefhF0=","Date":"Fri, 25 Jun 2021 15:50:19 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YNXRC9eEhre8IB8L@pendragon.ideasonboard.com>","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>\n\t<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>\n\t<20210625084008.GN2599@pyrite.rasen.tech>\n\t<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17816,"web_url":"https://patchwork.libcamera.org/comment/17816/","msgid":"<6f7e4182-2ad6-1423-7ce3-52b88f3b1808@ideasonboard.com>","date":"2021-06-25T14:49:41","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 25/06/2021 13:50, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Fri, Jun 25, 2021 at 10:34:29AM +0100, Kieran Bingham wrote:\n>> On 25/06/2021 09:40, paul.elder@ideasonboard.com wrote:\n>>> On Fri, Jun 25, 2021 at 01:12:57PM +0900, Hirokazu Honda wrote:\n>>>> On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham wrote:\n>>>>>\n>>>>> Headers which must not be exposed as part of the public libcamera API\n>>>>> can include base/private.h.\n>>>>>\n>>>>> Any interface which includes the private.h header will only be able to\n>>>>> build if the libcamera_private dependency is used (or the\n>>>>> libcamera_base_private dependency directly)\n>>>>\n>>>> I couldn't understand well which one of the four dependencies\n>>>> (libcamera_private, libcamera_base, libcamera_dep,\n>>>> libcamera_base_private) should be used in a specific target.\n>>>> Would you mind describing the rule of using these dependencies?\n>>>\n>>> My understanding is that:\n>>>\n>>> - libcamera_base is everything in base\n>>> - libcamera_base_private is libcamera_base + the macro required for\n>>>   using the private headers\n>>\n>> Correct.\n>>\n>>> - libcamera_dep is public + private, for things like IPAs and internal\n>>>   components (but doesn't include the macro for private headers)\n>>\n>> - libcamera_dep is the existing, widely used dependency for linking\n>> against libcamera within the meson project.\n>>\n>> It indeed links against all things public and private currently, and\n>> anything which references this could use any part of the libcamera library.\n>>\n>> (However after this patch, any inclusion of a header without defining\n>> 'LIBCAMERA_BASE_PRIVATE' will hit a compile break)\n>>\n>>> - libcamera_private is libcamera_dep + the macro\n>>\n>> Correct - this allows a component to link against libcamera, whilst also\n>> defining that it is explicitly allowed to access 'private' components,\n>> which should not leak to the public APIs.\n>>\n>>> Kieran, is this correct? (it is a bit hard to keep track of...)\n>>\n>> I've added\n>>\n>>\n>> Build targets which are intended to use the private API's will use the\n>> libcamera_private to handle the automatic definition of the inclusion\n>> guard.\n>>\n>>\n>> It's hard to go into more detail on this in this commit, as it's about\n>> to get changed in the up coming patches, and I don't want someone to\n>> read this and say \"Oh I should use the libcamera_dep for my public\n>> component, as ... it will very soon become libcamera_public\"\n> \n> Let's make sure it's properly documented with the whole series applied,\n> it should be enough.\n> \n>>>>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>>>> ---\n>>>>>  include/libcamera/base/event_dispatcher.h     |  2 ++\n>>>>>  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n>>>>>  include/libcamera/base/event_notifier.h       |  1 +\n>>>>>  include/libcamera/base/file.h                 |  1 +\n>>>>>  include/libcamera/base/log.h                  |  1 +\n>>>>>  include/libcamera/base/meson.build            |  1 +\n>>>>>  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n>>>>>  include/libcamera/base/semaphore.h            |  1 +\n>>>>>  include/libcamera/base/thread.h               |  1 +\n>>>>>  include/libcamera/base/timer.h                |  1 +\n>>>>>  include/libcamera/base/utils.h                |  2 ++\n>>>>>  src/android/meson.build                       |  2 +-\n>>>>>  src/ipa/ipu3/meson.build                      |  2 +-\n>>>>>  src/ipa/libipa/meson.build                    |  2 +-\n>>>>>  src/ipa/raspberrypi/meson.build               |  2 +-\n>>>>>  src/ipa/rkisp1/meson.build                    |  2 +-\n>>>>>  src/ipa/vimc/meson.build                      |  2 +-\n>>>>>  src/libcamera/base/meson.build                |  8 +++++++\n>>>>>  src/libcamera/meson.build                     | 10 +++++++--\n>>>>>  src/libcamera/proxy/worker/meson.build        |  2 +-\n>>>>>  src/v4l2/meson.build                          |  2 +-\n>>>>>  test/camera/meson.build                       |  2 +-\n>>>>>  test/ipa/meson.build                          |  2 +-\n>>>>>  test/ipc/meson.build                          |  2 +-\n>>>>>  test/libtest/meson.build                      |  2 +-\n>>>>>  test/log/meson.build                          |  2 +-\n>>>>>  test/media_device/meson.build                 |  4 ++--\n>>>>>  test/meson.build                              |  2 +-\n>>>>>  test/pipeline/ipu3/meson.build                |  2 +-\n>>>>>  test/pipeline/rkisp1/meson.build              |  2 +-\n>>>>>  test/process/meson.build                      |  2 +-\n>>>>>  .../generated_serializer/meson.build          |  2 +-\n>>>>>  test/serialization/meson.build                |  2 +-\n>>>>>  test/v4l2_subdevice/meson.build               |  2 +-\n>>>>>  test/v4l2_videodevice/meson.build             |  2 +-\n>>>>>  35 files changed, 74 insertions(+), 25 deletions(-)\n>>>>>  create mode 100644 include/libcamera/base/private.h\n>>>>>\n>>>>> diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n>>>>> index 045df27fff16..825af7a33919 100644\n>>>>> --- a/include/libcamera/base/event_dispatcher.h\n>>>>> +++ b/include/libcamera/base/event_dispatcher.h\n>>>>> @@ -9,6 +9,8 @@\n>>>>>\n>>>>>  #include <vector>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>> +\n>>>>>  namespace libcamera {\n>>>>>\n>>>>>  class EventNotifier;\n>>>>> diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n>>>>> index ae2a3f04e4b9..88835902980c 100644\n>>>>> --- a/include/libcamera/base/event_dispatcher_poll.h\n>>>>> +++ b/include/libcamera/base/event_dispatcher_poll.h\n>>>>> @@ -13,6 +13,8 @@\n>>>>>\n>>>>>  #include <libcamera/base/event_dispatcher.h>\n>>>>>\n> \n> Extra blank line ?\n> \n> I'd be tempted to move private.h to the very beginning, but it may cause\n> issues with clang-format I suppose.\n\nI had the same thoughts but left it to be sorted automatically.\n\nBut ... now I'm better at handling the .clang-format sorts - I can\ncreate a new 'group' for private headers to separate it.\n\nI think that's a useful thing, as these need to stand out as private as\na declaration, not be hidden in amongst others.\n\nWe're late enough in the series that I can do this without rebase pain.\n\nI'll update it now.\n\n> \n>>>>> +#include <libcamera/base/private.h>\n>>>>> +\n>>>>>  struct pollfd;\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n>>>>> index 8a6419f23004..6bb4e5143aa6 100644\n>>>>> --- a/include/libcamera/base/event_notifier.h\n>>>>> +++ b/include/libcamera/base/event_notifier.h\n>>>>> @@ -8,6 +8,7 @@\n>>>>>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n>>>>>\n>>>>>  #include <libcamera/base/object.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/signal.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n>>>>> index e8e4b76e1a4e..cecbb254591f 100644\n>>>>> --- a/include/libcamera/base/file.h\n>>>>> +++ b/include/libcamera/base/file.h\n>>>>> @@ -12,6 +12,7 @@\n>>>>>  #include <sys/types.h>\n>>>>>\n>>>>>  #include <libcamera/base/class.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>\n>>>>>  #include <libcamera/span.h>\n>>>>>\n>>>>> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n>>>>> index b93c947ae7db..70582cd47902 100644\n>>>>> --- a/include/libcamera/base/log.h\n>>>>> +++ b/include/libcamera/base/log.h\n>>>>> @@ -11,6 +11,7 @@\n>>>>>  #include <sstream>\n>>>>>\n>>>>>  #include <libcamera/base/class.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/utils.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n>>>>> index 83c664affc88..aaac324d7149 100644\n>>>>> --- a/include/libcamera/base/meson.build\n>>>>> +++ b/include/libcamera/base/meson.build\n>>>>> @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n>>>>>      'log.h',\n>>>>>      'message.h',\n>>>>>      'object.h',\n>>>>> +    'private.h',\n>>>>>      'semaphore.h',\n>>>>>      'signal.h',\n>>>>>      'thread.h',\n>>>>> diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n>>>>> new file mode 100644\n>>>>> index 000000000000..b54ad076688e\n>>>>> --- /dev/null\n>>>>> +++ b/include/libcamera/base/private.h\n>>>>> @@ -0,0 +1,22 @@\n>>>>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>>>> +/*\n>>>>> + * Copyright (C) 2021, Google Inc.\n>>>>> + *\n>>>>> + * private.h - Private Header Validation\n>>>>> + *\n>>>>> + * A selection of internal libcamera headers are installed as part\n>>>>> + * of the libcamera package to allow sharing of a select subset of\n>>>>> + * internal functionality with IPA module developers only.\n> \n> s/developers //\n> \n>>>>> + *\n>>>>> + * This functionality is not considered part of the public libcamera\n>>>>> + * API, and can therefore potentially face ABI instabilities which\n>>>>> + * should not be exposed to applications. IPA modules however should be\n>>>>> + * versioned and more closely matched to the libcamera installation.\n>>>>> + *\n>>>>> + * Components which include this file can not be included in any file\n>>>>> + * which forms part of the libcamera API.\n>>>>> + */\n>>>>> +\n>>>>> +#ifndef LIBCAMERA_BASE_PRIVATE\n>>>>> +#error \"Private headers must not be included in the libcamera API\"\n>>>>> +#endif\n>>>>> diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n>>>>> index c8e62e3ee68b..d8146eb8060b 100644\n>>>>> --- a/include/libcamera/base/semaphore.h\n>>>>> +++ b/include/libcamera/base/semaphore.h\n>>>>> @@ -9,6 +9,7 @@\n>>>>>\n>>>>>  #include <condition_variable>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/thread.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n>>>>> index 2ed18d49c978..b30ed12715a2 100644\n>>>>> --- a/include/libcamera/base/thread.h\n>>>>> +++ b/include/libcamera/base/thread.h\n>>>>> @@ -13,6 +13,7 @@\n>>>>>  #include <thread>\n>>>>>\n>>>>>  #include <libcamera/base/message.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/signal.h>\n>>>>>  #include <libcamera/base/utils.h>\n>>>>>\n>>>>> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n>>>>> index e79e85f1ef0d..f762e8767d97 100644\n>>>>> --- a/include/libcamera/base/timer.h\n>>>>> +++ b/include/libcamera/base/timer.h\n>>>>> @@ -11,6 +11,7 @@\n>>>>>  #include <stdint.h>\n>>>>>\n>>>>>  #include <libcamera/base/object.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/signal.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n>>>>> index d1aaff65211a..07685045aa05 100644\n>>>>> --- a/include/libcamera/base/utils.h\n>>>>> +++ b/include/libcamera/base/utils.h\n>>>>> @@ -19,6 +19,8 @@\n>>>>>  #include <utility>\n>>>>>  #include <vector>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>> +\n>>>>>  #ifndef __DOXYGEN__\n>>>>>\n>>>>>  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n>>>>> diff --git a/src/android/meson.build b/src/android/meson.build\n>>>>> index bd58ef964c2a..7d1e7e85f16e 100644\n>>>>> --- a/src/android/meson.build\n>>>>> +++ b/src/android/meson.build\n>>>>> @@ -4,7 +4,7 @@ android_deps = [\n>>>>>      dependency('libexif', required : get_option('android')),\n>>>>>      dependency('libjpeg', required : get_option('android')),\n>>>>>      dependency('yaml-0.1', required : get_option('android')),\n>>>>> -    libcamera_dep,\n>>>>> +    libcamera_private,\n>>>>>  ]\n>>>>>\n>>>>>  android_enabled = true\n>>>>> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n>>>>> index 0d843846acde..b63641908710 100644\n>>>>> --- a/src/ipa/ipu3/meson.build\n>>>>> +++ b/src/ipa/ipu3/meson.build\n>>>>> @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n>>>>>                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n>>>>>                      name_prefix : '',\n>>>>>                      include_directories : [ipa_includes, libipa_includes],\n>>>>> -                    dependencies : libcamera_dep,\n>>>>> +                    dependencies : libcamera_private,\n>>>>>                      link_with : libipa,\n>>>>>                      install : true,\n>>>>>                      install_dir : ipa_install_dir)\n>>>>> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n>>>>> index 038fc49060ef..ca541a5aafd7 100644\n>>>>> --- a/src/ipa/libipa/meson.build\n>>>>> +++ b/src/ipa/libipa/meson.build\n>>>>> @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n>>>>>\n>>>>>  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n>>>>>                          include_directories : ipa_includes,\n>>>>> -                        dependencies : libcamera_dep)\n>>>>> +                        dependencies : libcamera_private)\n>>>>> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n>>>>> index 230356d3ce3a..d7203aa042cd 100644\n>>>>> --- a/src/ipa/raspberrypi/meson.build\n>>>>> +++ b/src/ipa/raspberrypi/meson.build\n>>>>> @@ -3,7 +3,7 @@\n>>>>>  ipa_name = 'ipa_rpi'\n>>>>>\n>>>>>  rpi_ipa_deps = [\n>>>>> -    libcamera_dep,\n>>>>> +    libcamera_private,\n>>>>>      dependency('boost'),\n>>>>>      libatomic,\n>>>>>  ]\n>>>>> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n>>>>> index 1a1c71591039..f76b37f5af50 100644\n>>>>> --- a/src/ipa/rkisp1/meson.build\n>>>>> +++ b/src/ipa/rkisp1/meson.build\n>>>>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>>>>>                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n>>>>>                      name_prefix : '',\n>>>>>                      include_directories : [ipa_includes, libipa_includes],\n>>>>> -                    dependencies : libcamera_dep,\n>>>>> +                    dependencies : libcamera_private,\n>>>>>                      link_with : libipa,\n>>>>>                      install : true,\n>>>>>                      install_dir : ipa_install_dir)\n>>>>> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n>>>>> index a35825ae25a6..ecbeee136451 100644\n>>>>> --- a/src/ipa/vimc/meson.build\n>>>>> +++ b/src/ipa/vimc/meson.build\n>>>>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>>>>>                      ['vimc.cpp', libcamera_generated_ipa_headers],\n>>>>>                      name_prefix : '',\n>>>>>                      include_directories : [ipa_includes, libipa_includes],\n>>>>> -                    dependencies : libcamera_dep,\n>>>>> +                    dependencies : libcamera_private,\n>>>>>                      link_with : libipa,\n>>>>>                      install : true,\n>>>>>                      install_dir : ipa_install_dir)\n>>>>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n>>>>> index a8b04cfc8a5f..871721571e98 100644\n>>>>> --- a/src/libcamera/base/meson.build\n>>>>> +++ b/src/libcamera/base/meson.build\n>>>>> @@ -21,10 +21,15 @@ libcamera_base_deps = [\n>>>>>      dependency('threads'),\n>>>>>  ]\n>>>>>\n>>>>> +# Internal components must use the libcamera_base_private dependency to enable\n>>>>> +# the use of headers which must not be exposed to the libcamera public api.\n>>>>> +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n>>>>> +\n>>>>>  libcamera_base_lib = shared_library('libcamera-base',\n>>>>>                                      [libcamera_base_sources, libcamera_base_headers],\n>>>>>                                      name_prefix : '',\n>>>>>                                      install : true,\n>>>>> +                                    cpp_args : libcamera_base_args,\n>>>>>                                      include_directories : libcamera_includes,\n>>>>>                                      dependencies : libcamera_base_deps)\n>>>>>\n>>>>> @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n>>>>>                   version : '1.0',\n>>>>>                   description : 'Camera support base utility library',\n>>>>>                   subdirs : 'libcamera')\n>>>>> +\n>>>>> +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n>>>>> +                                            compile_args : libcamera_base_args)\n>>>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>>>>> index 1f163cfe1225..64c7475f1a2e 100644\n>>>>> --- a/src/libcamera/meson.build\n>>>>> +++ b/src/libcamera/meson.build\n>>>>> @@ -115,7 +115,7 @@ libcamera_deps = [\n>>>>>      libgnutls,\n>>>>>      liblttng,\n>>>>>      libudev,\n>>>>> -    libcamera_base,\n>>>>> +    libcamera_base_private,\n>>>>>  ]\n>>>>>\n>>>>>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n>>>>> @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n>>>>>                                         libcamera_generated_ipa_headers,\n>>>>>                                     ],\n>>>>>                                     include_directories : libcamera_includes,\n>>>>> -                                   dependencies: libcamera_base,\n>>>>> +                                   dependencies : libcamera_base,\n>>>>>                                     link_with : libcamera)\n>>>>>\n>>>>> +# Internal dependancy for components and plugins which can use Private APIs\n> \n> s/dependancy/dependency/\n> s/Private/private/\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n>>>>> +libcamera_private = declare_dependency(dependencies : [\n>>>>> +                                           libcamera_dep,\n>>>>> +                                           libcamera_base_private,\n>>>>> +                                       ])\n>>>>> +\n>>>>>  pkg_mod = import('pkgconfig')\n>>>>>  pkg_mod.generate(libcamera,\n>>>>>                   libraries : libcamera_base_lib,\n>>>>> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n>>>>> index 28fe5f1fd6b2..70c8760a3d42 100644\n>>>>> --- a/src/libcamera/proxy/worker/meson.build\n>>>>> +++ b/src/libcamera/proxy/worker/meson.build\n>>>>> @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n>>>>>                         [worker, libcamera_generated_ipa_headers],\n>>>>>                         install : true,\n>>>>>                         install_dir : proxy_install_dir,\n>>>>> -                       dependencies : libcamera_dep)\n>>>>> +                       dependencies : libcamera_private)\n>>>>>  endforeach\n>>>>>\n>>>>>  config_h.set('IPA_PROXY_DIR',\n>>>>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n>>>>> index 0accac194be4..f78497b6799b 100644\n>>>>> --- a/src/v4l2/meson.build\n>>>>> +++ b/src/v4l2/meson.build\n>>>>> @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n>>>>>                               v4l2_compat_sources,\n>>>>>                               name_prefix : '',\n>>>>>                               install : true,\n>>>>> -                             dependencies : [libcamera_dep, libdl],\n>>>>> +                             dependencies : [libcamera_private, libdl],\n>>>>>                               cpp_args : v4l2_compat_cpp_args)\n>>>>> diff --git a/test/camera/meson.build b/test/camera/meson.build\n>>>>> index 9cb95affffab..002a87b594e0 100644\n>>>>> --- a/test/camera/meson.build\n>>>>> +++ b/test/camera/meson.build\n>>>>> @@ -12,7 +12,7 @@ camera_tests = [\n>>>>>\n>>>>>  foreach t : camera_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'camera', is_parallel : false)\n>>>>> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n>>>>> index e8a041b5bbd2..7938633e54ab 100644\n>>>>> --- a/test/ipa/meson.build\n>>>>> +++ b/test/ipa/meson.build\n>>>>> @@ -7,7 +7,7 @@ ipa_test = [\n>>>>>\n>>>>>  foreach t : ipa_test\n>>>>>      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : [libipa, test_libraries],\n>>>>>                       include_directories : [libipa_includes, test_includes_internal])\n>>>>>\n>>>>> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n>>>>> index ad47b2feb718..2a6cd7fb8433 100644\n>>>>> --- a/test/ipc/meson.build\n>>>>> +++ b/test/ipc/meson.build\n>>>>> @@ -7,7 +7,7 @@ ipc_tests = [\n>>>>>\n>>>>>  foreach t : ipc_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n>>>>> index 542335ea5e7c..351629f3ce73 100644\n>>>>> --- a/test/libtest/meson.build\n>>>>> +++ b/test/libtest/meson.build\n>>>>> @@ -18,7 +18,7 @@ test_includes_internal = [\n>>>>>  ]\n>>>>>\n>>>>>  libtest = static_library('libtest', libtest_sources,\n>>>>> -                         dependencies : libcamera_dep,\n>>>>> +                         dependencies : libcamera_private,\n>>>>>                           include_directories : test_includes_internal)\n>>>>>\n>>>>>  test_libraries = [libtest]\n>>>>> diff --git a/test/log/meson.build b/test/log/meson.build\n>>>>> index 8cd664e04a00..ac87841a24e1 100644\n>>>>> --- a/test/log/meson.build\n>>>>> +++ b/test/log/meson.build\n>>>>> @@ -7,7 +7,7 @@ log_test = [\n>>>>>\n>>>>>  foreach t : log_test\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n>>>>> index 1dfcdd8bd744..83dfe8f11d2f 100644\n>>>>> --- a/test/media_device/meson.build\n>>>>> +++ b/test/media_device/meson.build\n>>>>> @@ -11,12 +11,12 @@ media_device_tests = [\n>>>>>  ]\n>>>>>\n>>>>>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n>>>>> -                               dependencies : libcamera_dep,\n>>>>> +                               dependencies : libcamera_private,\n>>>>>                                 include_directories : test_includes_internal)\n>>>>>\n>>>>>  foreach t : media_device_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : [test_libraries, lib_mdev_test],\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/meson.build b/test/meson.build\n>>>>> index 045ad2a2d7c9..b8615e0fd3e6 100644\n>>>>> --- a/test/meson.build\n>>>>> +++ b/test/meson.build\n>>>>> @@ -64,7 +64,7 @@ endforeach\n>>>>>\n>>>>>  foreach t : internal_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n>>>>> index d062ecd269f2..16701080ca2b 100644\n>>>>> --- a/test/pipeline/ipu3/meson.build\n>>>>> +++ b/test/pipeline/ipu3/meson.build\n>>>>> @@ -6,7 +6,7 @@ ipu3_test = [\n>>>>>\n>>>>>  foreach t : ipu3_test\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n>>>>> index ece147b054e4..364b5711a0f9 100644\n>>>>> --- a/test/pipeline/rkisp1/meson.build\n>>>>> +++ b/test/pipeline/rkisp1/meson.build\n>>>>> @@ -6,7 +6,7 @@ rkisp1_test = [\n>>>>>\n>>>>>  foreach t : rkisp1_test\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/process/meson.build b/test/process/meson.build\n>>>>> index d2272d509db3..af86b277db63 100644\n>>>>> --- a/test/process/meson.build\n>>>>> +++ b/test/process/meson.build\n>>>>> @@ -6,7 +6,7 @@ process_tests = [\n>>>>>\n>>>>>  foreach t : process_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n>>>>> index 2460e0b114b3..9fb9cd1db968 100644\n>>>>> --- a/test/serialization/generated_serializer/meson.build\n>>>>> +++ b/test/serialization/generated_serializer/meson.build\n>>>>> @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n>>>>>                       generated_test_header,\n>>>>>                       generated_test_serializer,\n>>>>>                   ],\n>>>>> -                 dependencies : libcamera_dep,\n>>>>> +                 dependencies : libcamera_private,\n>>>>>                   link_with : test_libraries,\n>>>>>                   include_directories : [\n>>>>>                       test_includes_internal,\n>>>>> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n>>>>> index 60ebf3255b28..5446e4907f33 100644\n>>>>> --- a/test/serialization/meson.build\n>>>>> +++ b/test/serialization/meson.build\n>>>>> @@ -9,7 +9,7 @@ serialization_tests = [\n>>>>>\n>>>>>  foreach t : serialization_tests\n>>>>>      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'serialization', is_parallel : true)\n>>>>> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n>>>>> index 40d39766af9b..d82be3c60b75 100644\n>>>>> --- a/test/v4l2_subdevice/meson.build\n>>>>> +++ b/test/v4l2_subdevice/meson.build\n>>>>> @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n>>>>>\n>>>>>  foreach t : v4l2_subdevice_tests\n>>>>>      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n>>>>> -        dependencies : libcamera_dep,\n>>>>> +        dependencies : libcamera_private,\n>>>>>          link_with : test_libraries,\n>>>>>          include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n>>>>> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n>>>>> index e733518c0185..643f82edce5e 100644\n>>>>> --- a/test/v4l2_videodevice/meson.build\n>>>>> +++ b/test/v4l2_videodevice/meson.build\n>>>>> @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n>>>>>\n>>>>>  foreach t : v4l2_videodevice_tests\n>>>>>      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 409FBC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jun 2021 14:49:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD753684CF;\n\tFri, 25 Jun 2021 16:49:44 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECA17684C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 16:49:43 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 403C5501;\n\tFri, 25 Jun 2021 16:49:43 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FSptAsrv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624632583;\n\tbh=4GhjSF+X8z0S68txuVV4mYajdV5ekHT4c0NceaQcYyk=;\n\th=From:Subject:To:Cc:References:Date:In-Reply-To:From;\n\tb=FSptAsrvfFe8JV3euRJviE39LqtXZVG9wCudmlXLXuopXAZi71ZQNrfJ6NvKIauEH\n\tpaEkxxeZ04hOFP5Xapd+OQBXiRydzU8XOSCFoaW99Vo95/YWtP1KHnyz1q3ZxuuqLj\n\tFHBeJXmY+SlCL4BlyQCm8Tn0m9e/DWsDHy0cAvSI=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>\n\t<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>\n\t<20210625084008.GN2599@pyrite.rasen.tech>\n\t<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>\n\t<YNXRC9eEhre8IB8L@pendragon.ideasonboard.com>","Message-ID":"<6f7e4182-2ad6-1423-7ce3-52b88f3b1808@ideasonboard.com>","Date":"Fri, 25 Jun 2021 15:49:41 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<YNXRC9eEhre8IB8L@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17855,"web_url":"https://patchwork.libcamera.org/comment/17855/","msgid":"<CAO5uPHPp6WYUfxMLoVnjwP=hUwzTnuS_c=EVgHss89=2Z+Cytw@mail.gmail.com>","date":"2021-06-28T04:48:39","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Thanks Kieran and Paul,\n\nOn Fri, Jun 25, 2021 at 6:34 PM Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Hi Paul, Hiro,\n>\n> On 25/06/2021 09:40, paul.elder@ideasonboard.com wrote:\n> > Hi Hiro,\n> >\n> > On Fri, Jun 25, 2021 at 01:12:57PM +0900, Hirokazu Honda wrote:\n> >> Hi Kieran, thank you for the patch.\n> >>\n> >> On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham\n> >> <kieran.bingham@ideasonboard.com> wrote:\n> >>>\n> >>> Headers which must not be exposed as part of the public libcamera API\n> >>> can include base/private.h.\n> >>>\n> >>> Any interface which includes the private.h header will only be able to\n> >>> build if the libcamera_private dependency is used (or the\n> >>> libcamera_base_private dependency directly)\n> >>>\n> >>\n> >> I couldn't understand well which one of the four dependencies\n> >> (libcamera_private, libcamera_base, libcamera_dep,\n> >> libcamera_base_private) should be used in a specific target.\n> >> Would you mind describing the rule of using these dependencies?\n> >\n> > My understanding is that:\n> >\n> > - libcamera_base is everything in base\n> > - libcamera_base_private is libcamera_base + the macro required for\n> >   using the private headers\n>\n> Correct.\n>\n> > - libcamera_dep is public + private, for things like IPAs and internal\n> >   components (but doesn't include the macro for private headers)\n>\n> - libcamera_dep is the existing, widely used dependency for linking\n> against libcamera within the meson project.\n>\n> It indeed links against all things public and private currently, and\n> anything which references this could use any part of the libcamera library.\n>\n> (However after this patch, any inclusion of a header without defining\n> 'LIBCAMERA_BASE_PRIVATE' will hit a compile break)\n>\n>\n> > - libcamera_private is libcamera_dep + the macro\n>\n> Correct - this allows a component to link against libcamera, whilst also\n> defining that it is explicitly allowed to access 'private' components,\n> which should not leak to the public APIs.\n>\n> >\n> > Kieran, is this correct? (it is a bit hard to keep track of...)\n>\n> I've added\n>\n>\n> Build targets which are intended to use the private API's will use the\n> libcamera_private to handle the automatic definition of the inclusion\n> guard.\n>\n>\n> It's hard to go into more detail on this in this commit, as it's about\n> to get changed in the up coming patches, and I don't want someone to\n> read this and say \"Oh I should use the libcamera_dep for my public\n> component, as ... it will very soon become libcamera_public\"\n>\n\nIt would be great if the document about the targets is added later.\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n>\n>\n> >\n> >\n> > Paul\n> >\n> >>\n> >>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >>> ---\n> >>>  include/libcamera/base/event_dispatcher.h     |  2 ++\n> >>>  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n> >>>  include/libcamera/base/event_notifier.h       |  1 +\n> >>>  include/libcamera/base/file.h                 |  1 +\n> >>>  include/libcamera/base/log.h                  |  1 +\n> >>>  include/libcamera/base/meson.build            |  1 +\n> >>>  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n> >>>  include/libcamera/base/semaphore.h            |  1 +\n> >>>  include/libcamera/base/thread.h               |  1 +\n> >>>  include/libcamera/base/timer.h                |  1 +\n> >>>  include/libcamera/base/utils.h                |  2 ++\n> >>>  src/android/meson.build                       |  2 +-\n> >>>  src/ipa/ipu3/meson.build                      |  2 +-\n> >>>  src/ipa/libipa/meson.build                    |  2 +-\n> >>>  src/ipa/raspberrypi/meson.build               |  2 +-\n> >>>  src/ipa/rkisp1/meson.build                    |  2 +-\n> >>>  src/ipa/vimc/meson.build                      |  2 +-\n> >>>  src/libcamera/base/meson.build                |  8 +++++++\n> >>>  src/libcamera/meson.build                     | 10 +++++++--\n> >>>  src/libcamera/proxy/worker/meson.build        |  2 +-\n> >>>  src/v4l2/meson.build                          |  2 +-\n> >>>  test/camera/meson.build                       |  2 +-\n> >>>  test/ipa/meson.build                          |  2 +-\n> >>>  test/ipc/meson.build                          |  2 +-\n> >>>  test/libtest/meson.build                      |  2 +-\n> >>>  test/log/meson.build                          |  2 +-\n> >>>  test/media_device/meson.build                 |  4 ++--\n> >>>  test/meson.build                              |  2 +-\n> >>>  test/pipeline/ipu3/meson.build                |  2 +-\n> >>>  test/pipeline/rkisp1/meson.build              |  2 +-\n> >>>  test/process/meson.build                      |  2 +-\n> >>>  .../generated_serializer/meson.build          |  2 +-\n> >>>  test/serialization/meson.build                |  2 +-\n> >>>  test/v4l2_subdevice/meson.build               |  2 +-\n> >>>  test/v4l2_videodevice/meson.build             |  2 +-\n> >>>  35 files changed, 74 insertions(+), 25 deletions(-)\n> >>>  create mode 100644 include/libcamera/base/private.h\n> >>>\n> >>> diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n> >>> index 045df27fff16..825af7a33919 100644\n> >>> --- a/include/libcamera/base/event_dispatcher.h\n> >>> +++ b/include/libcamera/base/event_dispatcher.h\n> >>> @@ -9,6 +9,8 @@\n> >>>\n> >>>  #include <vector>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>> +\n> >>>  namespace libcamera {\n> >>>\n> >>>  class EventNotifier;\n> >>> diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n> >>> index ae2a3f04e4b9..88835902980c 100644\n> >>> --- a/include/libcamera/base/event_dispatcher_poll.h\n> >>> +++ b/include/libcamera/base/event_dispatcher_poll.h\n> >>> @@ -13,6 +13,8 @@\n> >>>\n> >>>  #include <libcamera/base/event_dispatcher.h>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>> +\n> >>>  struct pollfd;\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n> >>> index 8a6419f23004..6bb4e5143aa6 100644\n> >>> --- a/include/libcamera/base/event_notifier.h\n> >>> +++ b/include/libcamera/base/event_notifier.h\n> >>> @@ -8,6 +8,7 @@\n> >>>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n> >>>\n> >>>  #include <libcamera/base/object.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/signal.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n> >>> index e8e4b76e1a4e..cecbb254591f 100644\n> >>> --- a/include/libcamera/base/file.h\n> >>> +++ b/include/libcamera/base/file.h\n> >>> @@ -12,6 +12,7 @@\n> >>>  #include <sys/types.h>\n> >>>\n> >>>  #include <libcamera/base/class.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>\n> >>>  #include <libcamera/span.h>\n> >>>\n> >>> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n> >>> index b93c947ae7db..70582cd47902 100644\n> >>> --- a/include/libcamera/base/log.h\n> >>> +++ b/include/libcamera/base/log.h\n> >>> @@ -11,6 +11,7 @@\n> >>>  #include <sstream>\n> >>>\n> >>>  #include <libcamera/base/class.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/utils.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n> >>> index 83c664affc88..aaac324d7149 100644\n> >>> --- a/include/libcamera/base/meson.build\n> >>> +++ b/include/libcamera/base/meson.build\n> >>> @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n> >>>      'log.h',\n> >>>      'message.h',\n> >>>      'object.h',\n> >>> +    'private.h',\n> >>>      'semaphore.h',\n> >>>      'signal.h',\n> >>>      'thread.h',\n> >>> diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n> >>> new file mode 100644\n> >>> index 000000000000..b54ad076688e\n> >>> --- /dev/null\n> >>> +++ b/include/libcamera/base/private.h\n> >>> @@ -0,0 +1,22 @@\n> >>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> >>> +/*\n> >>> + * Copyright (C) 2021, Google Inc.\n> >>> + *\n> >>> + * private.h - Private Header Validation\n> >>> + *\n> >>> + * A selection of internal libcamera headers are installed as part\n> >>> + * of the libcamera package to allow sharing of a select subset of\n> >>> + * internal functionality with IPA module developers only.\n> >>> + *\n> >>> + * This functionality is not considered part of the public libcamera\n> >>> + * API, and can therefore potentially face ABI instabilities which\n> >>> + * should not be exposed to applications. IPA modules however should be\n> >>> + * versioned and more closely matched to the libcamera installation.\n> >>> + *\n> >>> + * Components which include this file can not be included in any file\n> >>> + * which forms part of the libcamera API.\n> >>> + */\n> >>> +\n> >>> +#ifndef LIBCAMERA_BASE_PRIVATE\n> >>> +#error \"Private headers must not be included in the libcamera API\"\n> >>> +#endif\n> >>> diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n> >>> index c8e62e3ee68b..d8146eb8060b 100644\n> >>> --- a/include/libcamera/base/semaphore.h\n> >>> +++ b/include/libcamera/base/semaphore.h\n> >>> @@ -9,6 +9,7 @@\n> >>>\n> >>>  #include <condition_variable>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/thread.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n> >>> index 2ed18d49c978..b30ed12715a2 100644\n> >>> --- a/include/libcamera/base/thread.h\n> >>> +++ b/include/libcamera/base/thread.h\n> >>> @@ -13,6 +13,7 @@\n> >>>  #include <thread>\n> >>>\n> >>>  #include <libcamera/base/message.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/signal.h>\n> >>>  #include <libcamera/base/utils.h>\n> >>>\n> >>> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n> >>> index e79e85f1ef0d..f762e8767d97 100644\n> >>> --- a/include/libcamera/base/timer.h\n> >>> +++ b/include/libcamera/base/timer.h\n> >>> @@ -11,6 +11,7 @@\n> >>>  #include <stdint.h>\n> >>>\n> >>>  #include <libcamera/base/object.h>\n> >>> +#include <libcamera/base/private.h>\n> >>>  #include <libcamera/base/signal.h>\n> >>>\n> >>>  namespace libcamera {\n> >>> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n> >>> index d1aaff65211a..07685045aa05 100644\n> >>> --- a/include/libcamera/base/utils.h\n> >>> +++ b/include/libcamera/base/utils.h\n> >>> @@ -19,6 +19,8 @@\n> >>>  #include <utility>\n> >>>  #include <vector>\n> >>>\n> >>> +#include <libcamera/base/private.h>\n> >>> +\n> >>>  #ifndef __DOXYGEN__\n> >>>\n> >>>  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n> >>> diff --git a/src/android/meson.build b/src/android/meson.build\n> >>> index bd58ef964c2a..7d1e7e85f16e 100644\n> >>> --- a/src/android/meson.build\n> >>> +++ b/src/android/meson.build\n> >>> @@ -4,7 +4,7 @@ android_deps = [\n> >>>      dependency('libexif', required : get_option('android')),\n> >>>      dependency('libjpeg', required : get_option('android')),\n> >>>      dependency('yaml-0.1', required : get_option('android')),\n> >>> -    libcamera_dep,\n> >>> +    libcamera_private,\n> >>>  ]\n> >>>\n> >>>  android_enabled = true\n> >>> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n> >>> index 0d843846acde..b63641908710 100644\n> >>> --- a/src/ipa/ipu3/meson.build\n> >>> +++ b/src/ipa/ipu3/meson.build\n> >>> @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n> >>>                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n> >>>                      name_prefix : '',\n> >>>                      include_directories : [ipa_includes, libipa_includes],\n> >>> -                    dependencies : libcamera_dep,\n> >>> +                    dependencies : libcamera_private,\n> >>>                      link_with : libipa,\n> >>>                      install : true,\n> >>>                      install_dir : ipa_install_dir)\n> >>> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> >>> index 038fc49060ef..ca541a5aafd7 100644\n> >>> --- a/src/ipa/libipa/meson.build\n> >>> +++ b/src/ipa/libipa/meson.build\n> >>> @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n> >>>\n> >>>  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n> >>>                          include_directories : ipa_includes,\n> >>> -                        dependencies : libcamera_dep)\n> >>> +                        dependencies : libcamera_private)\n> >>> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n> >>> index 230356d3ce3a..d7203aa042cd 100644\n> >>> --- a/src/ipa/raspberrypi/meson.build\n> >>> +++ b/src/ipa/raspberrypi/meson.build\n> >>> @@ -3,7 +3,7 @@\n> >>>  ipa_name = 'ipa_rpi'\n> >>>\n> >>>  rpi_ipa_deps = [\n> >>> -    libcamera_dep,\n> >>> +    libcamera_private,\n> >>>      dependency('boost'),\n> >>>      libatomic,\n> >>>  ]\n> >>> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n> >>> index 1a1c71591039..f76b37f5af50 100644\n> >>> --- a/src/ipa/rkisp1/meson.build\n> >>> +++ b/src/ipa/rkisp1/meson.build\n> >>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n> >>>                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n> >>>                      name_prefix : '',\n> >>>                      include_directories : [ipa_includes, libipa_includes],\n> >>> -                    dependencies : libcamera_dep,\n> >>> +                    dependencies : libcamera_private,\n> >>>                      link_with : libipa,\n> >>>                      install : true,\n> >>>                      install_dir : ipa_install_dir)\n> >>> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n> >>> index a35825ae25a6..ecbeee136451 100644\n> >>> --- a/src/ipa/vimc/meson.build\n> >>> +++ b/src/ipa/vimc/meson.build\n> >>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n> >>>                      ['vimc.cpp', libcamera_generated_ipa_headers],\n> >>>                      name_prefix : '',\n> >>>                      include_directories : [ipa_includes, libipa_includes],\n> >>> -                    dependencies : libcamera_dep,\n> >>> +                    dependencies : libcamera_private,\n> >>>                      link_with : libipa,\n> >>>                      install : true,\n> >>>                      install_dir : ipa_install_dir)\n> >>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> >>> index a8b04cfc8a5f..871721571e98 100644\n> >>> --- a/src/libcamera/base/meson.build\n> >>> +++ b/src/libcamera/base/meson.build\n> >>> @@ -21,10 +21,15 @@ libcamera_base_deps = [\n> >>>      dependency('threads'),\n> >>>  ]\n> >>>\n> >>> +# Internal components must use the libcamera_base_private dependency to enable\n> >>> +# the use of headers which must not be exposed to the libcamera public api.\n> >>> +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n> >>> +\n> >>>  libcamera_base_lib = shared_library('libcamera-base',\n> >>>                                      [libcamera_base_sources, libcamera_base_headers],\n> >>>                                      name_prefix : '',\n> >>>                                      install : true,\n> >>> +                                    cpp_args : libcamera_base_args,\n> >>>                                      include_directories : libcamera_includes,\n> >>>                                      dependencies : libcamera_base_deps)\n> >>>\n> >>> @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n> >>>                   version : '1.0',\n> >>>                   description : 'Camera support base utility library',\n> >>>                   subdirs : 'libcamera')\n> >>> +\n> >>> +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n> >>> +                                            compile_args : libcamera_base_args)\n> >>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> >>> index 1f163cfe1225..64c7475f1a2e 100644\n> >>> --- a/src/libcamera/meson.build\n> >>> +++ b/src/libcamera/meson.build\n> >>> @@ -115,7 +115,7 @@ libcamera_deps = [\n> >>>      libgnutls,\n> >>>      liblttng,\n> >>>      libudev,\n> >>> -    libcamera_base,\n> >>> +    libcamera_base_private,\n> >>>  ]\n> >>>\n> >>>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n> >>> @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n> >>>                                         libcamera_generated_ipa_headers,\n> >>>                                     ],\n> >>>                                     include_directories : libcamera_includes,\n> >>> -                                   dependencies: libcamera_base,\n> >>> +                                   dependencies : libcamera_base,\n> >>>                                     link_with : libcamera)\n> >>>\n> >>> +# Internal dependancy for components and plugins which can use Private APIs\n> >>> +libcamera_private = declare_dependency(dependencies : [\n> >>> +                                           libcamera_dep,\n> >>> +                                           libcamera_base_private,\n> >>> +                                       ])\n> >>> +\n> >>>  pkg_mod = import('pkgconfig')\n> >>>  pkg_mod.generate(libcamera,\n> >>>                   libraries : libcamera_base_lib,\n> >>> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n> >>> index 28fe5f1fd6b2..70c8760a3d42 100644\n> >>> --- a/src/libcamera/proxy/worker/meson.build\n> >>> +++ b/src/libcamera/proxy/worker/meson.build\n> >>> @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n> >>>                         [worker, libcamera_generated_ipa_headers],\n> >>>                         install : true,\n> >>>                         install_dir : proxy_install_dir,\n> >>> -                       dependencies : libcamera_dep)\n> >>> +                       dependencies : libcamera_private)\n> >>>  endforeach\n> >>>\n> >>>  config_h.set('IPA_PROXY_DIR',\n> >>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> >>> index 0accac194be4..f78497b6799b 100644\n> >>> --- a/src/v4l2/meson.build\n> >>> +++ b/src/v4l2/meson.build\n> >>> @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n> >>>                               v4l2_compat_sources,\n> >>>                               name_prefix : '',\n> >>>                               install : true,\n> >>> -                             dependencies : [libcamera_dep, libdl],\n> >>> +                             dependencies : [libcamera_private, libdl],\n> >>>                               cpp_args : v4l2_compat_cpp_args)\n> >>> diff --git a/test/camera/meson.build b/test/camera/meson.build\n> >>> index 9cb95affffab..002a87b594e0 100644\n> >>> --- a/test/camera/meson.build\n> >>> +++ b/test/camera/meson.build\n> >>> @@ -12,7 +12,7 @@ camera_tests = [\n> >>>\n> >>>  foreach t : camera_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'camera', is_parallel : false)\n> >>> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n> >>> index e8a041b5bbd2..7938633e54ab 100644\n> >>> --- a/test/ipa/meson.build\n> >>> +++ b/test/ipa/meson.build\n> >>> @@ -7,7 +7,7 @@ ipa_test = [\n> >>>\n> >>>  foreach t : ipa_test\n> >>>      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : [libipa, test_libraries],\n> >>>                       include_directories : [libipa_includes, test_includes_internal])\n> >>>\n> >>> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n> >>> index ad47b2feb718..2a6cd7fb8433 100644\n> >>> --- a/test/ipc/meson.build\n> >>> +++ b/test/ipc/meson.build\n> >>> @@ -7,7 +7,7 @@ ipc_tests = [\n> >>>\n> >>>  foreach t : ipc_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n> >>> index 542335ea5e7c..351629f3ce73 100644\n> >>> --- a/test/libtest/meson.build\n> >>> +++ b/test/libtest/meson.build\n> >>> @@ -18,7 +18,7 @@ test_includes_internal = [\n> >>>  ]\n> >>>\n> >>>  libtest = static_library('libtest', libtest_sources,\n> >>> -                         dependencies : libcamera_dep,\n> >>> +                         dependencies : libcamera_private,\n> >>>                           include_directories : test_includes_internal)\n> >>>\n> >>>  test_libraries = [libtest]\n> >>> diff --git a/test/log/meson.build b/test/log/meson.build\n> >>> index 8cd664e04a00..ac87841a24e1 100644\n> >>> --- a/test/log/meson.build\n> >>> +++ b/test/log/meson.build\n> >>> @@ -7,7 +7,7 @@ log_test = [\n> >>>\n> >>>  foreach t : log_test\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n> >>> index 1dfcdd8bd744..83dfe8f11d2f 100644\n> >>> --- a/test/media_device/meson.build\n> >>> +++ b/test/media_device/meson.build\n> >>> @@ -11,12 +11,12 @@ media_device_tests = [\n> >>>  ]\n> >>>\n> >>>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n> >>> -                               dependencies : libcamera_dep,\n> >>> +                               dependencies : libcamera_private,\n> >>>                                 include_directories : test_includes_internal)\n> >>>\n> >>>  foreach t : media_device_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : [test_libraries, lib_mdev_test],\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/meson.build b/test/meson.build\n> >>> index 045ad2a2d7c9..b8615e0fd3e6 100644\n> >>> --- a/test/meson.build\n> >>> +++ b/test/meson.build\n> >>> @@ -64,7 +64,7 @@ endforeach\n> >>>\n> >>>  foreach t : internal_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n> >>> index d062ecd269f2..16701080ca2b 100644\n> >>> --- a/test/pipeline/ipu3/meson.build\n> >>> +++ b/test/pipeline/ipu3/meson.build\n> >>> @@ -6,7 +6,7 @@ ipu3_test = [\n> >>>\n> >>>  foreach t : ipu3_test\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n> >>> index ece147b054e4..364b5711a0f9 100644\n> >>> --- a/test/pipeline/rkisp1/meson.build\n> >>> +++ b/test/pipeline/rkisp1/meson.build\n> >>> @@ -6,7 +6,7 @@ rkisp1_test = [\n> >>>\n> >>>  foreach t : rkisp1_test\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/process/meson.build b/test/process/meson.build\n> >>> index d2272d509db3..af86b277db63 100644\n> >>> --- a/test/process/meson.build\n> >>> +++ b/test/process/meson.build\n> >>> @@ -6,7 +6,7 @@ process_tests = [\n> >>>\n> >>>  foreach t : process_tests\n> >>>      exe = executable(t[0], t[1],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>\n> >>> diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n> >>> index 2460e0b114b3..9fb9cd1db968 100644\n> >>> --- a/test/serialization/generated_serializer/meson.build\n> >>> +++ b/test/serialization/generated_serializer/meson.build\n> >>> @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n> >>>                       generated_test_header,\n> >>>                       generated_test_serializer,\n> >>>                   ],\n> >>> -                 dependencies : libcamera_dep,\n> >>> +                 dependencies : libcamera_private,\n> >>>                   link_with : test_libraries,\n> >>>                   include_directories : [\n> >>>                       test_includes_internal,\n> >>> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n> >>> index 60ebf3255b28..5446e4907f33 100644\n> >>> --- a/test/serialization/meson.build\n> >>> +++ b/test/serialization/meson.build\n> >>> @@ -9,7 +9,7 @@ serialization_tests = [\n> >>>\n> >>>  foreach t : serialization_tests\n> >>>      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'serialization', is_parallel : true)\n> >>> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n> >>> index 40d39766af9b..d82be3c60b75 100644\n> >>> --- a/test/v4l2_subdevice/meson.build\n> >>> +++ b/test/v4l2_subdevice/meson.build\n> >>> @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n> >>>\n> >>>  foreach t : v4l2_subdevice_tests\n> >>>      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n> >>> -        dependencies : libcamera_dep,\n> >>> +        dependencies : libcamera_private,\n> >>>          link_with : test_libraries,\n> >>>          include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n> >>> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n> >>> index e733518c0185..643f82edce5e 100644\n> >>> --- a/test/v4l2_videodevice/meson.build\n> >>> +++ b/test/v4l2_videodevice/meson.build\n> >>> @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n> >>>\n> >>>  foreach t : v4l2_videodevice_tests\n> >>>      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n> >>> -                     dependencies : libcamera_dep,\n> >>> +                     dependencies : libcamera_private,\n> >>>                       link_with : test_libraries,\n> >>>                       include_directories : test_includes_internal)\n> >>>      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n> >>> --\n> >>> 2.30.2\n> >>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2E80FC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Jun 2021 04:48:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B2DD684D4;\n\tMon, 28 Jun 2021 06:48:52 +0200 (CEST)","from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n\t[IPv6:2a00:1450:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EDDA66028C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jun 2021 06:48:50 +0200 (CEST)","by mail-ej1-x633.google.com with SMTP id bg14so27571630ejb.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Jun 2021 21:48:50 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"l0FQ/80C\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=LvdO0OfU5qfnLHW6HUjwRX7BvSnL5D9dkb9/fAihwqM=;\n\tb=l0FQ/80C+jVUoBoC6rBmyTLwLNcxVuiOgyWjewAxeLQlQgNkn4fcs5VWCX6hZ6piOw\n\tuNC6UWZfdIOlLZLuzMJdYZZvJbfhKTspKM52YBDkwYfspjXGxJMWRekCjlrev4oz38y3\n\tUwXmwERLRdahwYgiYSiz6ipTVKl14YKhFGZgE=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=LvdO0OfU5qfnLHW6HUjwRX7BvSnL5D9dkb9/fAihwqM=;\n\tb=pZiCOl9iDrYTx1GR8ebi6Zn9B+Ew+j0EDUU61JZblZ9TqyCuEBjG85Xy9cxi8ITFon\n\tJnbPG0gStm0FourS37L5KZesRVVLBxJIWY/RIGXPtpy4/91jnABc/CjlzDrtWDzmUK20\n\tCIp6CwZPShsQrhfQxhW2UFv8Slw8Hgc4Vsso81AMG5gBX+/C0s4pU9ZuB8G0+KfoUfZz\n\tJXOrLKkZwuZY0IkBiCd+2n6SUcmJcFEhHmEV39qVdZKVylNhZA7sRhTJqGL74LkDikJc\n\tPF2g4o+KxzM/NFV+ZHsptOiinAYgiU7EHy5DNMnQpJiM/z8pOZ4Jn8TnZHMWBV8ZazwP\n\tH7Dw==","X-Gm-Message-State":"AOAM533fVaWmAr+Selt8mK4t+w0QAGNPbiGc4tuE64vMN0aqhpm7d71M\n\tLKU1e0YKBO5lUHw6lV+FOCGKl4Uo3I4Y6LxRzCGAJQ==","X-Google-Smtp-Source":"ABdhPJxSuYKvNjf2aJvFHu4E+6fGCsUnenm40JPfijszsStHORBiLWPKjeBn3McHcL++p02tPhnBkx04U0CI10yL7f0=","X-Received":"by 2002:a17:907:2623:: with SMTP id\n\taq3mr22874122ejc.292.1624855730419; \n\tSun, 27 Jun 2021 21:48:50 -0700 (PDT)","MIME-Version":"1.0","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>\n\t<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>\n\t<20210625084008.GN2599@pyrite.rasen.tech>\n\t<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>","In-Reply-To":"<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 28 Jun 2021 13:48:39 +0900","Message-ID":"<CAO5uPHPp6WYUfxMLoVnjwP=hUwzTnuS_c=EVgHss89=2Z+Cytw@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17878,"web_url":"https://patchwork.libcamera.org/comment/17878/","msgid":"<3df7b8ba-d4b3-d57a-f109-6b2ef06dd37c@ideasonboard.com>","date":"2021-06-28T08:31:56","subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Hiro,\n\nOn 28/06/2021 05:48, Hirokazu Honda wrote:\n> Thanks Kieran and Paul,\n> \n> On Fri, Jun 25, 2021 at 6:34 PM Kieran Bingham\n> <kieran.bingham@ideasonboard.com> wrote:\n>>\n>> Hi Paul, Hiro,\n>>\n>> On 25/06/2021 09:40, paul.elder@ideasonboard.com wrote:\n>>> Hi Hiro,\n>>>\n>>> On Fri, Jun 25, 2021 at 01:12:57PM +0900, Hirokazu Honda wrote:\n>>>> Hi Kieran, thank you for the patch.\n>>>>\n>>>> On Fri, Jun 25, 2021 at 10:35 AM Kieran Bingham\n>>>> <kieran.bingham@ideasonboard.com> wrote:\n>>>>>\n>>>>> Headers which must not be exposed as part of the public libcamera API\n>>>>> can include base/private.h.\n>>>>>\n>>>>> Any interface which includes the private.h header will only be able to\n>>>>> build if the libcamera_private dependency is used (or the\n>>>>> libcamera_base_private dependency directly)\n>>>>>\n>>>>\n>>>> I couldn't understand well which one of the four dependencies\n>>>> (libcamera_private, libcamera_base, libcamera_dep,\n>>>> libcamera_base_private) should be used in a specific target.\n>>>> Would you mind describing the rule of using these dependencies?\n>>>\n>>> My understanding is that:\n>>>\n>>> - libcamera_base is everything in base\n>>> - libcamera_base_private is libcamera_base + the macro required for\n>>>   using the private headers\n>>\n>> Correct.\n>>\n>>> - libcamera_dep is public + private, for things like IPAs and internal\n>>>   components (but doesn't include the macro for private headers)\n>>\n>> - libcamera_dep is the existing, widely used dependency for linking\n>> against libcamera within the meson project.\n>>\n>> It indeed links against all things public and private currently, and\n>> anything which references this could use any part of the libcamera library.\n>>\n>> (However after this patch, any inclusion of a header without defining\n>> 'LIBCAMERA_BASE_PRIVATE' will hit a compile break)\n>>\n>>\n>>> - libcamera_private is libcamera_dep + the macro\n>>\n>> Correct - this allows a component to link against libcamera, whilst also\n>> defining that it is explicitly allowed to access 'private' components,\n>> which should not leak to the public APIs.\n>>\n>>>\n>>> Kieran, is this correct? (it is a bit hard to keep track of...)\n>>\n>> I've added\n>>\n>>\n>> Build targets which are intended to use the private API's will use the\n>> libcamera_private to handle the automatic definition of the inclusion\n>> guard.\n>>\n>>\n>> It's hard to go into more detail on this in this commit, as it's about\n>> to get changed in the up coming patches, and I don't want someone to\n>> read this and say \"Oh I should use the libcamera_dep for my public\n>> component, as ... it will very soon become libcamera_public\"\n>>\n> \n> It would be great if the document about the targets is added later.\n> \n\nAgreed, I'll add something.\n\n> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\nThank you, but the series is already merged, I pushed it on Friday.\n\n> \n>>\n>>\n>>>\n>>>\n>>> Paul\n>>>\n>>>>\n>>>>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>>>> ---\n>>>>>  include/libcamera/base/event_dispatcher.h     |  2 ++\n>>>>>  .../libcamera/base/event_dispatcher_poll.h    |  2 ++\n>>>>>  include/libcamera/base/event_notifier.h       |  1 +\n>>>>>  include/libcamera/base/file.h                 |  1 +\n>>>>>  include/libcamera/base/log.h                  |  1 +\n>>>>>  include/libcamera/base/meson.build            |  1 +\n>>>>>  include/libcamera/base/private.h              | 22 +++++++++++++++++++\n>>>>>  include/libcamera/base/semaphore.h            |  1 +\n>>>>>  include/libcamera/base/thread.h               |  1 +\n>>>>>  include/libcamera/base/timer.h                |  1 +\n>>>>>  include/libcamera/base/utils.h                |  2 ++\n>>>>>  src/android/meson.build                       |  2 +-\n>>>>>  src/ipa/ipu3/meson.build                      |  2 +-\n>>>>>  src/ipa/libipa/meson.build                    |  2 +-\n>>>>>  src/ipa/raspberrypi/meson.build               |  2 +-\n>>>>>  src/ipa/rkisp1/meson.build                    |  2 +-\n>>>>>  src/ipa/vimc/meson.build                      |  2 +-\n>>>>>  src/libcamera/base/meson.build                |  8 +++++++\n>>>>>  src/libcamera/meson.build                     | 10 +++++++--\n>>>>>  src/libcamera/proxy/worker/meson.build        |  2 +-\n>>>>>  src/v4l2/meson.build                          |  2 +-\n>>>>>  test/camera/meson.build                       |  2 +-\n>>>>>  test/ipa/meson.build                          |  2 +-\n>>>>>  test/ipc/meson.build                          |  2 +-\n>>>>>  test/libtest/meson.build                      |  2 +-\n>>>>>  test/log/meson.build                          |  2 +-\n>>>>>  test/media_device/meson.build                 |  4 ++--\n>>>>>  test/meson.build                              |  2 +-\n>>>>>  test/pipeline/ipu3/meson.build                |  2 +-\n>>>>>  test/pipeline/rkisp1/meson.build              |  2 +-\n>>>>>  test/process/meson.build                      |  2 +-\n>>>>>  .../generated_serializer/meson.build          |  2 +-\n>>>>>  test/serialization/meson.build                |  2 +-\n>>>>>  test/v4l2_subdevice/meson.build               |  2 +-\n>>>>>  test/v4l2_videodevice/meson.build             |  2 +-\n>>>>>  35 files changed, 74 insertions(+), 25 deletions(-)\n>>>>>  create mode 100644 include/libcamera/base/private.h\n>>>>>\n>>>>> diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h\n>>>>> index 045df27fff16..825af7a33919 100644\n>>>>> --- a/include/libcamera/base/event_dispatcher.h\n>>>>> +++ b/include/libcamera/base/event_dispatcher.h\n>>>>> @@ -9,6 +9,8 @@\n>>>>>\n>>>>>  #include <vector>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>> +\n>>>>>  namespace libcamera {\n>>>>>\n>>>>>  class EventNotifier;\n>>>>> diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h\n>>>>> index ae2a3f04e4b9..88835902980c 100644\n>>>>> --- a/include/libcamera/base/event_dispatcher_poll.h\n>>>>> +++ b/include/libcamera/base/event_dispatcher_poll.h\n>>>>> @@ -13,6 +13,8 @@\n>>>>>\n>>>>>  #include <libcamera/base/event_dispatcher.h>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>> +\n>>>>>  struct pollfd;\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h\n>>>>> index 8a6419f23004..6bb4e5143aa6 100644\n>>>>> --- a/include/libcamera/base/event_notifier.h\n>>>>> +++ b/include/libcamera/base/event_notifier.h\n>>>>> @@ -8,6 +8,7 @@\n>>>>>  #define __LIBCAMERA_INTERNAL_EVENT_NOTIFIER_H__\n>>>>>\n>>>>>  #include <libcamera/base/object.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/signal.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h\n>>>>> index e8e4b76e1a4e..cecbb254591f 100644\n>>>>> --- a/include/libcamera/base/file.h\n>>>>> +++ b/include/libcamera/base/file.h\n>>>>> @@ -12,6 +12,7 @@\n>>>>>  #include <sys/types.h>\n>>>>>\n>>>>>  #include <libcamera/base/class.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>\n>>>>>  #include <libcamera/span.h>\n>>>>>\n>>>>> diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\n>>>>> index b93c947ae7db..70582cd47902 100644\n>>>>> --- a/include/libcamera/base/log.h\n>>>>> +++ b/include/libcamera/base/log.h\n>>>>> @@ -11,6 +11,7 @@\n>>>>>  #include <sstream>\n>>>>>\n>>>>>  #include <libcamera/base/class.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/utils.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\n>>>>> index 83c664affc88..aaac324d7149 100644\n>>>>> --- a/include/libcamera/base/meson.build\n>>>>> +++ b/include/libcamera/base/meson.build\n>>>>> @@ -12,6 +12,7 @@ libcamera_base_headers = files([\n>>>>>      'log.h',\n>>>>>      'message.h',\n>>>>>      'object.h',\n>>>>> +    'private.h',\n>>>>>      'semaphore.h',\n>>>>>      'signal.h',\n>>>>>      'thread.h',\n>>>>> diff --git a/include/libcamera/base/private.h b/include/libcamera/base/private.h\n>>>>> new file mode 100644\n>>>>> index 000000000000..b54ad076688e\n>>>>> --- /dev/null\n>>>>> +++ b/include/libcamera/base/private.h\n>>>>> @@ -0,0 +1,22 @@\n>>>>> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>>>> +/*\n>>>>> + * Copyright (C) 2021, Google Inc.\n>>>>> + *\n>>>>> + * private.h - Private Header Validation\n>>>>> + *\n>>>>> + * A selection of internal libcamera headers are installed as part\n>>>>> + * of the libcamera package to allow sharing of a select subset of\n>>>>> + * internal functionality with IPA module developers only.\n>>>>> + *\n>>>>> + * This functionality is not considered part of the public libcamera\n>>>>> + * API, and can therefore potentially face ABI instabilities which\n>>>>> + * should not be exposed to applications. IPA modules however should be\n>>>>> + * versioned and more closely matched to the libcamera installation.\n>>>>> + *\n>>>>> + * Components which include this file can not be included in any file\n>>>>> + * which forms part of the libcamera API.\n>>>>> + */\n>>>>> +\n>>>>> +#ifndef LIBCAMERA_BASE_PRIVATE\n>>>>> +#error \"Private headers must not be included in the libcamera API\"\n>>>>> +#endif\n>>>>> diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h\n>>>>> index c8e62e3ee68b..d8146eb8060b 100644\n>>>>> --- a/include/libcamera/base/semaphore.h\n>>>>> +++ b/include/libcamera/base/semaphore.h\n>>>>> @@ -9,6 +9,7 @@\n>>>>>\n>>>>>  #include <condition_variable>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/thread.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h\n>>>>> index 2ed18d49c978..b30ed12715a2 100644\n>>>>> --- a/include/libcamera/base/thread.h\n>>>>> +++ b/include/libcamera/base/thread.h\n>>>>> @@ -13,6 +13,7 @@\n>>>>>  #include <thread>\n>>>>>\n>>>>>  #include <libcamera/base/message.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/signal.h>\n>>>>>  #include <libcamera/base/utils.h>\n>>>>>\n>>>>> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\n>>>>> index e79e85f1ef0d..f762e8767d97 100644\n>>>>> --- a/include/libcamera/base/timer.h\n>>>>> +++ b/include/libcamera/base/timer.h\n>>>>> @@ -11,6 +11,7 @@\n>>>>>  #include <stdint.h>\n>>>>>\n>>>>>  #include <libcamera/base/object.h>\n>>>>> +#include <libcamera/base/private.h>\n>>>>>  #include <libcamera/base/signal.h>\n>>>>>\n>>>>>  namespace libcamera {\n>>>>> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n>>>>> index d1aaff65211a..07685045aa05 100644\n>>>>> --- a/include/libcamera/base/utils.h\n>>>>> +++ b/include/libcamera/base/utils.h\n>>>>> @@ -19,6 +19,8 @@\n>>>>>  #include <utility>\n>>>>>  #include <vector>\n>>>>>\n>>>>> +#include <libcamera/base/private.h>\n>>>>> +\n>>>>>  #ifndef __DOXYGEN__\n>>>>>\n>>>>>  /* uClibc and uClibc-ng don't provide O_TMPFILE */\n>>>>> diff --git a/src/android/meson.build b/src/android/meson.build\n>>>>> index bd58ef964c2a..7d1e7e85f16e 100644\n>>>>> --- a/src/android/meson.build\n>>>>> +++ b/src/android/meson.build\n>>>>> @@ -4,7 +4,7 @@ android_deps = [\n>>>>>      dependency('libexif', required : get_option('android')),\n>>>>>      dependency('libjpeg', required : get_option('android')),\n>>>>>      dependency('yaml-0.1', required : get_option('android')),\n>>>>> -    libcamera_dep,\n>>>>> +    libcamera_private,\n>>>>>  ]\n>>>>>\n>>>>>  android_enabled = true\n>>>>> diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\n>>>>> index 0d843846acde..b63641908710 100644\n>>>>> --- a/src/ipa/ipu3/meson.build\n>>>>> +++ b/src/ipa/ipu3/meson.build\n>>>>> @@ -12,7 +12,7 @@ mod = shared_module(ipa_name,\n>>>>>                      [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n>>>>>                      name_prefix : '',\n>>>>>                      include_directories : [ipa_includes, libipa_includes],\n>>>>> -                    dependencies : libcamera_dep,\n>>>>> +                    dependencies : libcamera_private,\n>>>>>                      link_with : libipa,\n>>>>>                      install : true,\n>>>>>                      install_dir : ipa_install_dir)\n>>>>> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n>>>>> index 038fc49060ef..ca541a5aafd7 100644\n>>>>> --- a/src/ipa/libipa/meson.build\n>>>>> +++ b/src/ipa/libipa/meson.build\n>>>>> @@ -14,4 +14,4 @@ libipa_includes = include_directories('..')\n>>>>>\n>>>>>  libipa = static_library('ipa', [libipa_sources, libipa_headers],\n>>>>>                          include_directories : ipa_includes,\n>>>>> -                        dependencies : libcamera_dep)\n>>>>> +                        dependencies : libcamera_private)\n>>>>> diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\n>>>>> index 230356d3ce3a..d7203aa042cd 100644\n>>>>> --- a/src/ipa/raspberrypi/meson.build\n>>>>> +++ b/src/ipa/raspberrypi/meson.build\n>>>>> @@ -3,7 +3,7 @@\n>>>>>  ipa_name = 'ipa_rpi'\n>>>>>\n>>>>>  rpi_ipa_deps = [\n>>>>> -    libcamera_dep,\n>>>>> +    libcamera_private,\n>>>>>      dependency('boost'),\n>>>>>      libatomic,\n>>>>>  ]\n>>>>> diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build\n>>>>> index 1a1c71591039..f76b37f5af50 100644\n>>>>> --- a/src/ipa/rkisp1/meson.build\n>>>>> +++ b/src/ipa/rkisp1/meson.build\n>>>>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>>>>>                      ['rkisp1.cpp', libcamera_generated_ipa_headers],\n>>>>>                      name_prefix : '',\n>>>>>                      include_directories : [ipa_includes, libipa_includes],\n>>>>> -                    dependencies : libcamera_dep,\n>>>>> +                    dependencies : libcamera_private,\n>>>>>                      link_with : libipa,\n>>>>>                      install : true,\n>>>>>                      install_dir : ipa_install_dir)\n>>>>> diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build\n>>>>> index a35825ae25a6..ecbeee136451 100644\n>>>>> --- a/src/ipa/vimc/meson.build\n>>>>> +++ b/src/ipa/vimc/meson.build\n>>>>> @@ -6,7 +6,7 @@ mod = shared_module(ipa_name,\n>>>>>                      ['vimc.cpp', libcamera_generated_ipa_headers],\n>>>>>                      name_prefix : '',\n>>>>>                      include_directories : [ipa_includes, libipa_includes],\n>>>>> -                    dependencies : libcamera_dep,\n>>>>> +                    dependencies : libcamera_private,\n>>>>>                      link_with : libipa,\n>>>>>                      install : true,\n>>>>>                      install_dir : ipa_install_dir)\n>>>>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n>>>>> index a8b04cfc8a5f..871721571e98 100644\n>>>>> --- a/src/libcamera/base/meson.build\n>>>>> +++ b/src/libcamera/base/meson.build\n>>>>> @@ -21,10 +21,15 @@ libcamera_base_deps = [\n>>>>>      dependency('threads'),\n>>>>>  ]\n>>>>>\n>>>>> +# Internal components must use the libcamera_base_private dependency to enable\n>>>>> +# the use of headers which must not be exposed to the libcamera public api.\n>>>>> +libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]\n>>>>> +\n>>>>>  libcamera_base_lib = shared_library('libcamera-base',\n>>>>>                                      [libcamera_base_sources, libcamera_base_headers],\n>>>>>                                      name_prefix : '',\n>>>>>                                      install : true,\n>>>>> +                                    cpp_args : libcamera_base_args,\n>>>>>                                      include_directories : libcamera_includes,\n>>>>>                                      dependencies : libcamera_base_deps)\n>>>>>\n>>>>> @@ -39,3 +44,6 @@ pkg_mod.generate(libcamera_base_lib,\n>>>>>                   version : '1.0',\n>>>>>                   description : 'Camera support base utility library',\n>>>>>                   subdirs : 'libcamera')\n>>>>> +\n>>>>> +libcamera_base_private = declare_dependency(dependencies : libcamera_base,\n>>>>> +                                            compile_args : libcamera_base_args)\n>>>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>>>>> index 1f163cfe1225..64c7475f1a2e 100644\n>>>>> --- a/src/libcamera/meson.build\n>>>>> +++ b/src/libcamera/meson.build\n>>>>> @@ -115,7 +115,7 @@ libcamera_deps = [\n>>>>>      libgnutls,\n>>>>>      liblttng,\n>>>>>      libudev,\n>>>>> -    libcamera_base,\n>>>>> +    libcamera_base_private,\n>>>>>  ]\n>>>>>\n>>>>>  # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n>>>>> @@ -143,9 +143,15 @@ libcamera_dep = declare_dependency(sources : [\n>>>>>                                         libcamera_generated_ipa_headers,\n>>>>>                                     ],\n>>>>>                                     include_directories : libcamera_includes,\n>>>>> -                                   dependencies: libcamera_base,\n>>>>> +                                   dependencies : libcamera_base,\n>>>>>                                     link_with : libcamera)\n>>>>>\n>>>>> +# Internal dependancy for components and plugins which can use Private APIs\n>>>>> +libcamera_private = declare_dependency(dependencies : [\n>>>>> +                                           libcamera_dep,\n>>>>> +                                           libcamera_base_private,\n>>>>> +                                       ])\n>>>>> +\n>>>>>  pkg_mod = import('pkgconfig')\n>>>>>  pkg_mod.generate(libcamera,\n>>>>>                   libraries : libcamera_base_lib,\n>>>>> diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build\n>>>>> index 28fe5f1fd6b2..70c8760a3d42 100644\n>>>>> --- a/src/libcamera/proxy/worker/meson.build\n>>>>> +++ b/src/libcamera/proxy/worker/meson.build\n>>>>> @@ -21,7 +21,7 @@ foreach mojom : ipa_mojoms\n>>>>>                         [worker, libcamera_generated_ipa_headers],\n>>>>>                         install : true,\n>>>>>                         install_dir : proxy_install_dir,\n>>>>> -                       dependencies : libcamera_dep)\n>>>>> +                       dependencies : libcamera_private)\n>>>>>  endforeach\n>>>>>\n>>>>>  config_h.set('IPA_PROXY_DIR',\n>>>>> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n>>>>> index 0accac194be4..f78497b6799b 100644\n>>>>> --- a/src/v4l2/meson.build\n>>>>> +++ b/src/v4l2/meson.build\n>>>>> @@ -31,5 +31,5 @@ v4l2_compat = shared_library('v4l2-compat',\n>>>>>                               v4l2_compat_sources,\n>>>>>                               name_prefix : '',\n>>>>>                               install : true,\n>>>>> -                             dependencies : [libcamera_dep, libdl],\n>>>>> +                             dependencies : [libcamera_private, libdl],\n>>>>>                               cpp_args : v4l2_compat_cpp_args)\n>>>>> diff --git a/test/camera/meson.build b/test/camera/meson.build\n>>>>> index 9cb95affffab..002a87b594e0 100644\n>>>>> --- a/test/camera/meson.build\n>>>>> +++ b/test/camera/meson.build\n>>>>> @@ -12,7 +12,7 @@ camera_tests = [\n>>>>>\n>>>>>  foreach t : camera_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'camera', is_parallel : false)\n>>>>> diff --git a/test/ipa/meson.build b/test/ipa/meson.build\n>>>>> index e8a041b5bbd2..7938633e54ab 100644\n>>>>> --- a/test/ipa/meson.build\n>>>>> +++ b/test/ipa/meson.build\n>>>>> @@ -7,7 +7,7 @@ ipa_test = [\n>>>>>\n>>>>>  foreach t : ipa_test\n>>>>>      exe = executable(t[0], [t[1], libcamera_generated_ipa_headers],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : [libipa, test_libraries],\n>>>>>                       include_directories : [libipa_includes, test_includes_internal])\n>>>>>\n>>>>> diff --git a/test/ipc/meson.build b/test/ipc/meson.build\n>>>>> index ad47b2feb718..2a6cd7fb8433 100644\n>>>>> --- a/test/ipc/meson.build\n>>>>> +++ b/test/ipc/meson.build\n>>>>> @@ -7,7 +7,7 @@ ipc_tests = [\n>>>>>\n>>>>>  foreach t : ipc_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/libtest/meson.build b/test/libtest/meson.build\n>>>>> index 542335ea5e7c..351629f3ce73 100644\n>>>>> --- a/test/libtest/meson.build\n>>>>> +++ b/test/libtest/meson.build\n>>>>> @@ -18,7 +18,7 @@ test_includes_internal = [\n>>>>>  ]\n>>>>>\n>>>>>  libtest = static_library('libtest', libtest_sources,\n>>>>> -                         dependencies : libcamera_dep,\n>>>>> +                         dependencies : libcamera_private,\n>>>>>                           include_directories : test_includes_internal)\n>>>>>\n>>>>>  test_libraries = [libtest]\n>>>>> diff --git a/test/log/meson.build b/test/log/meson.build\n>>>>> index 8cd664e04a00..ac87841a24e1 100644\n>>>>> --- a/test/log/meson.build\n>>>>> +++ b/test/log/meson.build\n>>>>> @@ -7,7 +7,7 @@ log_test = [\n>>>>>\n>>>>>  foreach t : log_test\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/media_device/meson.build b/test/media_device/meson.build\n>>>>> index 1dfcdd8bd744..83dfe8f11d2f 100644\n>>>>> --- a/test/media_device/meson.build\n>>>>> +++ b/test/media_device/meson.build\n>>>>> @@ -11,12 +11,12 @@ media_device_tests = [\n>>>>>  ]\n>>>>>\n>>>>>  lib_mdev_test = static_library('lib_mdev_test', lib_mdev_test_sources,\n>>>>> -                               dependencies : libcamera_dep,\n>>>>> +                               dependencies : libcamera_private,\n>>>>>                                 include_directories : test_includes_internal)\n>>>>>\n>>>>>  foreach t : media_device_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : [test_libraries, lib_mdev_test],\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/meson.build b/test/meson.build\n>>>>> index 045ad2a2d7c9..b8615e0fd3e6 100644\n>>>>> --- a/test/meson.build\n>>>>> +++ b/test/meson.build\n>>>>> @@ -64,7 +64,7 @@ endforeach\n>>>>>\n>>>>>  foreach t : internal_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/pipeline/ipu3/meson.build b/test/pipeline/ipu3/meson.build\n>>>>> index d062ecd269f2..16701080ca2b 100644\n>>>>> --- a/test/pipeline/ipu3/meson.build\n>>>>> +++ b/test/pipeline/ipu3/meson.build\n>>>>> @@ -6,7 +6,7 @@ ipu3_test = [\n>>>>>\n>>>>>  foreach t : ipu3_test\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/pipeline/rkisp1/meson.build b/test/pipeline/rkisp1/meson.build\n>>>>> index ece147b054e4..364b5711a0f9 100644\n>>>>> --- a/test/pipeline/rkisp1/meson.build\n>>>>> +++ b/test/pipeline/rkisp1/meson.build\n>>>>> @@ -6,7 +6,7 @@ rkisp1_test = [\n>>>>>\n>>>>>  foreach t : rkisp1_test\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/process/meson.build b/test/process/meson.build\n>>>>> index d2272d509db3..af86b277db63 100644\n>>>>> --- a/test/process/meson.build\n>>>>> +++ b/test/process/meson.build\n>>>>> @@ -6,7 +6,7 @@ process_tests = [\n>>>>>\n>>>>>  foreach t : process_tests\n>>>>>      exe = executable(t[0], t[1],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>\n>>>>> diff --git a/test/serialization/generated_serializer/meson.build b/test/serialization/generated_serializer/meson.build\n>>>>> index 2460e0b114b3..9fb9cd1db968 100644\n>>>>> --- a/test/serialization/generated_serializer/meson.build\n>>>>> +++ b/test/serialization/generated_serializer/meson.build\n>>>>> @@ -8,7 +8,7 @@ exe = executable('generated_serializer_test',\n>>>>>                       generated_test_header,\n>>>>>                       generated_test_serializer,\n>>>>>                   ],\n>>>>> -                 dependencies : libcamera_dep,\n>>>>> +                 dependencies : libcamera_private,\n>>>>>                   link_with : test_libraries,\n>>>>>                   include_directories : [\n>>>>>                       test_includes_internal,\n>>>>> diff --git a/test/serialization/meson.build b/test/serialization/meson.build\n>>>>> index 60ebf3255b28..5446e4907f33 100644\n>>>>> --- a/test/serialization/meson.build\n>>>>> +++ b/test/serialization/meson.build\n>>>>> @@ -9,7 +9,7 @@ serialization_tests = [\n>>>>>\n>>>>>  foreach t : serialization_tests\n>>>>>      exe = executable(t[0], [t[1], 'serialization_test.cpp'],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'serialization', is_parallel : true)\n>>>>> diff --git a/test/v4l2_subdevice/meson.build b/test/v4l2_subdevice/meson.build\n>>>>> index 40d39766af9b..d82be3c60b75 100644\n>>>>> --- a/test/v4l2_subdevice/meson.build\n>>>>> +++ b/test/v4l2_subdevice/meson.build\n>>>>> @@ -7,7 +7,7 @@ v4l2_subdevice_tests = [\n>>>>>\n>>>>>  foreach t : v4l2_subdevice_tests\n>>>>>      exe = executable(t[0], [t[1], 'v4l2_subdevice_test.cpp'],\n>>>>> -        dependencies : libcamera_dep,\n>>>>> +        dependencies : libcamera_private,\n>>>>>          link_with : test_libraries,\n>>>>>          include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'v4l2_subdevice', is_parallel : false)\n>>>>> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build\n>>>>> index e733518c0185..643f82edce5e 100644\n>>>>> --- a/test/v4l2_videodevice/meson.build\n>>>>> +++ b/test/v4l2_videodevice/meson.build\n>>>>> @@ -16,7 +16,7 @@ v4l2_videodevice_tests = [\n>>>>>\n>>>>>  foreach t : v4l2_videodevice_tests\n>>>>>      exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'],\n>>>>> -                     dependencies : libcamera_dep,\n>>>>> +                     dependencies : libcamera_private,\n>>>>>                       link_with : test_libraries,\n>>>>>                       include_directories : test_includes_internal)\n>>>>>      test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false)\n>>>>> --\n>>>>> 2.30.2\n>>>>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id AB0CAC321F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Jun 2021 08:32:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE5FD684D8;\n\tMon, 28 Jun 2021 10:31:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F1108684D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jun 2021 10:31:58 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4832FB8A;\n\tMon, 28 Jun 2021 10:31:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"bKA7GnXp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624869118;\n\tbh=EJ/LaZDGWJiqCU8hDKxryIzha5tCTXtKJ1QhnThwJHw=;\n\th=From:Subject:To:Cc:References:Date:In-Reply-To:From;\n\tb=bKA7GnXpYTKcpcmljwVGsA2N+qVC836zYhb9VRdG/RWCaEbCib3XM2tMragUOK9YW\n\tbeYbv4iyYiUtGp0ZZKAVBavop06EUjONWfQRT+nZZUpPlwhorcBMAAV6VFoUePLTsc\n\t6yTw86ln3R76GjndjD++bC8yRqF3GUdpkku7PIT8=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","References":"<20210625013539.625803-1-kieran.bingham@ideasonboard.com>\n\t<20210625013539.625803-13-kieran.bingham@ideasonboard.com>\n\t<CAO5uPHOybP=oSqBX_aeF+kn5BWmf6wqNziF8WmZ9T_dJQVzaig@mail.gmail.com>\n\t<20210625084008.GN2599@pyrite.rasen.tech>\n\t<f52a6eb9-a2d6-cb5f-0e19-287b1a15bbde@ideasonboard.com>\n\t<CAO5uPHPp6WYUfxMLoVnjwP=hUwzTnuS_c=EVgHss89=2Z+Cytw@mail.gmail.com>","Message-ID":"<3df7b8ba-d4b3-d57a-f109-6b2ef06dd37c@ideasonboard.com>","Date":"Mon, 28 Jun 2021 09:31:56 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<CAO5uPHPp6WYUfxMLoVnjwP=hUwzTnuS_c=EVgHss89=2Z+Cytw@mail.gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 12/16] libcamera/base: Validate\n\tinternal headers as private","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]