summaryrefslogtreecommitdiff
path: root/test/media_device
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-06 00:32:19 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-07 19:18:40 +0300
commit8926fe6d74a272b4a3e83f12a2fb244a53305906 (patch)
treefe72786440796561755a41cbb696910183804cc9 /test/media_device
parent894ca69f60435e3402de5786682d621362979171 (diff)
cam: Add Image class
The new Image class represents a multi-planar image with direct access to pixel data. It currently duplicates the function of the MappedFrameBuffer class which is internal to libcamera, and will serve as a design playground to improve the API until it is considered ready to be made part of the libcamera public API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/media_device')
0 files changed, 0 insertions, 0 deletions
'#n33'>33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * event_dispatcher_poll.h - Poll-based event dispatcher
 */
#ifndef __LIBCAMERA_EVENT_DISPATCHER_POLL_H__
#define __LIBCAMERA_EVENT_DISPATCHER_POLL_H__

#include <list>
#include <map>
#include <vector>

#include <libcamera/event_dispatcher.h>

struct pollfd;

namespace libcamera {

class EventNotifier;
class Timer;

class EventDispatcherPoll final : public EventDispatcher
{
public:
	EventDispatcherPoll();
	~EventDispatcherPoll();

	void registerEventNotifier(EventNotifier *notifier);
	void unregisterEventNotifier(EventNotifier *notifier);

	void registerTimer(Timer *timer);
	void unregisterTimer(Timer *timer);

	void processEvents();
	void interrupt();

private:
	struct EventNotifierSetPoll {
		short events() const;
		EventNotifier *notifiers[3];
	};

	std::map<int, EventNotifierSetPoll> notifiers_;
	std::list<Timer *> timers_;
	int eventfd_;

	bool processingEvents_;

	int poll(std::vector<struct pollfd> *pollfds);
	void processInterrupt(const struct pollfd &pfd);
	void processNotifiers(const std::vector<struct pollfd> &pollfds);
	void processTimers();
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_EVENT_DISPATCHER_POLL_H__ */