Loading...
Searching...
No Matches
v4l2_request.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2025, Ideas On Board
*
* V4L2 Request
*/
#pragma once
#include <string>
#include <linux/videodev2.h>
#include <libcamera/base/event_notifier.h>
#include <libcamera/base/log.h>
#include <libcamera/base/signal.h>
#include <libcamera/base/unique_fd.h>
namespace libcamera {
class V4L2Request : protected Loggable
{
public:
bool isValid() const { return fd_.isValid(); }
int fd() const { return fd_.get(); }
int reinit();
int queue();
V4L2Request(UniqueFD &&fd);
Signal<V4L2Request *> requestDone;
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(V4L2Request)
void requestReady();
std::string logPrefix() const override;
UniqueFD fd_;
EventNotifier fdNotifier_;
};
} /* namespace libcamera */
LIBCAMERA_DISABLE_COPY_AND_MOVE
#define LIBCAMERA_DISABLE_COPY_AND_MOVE(klass)
Disable copy and move construction and assignment of the klass.
Definition class.h:29
libcamera::EventNotifier
Notify of activity on a file descriptor.
Definition event_notifier.h:20
libcamera::Loggable
Base class to support log message extensions.
Definition log.h:92
libcamera::Loggable::logPrefix
virtual std::string logPrefix() const =0
Retrieve a string to be prefixed to the log message.
libcamera::Signal
Generic signal and slot communication mechanism.
Definition signal.h:39
libcamera::UniqueFD
unique_ptr-like wrapper for a file descriptor
Definition unique_fd.h:17
libcamera::V4L2Request::fd
int fd() const
Get the file descriptor.
Definition v4l2_request.h:25
libcamera::V4L2Request::requestDone
Signal< V4L2Request * > requestDone
Signal that is emitted when the request is done.
Definition v4l2_request.h:32
libcamera::V4L2Request::queue
int queue()
Queue the request.
Definition v4l2_request.cpp:102
libcamera::V4L2Request::V4L2Request
V4L2Request(UniqueFD &&fd)
Construct a V4L2Request.
Definition v4l2_request.cpp:47
libcamera::V4L2Request::reinit
int reinit()
Reinit the request.
Definition v4l2_request.cpp:85
libcamera::V4L2Request::isValid
bool isValid() const
Check if the request is valid.
Definition v4l2_request.h:24
event_notifier.h
File descriptor event notifier.
log.h
Logging infrastructure.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
signal.h
Signal & slot implementation.
unique_fd.h
File descriptor wrapper that owns a file descriptor.