| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_CHANNEL_LAYOUT_H_ | 5 #ifndef MEDIA_BASE_CHANNEL_LAYOUT_H_ |
| 6 #define MEDIA_BASE_CHANNEL_LAYOUT_H_ | 6 #define MEDIA_BASE_CHANNEL_LAYOUT_H_ |
| 7 | 7 |
| 8 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC | 90 // Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC |
| 91 CHANNEL_LAYOUT_7_0_FRONT = 26, | 91 CHANNEL_LAYOUT_7_0_FRONT = 26, |
| 92 | 92 |
| 93 // Front L, Front R, Front C, Back L, Back R, LFE, Front LofC, Front RofC | 93 // Front L, Front R, Front C, Back L, Back R, LFE, Front LofC, Front RofC |
| 94 CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, | 94 CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, |
| 95 | 95 |
| 96 // Front L, Front R, Front C, Side L, Side R, Rear C, Back L, Back R. | 96 // Front L, Front R, Front C, Side L, Side R, Rear C, Back L, Back R. |
| 97 CHANNEL_LAYOUT_OCTAGONAL = 28, | 97 CHANNEL_LAYOUT_OCTAGONAL = 28, |
| 98 | 98 |
| 99 // Channels are not explicitly mapped to speakers. |
| 100 CHANNEL_LAYOUT_DISCRETE = 29, |
| 101 |
| 99 // Total number of layouts. | 102 // Total number of layouts. |
| 100 CHANNEL_LAYOUT_MAX // Must always be last! | 103 CHANNEL_LAYOUT_MAX // Must always be last! |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 enum Channels { | 106 enum Channels { |
| 104 LEFT = 0, | 107 LEFT = 0, |
| 105 RIGHT, | 108 RIGHT, |
| 106 CENTER, | 109 CENTER, |
| 107 LFE, | 110 LFE, |
| 108 BACK_LEFT, | 111 BACK_LEFT, |
| 109 BACK_RIGHT, | 112 BACK_RIGHT, |
| 110 LEFT_OF_CENTER, | 113 LEFT_OF_CENTER, |
| 111 RIGHT_OF_CENTER, | 114 RIGHT_OF_CENTER, |
| 112 BACK_CENTER, | 115 BACK_CENTER, |
| 113 SIDE_LEFT, | 116 SIDE_LEFT, |
| 114 SIDE_RIGHT, | 117 SIDE_RIGHT, |
| 115 CHANNELS_MAX | 118 CHANNELS_MAX |
| 116 }; | 119 }; |
| 117 | 120 |
| 118 // Returns the expected channel position in an interleaved stream. Values of -1 | 121 // Returns the expected channel position in an interleaved stream. Values of -1 |
| 119 // mean the channel at that index is not used for that layout. Values range | 122 // mean the channel at that index is not used for that layout. Values range |
| 120 // from 0 to CHANNELS_MAX - 1. | 123 // from 0 to CHANNELS_MAX - 1. |
| 121 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); | 124 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); |
| 122 | 125 |
| 123 // Returns the number of channels in a given ChannelLayout. | 126 // Returns the number of channels in a given ChannelLayout. |
| 124 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); | 127 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); |
| 125 | 128 |
| 129 // Given the number of channels, return the best layout, |
| 130 // or return CHANNEL_LAYOUT_UNSUPPORTED if there is no good match. |
| 131 MEDIA_EXPORT ChannelLayout GuessChannelLayout(int channels); |
| 132 |
| 126 } // namespace media | 133 } // namespace media |
| 127 | 134 |
| 128 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ | 135 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ |
| OLD | NEW |