| 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 | |
| 102 // Total number of layouts. | 99 // Total number of layouts. |
| 103 CHANNEL_LAYOUT_MAX // Must always be last! | 100 CHANNEL_LAYOUT_MAX // Must always be last! |
| 104 }; | 101 }; |
| 105 | 102 |
| 106 enum Channels { | 103 enum Channels { |
| 107 LEFT = 0, | 104 LEFT = 0, |
| 108 RIGHT, | 105 RIGHT, |
| 109 CENTER, | 106 CENTER, |
| 110 LFE, | 107 LFE, |
| 111 BACK_LEFT, | 108 BACK_LEFT, |
| 112 BACK_RIGHT, | 109 BACK_RIGHT, |
| 113 LEFT_OF_CENTER, | 110 LEFT_OF_CENTER, |
| 114 RIGHT_OF_CENTER, | 111 RIGHT_OF_CENTER, |
| 115 BACK_CENTER, | 112 BACK_CENTER, |
| 116 SIDE_LEFT, | 113 SIDE_LEFT, |
| 117 SIDE_RIGHT, | 114 SIDE_RIGHT, |
| 118 CHANNELS_MAX | 115 CHANNELS_MAX |
| 119 }; | 116 }; |
| 120 | 117 |
| 121 // Returns the expected channel position in an interleaved stream. Values of -1 | 118 // Returns the expected channel position in an interleaved stream. Values of -1 |
| 122 // mean the channel at that index is not used for that layout. Values range | 119 // mean the channel at that index is not used for that layout. Values range |
| 123 // from 0 to CHANNELS_MAX - 1. | 120 // from 0 to CHANNELS_MAX - 1. |
| 124 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); | 121 MEDIA_EXPORT int ChannelOrder(ChannelLayout layout, Channels channel); |
| 125 | 122 |
| 126 // Returns the number of channels in a given ChannelLayout. | 123 // Returns the number of channels in a given ChannelLayout. |
| 127 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); | 124 MEDIA_EXPORT int ChannelLayoutToChannelCount(ChannelLayout layout); |
| 128 | 125 |
| 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 | |
| 133 } // namespace media | 126 } // namespace media |
| 134 | 127 |
| 135 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ | 128 #endif // MEDIA_BASE_CHANNEL_LAYOUT_H_ |
| OLD | NEW |