summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/simple/converter.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-26 23:45:04 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-03 00:59:00 +0200
commitcc8da6b8c215d125d4a5c51a36697609f40b9362 (patch)
tree046e0251eadb5a4a2d868dab706522913e0b7db4 /src/libcamera/pipeline/simple/converter.cpp
parent29bd5583c4ebbd62583c12d76d5d0aceb300b649 (diff)
libcamera: pipeline: simple: converter: Group query functions together
The SimpleConverter class has different sets of functions, related to static queries, device configuration and runtime operation. Group the query functions together. While at it, swap the arguments to the strideAndFrameSize() function to match the order in which pixel format and size are usually specified. No functional change is included. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Phi-Bang Nguyen <pnguyen@baylibre.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/simple/converter.cpp')
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index 87d15c78..8f54caac 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -133,6 +133,21 @@ SizeRange SimpleConverter::sizes(const Size &input)
return sizes;
}
+std::tuple<unsigned int, unsigned int>
+SimpleConverter::strideAndFrameSize(const PixelFormat &pixelFormat,
+ const Size &size)
+{
+ V4L2DeviceFormat format;
+ format.fourcc = m2m_->capture()->toV4L2PixelFormat(pixelFormat);
+ format.size = size;
+
+ int ret = m2m_->capture()->tryFormat(&format);
+ if (ret < 0)
+ return std::make_tuple(0, 0);
+
+ return std::make_tuple(format.planes[0].bpl, format.planes[0].size);
+}
+
int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,
const StreamConfiguration &outputCfg)
{
@@ -254,19 +269,4 @@ void SimpleConverter::outputBufferReady(FrameBuffer *buffer)
}
}
-std::tuple<unsigned int, unsigned int>
-SimpleConverter::strideAndFrameSize(const Size &size,
- const PixelFormat &pixelFormat)
-{
- V4L2DeviceFormat format;
- format.fourcc = m2m_->capture()->toV4L2PixelFormat(pixelFormat);
- format.size = size;
-
- int ret = m2m_->capture()->tryFormat(&format);
- if (ret < 0)
- return std::make_tuple(0, 0);
-
- return std::make_tuple(format.planes[0].bpl, format.planes[0].size);
-}
-
} /* namespace libcamera */