[libcamera-devel] [PATCH v3 0/2] libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets

Niklas Söderlund niklas.soderlund at ragnatech.se
Tue Jul 2 00:06:10 CEST 2019


Hello,

This series adds an IPC mechanism to pass data and file descriptors
between two processes. The interface is asynchronous and bi-directional.

* Changes since v2
- Mark IPCUnixSocket::isBound() const.
- Fixup documentation.
- Remove a unused variable.
- Added two new tests, sending empty message and ordering of file 
  descriptors.

* Changes since v1
- Add a bugfix for Timer which prevented the test case to function
  properly.
- Add destructor to close the IPC channel.
- Rename attach() to bind().
- Add isBound() mehtod.
- Rework signal emitted for incoming data to Signal<IPCUnixSocket *>
  readyRead.
- Make payload argument in send() const at the cost of adding a
  const_cast().
- Dropped unused master_ property.
- Updated documentation, thanks Laurent!
- Add a call() method in the test case to simplify test logic.
- Use dup() instead of opening the same file path multiple times.

* Changes since RFC
- Switch to an event notifications and signals for the ingress code
  path, making the interface asynchronous.
- Removed any protocol helpers in the IPC object, a protocol should be
  implemented on top of the IPC.
- Added documentation.
- Switched to SOCK_DGRAM.
- Send both data and file descriptors in the same sendmsg().
- Fixed spelling and silly errors in the code.
- Merged test case in a single binary.

Niklas Söderlund (2):
  libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets
  test: ipc: unix: Add test for IPCUnixSocket

 src/libcamera/include/ipc_unixsocket.h |  57 +++
 src/libcamera/ipc_unixsocket.cpp       | 309 +++++++++++++++
 src/libcamera/meson.build              |   2 +
 test/ipc/meson.build                   |  17 +
 test/ipc/unixsocket.cpp                | 510 +++++++++++++++++++++++++
 test/meson.build                       |   1 +
 6 files changed, 896 insertions(+)
 create mode 100644 src/libcamera/include/ipc_unixsocket.h
 create mode 100644 src/libcamera/ipc_unixsocket.cpp
 create mode 100644 test/ipc/meson.build
 create mode 100644 test/ipc/unixsocket.cpp

-- 
2.21.0



More information about the libcamera-devel mailing list