summaryrefslogtreecommitdiff
path: root/src/android/mm
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-23 05:13:17 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-03 23:05:09 +0300
commit5694a6791f8b1d04de9c42a34a0b63b0bb635d7c (patch)
treebbd67345d014b78c1fc646d101d45a0dff5eff04 /src/android/mm
parent33dd4fab9d39726be4fcbd300a27f2640be1cd6f (diff)
libcamera: frame_buffer: Document the FrameBuffer::Private class
The FrameBuffer::Private class is exposed to pipeline handlers, and is thus part of the internal libcamera API. As such, it should be documented. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/mm')
0 files changed, 0 insertions, 0 deletions
ss="hl opt">: streamNames_(streamNames), pattern_(pattern) { } FileSink::~FileSink() { } int FileSink::configure(const libcamera::CameraConfiguration &config) { int ret = FrameSink::configure(config); if (ret < 0) return ret; return 0; } void FileSink::mapBuffer(FrameBuffer *buffer) { std::unique_ptr<Image> image = Image::fromFrameBuffer(buffer, Image::MapMode::ReadOnly); assert(image != nullptr); mappedBuffers_[buffer] = std::move(image); } bool FileSink::processRequest(Request *request) { for (auto [stream, buffer] : request->buffers()) writeBuffer(stream, buffer); return true; } void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer) { std::string filename; size_t pos; int fd, ret = 0; if (!pattern_.empty()) filename = pattern_; if (filename.empty() || filename.back() == '/') filename += "frame-#.bin"; pos = filename.find_first_of('#'); if (pos != std::string::npos) { std::stringstream ss; ss << streamNames_[stream] << "-" << std::setw(6) << std::setfill('0') << buffer->metadata().sequence; filename.replace(pos, 1, ss.str()); } fd = open(filename.c_str(), O_CREAT | O_WRONLY | (pos == std::string::npos ? O_APPEND : O_TRUNC), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd == -1) { ret = -errno;