summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/feathericons.qrc
AgeCommit message (Expand)Author
2020-10-04qcam: Remove unneeded './' file prefix in *.qrcLaurent Pinchart
2020-06-09libcamera: Add missing SPDX headers to miscellaneous small filesLaurent Pinchart
2020-05-02qcam: Add RAW capture supportNiklas Söderlund
2020-03-24qcam: viewfinder: Display icon when stopping captureLaurent Pinchart
2020-02-14qcam: Provide save image functionalityKieran Bingham
2020-02-14qcam: Provide initial icon buttons "Play/Stop"Kieran Bingham
>21 22 23 24 25 26 27 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 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
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * framebuffer.h - Frame buffer handling
 */

#pragma once

#include <assert.h>
#include <limits>
#include <memory>
#include <stdint.h>
#include <vector>

#include <libcamera/base/class.h>
#include <libcamera/base/shared_fd.h>
#include <libcamera/base/span.h>

namespace libcamera {

class Fence;
class Request;

struct FrameMetadata {
	enum Status {
		FrameSuccess,
		FrameError,
		FrameCancelled,
	};

	struct Plane {
		unsigned int bytesused;
	};

	Status status;
	unsigned int sequence;
	uint64_t timestamp;

	Span<Plane> planes() { return planes_; }
	Span<const Plane> planes() const { return planes_; }

private:
	friend class FrameBuffer;

	std::vector<Plane> planes_;
};

class FrameBuffer final : public Extensible
{
	LIBCAMERA_DECLARE_PRIVATE()

public:
	struct Plane {
		static constexpr unsigned int kInvalidOffset = std::numeric_limits<unsigned int>::max();
		SharedFD fd;
		unsigned int offset = kInvalidOffset;
		unsigned int length;
	};

	FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);
	FrameBuffer(std::unique_ptr<Private> d,
		    const std::vector<Plane> &planes, unsigned int cookie = 0);

	const std::vector<Plane> &planes() const { return planes_; }
	Request *request() const;
	const FrameMetadata &metadata() const { return metadata_; }

	uint64_t cookie() const { return cookie_; }
	void setCookie(uint64_t cookie) { cookie_ = cookie; }

	std::unique_ptr<Fence> releaseFence();

private:
	LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)

	friend class V4L2VideoDevice; /* Needed to update metadata_. */

	std::vector<Plane> planes_;

	FrameMetadata metadata_;

	uint64_t cookie_;
};

} /* namespace libcamera */