android: camera_device: Refuse unsupported formats
The current implementation of CameraDevice::initializeStreamConfigurations() fails if an image format marked as mandatory is not supported by the libcamera::Camera device, but erroneously accepts non-mandatory non-supported formats in the list of accepted ones. Fix this by ignoring non supported image formats which are not marked as mandatory. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
d5ce2679c6
commit
3533fd4271
1 changed files with 10 additions and 4 deletions
|
@ -398,10 +398,16 @@ int CameraDevice::initializeStreamConfigurations()
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (camera3Format.mandatory && !mappedFormat.isValid()) {
|
||||
LOG(HAL, Error) << "Failed to map Android format "
|
||||
<< camera3Format.name << " ("
|
||||
<< utils::hex(androidFormat) << ")";
|
||||
|
||||
if (!mappedFormat.isValid()) {
|
||||
/* If the format is not mandatory, skip it. */
|
||||
if (!camera3Format.mandatory)
|
||||
continue;
|
||||
|
||||
LOG(HAL, Error)
|
||||
<< "Failed to map mandatory Android format "
|
||||
<< camera3Format.name << " ("
|
||||
<< utils::hex(androidFormat) << "): aborting";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue