blob: ecb9a922e8bddf667fd30ced2761b21438e0131c [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.
*/
#ifndef HAL_USB_STREAM_FORMAT_H_
#define HAL_USB_STREAM_FORMAT_H_
#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);
// 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
#endif // HAL_USB_STREAM_FORMAT_H_