diff options
-rw-r--r-- | src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 10 | ||||
-rw-r--r-- | src/libcamera/pipeline/rpi/common/rpi_stream.h | 11 |
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_; |