summaryrefslogtreecommitdiff
path: root/src/ipa/vimc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-03 11:52:20 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-07 19:18:16 +0300
commit17b9db376ccef2097018c40e17da884e619dd360 (patch)
treea934812115f08abd607209fbc509381a21f25788 /src/ipa/vimc
parent6d98fe5b683a38748d708c810d52d5f96e312bda (diff)
libcamera: v4l2_videodevice: Document plane handling in createBuffer()
The V4L2VideoDevice::createBuffer() calculates offsets manually when using a multi-planar pixel format and a single-planar V4L2 format. The process isn't trivial, document it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/vimc')
0 files changed, 0 insertions, 0 deletions
a> 28 29 30 31 32 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_INTERNAL_EVENT_DISPATCHER_POLL_H__
#define __LIBCAMERA_INTERNAL_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];
	};

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

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

	bool processingEvents_;
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_INTERNAL_EVENT_DISPATCHER_POLL_H__ */