blob: 773571c962623191677df17d9d20e2a7a35d9fc7 [file] [log] [blame]
// Copyright 2018 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 MinVersion: 4
module chromeos.media_perception.mojom;
import "mojom/appearances.mojom";
import "mojom/device_management.mojom";
import "mojom/frame_perception.mojom";
import "mojom/hotword_detection.mojom";
import "mojom/occupancy_trigger.mojom";
import "mojom/pipeline.mojom";
import "mojom/presence_perception.mojom";
import "mojom/one_touch_autozoom.mojom";
import "mojom/software_autozoom.mojom";
struct SuccessStatus {
// Whether or not the action succeeded.
bool success@0;
string? failure_reason@1;
};
// Feature or configuration specific functionality belongs in these interfaces.
struct PerceptionInterfaces {
FramePerceptionHandler&? frame_perception_handler_request@0;
HotwordDetectionHandler&? hotword_detection_handler_request@1;
PresencePerceptionHandler&? presence_perception_handler_request@2;
OccupancyTriggerHandler&? occupancy_trigger_handler_request@3;
[MinVersion=1] AppearancesHandler&? appearances_handler_request@4;
[MinVersion=2] OneTouchAutozoomHandler&? one_touch_autozoom_handler_request@5;
[MinVersion=3] SoftwareAutozoomHandler&? software_autozoom_handler_request@6;
};
interface MediaPerception {
// Sets up the pipeline configuration to select a desired featureset. Media
// perception service responds back with the InterfaceType(s) that the client
// needs to have implemented.
// Client of the MediaPerception service needs to provide an implemented
// interface for the requests that are returned.
SetupConfiguration@0(string configuration_name) =>
(SuccessStatus status,
PerceptionInterfaces interfaces);
// Sets template arguments for a specified configuration. Arguments should be
// passed as a serialized proto that is kept in sync between the MPS and a
// client.
SetTemplateArguments@10(
string configuration_name, array<uint8> serialized_arguments_proto) =>
(SuccessStatus status);
// ------------------- Start of device management definitions. -------------
GetVideoDevices@1() => (array<VideoDevice> devices);
GetAudioDevices@2() => (array<AudioDevice> devices);
// Returns a list of template names for devices that can be filled in for
// a particular configuration.
GetTemplateDevices@3(string configuration_name) =>
(array<DeviceTemplate> device_templates);
SetVideoDeviceForTemplateName@4(
string configuration_name, string template_name,
VideoDevice device) => (SuccessStatus status);
SetAudioDeviceForTemplateName@5(
string configuration_name, string template_name,
AudioDevice device) => (SuccessStatus status);
SetVirtualVideoDeviceForTemplateName@6(
string configuration_name, string template_name,
VirtualVideoDevice device) => (SuccessStatus status);
// ------------------- End of device management definitions. ---------------
// ------------------- Start of pipeline state definitions. ----------------
// Get the status of the media perception processing pipeline.
GetPipelineState@7(string configuration_name) => (PipelineState state);
// Set the desired state of the media perception pipeline.
SetPipelineState@8(string configuration_name, PipelineState desired_state)
=> (PipelineState state);
// Returns the state of all pipelines.
GetGlobalPipelineState@9() => (GlobalPipelineState state);
// ------------------- End of pipeline state definitions. ------------------
};