summaryrefslogtreecommitdiff
path: root/utils/tuning/libtuning/modules/__init__.py
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-10-13 08:48:41 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-10-18 11:01:23 +0100
commitd848d2a21cac21b1189e641347d0869eb77744b4 (patch)
treee276bfa128ab51e360a0682ee6eada4370c37f83 /utils/tuning/libtuning/modules/__init__.py
parentdaeaf681c90f4837e4835c10f55c8f01f1a3d098 (diff)
ipa: rpi: agc: When AGC channels are changed, start with the 1st channel
Whenever the AGC active channels are changed, start with the first channel listed. This allows applications to rely on a particular channel being generated first. For example, multi-exposure HDR always wants the short channel first. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils/tuning/libtuning/modules/__init__.py')
0 files changed, 0 insertions, 0 deletions
5' href='#n75'>75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * buffer.h - Buffer handling
 */
#ifndef __LIBCAMERA_BUFFER_H__
#define __LIBCAMERA_BUFFER_H__

#include <stdint.h>
#include <vector>

namespace libcamera {

class BufferPool;

class Plane final
{
public:
	Plane();
	~Plane();

	int dmabuf() const { return fd_; }
	int setDmabuf(int fd, unsigned int length);

	void *mem();
	unsigned int length() const { return length_; }

private:
	int mmap();
	int munmap();

	int fd_;
	unsigned int length_;
	void *mem_;
};

class Buffer final
{
public:
	enum Status {
		BufferSuccess,
		BufferError,
		BufferCancelled,
	};

	Buffer();

	unsigned int index() const { return index_; }
	unsigned int bytesused() const { return bytesused_; }
	uint64_t timestamp() const { return timestamp_; }
	unsigned int sequence() const { return sequence_; }
	Status status() const { return status_; }
	std::vector<Plane> &planes() { return planes_; }

private:
	friend class BufferPool;
	friend class PipelineHandler;
	friend class V4L2Device;

	void cancel();

	unsigned int index_;
	unsigned int bytesused_;
	uint64_t timestamp_;
	unsigned int sequence_;
	Status status_;

	std::vector<Plane> planes_;
};

class BufferPool final
{
public:
	~BufferPool();

	void createBuffers(unsigned int count);
	void destroyBuffers();

	unsigned int count() const { return buffers_.size(); }
	std::vector<Buffer> &buffers() { return buffers_; }

private:
	std::vector<Buffer> buffers_;
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_BUFFER_H__ */