chromium/media/base/svc_scalability_mode.h

// Copyright 2021 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_SVC_SCALABILITY_MODE_H_
#define MEDIA_BASE_SVC_SCALABILITY_MODE_H_

#include <cstddef>
#include <vector>

#include "media/base/media_export.h"

namespace media {

// This enum class is the corresponding implementation with WebRTC-SVC.
// See https://www.w3.org/TR/webrtc-svc/#scalabilitymodes* for the detail.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. Please keep the consistency with
// VideoEncoderUseCase in tools/metrics/histograms/enums.xml.
enum class SVCScalabilityMode : int {};

enum class SVCInterLayerPredMode : int {};

// Gets the WebRTC-SVC Spec defined scalability mode name.
MEDIA_EXPORT const char* GetScalabilityModeName(
    SVCScalabilityMode scalability_mode);

// Gets the SVCScalabilityMode from |num_spatial_layers|,
// |num_temporal_layers| and |inter_layer_pred|.
MEDIA_EXPORT SVCScalabilityMode
GetSVCScalabilityMode(const size_t num_spatial_layers,
                      const size_t num_temporal_layers,
                      SVCInterLayerPredMode inter_layer_pred);

// Gets the supported SVCScalabilityModes by hardware encoders.
MEDIA_EXPORT std::vector<SVCScalabilityMode>
GetSupportedScalabilityModesByHWEncoderForTesting();
}  // namespace media

#endif  // MEDIA_BASE_SVC_SCALABILITY_MODE_H_