summaryrefslogtreecommitdiff
path: root/test/libtest
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-01-23 15:49:22 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-01-30 16:30:43 +0000
commitd70c38dca8ea9b236e764106bad21ccc0a89b54c (patch)
tree9a199d700d4e17794d67b6988861908eef2e700c /test/libtest
parenta0701930a8be9900d428a8cbae0414b455b56e97 (diff)
pipeline: ipa: raspberrypi: Remove unused streamConfig
Remove the streamConfig parameter from the ipa::configure() call, it is never used. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/libtest')
0 files changed, 0 insertions, 0 deletions
58'>58 59
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * File descriptor wrapper with shared ownership
 */

#pragma once

#include <memory>

namespace libcamera {

class UniqueFD;

class SharedFD final
{
public:
	explicit SharedFD(const int &fd = -1);
	explicit SharedFD(int &&fd);
	explicit SharedFD(UniqueFD fd);
	SharedFD(const SharedFD &other);
	SharedFD(SharedFD &&other);
	~SharedFD();

	SharedFD &operator=(const SharedFD &other);
	SharedFD &operator=(SharedFD &&other);

	bool isValid() const { return fd_ != nullptr; }
	int get() const { return fd_ ? fd_->fd() : -1; }
	UniqueFD dup() const;

private:
	class Descriptor
	{
	public:
		Descriptor(int fd, bool duplicate);
		~Descriptor();

		int fd() const { return fd_; }

	private:
		int fd_;
	};

	std::shared_ptr<Descriptor> fd_;
};

static inline bool operator==(const SharedFD &lhs, const SharedFD &rhs)
{
	return lhs.get() == rhs.get();
}

static inline bool operator!=(const SharedFD &lhs, const SharedFD &rhs)
{
	return !(lhs == rhs);
}

} /* namespace libcamera */