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>
This commit is contained in:
Naushir Patuck
2023-10-13 08:48:33 +01:00
committed by Kieran Bingham
parent ded9004e91
commit 9535f2c745
2 changed files with 19 additions and 2 deletions

View File

@@ -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. */

View File

@@ -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_;