summaryrefslogtreecommitdiff
path: root/test/utils.cpp
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2022-03-28 11:05:44 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-04-06 12:52:24 +0300
commit8dc2699bb87f5328dd3aae540d6e9d858212f774 (patch)
treef272800c18691b72f0212b4d85f535a2dc646540 /test/utils.cpp
parenta2aa1b4c4e441b7b2fb40c976489b109c1de0bc4 (diff)
ipa: raspberrypi: Correct some of the ControlInfo ranges and defaults
Some of the values were listed incorrectly. Specifically: ExposureValue: the range is now centred correctly on zero Brightness: the default value (0.0) is made explicit Contrast: the default value is corrected to be 1.0 Saturation: the default value is corrected to be 1.0 Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/utils.cpp')
0 files changed, 0 insertions, 0 deletions
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * v4l2_device.h - Common base for V4L2 video devices and subdevices
 */

#pragma once

#include <map>
#include <memory>
#include <optional>
#include <vector>

#include <linux/videodev2.h>

#include <libcamera/base/log.h>
#include <libcamera/base/signal.h>
#include <libcamera/base/span.h>
#include <libcamera/base/unique_fd.h>

#include <libcamera/color_space.h>
#include <libcamera/controls.h>

#include "libcamera/internal/formats.h"

namespace libcamera {

class EventNotifier;

class V4L2Device : protected Loggable
{
public:
	void close();
	bool isOpen() const { return fd_.isValid(); }

	const ControlInfoMap &controls() const { return controls_; }

	ControlList getControls(const std::vector<uint32_t> &ids);
	int setControls(ControlList *ctrls);

	const struct v4l2_query_ext_ctrl *controlInfo(uint32_t id) const;

	const std::string &deviceNode() const { return deviceNode_; }
	std::string devicePath() const;

	int setFrameStartEnabled(bool enable);
	Signal<uint32_t> frameStart;

	void updateControlInfo();

protected:
	V4L2Device(const std::string &deviceNode);
	~V4L2Device();

	int open(unsigned int flags);