summaryrefslogtreecommitdiff
path: root/utils/hooks
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-01 22:53:24 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-22 17:00:41 +0200
commit72b9b7d3f33a5540d726bf0e00c29ac95b07cc48 (patch)
treebcabbb95d2c9d2a78dc3e1d670e8c2d5f11483e3 /utils/hooks
parent846e7d999a15ce0c3784a790cd5c249ba7aaa5c6 (diff)
libcamera: stream: Initialize stride and bufferCount
The two public unsigned integer fields of StreamConfiguration, stride and bufferCount where not initialized, fix this to match other members being initialized to their 'zero' state. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/hooks')
0 files changed, 0 insertions, 0 deletions
> 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 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 177 178 179 180 181 182 183 184
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2021, Google Inc.
 *
 * camera_sensor_properties.cpp - Database of camera sensor properties
 */

#include "libcamera/internal/camera_sensor_properties.h"

#include <map>

#include <libcamera/base/log.h>

#include <libcamera/control_ids.h>

/**
 * \file camera_sensor_properties.h
 * \brief Database of camera sensor properties
 *
 * The database of camera sensor properties collects static information about
 * camera sensors that is not possible or desirable to retrieve from the device
 * at run time.
 *
 * The database is indexed using the camera sensor model, as reported by the
 * properties::Model property, and for each supported sensor it contains a
 * list of properties.
 */

namespace libcamera {

LOG_DEFINE_CATEGORY(CameraSensorProperties)

/**
 * \struct CameraSensorProperties
 * \brief Database of camera sensor properties
 *
 * \var CameraSensorProperties::unitCellSize
 * \brief The physical size of a pixel, including pixel edges, in nanometers.
 *
 * \var CameraSensorProperties::testPatternModes
 * \brief Map that associates the TestPattern control value with the indexes of
 * the corresponding sensor test pattern modes as returned by
 * V4L2_CID_TEST_PATTERN.
 */

/**
 * \brief Retrieve the properties associated with a sensor
 * \param sensor The sensor model name as reported by properties::Model
 * \return A pointer to the CameraSensorProperties instance associated with a sensor
 * or nullptr if the sensor is not supported
 */
const CameraSensorProperties *CameraSensorProperties::get(const std::string &sensor)
{
	static const std::map<std::string, const CameraSensorProperties> sensorProps = {
		{ "hi846", {
			.unitCellSize = { 1120, 1120 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeSolidColor, 1 },
				{ controls::draft::TestPatternModeColorBars, 2 },
				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
				{ controls::draft::TestPatternModePn9, 4 },
				/*
				 * No corresponding test pattern mode for:
				 * 5: "Gradient Horizontal"
				 * 6: "Gradient Vertical"
				 * 7: "Check Board"
				 * 8: "Slant Pattern"
				 * 9: "Resolution Pattern"
				 */
			},
		} },
		{ "imx219", {
			.unitCellSize = { 1120, 1120 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 1 },
				{ controls::draft::TestPatternModeSolidColor, 2 },
				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
				{ controls::draft::TestPatternModePn9, 4 },
			},
		} },
		{ "imx258", {
			.unitCellSize = { 1120, 1120 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeSolidColor, 1 },
				{ controls::draft::TestPatternModeColorBars, 2 },
				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
				{ controls::draft::TestPatternModePn9, 4 },
			},
		} },
		{ "imx290", {
			.unitCellSize = { 2900, 2900 },
			.testPatternModes = {},
		} },
		{ "imx296", {
			.unitCellSize = { 3450, 3450 },
			.testPatternModes = {},
		} },
		{ "imx477", {
			.unitCellSize = { 1550, 1550 },
			.testPatternModes = {},
		} },
		{ "ov2740", {
			.unitCellSize = { 1400, 1400 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 1},
			},
		} },
		{ "ov5640", {
			.unitCellSize = { 1400, 1400 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 1 },
			},
		} },
		{ "ov5647", {
			.unitCellSize = { 1400, 1400 },
			.testPatternModes = {},
		} },
		{ "ov5670", {
			.unitCellSize = { 1120, 1120 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 1 },
			},
		} },
		{ "ov5675", {
			.unitCellSize = { 1120, 1120 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 1 },
			},
		} },
		{ "ov5693", {
			.unitCellSize = { 1400, 1400 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 2 },
				/*
				 * No corresponding test pattern mode for
				 * 1: "Random data" and 3: "Colour Bars with
				 * Rolling Bar".
				 */
			},
		} },
		{ "ov8865", {
			.unitCellSize = { 1400, 1400 },
			.testPatternModes = {
				{ controls::draft::TestPatternModeOff, 0 },
				{ controls::draft::TestPatternModeColorBars, 2 },
				/*
				 * No corresponding test pattern mode for:
				 * 1: "Random data"
				 * 3: "Color bars with rolling bar"
				 * 4: "Color squares"
				 * 5: "Color squares with rolling bar"
				 */