diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-11-28 05:45:34 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-12-04 23:05:05 +0200 |
commit | 5c85e7024027c90b1b054782e510691b8b9c7419 (patch) | |
tree | 4fa3beff65de2a9a1236ad5c931b8e2495fd6eb2 /src/libcamera/v4l2_videodevice.cpp | |
parent | 3dc3e2e61e548e4cd3e213b1b3022ed4d8e7ecee (diff) |
libcamera: base: Rename FileDescriptor to SharedFD
Now that we have a UniqueFD class, the name FileDescriptor is ambiguous.
Rename it to SharedFD.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 5f1cc6e2..0d214d9e 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -22,8 +22,8 @@ #include <linux/version.h> #include <libcamera/base/event_notifier.h> -#include <libcamera/base/file_descriptor.h> #include <libcamera/base/log.h> +#include <libcamera/base/shared_fd.h> #include <libcamera/base/unique_fd.h> #include <libcamera/base/utils.h> @@ -617,7 +617,7 @@ int V4L2VideoDevice::open() * * \return 0 on success or a negative error code otherwise */ -int V4L2VideoDevice::open(FileDescriptor handle, enum v4l2_buf_type type) +int V4L2VideoDevice::open(SharedFD handle, enum v4l2_buf_type type) { UniqueFD newFd = handle.dup(); if (!newFd.isValid()) { @@ -1323,7 +1323,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index) return nullptr; FrameBuffer::Plane plane; - plane.fd = FileDescriptor(std::move(fd)); + plane.fd = SharedFD(std::move(fd)); /* * V4L2 API doesn't provide dmabuf offset information of plane. * Set 0 as a placeholder offset. @@ -1352,7 +1352,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index) ASSERT(numPlanes == 1u); planes.resize(formatInfo_->numPlanes()); - const FileDescriptor &fd = planes[0].fd; + const SharedFD &fd = planes[0].fd; size_t offset = 0; for (auto [i, plane] : utils::enumerate(planes)) { @@ -1900,8 +1900,8 @@ int V4L2M2MDevice::open() * The output and capture V4L2VideoDevice instances use the same file * handle for the same device node. */ - FileDescriptor fd(syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(), - O_RDWR | O_NONBLOCK)); + SharedFD fd(syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(), + O_RDWR | O_NONBLOCK)); if (!fd.isValid()) { ret = -errno; LOG(V4L2, Error) << "Failed to open V4L2 M2M device: " |