chromium/media/mojo/mojom/video_encoder_info.mojom

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

module media.mojom;

import "ui/gfx/geometry/mojom/geometry.mojom";

// The following mojom classes are the corresponding classes in webrtc project.
// See third_party/webrtc/api/video_codecs/video_encoder.h for details.
struct ResolutionBitrateLimit {
  gfx.mojom.Size frame_size;
  int32 min_start_bitrate_bps;
  int32 min_bitrate_bps;
  int32 max_bitrate_bps;
};

// TODO(crbug.com/40489779): Remove |has_*| values and use nullable types.
struct VideoEncoderInfo {
  string implementation_name;

  bool has_frame_delay = false;
  int32 frame_delay;

  bool has_input_capacity = false;
  int32 input_capacity;

  bool supports_native_handle;
  bool has_trusted_rate_controller;
  bool is_hardware_accelerated;
  bool supports_simulcast;
  bool reports_average_qp;
  uint32 requested_resolution_alignment;
  bool apply_alignment_to_all_simulcast_layers;
  // True if encoder supports frame size change without re-initialization.
  bool supports_frame_size_change = false;

  // This array size is equal to media::VideoEncoderInfo::kMaxSpatialLayers.
  array<array<uint8>, 5> fps_allocation;
  array<ResolutionBitrateLimit> resolution_bitrate_limits;
};