summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-10-18 12:56:49 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2021-02-05 01:20:32 +0100
commitef8013767191da805caf81f30d7219863beae7d9 (patch)
tree0e331e4262cb23324c7474ef456ea88a5e786519
parent354f1fb933e7cd8f01fb4d16c78d1f851fa08d7b (diff)
libcamera: ipu3: cio2: Generate start of frame event
Propagate the frameStart event whenever the CSI-2 receiver in the CIO2 pipeline generates one. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/ipu3/cio2.cpp18
-rw-r--r--src/libcamera/pipeline/ipu3/cio2.h3
2 files changed, 17 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
index c7fabb98..0ef3bc04 100644
--- a/src/libcamera/pipeline/ipu3/cio2.cpp
+++ b/src/libcamera/pipeline/ipu3/cio2.cpp
@@ -238,15 +238,27 @@ int CIO2Device::start()
availableBuffers_.push(buffer.get());
ret = output_->streamOn();
- if (ret)
+ if (ret) {
freeBuffers();
+ return ret;
+ }
- return ret;
+ ret = csi2_->setFrameStartEnabled(true);
+ if (ret) {
+ stop();
+ return ret;
+ }
+
+ return 0;
}
int CIO2Device::stop()
{
- int ret = output_->streamOff();
+ int ret;
+
+ csi2_->setFrameStartEnabled(false);
+
+ ret = output_->streamOff();
freeBuffers();
diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h
index dca4d40e..5ecc4f47 100644
--- a/src/libcamera/pipeline/ipu3/cio2.h
+++ b/src/libcamera/pipeline/ipu3/cio2.h
@@ -13,6 +13,7 @@
#include <libcamera/signal.h>
+#include "libcamera/internal/v4l2_subdevice.h"
#include "libcamera/internal/v4l2_videodevice.h"
namespace libcamera {
@@ -24,7 +25,6 @@ class PixelFormat;
class Request;
class Size;
class SizeRange;
-class V4L2Subdevice;
struct StreamConfiguration;
class CIO2Device
@@ -54,6 +54,7 @@ public:
FrameBuffer *queueBuffer(Request *request, FrameBuffer *rawBuffer);
void tryReturnBuffer(FrameBuffer *buffer);
Signal<FrameBuffer *> &bufferReady() { return output_->bufferReady; }
+ Signal<uint32_t> &frameStart() { return csi2_->frameStart; }
private:
void freeBuffers();