libcamera: Fix CameraSensor::getFormat() search order
According to the documentation, the CameraSensor::getFormat() method should select the first media bus code from the mbusCodes parameter that is supported by the sensor. However, the current implementation wrongly selects the first media bus code from the codes supported by the sensor that is listed in the mbusCodes parameter. This results in the preference order specified by the caller being ignored. Fix it. Signed-off-by: Mickael Guene <mickael.guene@st.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
cefe067c5b
commit
846d4c7d3e
1 changed files with 2 additions and 2 deletions
|
@ -191,8 +191,8 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu
|
|||
{
|
||||
V4L2SubdeviceFormat format{};
|
||||
|
||||
for (unsigned int code : mbusCodes_) {
|
||||
if (std::any_of(mbusCodes.begin(), mbusCodes.end(),
|
||||
for (unsigned int code : mbusCodes) {
|
||||
if (std::any_of(mbusCodes_.begin(), mbusCodes_.end(),
|
||||
[code](unsigned int c) { return c == code; })) {
|
||||
format.mbus_code = code;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue