| // 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: 1 |
| |
| module chromeos.media_perception.mojom; |
| |
| [Extensible] |
| enum PixelFormat { |
| FORMAT_UNKNOWN = 0, |
| I420 = 1, |
| MJPEG = 2, |
| }; |
| |
| struct VideoStreamParams { |
| uint32 width_in_pixels@0; |
| uint32 height_in_pixels@1; |
| float frame_rate_in_frames_per_second@2; |
| PixelFormat pixel_format@3; |
| }; |
| |
| struct VideoDevice { |
| // Unique obfuscated id for this video device. |
| string id@0; |
| |
| // Human readable name for the video device. |
| string? display_name@1; |
| string? model_id@2; |
| |
| array<VideoStreamParams> supported_configurations@3; |
| |
| // Specifies a desired or currently selected configuration for a particular |
| // device. |
| VideoStreamParams? configuration@4; |
| |
| bool in_use@5; |
| }; |
| |
| // Wrapper on the VideoDevice object so that we can add virtual device specific |
| // parameters if necessary. |
| struct VirtualVideoDevice { |
| VideoDevice video_device@0; |
| }; |
| |
| // Sample formats that CrAS supports. |
| // Full list: https://cs.corp.google.com/chromeos_public/src/third_party/adhd/cras/src/common/cras_audio_format.h |
| [Extensible] |
| enum SampleFormat { |
| SND_PCM_UNKNOWN_FORMAT = 0, |
| |
| // PCM signed 32 bit, little endian. |
| SND_PCM_FORMAT_S32_LE = 1, |
| |
| // PCM signed 16 bit, little endian. |
| SND_PCM_FORMAT_S16_LE = 2, |
| }; |
| |
| struct AudioStreamParams { |
| float frequency_in_hz@0; |
| int32 num_channels@1; |
| int32 frame_size@2; |
| SampleFormat sample_format@3; |
| }; |
| |
| struct AudioDevice { |
| // Unique obfuscated id for this audio device. |
| string id@0; |
| |
| // Human readable name of the audio device. |
| string? display_name@1; |
| |
| array<AudioStreamParams> supported_configurations@2; |
| |
| // Specifies a desired or currently selected configuration for a particular |
| // device. |
| AudioStreamParams? configuration@3; |
| }; |
| |
| [Extensible] |
| enum DeviceType { |
| TYPE_UNKNOWN = 0, |
| VIDEO = 1 , |
| AUDIO = 2, |
| VIRTUAL_VIDEO = 3, |
| }; |
| |
| struct DeviceTemplate { |
| string template_name@0; |
| |
| DeviceType device_type@1; |
| }; |