summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Expand)Author
2021-08-02controls: Add boolean constructors for ControlInfoPaul Elder
2021-07-27ipa: core.mojom: Rework core file documentationJacopo Mondi
2021-07-19libcamera: ipa_manager: Split common code out of createIPA()Laurent Pinchart
2021-07-19libcamera: ipa_manager: Fix IPA module min/max version checkLaurent Pinchart
2021-07-12libcamera: framebuffer: Make FrameBuffer class ExtensibleLaurent Pinchart
2021-07-12libcamera: Drop the LIBCAMERA_D_PTR macro in favour of the _d() functionLaurent Pinchart
2021-07-12libcamera: base: class: Expose Extensible private data to other classesLaurent Pinchart
2021-07-11libcamera: buffer: Rename buffer.h to framebuffer.hLaurent Pinchart
2021-07-06libcamera: device_enumerator: Drop inclusion of linux/media.hLaurent Pinchart
2021-07-06libcamera: media_device: Rename valid() function to isValid()Laurent Pinchart
2021-06-28libcamera: Add support for monochrome sensorsDavid Plowman
2021-06-28libcamera: utils: Only enable utils::hex() for integer argumentsLaurent Pinchart
2021-06-25libcamera/base: Validate internal headers as privateKieran Bingham
2021-06-25libcamera/base: Move span to base libraryKieran Bingham
2021-06-25libcamera/base: Move event_notifier to baseKieran Bingham
2021-06-25libcamera/base: Move File to base libraryKieran Bingham
2021-06-25libcamera/base: Move extended base functionalityKieran Bingham
2021-06-25libcamera/base: Move class helpers to the base libraryKieran Bingham
2021-06-25libcamera/base: Move utils to the base libraryKieran Bingham
2021-06-25libcamera/base: Introduce new base libraryKieran Bingham
2021-06-25libcamera: Separate source and build path helpersKieran Bingham
2021-06-15libcamera: log: Destroy LogCategory instances in a controlled wayLaurent Pinchart
2021-06-14libcamera: CameraSensor: Enable retrieving supported test pattern modesHirokazu Honda
2021-06-14libcamera: CameraSensorProperties: Add table of v4l2 index and test patternHirokazu Honda
2021-06-14libcamera: V4L2Device: Support v4l2 menu controlHirokazu Honda
2021-06-14libcamera: request: Add Request::cancel()Jacopo Mondi
2021-06-14ipa: ipu3: Support return values from configure()Kieran Bingham
2021-06-08libcamera: utils: Add helper class for std::chrono::durationNaushir Patuck
2021-05-31android: Update Android headersLaurent Pinchart
2021-05-27meson: ipa: Pass core.mojom to the docs generatorPaul Elder
2021-05-27ipa: core: Move documentation from cpp file back into the mojom filePaul Elder
2021-05-27meson: ipa: Use files() to locate the mojom filesPaul Elder
2021-05-27controls: Split FrameDurations into FrameDuration and FrameDurationLimitsPaul Elder
2021-05-26ipa: ipu3: Provide frame timestamps through IPU3EventUmang Jain
2021-05-26ipa: ipu3: Rectify ControlInfoMap matching in IPAConfigInfoUmang Jain
2021-05-24ipa: ipu3: Introduce IPAConfigInfo in IPCUmang Jain
2021-05-24ipa: meson: Install mojom generated headers to include pathsUmang Jain
2021-05-24ipa: ipc: Rename CameraSensorInfo to IPACameraSensorInfoUmang Jain
2021-05-24ipa: mojom: Move CameraSensorInfo struct exclusively to IPA IPCUmang Jain
2021-05-24ipa: Move core IPA interface documentation to a .cpp fileUmang Jain
2021-05-24libcamera: V4L2Control: remove V4L2Control classesHirokazu Honda
2021-05-18libcamera: utils: Add enumerate view for range-based for loopsLaurent Pinchart
2021-05-11libcamera: Use get_option('includedir') instead of raw 'include'Umang Jain
2021-05-11meson: Replace obselete join_paths() with '/' operatorUmang Jain
2021-05-11libcamera: camera_sensor: Fix frame lengths calculated by sensorInfo()David Plowman
2021-05-10libcamera: camera_sensor: Register static propertiesJacopo Mondi
2021-05-10libcamera: Introduce camera sensor propertiesJacopo Mondi
2021-05-06libcamera: controls: Add a function to merge two control listsLaurent Pinchart
2021-04-27libcamera: internal: log: Report function on assertsKieran Bingham
2021-04-27ipa: mojom: Put core.mojom in the libcamera namespacePaul Elder
kwb">int Stream::getBufferId(FrameBuffer *buffer) const { if (importOnly_) return -1; /* Find the buffer in the map, and return the buffer id. */ auto it = std::find_if(bufferMap_.begin(), bufferMap_.end(), [&buffer](auto const &p) { return p.second == buffer; }); if (it == bufferMap_.end()) return -1; return it->first; } void Stream::setExternalBuffer(FrameBuffer *buffer) { bufferMap_.emplace(ipa::rpi::MaskExternalBuffer | id_.get(), buffer); } void Stream::removeExternalBuffer(FrameBuffer *buffer) { int id = getBufferId(buffer); /* Ensure we have this buffer in the stream, and it is marked external. */ ASSERT(id != -1 && (id & ipa::rpi::MaskExternalBuffer)); bufferMap_.erase(id); } int Stream::prepareBuffers(unsigned int count) { int ret; if (!importOnly_) { if (count) { /* Export some frame buffers for internal use. */ ret = dev_->exportBuffers(count, &internalBuffers_); if (ret < 0) return ret; /* Add these exported buffers to the internal/external buffer list. */ setExportedBuffers(&internalBuffers_); /* Add these buffers to the queue of internal usable buffers. */ for (auto const &buffer : internalBuffers_) availableBuffers_.push(buffer.get()); } /* We must import all internal/external exported buffers. */ count = bufferMap_.size(); } return dev_->importBuffers(count); } int Stream::queueBuffer(FrameBuffer *buffer) { /* * A nullptr buffer implies an external stream, but no external * buffer has been supplied in the Request. So, pick one from the * availableBuffers_ queue. */ if (!buffer) { if (availableBuffers_.empty()) { LOG(RPISTREAM, Info) << "No buffers available for " << name_; /* * Note that we need to queue an internal buffer as soon * as one becomes available. */ requestBuffers_.push(nullptr); return 0; } buffer = availableBuffers_.front(); availableBuffers_.pop(); } /* * If no earlier requests are pending to be queued we can go ahead and * queue this buffer into the device. */ if (requestBuffers_.empty()) return queueToDevice(buffer); /* * There are earlier Request buffers to be queued, so this buffer must go * on the waiting list. */ requestBuffers_.push(buffer); return 0; } void Stream::returnBuffer(FrameBuffer *buffer) { /* This can only be called for external streams. */ ASSERT(external_); /* Push this buffer back into the queue to be used again. */ availableBuffers_.push(buffer); /* Allow the buffer id to be reused. */ id_.release(getBufferId(buffer)); /* * Do we have any Request buffers that are waiting to be queued? * If so, do it now as availableBuffers_ will not be empty. */ while (!requestBuffers_.empty()) { FrameBuffer *requestBuffer = requestBuffers_.front(); if (!requestBuffer) { /* * We want to queue an internal buffer, but none * are available. Can't do anything, quit the loop. */ if (availableBuffers_.empty()) break; /* * We want to queue an internal buffer, and at least one * is available. */ requestBuffer = availableBuffers_.front(); availableBuffers_.pop(); } requestBuffers_.pop(); queueToDevice(requestBuffer); } } int Stream::queueAllBuffers() { int ret; if (external_) return 0; while (!availableBuffers_.empty()) { ret = queueBuffer(availableBuffers_.front()); if (ret < 0) return ret; availableBuffers_.pop(); } return 0; } void Stream::releaseBuffers() { dev_->releaseBuffers(); clearBuffers(); } void Stream::clearBuffers() { availableBuffers_ = std::queue<FrameBuffer *>{}; requestBuffers_ = std::queue<FrameBuffer *>{}; internalBuffers_.clear(); bufferMap_.clear(); id_.reset(); } int Stream::queueToDevice(FrameBuffer *buffer) { LOG(RPISTREAM, Debug) << "Queuing buffer " << getBufferId(buffer) << " for " << name_; int ret = dev_->queueBuffer(buffer); if (ret) LOG(RPISTREAM, Error) << "Failed to queue buffer for " << name_; return ret; } } /* namespace RPi */ } /* namespace libcamera */