mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
libcamera: pipeline: simple: converter: Configure input stride
Use the stride of the video capture device to configure the converter input. This ensures that no stride mismatch occurs inadvertently along the pipeline. 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>
This commit is contained in:
parent
ad12f09a62
commit
3e743ee8eb
2 changed files with 5 additions and 1 deletions
|
@ -159,6 +159,8 @@ int SimpleConverter::configure(const StreamConfiguration &inputCfg,
|
|||
V4L2DeviceFormat format;
|
||||
format.fourcc = videoFormat;
|
||||
format.size = inputCfg.size;
|
||||
format.planesCount = 1;
|
||||
format.planes[0].bpl = inputCfg.stride;
|
||||
|
||||
ret = m2m_->output()->setFormat(&format);
|
||||
if (ret < 0) {
|
||||
|
@ -167,7 +169,8 @@ int SimpleConverter::configure(const StreamConfiguration &inputCfg,
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (format.fourcc != videoFormat || format.size != inputCfg.size) {
|
||||
if (format.fourcc != videoFormat || format.size != inputCfg.size ||
|
||||
format.planes[0].bpl != inputCfg.stride) {
|
||||
LOG(SimplePipeline, Error)
|
||||
<< "Input format not supported";
|
||||
return -EINVAL;
|
||||
|
|
|
@ -606,6 +606,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
|
|||
StreamConfiguration inputCfg;
|
||||
inputCfg.pixelFormat = pipeConfig.pixelFormat;
|
||||
inputCfg.size = pipeConfig.captureSize;
|
||||
inputCfg.stride = captureFormat.planes[0].bpl;
|
||||
|
||||
ret = converter_->configure(inputCfg, cfg);
|
||||
if (ret < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue