chromium/media/base/supported_video_decoder_config.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_SUPPORTED_VIDEO_DECODER_CONFIG_H_
#define MEDIA_BASE_SUPPORTED_VIDEO_DECODER_CONFIG_H_

#include <vector>

#include "base/containers/flat_map.h"
#include "media/base/media_export.h"
#include "media/base/video_codecs.h"
#include "media/base/video_decoder_config.h"
#include "ui/gfx/geometry/size.h"

namespace media {

// The min and max resolution used by SW decoders (dav1d, libgav1, libvpx and
// ffmpeg for example) when queried about decoding capabilities. For now match
// the supported resolutions of HW decoders.
constexpr gfx::Size kDefaultSwDecodeSizeMin(8, 8);
constexpr gfx::Size kDefaultSwDecodeSizeMax(8192, 8192);

// Specification of a range of configurations that are supported by a video
// decoder.  Also provides the ability to check if a VideoDecoderConfig matches
// the supported range.
struct MEDIA_EXPORT SupportedVideoDecoderConfig {};

SupportedVideoDecoderConfigs;

// Helper method to determine if |config| is supported by |supported_configs|.
MEDIA_EXPORT bool IsVideoDecoderConfigSupported(
    const SupportedVideoDecoderConfigs& supported_configs,
    const VideoDecoderConfig& config);

}  // namespace media

#endif  // MEDIA_BASE_SUPPORTED_VIDEO_DECODER_CONFIG_H_