1// Copyright 2024 The ChromiumOS Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto3"; 6 7package chromiumos.test.lab.api.passport; 8 9option go_package = "go.chromium.org/chromiumos/config/go/test/lab/api/passport"; 10 11// CameraService is a service which controls a set of cameras connected to a 12// dedicated host. These cameras are used to verify that individual peripheral 13// components are functioning at runtime. E.g. verify that a monitor is turned 14// off when expected. 15service CameraService { 16 // GetCameras probes all cameras connected to the host device. 17 rpc GetCameras(GetCamerasRequest) returns (GetCamerasResponse) {} 18 // GetAveragePixel gets the average pixel color detected by the specified camera. 19 rpc GetAveragePixel(GetAveragePixelRequest) returns (GetAveragePixelResponse) {} 20} 21 22message GetCamerasRequest{} 23 24message Camera{ 25 // The unique ID of the camera. 26 string id = 1; 27 // The name of the camera, may be non-unique e.g. camera model. 28 string name = 2; 29} 30 31message GetCamerasResponse{ 32 // The found cameras. 33 repeated Camera cameras = 1; 34} 35 36message GetAveragePixelRequest{ 37 // The unique ID of the camera to query. 38 string device_id = 1; 39} 40 41message Pixel { 42 // The pixels red value. 43 int32 r = 1; 44 // The pixels green value. 45 int32 g = 2; 46 // The pixels blue value. 47 int32 b = 3; 48 // The pixels alpha value. 49 int32 a = 4; 50} 51 52message GetAveragePixelResponse { 53 // The average pixel color. 54 Pixel pixel = 1; 55 // The frame used to generate the image (.jpeg) 56 bytes frame = 2; 57}