Remove the verbose #ifndef/#define/#endif pattern for maintaining
header idempotency, and replace it with a simple #pragma once.
This simplifies the headers, and prevents redundant changes when
header files get moved.
The internal/request.h was missed at the time of the original
conversion. Update it.
Fixes: df131ad088 ("libcamera: internal: Convert to pragma once")
Tested-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
65 lines
1.3 KiB
C++
65 lines
1.3 KiB
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2019, Google Inc.
|
|
*
|
|
* request.h - Request class private data
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <map>
|
|
#include <memory>
|
|
|
|
#include <libcamera/base/event_notifier.h>
|
|
#include <libcamera/base/timer.h>
|
|
|
|
#include <libcamera/request.h>
|
|
|
|
using namespace std::chrono_literals;
|
|
|
|
namespace libcamera {
|
|
|
|
class Camera;
|
|
class FrameBuffer;
|
|
|
|
class Request::Private : public Extensible::Private
|
|
{
|
|
LIBCAMERA_DECLARE_PUBLIC(Request)
|
|
|
|
public:
|
|
Private(Camera *camera);
|
|
~Private();
|
|
|
|
Camera *camera() const { return camera_; }
|
|
bool hasPendingBuffers() const;
|
|
|
|
bool completeBuffer(FrameBuffer *buffer);
|
|
void complete();
|
|
void cancel();
|
|
void reset();
|
|
|
|
void prepare(std::chrono::milliseconds timeout = 0ms);
|
|
Signal<> prepared;
|
|
|
|
private:
|
|
friend class PipelineHandler;
|
|
friend std::ostream &operator<<(std::ostream &out, const Request &r);
|
|
|
|
void doCancelRequest();
|
|
void emitPrepareCompleted();
|
|
void notifierActivated(FrameBuffer *buffer);
|
|
void timeout();
|
|
|
|
Camera *camera_;
|
|
bool cancelled_;
|
|
uint32_t sequence_ = 0;
|
|
bool prepared_ = false;
|
|
|
|
std::unordered_set<FrameBuffer *> pending_;
|
|
std::map<FrameBuffer *, std::unique_ptr<EventNotifier>> notifiers_;
|
|
std::unique_ptr<Timer> timer_;
|
|
};
|
|
|
|
} /* namespace libcamera */
|