summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_camera_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/v4l2/v4l2_camera_file.cpp')
0 files changed, 0 insertions, 0 deletions
a> 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2020, Google Inc.
 *
 * ipc_pipe_unixsocket.h - Image Processing Algorithm IPC module using unix socket
 */

#pragma once

#include <map>
#include <memory>
#include <vector>

#include "libcamera/internal/ipc_pipe.h"
#include "libcamera/internal/ipc_unixsocket.h"

namespace libcamera {

class Process;

class IPCPipeUnixSocket : public IPCPipe
{
public:
	IPCPipeUnixSocket(const char *ipaModulePath, const char *ipaProxyWorkerPath);
	~IPCPipeUnixSocket();

	int sendSync(const IPCMessage &in,
		     IPCMessage *out = nullptr) override;

	int sendAsync(const IPCMessage &data) override;

private:
	struct CallData {
		IPCUnixSocket::Payload *response;
		bool done;
	};

	void readyRead();
	int call(const IPCUnixSocket::Payload &message,
		 IPCUnixSocket::Payload *response, uint32_t seq);

	std::unique_ptr<Process> proc_;
	std::unique_ptr<IPCUnixSocket> socket_;
	std::map<uint32_t, CallData> callData_;
};

} /* namespace libcamera */