blob: 88b56df5c53c11ef5eeecbd05646409aa4e7ee98 [file] [log] [blame]
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#include <vector>
#include <hardware/camera3.h>
#include "hal/usb/common_types.h"
namespace cros {
// Find a resolution from a supported list.
const SupportedFormat* FindFormatByResolution(const SupportedFormats& formats,
uint32_t width,
uint32_t height);
// Get the largest resolution from |supported_formats|.
SupportedFormat GetMaximumFormat(const SupportedFormats& supported_formats);
// Get all supported JPEG thumbnail sizes. See the requirements in
// Return flattened sizes [width_0, height_0, width_1, height_1, ...] for
// filling as camera metadata.
std::vector<int32_t> GetJpegAvailableThumbnailSizes(
const SupportedFormats& supported_formats);
// Find all formats in preference order.
// The resolutions in returned SupportedFormats vector are unique.
SupportedFormats GetQualifiedFormats(const SupportedFormats& supported_formats);
// Check |stream| is supported in |supported_formats|.
bool IsFormatSupported(const SupportedFormats& supported_formats,
const camera3_stream_t& stream);
} // namespace cros