OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module content.mojom; |
| 6 |
| 7 struct AudioOutputStreamParameters { |
| 8 |
| 9 enum Format { |
| 10 AUDIO_PCM_LINEAR = 0, // PCM is 'raw' amplitude samples. |
| 11 AUDIO_PCM_LOW_LATENCY, // Linear PCM, low latency requested. |
| 12 AUDIO_FAKE, // Creates a fake AudioOutputStream object. |
| 13 AUDIO_FORMAT_LAST = AUDIO_FAKE, // Only used for validation of format. |
| 14 }; |
| 15 |
| 16 // Enumerates the various representations of the ordering of audio channels. |
| 17 // Logged to UMA, so never reuse a value, always add new/greater ones! |
| 18 enum ChannelLayout { |
| 19 CHANNEL_LAYOUT_NONE = 0, |
| 20 CHANNEL_LAYOUT_UNSUPPORTED = 1, |
| 21 |
| 22 // Front C |
| 23 CHANNEL_LAYOUT_MONO = 2, |
| 24 |
| 25 // Front L, Front R |
| 26 CHANNEL_LAYOUT_STEREO = 3, |
| 27 |
| 28 // Front L, Front R, Back C |
| 29 CHANNEL_LAYOUT_2_1 = 4, |
| 30 |
| 31 // Front L, Front R, Front C |
| 32 CHANNEL_LAYOUT_SURROUND = 5, |
| 33 |
| 34 // Front L, Front R, Front C, Back C |
| 35 CHANNEL_LAYOUT_4_0 = 6, |
| 36 |
| 37 // Front L, Front R, Side L, Side R |
| 38 CHANNEL_LAYOUT_2_2 = 7, |
| 39 |
| 40 // Front L, Front R, Back L, Back R |
| 41 CHANNEL_LAYOUT_QUAD = 8, |
| 42 |
| 43 // Front L, Front R, Front C, Side L, Side R |
| 44 CHANNEL_LAYOUT_5_0 = 9, |
| 45 |
| 46 // Front L, Front R, Front C, LFE, Side L, Side R |
| 47 CHANNEL_LAYOUT_5_1 = 10, |
| 48 |
| 49 // Front L, Front R, Front C, Back L, Back R |
| 50 CHANNEL_LAYOUT_5_0_BACK = 11, |
| 51 |
| 52 // Front L, Front R, Front C, LFE, Back L, Back R |
| 53 CHANNEL_LAYOUT_5_1_BACK = 12, |
| 54 |
| 55 // Front L, Front R, Front C, Side L, Side R, Back L, Back R |
| 56 CHANNEL_LAYOUT_7_0 = 13, |
| 57 |
| 58 // Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R |
| 59 CHANNEL_LAYOUT_7_1 = 14, |
| 60 |
| 61 // Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC |
| 62 CHANNEL_LAYOUT_7_1_WIDE = 15, |
| 63 |
| 64 // Stereo L, Stereo R |
| 65 CHANNEL_LAYOUT_STEREO_DOWNMIX = 16, |
| 66 |
| 67 // Stereo L, Stereo R, LFE |
| 68 CHANNEL_LAYOUT_2POINT1 = 17, |
| 69 |
| 70 // Stereo L, Stereo R, Front C, LFE |
| 71 CHANNEL_LAYOUT_3_1 = 18, |
| 72 |
| 73 // Stereo L, Stereo R, Front C, Rear C, LFE |
| 74 CHANNEL_LAYOUT_4_1 = 19, |
| 75 |
| 76 // Stereo L, Stereo R, Front C, Side L, Side R, Back C |
| 77 CHANNEL_LAYOUT_6_0 = 20, |
| 78 |
| 79 // Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC |
| 80 CHANNEL_LAYOUT_6_0_FRONT = 21, |
| 81 |
| 82 // Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C |
| 83 CHANNEL_LAYOUT_HEXAGONAL = 22, |
| 84 |
| 85 // Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center |
| 86 CHANNEL_LAYOUT_6_1 = 23, |
| 87 |
| 88 // Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center |
| 89 CHANNEL_LAYOUT_6_1_BACK = 24, |
| 90 |
| 91 // Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE |
| 92 CHANNEL_LAYOUT_6_1_FRONT = 25, |
| 93 |
| 94 // Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC |
| 95 CHANNEL_LAYOUT_7_0_FRONT = 26, |
| 96 |
| 97 // Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC |
| 98 CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, |
| 99 |
| 100 // Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C. |
| 101 CHANNEL_LAYOUT_OCTAGONAL = 28, |
| 102 |
| 103 // Channels are not explicitly mapped to speakers. |
| 104 CHANNEL_LAYOUT_DISCRETE = 29, |
| 105 |
| 106 // Front L, Front R, Front C. Front C contains the keyboard mic audio. This |
| 107 // layout is only intended for input for WebRTC. The Front C channel |
| 108 // is stripped away in the WebRTC audio input pipeline and never seen outsid
e |
| 109 // of that. |
| 110 CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30, |
| 111 |
| 112 // Front L, Front R, Side L, Side R, LFE |
| 113 CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31, |
| 114 |
| 115 // Max value, must always equal the largest entry ever logged. |
| 116 CHANNEL_LAYOUT_MAX = CHANNEL_LAYOUT_4_1_QUAD_SIDE |
| 117 }; |
| 118 |
| 119 |
| 120 Format format_; // Format of the stream. |
| 121 ChannelLayout channel_layout_; // Order of surround sound channels. |
| 122 int32 channels_; // Number of channels. Value set based on |
| 123 // |channel_layout|. |
| 124 int32 sample_rate_; // Sampling frequency/rate. |
| 125 int32 bits_per_sample_; // Number of bits per sample. |
| 126 int32 frames_per_buffer_; // Number of frames in a buffer. |
| 127 int32 effects_; // Bitmask using PlatformEffectsMask. |
| 128 |
| 129 }; |
| 130 |
| 131 // Used on the renderer side. |
| 132 interface AudioOutputStream { |
| 133 Close(); |
| 134 }; |
| 135 |
| 136 // Used on the renderer side. |
| 137 interface AudioOutput { |
| 138 CreateStream( |
| 139 int32 stream_id_, |
| 140 int32 render_frame_id_, |
| 141 AudioOutputStreamParameters params) => |
| 142 (AudioOutputStream? stream, |
| 143 int32 stream_id, |
| 144 handle<shared_buffer>? shared_buffer, |
| 145 handle? socket_descriptor); |
| 146 }; |
OLD | NEW |