| // Copyright 2022 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Next min version: 4 |
| |
| module cros.mojom; |
| |
| import "camera/mojo/file_path.mojom"; |
| |
| // Set of effects that can be enabled. |
| // Used by EffectsConfig to indicate which effect the g3 shared library |
| // should be applying. Needs to be kept in sync with g3 version found in |
| // chromeos/ml/effects_pipeline/effects_config.h |
| [Extensible] |
| enum CameraEffect { |
| [Default] kNone = 0, |
| kBackgroundBlur = 1, |
| kBackgroundReplace = 2, |
| kPortraitRelight = 3, |
| kBackgroundBlurPortraitRelight = 4, |
| kCount = 5, |
| }; |
| |
| // Set of GPU APIs available. |
| [Extensible] |
| enum GpuApi { |
| kOpenCL = 0, |
| [Default] kOpenGL = 1, |
| kAny = 2, |
| }; |
| |
| // Defines which level of blur to apply with the background blur effect. |
| [Extensible] |
| enum BlurLevel { |
| kLowest = 0, |
| kLight = 1, |
| [Default] kMedium = 2, |
| kHeavy = 3, |
| kMaximum = 4, |
| }; |
| |
| // Defines the types of segmentation models that the video effects can use. |
| // Lower resolution models will reduce the workload on the GPU. |
| [Extensible] |
| enum SegmentationModel { |
| kAuto = 0, |
| [Default] kHighResolution = 1, |
| kLowerResolution = 2, |
| }; |
| |
| // Structure used for configuring and enabling video conferencing effects. |
| // This should be kept in sync with the google3 version found in: |
| // chromeos/ml/effects_pipeline/effects_config.h |
| struct EffectsConfig { |
| // Name of the effect to enable. |
| CameraEffect effect = kNone; |
| |
| // How much blur to apply for the background blur effect. |
| BlurLevel blur_level = kMedium; |
| |
| // Select which GPU API to use to perform the segmentation inference. |
| GpuApi segmentation_gpu_api = kOpenGL; |
| |
| // Maximum number of frames allowed in flight. |
| uint16 graph_max_frames_in_flight = 2; |
| |
| // Whether background background blur should be enabled. |
| [MinVersion=1] bool blur_enabled; |
| |
| // Whether background replacement should be enabled. |
| [MinVersion=1] bool replace_enabled; |
| |
| // Whether portrait relighting should be enabled. |
| [MinVersion=1] bool relight_enabled; |
| |
| // The type of segmentation model to use. Lower resolution models will reduce |
| // the workload on the GPU. |
| [MinVersion=2] SegmentationModel segmentation_model; |
| |
| // The file path to use for the background image. |
| // Must be readable from within camera stack. |
| [MinVersion=3] mojo_base.mojom.RelativeFilePath? background_filepath; |
| }; |