libcamera: base: shared_fd: Rename fd() to get()
For consistency with UniqueFD, rename the fd() function to get(). Renaming UniqueFD::get() to fd() would have been another option, but was rejected to keep as close as possible to the std::shared_ptr<> and std::unique_ptr<> APIs. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
@@ -198,7 +198,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
|
||||
std::map<int, MappedBufferInfo> mappedBuffers;
|
||||
|
||||
for (const FrameBuffer::Plane &plane : buffer->planes()) {
|
||||
const int fd = plane.fd.fd();
|
||||
const int fd = plane.fd.get();
|
||||
if (mappedBuffers.find(fd) == mappedBuffers.end()) {
|
||||
const size_t length = lseek(fd, 0, SEEK_END);
|
||||
mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };
|
||||
@@ -220,7 +220,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
|
||||
}
|
||||
|
||||
for (const FrameBuffer::Plane &plane : buffer->planes()) {
|
||||
const int fd = plane.fd.fd();
|
||||
const int fd = plane.fd.get();
|
||||
auto &info = mappedBuffers[fd];
|
||||
if (!info.address) {
|
||||
void *address = mmap(nullptr, info.mapLength, mmapFlags,
|
||||
|
||||
Reference in New Issue
Block a user