summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index f821d8fe..0bab3bed 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -1520,8 +1520,14 @@ void RPiCameraData::clearIncompleteRequests()
for (auto &b : request->buffers()) {
FrameBuffer *buffer = b.second;
- buffer->cancel();
- pipe_->completeBuffer(request, buffer);
+ /*
+ * Has the buffer already been handed back to the
+ * request? If not, do so now.
+ */
+ if (buffer->request()) {
+ buffer->cancel();
+ pipe_->completeBuffer(request, buffer);
+ }
}
pipe_->completeRequest(request);
pc"> namespace libcamera { class MediaDevice : protected Loggable { public: MediaDevice(const std::string &deviceNode); ~MediaDevice(); bool acquire(); void release(); bool busy() const { return acquired_; } bool lock(); void unlock(); int populate(); bool isValid() const { return valid_; } const std::string &driver() const { return driver_; } const std::string &deviceNode() const { return deviceNode_; } const std::string &model() const { return model_; } unsigned int version() const { return version_; } unsigned int hwRevision() const { return hwRevision_; } const std::vector<MediaEntity *> &entities() const { return entities_; } MediaEntity *getEntityByName(const std::string &name) const; MediaLink *link(const std::string &sourceName, unsigned int sourceIdx, const std::string &sinkName, unsigned int sinkIdx); MediaLink *link(const MediaEntity *source, unsigned int sourceIdx, const MediaEntity *sink, unsigned int sinkIdx); MediaLink *link(const MediaPad *source, const MediaPad *sink); int disableLinks(); Signal<> disconnected; protected: std::string logPrefix() const override; private: int open(); void close(); MediaObject *object(unsigned int id); bool addObject(MediaObject *object); void clear(); struct media_v2_interface *findInterface(const struct media_v2_topology &topology, unsigned int entityId); bool populateEntities(const struct media_v2_topology &topology); bool populatePads(const struct media_v2_topology &topology); bool populateLinks(const struct media_v2_topology &topology); void fixupEntityFlags(struct media_v2_entity *entity); friend int MediaLink::setEnabled(bool enable); int setupLink(const MediaLink *link, unsigned int flags); std::string driver_; std::string deviceNode_; std::string model_; unsigned int version_; unsigned int hwRevision_; UniqueFD fd_; bool valid_; bool acquired_; std::map<unsigned int, MediaObject *> objects_; std::vector<MediaEntity *> entities_; }; } /* namespace libcamera */