summaryrefslogtreecommitdiff
path: root/src/android/camera_stream.h
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-02-28 11:23:26 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-03-28 14:12:18 +0100
commit6e889113380111dfa10438e4a5a6b25d73e84c18 (patch)
tree866542923c5a71a712718afec2a11821872470fe /src/android/camera_stream.h
parentf0b9eaeaa82d00a939a91115a7e686151068a9e7 (diff)
ipa: raspberrypi: Ensure shutter speed and gain are clipped in the AGC
Make a copy of the CameraMode structure on a switch mode call. This replaces the existing lastSensitivity_ field. Limit the AGC gain calculations to the minimum value given by the CameraMode structure. The maximum value remains unclipped as any gain over the sensor maximum will be made up by digital gain. Rename clipShutter to limitShutter for consistency, and have the latter limit the shutter speed to both upper and lower bounds. 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 'src/android/camera_stream.h')
0 files changed, 0 insertions, 0 deletions
n54'>54 55 56 57 58 59 60 61
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * ipc_unixsocket.h - IPC mechanism based on Unix sockets
 */

#ifndef __LIBCAMERA_INTERNAL_IPC_UNIXSOCKET_H__
#define __LIBCAMERA_INTERNAL_IPC_UNIXSOCKET_H__

#include <stdint.h>
#include <sys/types.h>
#include <vector>

#include <libcamera/base/signal.h>

namespace libcamera {

class EventNotifier;

class IPCUnixSocket
{
public:
	struct Payload {
		std::vector<uint8_t> data;
		std::vector<int32_t> fds;
	};

	IPCUnixSocket();
	~IPCUnixSocket();

	int create();
	int bind(int fd);
	void close();
	bool isBound() const;

	int send(const Payload &payload);
	int receive(Payload *payload);

	Signal<> readyRead;

private:
	struct Header {
		uint32_t data;
		uint8_t fds;
	};

	int sendData(const void *buffer, size_t length, const int32_t *fds, unsigned int num);
	int recvData(void *buffer, size_t length, int32_t *fds, unsigned int num);

	void dataNotifier();

	int fd_;
	bool headerReceived_;
	struct Header header_;
	EventNotifier *notifier_;
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_INTERNAL_IPC_UNIXSOCKET_H__ */