blob: 6c6051ff2edbb6d38de94d894aaf3fbf250751f4 [file] [log] [blame] [edit]
// Copyright 2023 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Next min version: 1
module cros.mojom;
// Available diagnostics result type. This is a bitmask,
// so multiple results can be combined.
[Extensible]
enum DiagnosticsResult {
[Default] UNKNOWN = 0,
MANUFACTURER_ISSUE = 1,
TOO_DARK = 2,
PRIVACY_SHUTTER_ON = 4,
DIRTY_LENS = 8,
};
struct CameraDiagnosticsFrame {
handle<data_pipe_consumer> data_handle;
uint32 data_size;
uint32 width;
uint32 height;
};
// Response to be sent to the user of the service.
enum Response {
ANALYSIS_NOT_STARTED = 0,
FRAME_PROCESS_SUCCESSFUL = 1,
ANALYSIS_FAILED = 2,
};
// Camera Diagnostics service implements this interface.
interface CameraDiagnostics {
// Invoke by diagnostics frontend to decide whether the YUV frames analysis
// should be enabled. Once it is on, the YUV frame will be continuously fed
// to the diagnostics service for frame analysis. Once it is disabled, the
// stored frame issue(s) will be cleared.
SetYuvAnalysisEnabled@0(bool state);
// Getter method to fetch current YUV frame analysis state of camera
// diagnostics service.
GetYuvAnalysisEnabled@1() => (bool state);
// Invoke by camera service to pass YUV frame to diagnostics service for
// frame analysis. A result callback is provided whether the buffer transport
// was successful or not.
AnalyzeYuvFrame@2(CameraDiagnosticsFrame buffer) => (Response response);
// Invoke by diagnostics frontend to get results which can be mapped to
// actionable suggestions.
GetDiagnosticsResult@3() => (uint32 result);
};