Skip to content

libcamera Chromium support (deprecated)

Kieran Bingham edited this page Oct 28, 2021 · 1 revision

This content is archived. The Chromium support has not progressed in some time, and much of the community are using a v4l2-loopback solution, which is effective until we get wider application support built in.

Built in support is more likely to come through pipewire video integration into browsers.

Chromium

Chromium integration is being developed, and a development tree is available at: https://github.com/libcamera-org/chromium/ This is not yet available in a packaged form, and requires building Chromium from source. This is no small undertaking, community support in packaging this for a binary release is welcome.

Building chromium is documented at https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md

The steps are replicated here to demonstrate all commands required to build on a clean ubuntu-20.04 based build system, specifically building the required branch for libcamera integration.

This will require approximately 50 GB of free disk space, and may be expected to take between 4-8 hours or more to complete depending on your system.

Obtain the sources:

$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH="$PATH:${HOME}/depot_tools"

$ mkdir ~/chromium && cd ~/chromium
$ fetch --nohooks chromium
$ cd src

Make sure we have all dependencies:

$ sudo apt upgrade -y
$ sudo apt install gnome-keyring libva-dev libdri2-dev mesa-common-dev \
      python python2.7 libx11-xcb-dev
$ sudo ./build/install-build-deps.sh --unsupported
$ gclient runhooks

Use the custom Surface Chromium Branch:

$ git remote add github https://github.com/libcamera-org/chromium.git
$ git fetch github
$ git checkout -b surface github/surface

$ gclient sync -D

Build:

$ gn gen out/Default \
	--args="is_debug=false is_component_build=true symbol_level=0 \
		enable_nacl=false blink_symbol_level=0 use_gold=false \
		use_sysroot=false is_clang=true clang_use_chrome_plugins=false \
		use_lld=false is_clang=true use_custom_libcxx=true \
		libcxx_abi_unstable=false use_gnome_keyring=false \
		use_libcamera=true"

$ autoninja -C out/Default chrome

And then we can run and test:

$ out/Default/chrome

Clone this wiki locally