config BR2_PACKAGE_RPI_LIBCAMERA_ARCH_SUPPORTS
	bool
	default y
	# Invalid packing size of ControlValue struct on m68k
	depends on !BR2_m68k

menuconfig BR2_PACKAGE_RPI_LIBCAMERA
	bool "rpi-libcamera"
	depends on BR2_PACKAGE_RPI_LIBCAMERA_ARCH_SUPPORTS
	depends on BR2_INSTALL_LIBSTDCPP
	depends on BR2_TOOLCHAIN_HAS_THREADS
	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # C++17
	depends on !BR2_STATIC_LIBS # gnutls
	depends on BR2_USE_WCHAR # gnutls
	select BR2_PACKAGE_GNUTLS
	select BR2_PACKAGE_LIBYAML
	select BR2_PACKAGE_RPI_LIBCAMERA_PIPELINE_UVCVIDEO if !BR2_PACKAGE_RPI_LIBCAMERA_HAS_PIPELINE
	help
	  libcamera provides a software stack to support
	  complex devices that need heavy hardware image
	  processing operations.

	  THIS IS THE RASPBERRY PI FORK.

	  https://github.com/raspberrypi/libcamera

if BR2_PACKAGE_RPI_LIBCAMERA

config BR2_PACKAGE_RPI_LIBCAMERA_V4L2
	bool "libcamera v4l2 compatibility layer"
	help
	  libcamera v4l2 compatibility layer

config BR2_PACKAGE_RPI_LIBCAMERA_HAS_PIPELINE
	bool

config BR2_PACKAGE_RPI_LIBCAMERA_PIPELINE_SIMPLE
	bool "simple pipeline"
	select BR2_PACKAGE_RPI_LIBCAMERA_HAS_PIPELINE
	help
	  Pipeline for simple pipelines.

config BR2_PACKAGE_RPI_LIBCAMERA_PIPELINE_UVCVIDEO
	bool "uvcvideo pipeline"
	help
	  Pipeline for uvcvideo devices.

config BR2_PACKAGE_RPI_LIBCAMERA_PIPELINE_VIMC
	bool "vimc pipeline"
	select BR2_PACKAGE_LIBCAMERA_HAS_PIPELINE
	help
	  Pipeline for the vimc device.

config BR2_PACKAGE_RPI_LIBCAMERA_COMPLIANCE
	bool "lc-compliance test application"
	depends on BR2_USE_WCHAR # gtest
	depends on BR2_TOOLCHAIN_HAS_THREADS # gtest
	depends on BR2_INSTALL_LIBSTDCPP # gtest
	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # gtest
	depends on BR2_USE_MMU # gtest
	select BR2_PACKAGE_GTEST
	select BR2_PACKAGE_LIBEVENT
	help
	  lc-compliance test application

comment "lc-compliance test application needs a toolchain w/ C++, wchar, threads, gcc >= 5"
	depends on BR2_USE_MMU
	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
		!BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_5

endif # BR2_PACKAGE_RPI_LIBCAMERA

comment "rpi-libcamera needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 8"
	depends on BR2_PACKAGE_RPI_LIBCAMERA_ARCH_SUPPORTS
	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
		!BR2_TOOLCHAIN_GCC_AT_LEAST_8 || BR2_STATIC_LIBS || !BR2_USE_WCHAR
