summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-10-13 08:48:33 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-10-18 11:01:23 +0100
commit9535f2c745944fcacfdd661fdba120800164d037 (patch)
treef6ed778056ae742eaa9137451939284e92b79190 /src
parentded9004e91dd2487f3ec1827eaab8c80b0e02e68 (diff)
pipeline: rpi: Add SW downscale status to RPi::Stream
Record if additional software downscaling is needed for a particular stream in the RPi::Stream class. Additional software downscaling may be needed if the user required downscale factor is greater than what the ISP hardware is capable of. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/rpi/common/rpi_stream.cpp10
-rw-r--r--src/libcamera/pipeline/rpi/common/rpi_stream.h11
2 files changed, 19 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp
index 20864aee..70f115f1 100644
--- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp
+++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp
@@ -57,6 +57,16 @@ const std::string &Stream::name() const
return name_;
}
+unsigned int Stream::swDownscale() const
+{
+ return swDownscale_;
+}
+
+void Stream::setSwDownscale(unsigned int swDownscale)
+{
+ swDownscale_ = swDownscale;
+}
+
void Stream::resetBuffers()
{
/* Add all internal buffers to the queue of usable buffers. */
diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h
index c5e35d13..fc2bdfe2 100644
--- a/src/libcamera/pipeline/rpi/common/rpi_stream.h
+++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h
@@ -86,13 +86,14 @@ public:
using StreamFlags = Flags<StreamFlag>;
Stream()
- : flags_(StreamFlag::None), id_(0)
+ : flags_(StreamFlag::None), id_(0), swDownscale_(0)
{
}
Stream(const char *name, MediaEntity *dev, StreamFlags flags = StreamFlag::None)
: flags_(flags), name_(name),
- dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0)
+ dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0),
+ swDownscale_(0)
{
}
@@ -104,6 +105,9 @@ public:
const std::string &name() const;
void resetBuffers();
+ unsigned int swDownscale() const;
+ void setSwDownscale(unsigned int swDownscale);
+
void setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers);
const BufferMap &getBuffers() const;
unsigned int getBufferId(FrameBuffer *buffer) const;
@@ -139,6 +143,9 @@ private:
/* Tracks a unique id key for the bufferMap_ */
unsigned int id_;
+ /* Power of 2 greater than one if software downscaling will be required. */
+ unsigned int swDownscale_;
+
/* All frame buffers associated with this device stream. */
BufferMap bufferMap_;