summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDorota Czaplejewicz <dorota.czaplejewicz@puri.sm>2021-11-19 16:05:58 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-04-14 00:19:36 +0200
commitd98af71eaa3f28f5e49456dd1e3462e1580463f5 (patch)
treea4323641061237c5b7d59dbed66648a9c25a32c0
parentcef3e15324f3dbf35b1434cb901b91e2a8fc980b (diff)
libcamera: framebuffer: Make FrameBuffer::cancel() private
FrameBuffer::cancel() is not meant to be used by applications. Move it to the FrameBuffer::Private class. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> [Kieran: Handle rebase] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--include/libcamera/framebuffer.h2
-rw-r--r--include/libcamera/internal/framebuffer.h2
-rw-r--r--src/libcamera/framebuffer.cpp16
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp5
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp2
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp3
-rw-r--r--src/libcamera/request.cpp2
7 files changed, 17 insertions, 15 deletions
diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h
index de172d97..3b1118d1 100644
--- a/include/libcamera/framebuffer.h
+++ b/include/libcamera/framebuffer.h
@@ -71,8 +71,6 @@ public:
std::unique_ptr<Fence> releaseFence();
- void cancel() { metadata_.status = FrameMetadata::FrameCancelled; }
-
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)
diff --git a/include/libcamera/internal/framebuffer.h b/include/libcamera/internal/framebuffer.h
index 97dca963..8a9cc98e 100644
--- a/include/libcamera/internal/framebuffer.h
+++ b/include/libcamera/internal/framebuffer.h
@@ -31,6 +31,8 @@ public:
Fence *fence() const { return fence_.get(); }
void setFence(std::unique_ptr<Fence> fence) { fence_ = std::move(fence); }
+ void cancel() { LIBCAMERA_O_PTR()->metadata_.status = FrameMetadata::FrameCancelled; }
+
private:
std::unique_ptr<Fence> fence_;
Request *request_;
diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp
index 142e2af7..7be18560 100644
--- a/src/libcamera/framebuffer.cpp
+++ b/src/libcamera/framebuffer.cpp
@@ -187,6 +187,14 @@ FrameBuffer::Private::~Private()
*/
/**
+ * \fn FrameBuffer::Private::cancel()
+ * \brief Marks the buffer as cancelled
+ *
+ * If a buffer is not used by a request, it shall be marked as cancelled to
+ * indicate that the metadata is invalid.
+ */
+
+/**
* \class FrameBuffer
* \brief Frame buffer data and its associated dynamic metadata
*
@@ -407,12 +415,4 @@ std::unique_ptr<Fence> FrameBuffer::releaseFence()
return std::move(_d()->fence_);
}
-/**
- * \fn FrameBuffer::cancel()
- * \brief Marks the buffer as cancelled
- *
- * If a buffer is not used by a request, it shall be marked as cancelled to
- * indicate that the metadata is invalid.
- */
-
} /* namespace libcamera */
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 9f113171..fd989e61 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -28,6 +28,7 @@
#include "libcamera/internal/camera_sensor.h"
#include "libcamera/internal/delayed_controls.h"
#include "libcamera/internal/device_enumerator.h"
+#include "libcamera/internal/framebuffer.h"
#include "libcamera/internal/ipa_manager.h"
#include "libcamera/internal/media_device.h"
#include "libcamera/internal/pipeline_handler.h"
@@ -836,7 +837,7 @@ void IPU3CameraData::cancelPendingRequests()
for (auto it : request->buffers()) {
FrameBuffer *buffer = it.second;
- buffer->cancel();
+ buffer->_d()->cancel();
pipe()->completeBuffer(request, buffer);
}
@@ -1356,7 +1357,7 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)
if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
for (auto it : request->buffers()) {
FrameBuffer *b = it.second;
- b->cancel();
+ b->_d()->cancel();
pipe()->completeBuffer(request, b);
}
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index d6148724..acc0beca 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -1907,7 +1907,7 @@ void RPiCameraData::clearIncompleteRequests()
* request? If not, do so now.
*/
if (buffer->request()) {
- buffer->cancel();
+ buffer->_d()->cancel();
pipe()->completeBuffer(request, buffer);
}
}
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index fff95a34..c3e33ecf 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -32,6 +32,7 @@
#include "libcamera/internal/camera.h"
#include "libcamera/internal/camera_sensor.h"
#include "libcamera/internal/device_enumerator.h"
+#include "libcamera/internal/framebuffer.h"
#include "libcamera/internal/ipa_manager.h"
#include "libcamera/internal/media_device.h"
#include "libcamera/internal/pipeline_handler.h"
@@ -574,7 +575,7 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer)
if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
for (auto it : request->buffers()) {
FrameBuffer *b = it.second;
- b->cancel();
+ b->_d()->cancel();
pipe->completeBuffer(request, b);
}
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 9c8da6ca..5704972d 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -129,7 +129,7 @@ void Request::Private::doCancelRequest()
Request *request = _o<Request>();
for (FrameBuffer *buffer : pending_) {
- buffer->cancel();
+ buffer->_d()->cancel();
camera_->bufferCompleted.emit(request, buffer);
}