Files
external_libcamera/src/cam/capture.h
T
Niklas Söderlund 9217f274f6 libcamera: Switch to FrameBuffer interface
Switch to the FrameBuffer interface where all buffers are treated as
external buffers and are allocated outside the camera. Applications
allocating buffers using libcamera are switched to use the
FrameBufferAllocator helper.

Follow-up changes to this one will finalize the transition to the new
FrameBuffer interface by removing code that is left unused after this
change.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-01-12 16:10:38 +01:00

45 lines
1.0 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* capture.h - Cam capture
*/
#ifndef __CAM_CAPTURE_H__
#define __CAM_CAPTURE_H__
#include <chrono>
#include <memory>
#include <libcamera/buffer.h>
#include <libcamera/camera.h>
#include <libcamera/framebuffer_allocator.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
#include "buffer_writer.h"
#include "event_loop.h"
#include "options.h"
class Capture
{
public:
Capture(std::shared_ptr<libcamera::Camera> camera,
libcamera::CameraConfiguration *config);
int run(EventLoop *loop, const OptionsParser::Options &options);
private:
int capture(EventLoop *loop,
libcamera::FrameBufferAllocator *allocator);
void requestComplete(libcamera::Request *request);
std::shared_ptr<libcamera::Camera> camera_;
libcamera::CameraConfiguration *config_;
std::map<libcamera::Stream *, std::string> streamName_;
BufferWriter *writer_;
std::chrono::steady_clock::time_point last_;
};
#endif /* __CAM_CAPTURE_H__ */