apps: qcam: Simplify PixelFormat
search
Since `PixelFormat` has `operator==()`, `std::find()` can be used directly, so do that to simplify. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
314ecb5400
commit
bb7f702b48
1 changed files with 1 additions and 4 deletions
|
@ -386,10 +386,7 @@ int MainWindow::startCapture()
|
||||||
/* Use a format supported by the viewfinder if available. */
|
/* Use a format supported by the viewfinder if available. */
|
||||||
std::vector<PixelFormat> formats = vfConfig.formats().pixelformats();
|
std::vector<PixelFormat> formats = vfConfig.formats().pixelformats();
|
||||||
for (const PixelFormat &format : viewfinder_->nativeFormats()) {
|
for (const PixelFormat &format : viewfinder_->nativeFormats()) {
|
||||||
auto match = std::find_if(formats.begin(), formats.end(),
|
auto match = std::find(formats.begin(), formats.end(), format);
|
||||||
[&](const PixelFormat &f) {
|
|
||||||
return f == format;
|
|
||||||
});
|
|
||||||
if (match != formats.end()) {
|
if (match != formats.end()) {
|
||||||
vfConfig.pixelFormat = format;
|
vfConfig.pixelFormat = format;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue