summaryrefslogtreecommitdiff
path: root/src/android/post_processor.h
blob: 1a205b05e8426ab22ad5059f16c396046ed3a179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2020, Google Inc.
 *
 * post_processor.h - CameraStream Post Processing Interface
 */

#pragma once

#include <libcamera/base/signal.h>

#include <libcamera/framebuffer.h>
#include <libcamera/stream.h>

#include "camera_buffer.h"
#include "camera_request.h"

class PostProcessor
{
public:
	enum class Status {
		Error,
		Success
	};

	virtual ~PostProcessor() = default;

	virtual int configure(const libcamera::StreamConfiguration &inCfg,
			      const libcamera::StreamConfiguration &outCfg) = 0;
	virtual void process(Camera3RequestDescriptor::StreamBuffer *streamBuffer) = 0;

	libcamera::Signal<Camera3RequestDescriptor::StreamBuffer *, Status> processComplete;
};
> 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
.. SPDX-License-Identifier: CC-BY-SA-4.0

.. include:: documentation-contents.rst

Environment variables
=====================

The libcamera behaviour can be tuned through environment variables. This
document lists all the available variables and describes their usage.

List of variables
-----------------

LIBCAMERA_LOG_FILE
   The custom destination for log output.

   Example value: ``/home/{user}/camera_log.log``

LIBCAMERA_LOG_LEVELS
   Configure the verbosity of log messages for different categories (`more <Log levels_>`__).

   Example value: ``*:DEBUG``

LIBCAMERA_LOG_NO_COLOR
   Disable coloring of log messages (`more <Notes about debugging_>`__).

LIBCAMERA_IPA_CONFIG_PATH
   Define custom search locations for IPA configurations (`more <IPA configuration_>`__).

   Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``

LIBCAMERA_IPA_FORCE_ISOLATION
   When set to a non-empty string, force process isolation of all IPA modules.

   Example value: ``1``

LIBCAMERA_IPA_MODULE_PATH
   Define custom search locations for IPA modules (`more <IPA module_>`__).

   Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib``

LIBCAMERA_IPA_PROXY_PATH
   Define custom full path for a proxy worker for a given executable name.

   Example value: ``${HOME}/.libcamera/proxy/worker:/opt/libcamera/vendor/proxy/worker``

LIBCAMERA_PIPELINES_MATCH_LIST
   Define an ordered list of pipeline names to be used to match the media
   devices in the system. The pipeline handler names used to populate the
   variable are the ones passed to the REGISTER_PIPELINE_HANDLER() macro in the
   source code.

   Example value: ``rkisp1,simple``

LIBCAMERA_RPI_CONFIG_FILE
   Define a custom configuration file to use in the Raspberry Pi pipeline handler.

   Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``

LIBCAMERA_RPI_TUNING_FILE
   Define a custom JSON tuning file to use in the Raspberry Pi.

   Example value: ``/usr/local/share/libcamera/ipa/rpi/vc4/custom_sensor.json``

Further details
---------------

Notes about debugging
~~~~~~~~~~~~~~~~~~~~~

The environment variables ``LIBCAMERA_LOG_FILE``, ``LIBCAMERA_LOG_LEVELS`` and
``LIBCAMERA_LOG_NO_COLOR`` are used to modify the default configuration of the
libcamera logger.

By default, libcamera logs all messages to the standard error (std::cerr).
Messages are colored by default depending on the log level. Coloring can be
disabled by setting the ``LIBCAMERA_LOG_NO_COLOR`` environment variable.

The default log destination can also be directed to a file by setting the
``LIBCAMERA_LOG_FILE`` environment variable to the log file name. This also
disables coloring.

Log levels are controlled through the ``LIBCAMERA_LOG_LEVELS`` variable, which
accepts a comma-separated list of 'category:level' pairs.

The `level <Log levels_>`__ part is mandatory and can either be specified by
name or by numerical index associated with each level.

The optional `category <Log categories_>`__ is a string matching the categories
defined by each file in the source base using the logging infrastructure. It
can include a wildcard ('*') character at the end to match multiple categories.

For more information refer to the `API documentation <https://libcamera.org/api-html/log_8h.html#details>`__.

Examples: