Fork of https://gitlab.com/megapixels-org/Megapixels

Martijn Braam 4fb0a5b133 Change up config lookup and add documentation for it %!s(int64=4) %!d(string=hai) anos
.builds e3532c40b4 Fixed up arch CI %!s(int64=4) %!d(string=hai) anos
config 59dc47f72c Use dtb auto detection for config file %!s(int64=4) %!d(string=hai) anos
.gitignore db131f2cb0 Chosen project name %!s(int64=4) %!d(string=hai) anos
CMakeLists.txt db131f2cb0 Chosen project name %!s(int64=4) %!d(string=hai) anos
LICENSE db131f2cb0 Chosen project name %!s(int64=4) %!d(string=hai) anos
README.md 4fb0a5b133 Change up config lookup and add documentation for it %!s(int64=4) %!d(string=hai) anos
bayer.c 38fd591828 Make the camera work in bayer mode %!s(int64=4) %!d(string=hai) anos
bayer.h 38fd591828 Make the camera work in bayer mode %!s(int64=4) %!d(string=hai) anos
camera.css 35770cfa3d Added end-user errors %!s(int64=4) %!d(string=hai) anos
camera.glade efb26135bd Use gresources and add new camera icon %!s(int64=4) %!d(string=hai) anos
ini.c 94d437df30 Added config file parser and meson script %!s(int64=5) %!d(string=hai) anos
ini.h 94d437df30 Added config file parser and meson script %!s(int64=5) %!d(string=hai) anos
main.c 4fb0a5b133 Change up config lookup and add documentation for it %!s(int64=4) %!d(string=hai) anos
meson.build 4fb0a5b133 Change up config lookup and add documentation for it %!s(int64=4) %!d(string=hai) anos
org.postmarketos.Megapixels.desktop 4be3e43b3a Added launcher %!s(int64=4) %!d(string=hai) anos
org.postmarketos.Megapixels.gresource.xml efb26135bd Use gresources and add new camera icon %!s(int64=4) %!d(string=hai) anos
org.postmarketos.Megapixels.svg 2f3b1afe2d Improved icon %!s(int64=4) %!d(string=hai) anos
quickdebayer.c 9871fe602d Improved debayer implementation %!s(int64=4) %!d(string=hai) anos
quickdebayer.h 243ef89cb5 Added quick'n'bad debayer implementation for previews %!s(int64=4) %!d(string=hai) anos
switch-camera.svg efb26135bd Use gresources and add new camera icon %!s(int64=4) %!d(string=hai) anos

README.md

Megapixels

A GTK3 camera application that knows how to deal with the media request api

Building

$ meson build
$ cd build
$ ninja
$ sudo ninja install

Developing

See the mailing list and issue tracker on https://sr.ht/~martijnbraam/Megapixels/

Config

Megapixels checks multiple locations for it's configuration file and uses the first one it finds. As first step it will get the first compatible name in the device tree, in the case of a PinePhone this might be "pine64,pinephone-1.2". Then that dtname will be used as the filename in the search path in this order:

  • $XDG_CONFIG_DIR/megapixels/config/$dtname.ini
  • ~/.config/megapixels/config/$dtname.ini
  • /etc/megapixels/config/$dtname.ini
  • /usr/share/megapixels/config/$dtname.ini

The files in /usr/share/megapixels should be the config files distributed in this repository. The other locations allow the user or distribution to override config.

Config file format

Configuration files are INI format files.

[device]

This provides global info, currently only the csi key exists, telling megapixels which device in the media-ctl tree is the interface to the kernel. This should provide the /dev/video* node.

[rear] and [front]

These are the sections describing the sensors.

  • driver=ov5640 the name of the media node that provides the sensor and it's /dev/v4l-subdev* node.
  • width=640 and height=480 the resolution to use for the sensor
  • rate=15 the refresh rate in fps to use for the sensor
  • fmt=BGGR8 sets the pixel and bus formats used when capturing from the sensor, only BGGR8 is fully supported
  • rotate=90 the rotation angle to make the sensor match the screen